ahdjs 0.0.13 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * ahdjs v0.0.13
3
+ * ahdjs v0.0.14
4
4
  *
5
5
  *
6
6
  * Copyright (c) Ishaan Puniani (https://github.com/ishaan-puniani) and project contributors.
package/build/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  /*!
2
2
  *
3
- * ahdjs v0.0.13
3
+ * ahdjs v0.0.14
4
4
  *
5
5
  *
6
6
  * Copyright (c) Ishaan Puniani (https://github.com/ishaan-puniani) and project contributors.
@@ -9,5 +9,5 @@
9
9
  * LICENSE file in the root directory of this source tree.
10
10
  *
11
11
  */
12
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AHDjs=e():t.AHDjs=e()}(self,(()=>(()=>{var t={705:(t,e,n)=>{var r=n(639).Symbol;t.exports=r},932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},239:(t,e,n)=>{var r=n(705),i=n(607),o=n(333),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},531:(t,e,n)=>{var r=n(705),i=n(932),o=n(469),a=n(448),s=r?r.prototype:void 0,c=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n}},957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},607:(t,e,n)=>{var r=n(705),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},639:(t,e,n)=>{var r=n(957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},469:t=>{var e=Array.isArray;t.exports=e},220:t=>{t.exports=function(t){return null===t}},5:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},448:(t,e,n)=>{var r=n(239),i=n(5);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},353:t=>{t.exports=function(t){return void 0===t}},833:(t,e,n)=>{var r=n(531);t.exports=function(t){return null==t?"":r(t)}},955:(t,e,n)=>{var r=n(833),i=0;t.exports=function(t){var e=++i;return r(t)+e}},68:(t,e,n)=>{"use strict";function r(t,e){void 0===e&&(e={});for(var n=function(t){for(var e=[],n=0;n<t.length;){var r=t[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)e.push({type:"CHAR",index:n,value:t[n++]});else{var i=1,o="";if("?"===t[s=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<t.length;)if("\\"!==t[s]){if(")"===t[s]){if(0==--i){s++;break}}else if("("===t[s]&&(i++,"?"!==t[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));o+=t[s++]}else o+=t[s++]+t[s++];if(i)throw new TypeError("Unbalanced pattern at ".concat(n));if(!o)throw new TypeError("Missing pattern at ".concat(n));e.push({type:"PATTERN",index:n,value:o}),n=s}else{for(var a="",s=n+1;s<t.length;){var c=t.charCodeAt(s);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;a+=t[s++]}if(!a)throw new TypeError("Missing parameter name at ".concat(n));e.push({type:"NAME",index:n,value:a}),n=s}else e.push({type:"CLOSE",index:n,value:t[n++]});else e.push({type:"OPEN",index:n,value:t[n++]});else e.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});else e.push({type:"MODIFIER",index:n,value:t[n++]})}return e.push({type:"END",index:n,value:""}),e}(t),r=e.prefixes,i=void 0===r?"./":r,o="[^".concat(c(e.delimiter||"/#?"),"]+?"),a=[],s=0,l=0,u="",p=function(t){if(l<n.length&&n[l].type===t)return n[l++].value},h=function(t){var e=p(t);if(void 0!==e)return e;var r=n[l],i=r.type,o=r.index;throw new TypeError("Unexpected ".concat(i," at ").concat(o,", expected ").concat(t))},f=function(){for(var t,e="";t=p("CHAR")||p("ESCAPED_CHAR");)e+=t;return e};l<n.length;){var d=p("CHAR"),v=p("NAME"),g=p("PATTERN");if(v||g){var y=d||"";-1===i.indexOf(y)&&(u+=y,y=""),u&&(a.push(u),u=""),a.push({name:v||s++,prefix:y,suffix:"",pattern:g||o,modifier:p("MODIFIER")||""})}else{var m=d||p("ESCAPED_CHAR");if(m)u+=m;else if(u&&(a.push(u),u=""),p("OPEN")){y=f();var b=p("NAME")||"",x=p("PATTERN")||"",S=f();h("CLOSE"),a.push({name:b||(x?s++:""),pattern:b&&!x?o:x,prefix:y,suffix:S,modifier:p("MODIFIER")||""})}else h("END")}}return a}function i(t,e){return o(r(t,e),e)}function o(t,e){void 0===e&&(e={});var n=l(e),r=e.encode,i=void 0===r?function(t){return t}:r,o=e.validate,a=void 0===o||o,s=t.map((function(t){if("object"==typeof t)return new RegExp("^(?:".concat(t.pattern,")$"),n)}));return function(e){for(var n="",r=0;r<t.length;r++){var o=t[r];if("string"!=typeof o){var c=e?e[o.name]:void 0,l="?"===o.modifier||"*"===o.modifier,u="*"===o.modifier||"+"===o.modifier;if(Array.isArray(c)){if(!u)throw new TypeError('Expected "'.concat(o.name,'" to not repeat, but got an array'));if(0===c.length){if(l)continue;throw new TypeError('Expected "'.concat(o.name,'" to not be empty'))}for(var p=0;p<c.length;p++){var h=i(c[p],o);if(a&&!s[r].test(h))throw new TypeError('Expected all "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(h,'"'));n+=o.prefix+h+o.suffix}}else if("string"!=typeof c&&"number"!=typeof c){if(!l){var f=u?"an array":"a string";throw new TypeError('Expected "'.concat(o.name,'" to be ').concat(f))}}else{h=i(String(c),o);if(a&&!s[r].test(h))throw new TypeError('Expected "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(h,'"'));n+=o.prefix+h+o.suffix}}else n+=o}return n}}function a(t,e){var n=[];return s(p(t,n,e),n,e)}function s(t,e,n){void 0===n&&(n={});var r=n.decode,i=void 0===r?function(t){return t}:r;return function(n){var r=t.exec(n);if(!r)return!1;for(var o=r[0],a=r.index,s=Object.create(null),c=function(t){if(void 0===r[t])return"continue";var n=e[t-1];"*"===n.modifier||"+"===n.modifier?s[n.name]=r[t].split(n.prefix+n.suffix).map((function(t){return i(t,n)})):s[n.name]=i(r[t],n)},l=1;l<r.length;l++)c(l);return{path:o,index:a,params:s}}}function c(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function l(t){return t&&t.sensitive?"":"i"}function u(t,e,n){void 0===n&&(n={});for(var r=n.strict,i=void 0!==r&&r,o=n.start,a=void 0===o||o,s=n.end,u=void 0===s||s,p=n.encode,h=void 0===p?function(t){return t}:p,f=n.delimiter,d=void 0===f?"/#?":f,v=n.endsWith,g="[".concat(c(void 0===v?"":v),"]|$"),y="[".concat(c(d),"]"),m=a?"^":"",b=0,x=t;b<x.length;b++){var S=x[b];if("string"==typeof S)m+=c(h(S));else{var w=c(h(S.prefix)),E=c(h(S.suffix));if(S.pattern)if(e&&e.push(S),w||E)if("+"===S.modifier||"*"===S.modifier){var k="*"===S.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(S.pattern,")(?:").concat(E).concat(w,"(?:").concat(S.pattern,"))*)").concat(E,")").concat(k)}else m+="(?:".concat(w,"(").concat(S.pattern,")").concat(E,")").concat(S.modifier);else"+"===S.modifier||"*"===S.modifier?m+="((?:".concat(S.pattern,")").concat(S.modifier,")"):m+="(".concat(S.pattern,")").concat(S.modifier);else m+="(?:".concat(w).concat(E,")").concat(S.modifier)}}if(u)i||(m+="".concat(y,"?")),m+=n.endsWith?"(?=".concat(g,")"):"$";else{var O=t[t.length-1],P="string"==typeof O?y.indexOf(O[O.length-1])>-1:void 0===O;i||(m+="(?:".concat(y,"(?=").concat(g,"))?")),P||(m+="(?=".concat(y,"|").concat(g,")"))}return new RegExp(m,l(n))}function p(t,e,n){return t instanceof RegExp?function(t,e){if(!e)return t;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,i=n.exec(t.source);i;)e.push({name:i[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),i=n.exec(t.source);return t}(t,e):Array.isArray(t)?function(t,e,n){var r=t.map((function(t){return p(t,e,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),l(n))}(t,e,n):function(t,e,n){return u(r(t,n),e,n)}(t,e,n)}n.r(e),n.d(e,{compile:()=>i,match:()=>a,parse:()=>r,pathToRegexp:()=>p,regexpToFunction:()=>s,tokensToFunction:()=>o,tokensToRegexp:()=>u})}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{default:()=>ot});var t=n(955),e=n.n(t),i=n(353),o=n.n(i),a=n(220),s=n.n(a);const c=function(t){return t instanceof HTMLElement||/^\[object HTML(.+)Element\]$/.test("".concat(t))},l=function(t){return t instanceof SVGElement||/^\[object SVG(.+)Element\]$/.test("".concat(t))},u=function(t){return/^[object NodeList]$/.test("".concat(t))};function p(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||g(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){d(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function m(t,e,n){return m=b()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&x(i,n.prototype),i},m.apply(null,arguments)}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function x(t,e){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},x(t,e)}const S=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new DOMParser,r=t.replace(/<template/g,"<gc-template");r=r.replace(/<\/template/g,"</gc-template");var i=n.parseFromString(r,"text/html"),a=document.implementation.createHTMLDocument(),h=/{{([^}}]+)?}}/gm,g=/^@(.+)$/,y=new Map,b=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.body,i=r,b=Object.keys(n),x=Object.values(n),S=function(t){return m(Function,b.concat(["return ".concat(t,";")])).apply(void 0,x)};if(e){if(e.nodeType===Node.ELEMENT_NODE){if(e.hasAttribute("if")){if(y.set(e.parentNode,!1),!S(e.getAttribute("if")))return;y.set(e.parentNode,!0)}if(e.hasAttribute("elseif")){if(y.get(e.parentNode)||!S(e.getAttribute("elseif")))return;y.set(e.parentNode,!0)}if(e.hasAttribute("else")){if(y.get(e.parentNode))return;y.set(e.parentNode,!0)}if(e.hasAttribute("for")){var w=e.getAttribute("for").split(" in "),E=v(w,2),k=E[0],O=E[1];e.removeAttribute("for");var P=k.replace(/\(|\)/g,"").split(","),T=v(P,2),L=T[0],A=T[1];L=L.trim(),A=A?A.trim():"";var I=S(O.trim()),j=Array.isArray(I);return void Object.keys(I).forEach((function(r){var o=f(f({},n),{},d({},L,I[r]));A&&(o[A]=j?parseInt(r,10):r),t(e,o,i)}))}e!==e.ownerDocument.body&&"GC-TEMPLATE"!==e.tagName&&(i=e.cloneNode(),r.append(i)),p(e.attributes).forEach((function(t){var e=t.name,n=t.value,r=g.exec(e);if(r){var a=v(r,2)[1];return i.addEventListener(a,(function(t){return m(Function,[].concat(b,["$event"]).concat(["return ".concat(n).concat(/\(.+\)/.test(n)?"":"()",";")])).apply(void 0,[].concat(x,[t]))})),void i.removeAttribute(e)}for(var c=h.exec(n),l=0,u="";c;){u+=n.slice(l,c.index);var p=v(c,2),f=p[0],d=p[1];d=d.trim();try{f=S(d),(o()(f)||s()(f))&&(f="")}catch(t){console.error(t)}u+=f,l=c.index+c[0].length,c=h.exec(n)}u+=n.substr(l,n.length-l),"html"===e?(i.innerHTML=u,i.removeAttribute(e)):["if","else","elseif"].includes(e)?i.removeAttribute(e):i.setAttribute(e,u)}))}else if(e.nodeType===Node.TEXT_NODE){var C=h.exec(e.nodeValue);if(C){for(var _=0;C;){i.append(document.createTextNode(e.nodeValue.slice(_,C.index)));var D=C,N=v(D,2),R=N[0],M=N[1];M=M.trim();try{R=S(M),(o()(R)||s()(R))&&(R="")}catch(t){console.error(t)}c(R)||l(R)?i.append(R):u(R)?R.forEach((function(t){i.append(t)})):i.append(document.createTextNode(R)),_=C.index+C[0].length,C=h.exec(e.nodeValue)}i.append(document.createTextNode(e.nodeValue.slice(_,e.nodeValue.length)))}else i.append(e.cloneNode())}var B=e.childNodes,$=void 0===B?[]:B;$.length&&$.forEach((function(e){t(e,n,i)}))}};return b(i.body,e,a.body),a.body.firstElementChild};function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){if(t){if("string"==typeof t)return P(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function T(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */T=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,o=Object.create(i.prototype),a=new k(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,a),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function p(){}function h(){}function f(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(O([])));g&&g!==e&&n.call(g,i)&&(d=g);var y=f.prototype=p.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(i,o,a,s){var c=l(t[i],t,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==w(p)&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(p).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return h.prototype=f,s(y,"constructor",f),s(f,"constructor",h),h.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},m(b.prototype),s(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new b(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(y),s(y,a,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function L(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function A(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){L(o,r,i,a,s,"next",t)}function s(t){L(o,r,i,a,s,"throw",t)}a(void 0)}))}}function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){C(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var N,R=function(){function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_(this,t),Object.defineProperty(this,"uid",{value:e()(),enumerable:!1,configurable:!1,writable:!1}),this.setDefaults(),this.cache=new Map,this.listeners={},this.observers={},this.options={},this.setOptions(r),this.tour=null,this.setTour(n),this.notifications=[],this.elements=new Map,this.init()}var n,r,i,o,a,s,l,u;return n=t,r=[{key:"init",value:function(){}},{key:"setDefaults",value:function(){return this.previousStep=null,this.currentStep=null,this.nextStep=null,this.fromStep=null,this.toStep=null,this.previousStepIndex=-1,this.currentStepIndex=-1,this.nextStepIndex=-1,this.fromStepIndex=-1,this.toStepIndex=-1,this.steps=[],this.isDisplayed=!1,this}},{key:"setTour",value:function(t){return this.tour=t,this}},{key:"getTour",value:function(){return this.tour}},{key:"setOptions",value:function(t){return this.options=j(j({},this.constructor.getDefaultOptions()),t),this}},{key:"getOptions",value:function(){return this.options}},{key:"start",value:(u=A(T().mark((function t(){var e,n,r,i,o,a,s=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=s.length>0&&void 0!==s[0]?s[0]:0,n=!(s.length>1&&void 0!==s[1])||s[1],this.isDisplayed=!0,this.mountOverlayEl(),this.startPreloader(),r=s.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=s[o];return t.next=8,this.emit.apply(this,["onStart"].concat(i));case 8:if(this.stopPreloader(),this.tour&&this.tour.length){t.next=13;break}return this.removeOverlayEl(),this.isDisplayed=!1,t.abrupt("return",!1);case 13:if(this.steps=this.sortSteps(this.getSteps(this.tour)),this.steps.length){t.next=18;break}return this.removeOverlayEl(),this.isDisplayed=!1,t.abrupt("return",!1);case 18:return document.body.classList.add(this.constructor.getBodyClass()),t.next=21,this.go.apply(this,[e,n].concat(i));case 21:return a=t.sent,this.isDisplayed=a,document.body.classList.toggle(this.constructor.getBodyClass(),a),a&&(this.options.useKeyboard&&this.addOnKeydownListener(),this.addOnWindowResizeListener(),this.addOnWindowScrollListener()),t.abrupt("return",a);case 26:case"end":return t.stop()}}),t,this)}))),function(){return u.apply(this,arguments)})},{key:"go",value:(l=A(T().mark((function t(e){var n,r,i,o,a,s,c,l,u,p,h,f,d,v,g,y,m,b=this,x=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=!(x.length>1&&void 0!==x[1])||x[1],r=x.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=x[o];if(this.isDisplayed&&this.steps.length){t.next=4;break}return t.abrupt("return",!1);case 4:if(a=n?parseInt(e,10):e,!this.currentStep){t.next=9;break}if(!(n?this.currentStepIndex===a:this.currentStep.step===a)){t.next=9;break}return t.abrupt("return",!1);case 9:if(s=this.currentStep,c=this.currentStepIndex,l=n?this.steps[a]:this.steps.filter((function(t){return t.step===a}))[0]){t.next=14;break}return t.abrupt("return",!1);case 14:if(u=this.steps.indexOf(l),h=u,f=(p=l).onBeforeChange,d=p.onAfterChange,this.startPreloader(),v=!1,!f){t.next=26;break}return t.next=23,Promise.resolve().then((function(){return f.call.apply(f,[b,p,s].concat(i))}));case 23:if(t.t0=t.sent,!1!==t.t0){t.next=26;break}v=!0;case 26:return t.next=28,this.emit.apply(this,["onBeforeChange",p,s].concat(i));case 28:if(!t.sent.some((function(t){return!1===t}))){t.next=30;break}v=!0;case 30:if(this.stopPreloader(),!v){t.next=33;break}return t.abrupt("return",!1);case 33:return this.beforeChangeStep({toStep:p,toStepIndex:h,currentStep:l,currentStepIndex:u,fromStep:s,fromStepIndex:c}),this.toStep=p,this.toStepIndex=h,this.currentStep=l,this.currentStepIndex=u,this.fromStep=s,this.fromStepIndex=c,this.previousStep=this.steps[this.currentStepIndex-1]||null,this.previousStepIndex=this.previousStep?this.currentStepIndex-1:-1,this.nextStep=this.steps[this.currentStepIndex+1]||null,this.nextStepIndex=this.nextStep?this.currentStepIndex+1:-1,g=this.options.scrollBehavior,y=this.currentStep.scrollPadding,m=void 0===y?this.options.scrollPadding:y,this.scrollParentsToStepEl(),this.scrollTo(this.getStepEl(this.currentStep,!0),g,m),this.mountStep(),setTimeout((function(){b.getEl("tooltip")&&b.scrollTo(b.getEl("tooltip"),g,m)}),300),d&&d.call.apply(d,[this,this.toStep,this.fromStep].concat(i)),this.emit.apply(this,["onAfterChange",this.toStep,this.fromStep].concat(i)),t.abrupt("return",!0);case 53:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"previous",value:(s=A(T().mark((function t(){var e,n,r,i,o=this,a=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=a.length,n=new Array(e),r=0;r<e;r++)n[r]=a[r];if(this.isDisplayed&&this.currentStep&&this.previousStep){t.next=3;break}return t.abrupt("return",!1);case 3:if(i=this.currentStep.onPrevious,this.startPreloader(),!i){t.next=12;break}return t.next=8,Promise.resolve().then((function(){return i.call.apply(i,[o,o.previousStep,o.currentStep].concat(n))}));case 8:if(t.t0=t.sent,!1!==t.t0){t.next=12;break}return this.stopPreloader(),t.abrupt("return",!1);case 12:return t.next=14,this.emit.apply(this,["onPrevious",this.previousStep,this.currentStep].concat(n));case 14:if(!t.sent.some((function(t){return!1===t}))){t.next=17;break}return this.stopPreloader(),t.abrupt("return",!1);case 17:return this.stopPreloader(),t.abrupt("return",this.go.apply(this,[this.previousStepIndex,!0].concat(n)));case 19:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"next",value:(a=A(T().mark((function t(){var e,n,r,i,o=this,a=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=a.length,n=new Array(e),r=0;r<e;r++)n[r]=a[r];if(this.isDisplayed&&this.currentStep&&this.nextStep){t.next=3;break}return t.abrupt("return",!1);case 3:if(i=this.currentStep.onNext,this.startPreloader(),!i){t.next=12;break}return t.next=8,Promise.resolve().then((function(){return i.call.apply(i,[o,o.nextStep,o.currentStep].concat(n))}));case 8:if(t.t0=t.sent,!1!==t.t0){t.next=12;break}return this.stopPreloader(),t.abrupt("return",!1);case 12:return t.next=14,this.emit.apply(this,["onNext",this.nextStep,this.currentStep].concat(n));case 14:if(!t.sent.some((function(t){return!1===t}))){t.next=17;break}return this.stopPreloader(),t.abrupt("return",!1);case 17:return this.stopPreloader(),t.abrupt("return",this.go.apply(this,[this.nextStepIndex,!0].concat(n)));case 19:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"stop",value:(o=A(T().mark((function t(){var e,n,r,i=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isDisplayed){t.next=2;break}return t.abrupt("return",this);case 2:for(e=i.length,n=new Array(e),r=0;r<e;r++)n[r]=i[r];if(this.currentStepIndex!==this.steps.length-1){t.next=8;break}return this.startPreloader(),t.next=7,this.emit.apply(this,["onComplete"].concat(n));case 7:this.stopPreloader();case 8:return this.startPreloader(),t.next=11,this.emit.apply(this,["onStop"].concat(n));case 11:return this.stopPreloader(),document.body.classList.remove(this.constructor.getBodyClass()),this.removeListeners(),this.unobserveStep(),this.unmountStep(),this.removeOverlayEl(),this.cache.clear(),this.elements.clear(),this.setDefaults(),t.abrupt("return",this);case 21:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"getSteps",value:function(t){return t&&t.length?"string"==typeof t?this.getDataSteps(t):this.getJsSteps(t):[]}},{key:"getDataSteps",value:function(t){var e=this,n="data-guidechimp",r=Array.from(document.querySelectorAll("[".concat(n,"-tour*='").concat(t,"']")));r=r.filter((function(t){return t.getAttribute("".concat(n,"-tour")).split(",").includes(e.tour)}));var i=new RegExp("^".concat(n,"-").concat(t,"-[^-]+$")),o=new RegExp("^".concat(n,"-[^-]+$"));return r.map((function(r,a){for(var s={},c=0;c<r.attributes.length;c++){var l=r.attributes[c],u=l.name,p=l.value,h=i.test(u),f=!h&&o.test(u);if(h||f){var d=h?u.replace("".concat(n,"-").concat(t,"-"),""):u.replace("".concat(n,"-"),"");"tour"!==d&&(h||f&&!s[d])&&(s[d]=p)}}return j(j({step:a,title:"",description:"",position:e.options.position,interaction:e.options.interaction},s),{},{element:r})}))}},{key:"getJsSteps",value:function(t){return t.map((function(t,e){return j(j({},t),{},{step:t.step||e})}))}},{key:"sortSteps",value:function(t){return k(t).sort((function(t,e){return t.step<e.step?-1:t.step>e.step?1:0}))}},{key:"getStepEl",value:function(t){var e=(t||{}).element;if(!e)return this.mountFakeStepEl();var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n="string"==typeof t?document.querySelector(t):t;return n||e}(e);return n&&"none"!==n.style.display&&"hidden"!==n.style.visibility||(n=this.getEl("fakeStep")?this.getEl("fakeStep"):this.mountFakeStepEl()),n}},{key:"scrollParentsToStepEl",value:function(){var t=this.currentStep.scrollPadding,e=void 0===t?this.options.scrollPadding:t;return this.scrollParentsToEl(this.getStepEl(this.currentStep),e)}},{key:"getScrollableParentsEls",value:function(t){for(var e=[],n=t;n&&n!==n.ownerDocument.body;)n=this.getScrollableParentEl(n),e.push(n);return e}},{key:"getScrollableParentEl",value:function(t){var e=/(auto|scroll)/,n=getComputedStyle(t),r=t.ownerDocument;return"fixed"===n.getPropertyValue("position")?r.body:function t(i){if(!i||i===r.body)return r.body;var o=getComputedStyle(i);if("fixed"===n.getPropertyValue("position")&&"static"===o.getPropertyValue("position"))return t(i.parentElement);var a=o.getPropertyValue("overflow-x"),s=o.getPropertyValue("overflow-y");return e.test(a)||e.test(s)?i:t(i.parentElement)}(t.parentElement)}},{key:"scrollParentsToEl",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.getScrollableParentsEls(t);return n.forEach((function(n){n!==document.body&&(n.scrollTop=t.offsetTop-n.offsetTop-e,n.scrollLeft=t.offsetLeft-n.offsetLeft-e)})),this}},{key:"scrollTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.getBoundingClientRect(),i=r.top,o=r.bottom,a=r.left,s=r.right,c=window,l=c.innerWidth,u=c.innerHeight;return a>=0&&s<=l||window.scrollBy({behavior:e,left:a-n}),i>=0&&o<=u||window.scrollBy({behavior:e,top:i-n}),this}},{key:"highlightStepEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.getStepEl(this.currentStep),n=this.getEl("overlay");if(n){var r=n.querySelector("path"),i=r.querySelector("animate"),o=this.isEl(e,"fakeStep"),a=o?this.getOverlayDocumentPath():this.getOverlayStepPath(this.currentStep);if(r.setAttribute("d",a),i){var s=i.getAttribute("lock");if(s||(i.setAttribute("from",a),i.setAttribute("to",a)),t){var c=this.isEl(this.getStepEl(this.fromStep),"fakeStep"),l=!this.fromStep||c||o?null:this.getOverlayStepPath(this.fromStep);l&&(i.setAttribute("from",l),i.setAttribute("to",a)),i.setAttribute("lock","true")}i.onend=function(){i.removeAttribute("lock")},i.beginElement()}}var u=getComputedStyle(e);return["absolute","relative","fixed"].includes(u.getPropertyValue("position"))||e.classList.add(this.constructor.getRelativePositionClass()),e.classList.add(this.constructor.getHighlightClass()),e.setAttribute("data-guidechimp-".concat(this.uid),"highlight"),this.elements.set("highlight",e),this}},{key:"resetHighlightStepEl",value:function(){var t=this.getEl("overlay");if(t){var e=t.querySelector("path"),n=t.querySelector("animate");e.setAttribute("d",this.getOverlayDocumentPath()),n&&(n.removeAttribute("from"),n.removeAttribute("to"))}var r=this.getStepEl(this.currentStep);return r.classList.remove(this.constructor.getRelativePositionClass()),r.classList.remove(this.constructor.getHighlightClass()),r.removeAttribute("data-guidechimp-".concat(this.uid)),this.elements.delete("highlight"),this}},{key:"setInteractionPosition",value:function(t){var e=this.getStepEl(this.currentStep);if(!t||!e)return this;var n=this.options.padding;"floating"===getComputedStyle(e).getPropertyValue("position")&&(n=0);var r=this.constructor.getOffset(e),i=r.width,o=r.height,a=r.top,s=r.left;return t.classList.toggle(this.constructor.getFixedClass(),this.constructor.isFixed(e)),t.style.cssText="width: ".concat(i+n,"px;\n height: ").concat(o+n,"px;\n top: ").concat(a-n/2,"px;\n left: ").concat(s-n/2,"px;"),this}},{key:"setControlPosition",value:function(t){var e=this.getStepEl(this.currentStep);if(!t||!e)return this;var n=this.options.padding;"floating"===getComputedStyle(e).getPropertyValue("position")&&(n=0);var r=e.ownerDocument.defaultView.pageXOffset,i=e.ownerDocument.documentElement.getBoundingClientRect().width,o=this.constructor.getOffset(e),a=o.height,s=o.top,c=o.left,l=o.right,u=a+n,p=s-n/2,h=r<r+(c-n/2)?r:c-n/2,f=r+i>r+(l+n/2)?i:l+n/2;return t.classList.toggle(this.constructor.getFixedClass(),this.constructor.isFixed(e)),t.style.cssText="width: ".concat(f,"px;\n height: ").concat(u,"px;\n top: ").concat(p,"px;\n left: ").concat(h,"px;"),this}},{key:"setTooltipPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.currentStep)return this;var n=this.getStepEl(this.currentStep);if(!t||!n)return this;var r=e.boundary,i=e.position,o=this.options.padding;r=r||window;var a=(i=(i=i||this.currentStep.position)||this.options.position).split("-"),s=E(a,2),c=s[0],l=s[1],u=getComputedStyle(n);"floating"===u.getPropertyValue("position")&&(o=0);var p=t.style;p.top=null,p.right=null,p.bottom=null,p.left=null,p.transform=null;var h=n.getBoundingClientRect(),f=h.top,d=h.bottom,v=h.left,g=h.right,y=h.width,m=h.height,b=t.getBoundingClientRect(),x=b.height,S=b.width,w=t.cloneNode(!0);w.style.visibility="hidden",w.innerHTML="",t.parentElement.appendChild(w);var k=w.getBoundingClientRect(),O=k.width;w.parentElement.removeChild(w);var P=new DOMRect(0,0,window.innerWidth,window.innerHeight);if(!(r instanceof Window)){var T=r.getBoundingClientRect(),L=T.x,A=T.y;P=new DOMRect(L,A,r.scrollWidth,r.scrollHeight)}var I=P,j=I.top,C=I.bottom,_=I.left,D=I.right;if(this.isEl(n,"fakeStep"))c="floating";else{var N=["bottom","right","left","top"],R=getComputedStyle(t),M=R.marginTop,B=R.marginLeft,$=R.marginRight,F=R.marginBottom;if(M=parseInt(M,10),B=parseInt(B,10),$=parseInt($,10),x+M+(F=parseInt(F,10))>f-j&&N.splice(N.indexOf("top"),1),x+M+F>C-d&&N.splice(N.indexOf("bottom"),1),O+B+$>v-_&&N.splice(N.indexOf("left"),1),O+B+$>D-g&&N.splice(N.indexOf("right"),1),"top"===(c=N.length?N.includes(c)?c:N[0]:"floating")||"bottom"===c){var W=["left","right","middle"];D-v<O&&W.splice(W.indexOf("left"),1),g-_<O&&W.splice(W.indexOf("right"),1),(v+y/2-_<O/2||D-(g-y/2)<O/2)&&W.splice(W.indexOf("middle"),1),l=W.length?W.includes(l)?l:W[0]:"middle"}}t.setAttribute("data-guidechimp-position",c);var H=document.documentElement;switch(c){case"top":p.bottom="".concat(m+o,"px");break;case"right":p.left="".concat(g+o/2-H.clientLeft,"px");break;case"left":p.right="".concat(H.clientWidth-(v-o/2),"px");break;case"bottom":p.top="".concat(m+o,"px");break;default:p.left="50%",p.top="50%",p.transform="translate(-50%,-50%)"}if(t.removeAttribute("data-guidechimp-alignment"),l)switch(t.setAttribute("data-guidechimp-alignment",l),l){case"left":p.left="".concat(v-o/2,"px");break;case"right":p.right="".concat(H.clientWidth-g-o/2,"px");break;default:v+y/2<S/2||v+y/2+S/2>H.clientWidth?p.left="".concat(H.clientWidth/2-S/2,"px"):p.left="".concat(v+y/2-S/2,"px")}return this}},{key:"startPreloader",value:function(){document.body.classList.add(this.constructor.getLoadingClass());var t=this.getEl("overlay");if(t){var e=t.querySelector("path"),n=t.querySelector("animate"),r=new Map;r.set("d",e.getAttribute("d")),e.setAttribute("d",this.getOverlayDocumentPath()),n&&(r.set("from",n.getAttribute("from")),r.set("to",n.getAttribute("to")),n.removeAttribute("from"),n.removeAttribute("to")),this.cache.set("preloaderCache",r)}var i=this.mountPreloaderEl();return i.hidden=!0,setTimeout((function(){i.hidden=!1}),100),this}},{key:"stopPreloader",value:function(){document.body.classList.remove(this.constructor.getLoadingClass());var t=this.getEl("overlay");if(t){var e=t.querySelector("path"),n=t.querySelector("animate"),r=this.cache.get("preloaderCache")||new Map;r.has("d")&&e.setAttribute("d",r.get("d")),n&&(r.has("from")&&n.setAttribute("from",r.get("from")),r.has("to")&&n.setAttribute("to",r.get("to"))),this.cache.delete("preloaderCache")}return this.removePreloaderEl(),this}},{key:"getDefaultTmplData",value:function(){var t=this;return{previousStep:this.previousStep,currentStep:this.currentStep,nextStep:this.nextStep,fromStep:this.fromStep,toStep:this.toStep,previousStepIndex:this.previousStepIndex,currentStepIndex:this.currentStepIndex,nextStepIndex:this.nextStepIndex,fromStepIndex:this.fromStepIndex,toStepIndex:this.toStepIndex,steps:this.steps,go:function(){return t.go.apply(t,arguments)},previous:function(){return t.previous.apply(t,arguments)},next:function(){return t.next.apply(t,arguments)},stop:function(){return t.stop.apply(t,arguments)}}}},{key:"mountStep",value:function(){var t=this.mountInteractionEl(),e=this.mountControlEl();return this.setInteractionPosition(t),this.setControlPosition(e),this.setTooltipPosition(this.getEl("tooltip")),this.observeStep(),this.highlightStepEl(!0),this}},{key:"unmountStep",value:function(){return this.resetHighlightStepEl(),this.removeInteractionEl(),this.removeControlEl(),this.removePreloaderEl(),this.removeFakeStepEl(),this}},{key:"createEl",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=S(e,n);return r&&r.setAttribute("data-quidechimp-".concat(this.uid),t),r}},{key:"getEl",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.elements.get(t);return n||(n=document.querySelector("[data-quidechimp-".concat(this.uid,'="').concat(t,'"]'))),n||e}},{key:"mountEl",value:function(t,e){var n=this;if(t){var r=t.querySelectorAll("[data-quidechimp-".concat(this.uid,"]"));[t].concat(k(r)).forEach((function(t){var e=t.getAttribute("data-quidechimp-".concat(n.uid));e&&(n.removeEl(e),n.elements.set(e,t))})),e.appendChild(t)}return t}},{key:"removeEl",value:function(t){var e=this.getEl(t);return e&&e.parentElement.removeChild(e),this.elements.delete(t),this}},{key:"isEl",value:function(t,e){return this.getEl(e)?t===this.getEl(e):t.getAttribute("data-quidechimp-".concat(this.uid))===e}},{key:"getFakeStepTmpl",value:function(){return'<div class="gc-fake-step"></div>'}},{key:"createFakeStepEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("fakeStep",this.getFakeStepTmpl(),j(j({},this.getDefaultTmplData()),t))}},{key:"mountFakeStepEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createFakeStepEl(t),document.body)}},{key:"removeFakeStepEl",value:function(){return this.removeEl("fakeStep")}},{key:"getPreloaderTmpl",value:function(){return'<div class="gc-preloader"></div>'}},{key:"createPreloaderEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("preloader",this.getPreloaderTmpl(),t)}},{key:"mountPreloaderEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createPreloaderEl(t),document.body)}},{key:"removePreloaderEl",value:function(){return this.removeEl("preloader")}},{key:"getOverlayDocumentPath",value:function(){var t=window,e=t.innerWidth,n=t.innerHeight,r=document.body,i=r.scrollWidth,o=r.scrollHeight,a=n>o?n:o;return"M 0 0 H ".concat(e>i?e:i," V ").concat(a," H 0 V 0 Z")}},{key:"getOverlayStepPath",value:function(t){return this.getOverlayElPath(this.getStepEl(t))}},{key:"getOverlayElPath",value:function(t){var e=this.options.padding;e=e?e/2:0;var n=t.getBoundingClientRect(),r=n.left,i=n.top,o=n.width,a=n.height,s=this.getOverlayDocumentPath();return s+="M ".concat(r-e+4," ").concat(i-e,"\n a ").concat(4,",").concat(4," 0 0 0 -").concat(4,",").concat(4,"\n V ").concat(a+i+e-4,"\n a ").concat(4,",").concat(4," 0 0 0 ").concat(4,",").concat(4,"\n H ").concat(o+r+e-4,"\n a ").concat(4,",").concat(4," 0 0 0 ").concat(4,",-").concat(4,"\n V ").concat(i-e+4,"\n a ").concat(4,",").concat(4," 0 0 0 -").concat(4,",-").concat(4,"Z")}},{key:"getOverlayTmpl",value:function(){return'<div class="gc-overlay" @click="stop({ event: $event })"> <svg class="svg-overlay"> <path d="{{path}}"> <animate attributeName="d" dur="200ms"/> </path> </svg> </div>'}},{key:"createOverlayEl",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={stop:(t=A(T().mark((function t(){var n=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.options.exitOverlay){t.next=3;break}return t.next=3,e.stop.apply(e,n);case 3:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)}),path:this.getOverlayDocumentPath()};return this.createEl("overlay",this.getOverlayTmpl(),j(j({},r),n))}},{key:"mountOverlayEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createOverlayEl(t),document.body)}},{key:"removeOverlayEl",value:function(){return this.removeEl("overlay")}},{key:"getInteractionTmpl",value:function(){return'<div if="!interaction" class="gc-interaction gc-disable"> </div>'}},{key:"createInteractionEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.options.interaction;"boolean"==typeof this.currentStep.interaction&&(e=this.currentStep.interaction);var n=j(j({},this.getDefaultTmplData()),{},{interaction:e});return this.createEl("interaction",this.getInteractionTmpl(),j(j({},n),t))}},{key:"mountInteractionEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createInteractionEl(t),document.body)}},{key:"removeInteractionEl",value:function(){return this.removeEl("interaction")}},{key:"getControlTmpl",value:function(){return'<div class="gc-control"> {{ tooltipEl }} </div>'}},{key:"createControlEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("control",this.getControlTmpl(),j(j({},this.getDefaultTmplData()),{},{tooltipEl:this.createTooltipEl(t)},t))}},{key:"mountControlEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createControlEl(t),document.body)}},{key:"removeControlEl",value:function(){return this.removeEl("control")}},{key:"getTooltipTmpl",value:function(){return'<div class="gc-tooltip"> <div class="gc-tooltip-tail"></div> {{ progressbar }} {{ title }} {{ description }} {{ close }} {{ customButtons }} <div if="previous || pagination || next" class="gc-navigation"> {{ previous }} {{ pagination }} {{ next }} </div> {{ copyright }} {{ notification }} </div>'}},{key:"createTooltipEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=j(j({},this.getDefaultTmplData()),{},{progressbar:this.createProgressbarEl(t),title:this.createTitleEl(t),description:this.createDescriptionEl(t),close:this.createCloseEl(t),customButtons:this.createCustomButtonsEl(t),previous:this.createPreviousEl(t),pagination:this.createPaginationEl(t),next:this.createNextEl(t),copyright:this.createCopyrightEl(t),notification:this.createNotificationEl(t)});return this.createEl("tooltip",this.getTooltipTmpl(),j(j({},e),t))}},{key:"getCloseTmpl",value:function(){return'<div class="gc-close" @click="stop({ event: $event })"></div>'}},{key:"createCloseEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("close",this.getCloseTmpl(),j(j({},this.getDefaultTmplData()),t))}},{key:"getProgressbarTmpl",value:function(){return'<div if="showProgressbar" class="gc-progressbar" role="progressbar" aria-valuemin="{{ progressMin }}" aria-valuemax="{{ progressMax }}" aria-valuenow="{{ progress }}" style="width:{{ progress }}%;"></div>'}},{key:"createProgressbarEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.options.showProgressbar;"boolean"==typeof this.currentStep.showProgressbar&&(e=this.currentStep.showProgressbar);var n=100,r=0,i=(this.currentStepIndex+1)/this.steps.length*100,o=j(j({},this.getDefaultTmplData()),{},{showProgressbar:e,progressMax:n,progressMin:r,progress:i});return this.createEl("progressbar",this.getProgressbarTmpl(),j(j({},o),t))}},{key:"getTitleTmpl",value:function(){return'<div if="title" html="{{ title }}" class="gc-title"> </div>'}},{key:"createTitleEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.currentStep.title,n=void 0===e?"":e;return this.createEl("title",this.getTitleTmpl(),j(j({},this.getDefaultTmplData()),{},{title:n},t))}},{key:"getDescriptionTmpl",value:function(){return'<div if="description" html="{{ description }}" class="gc-description"></div>'}},{key:"createDescriptionEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.currentStep.description,n=void 0===e?"":e;return this.createEl("description",this.getDescriptionTmpl(),j(j({},this.getDefaultTmplData()),{},{description:n},t))}},{key:"getCustomButtonsTmpl",value:function(){return'<div if="buttons.length" class="gc-custom-buttons"> <template for="button in buttons"> {{ button }} </template> </div>'}},{key:"createCustomButtonsEl",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[];return this.currentStep.buttons&&this.currentStep.buttons.forEach((function(e){var r=e;if(!c(r)){var i=e.onClick,o=e.tagName,a=void 0===o?"button":o,s=e.title,l=void 0===s?"":s,u=e.class;(r=document.createElement(a)).innerHTML=l,u&&(r.className=u),i&&r.addEventListener("click",(function(e){i.call(t,e)}))}n.push(r)})),this.createEl("customButtons",this.getCustomButtonsTmpl(),j(j({},this.getDefaultTmplData()),{},{buttons:n},e))}},{key:"getPaginationTmpl",value:function(){return'<div if="showPagination && steps.length > 1" class="gc-pagination"> <template if="paginationTheme === \'numbers\' || steps.length >= paginationCirclesMaxItems"> <ul class="gc-pagination-theme-numbers"> <template for="(step, index) in steps"> <template if="index === 0"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> <template if="currentStepIndex < 3"> <template if="index > 0 && index < 5"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> <li elseif="index === 5 && index !== steps.length - 1" class="gc-pagination-dots"> ... </li> </template> <template elseif="steps.length - currentStepIndex < 5"> <template if="steps.length - index < 6 && steps.length - 1 !== index"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> <li elseif="steps.length - index === 6 && index !== 0" class="gc-pagination-dots"> ... </li> </template> <template else> <li if="currentStepIndex - index === 3 && index !== 0" class="gc-pagination-dots"> ... </li> <template elseif="(currentStepIndex - index >= 0 && currentStepIndex - index < 3)\n || ( index - currentStepIndex >= 0 && index - currentStepIndex < 3)"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> <li elseif="index - currentStepIndex === 3 && steps.length -1 !== index" class="gc-pagination-dots"> ... </li> </template> <template if="index + 1 === steps.length"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> </template> </ul> </template> <template else> <div class="gc-pagination-theme-circles"> <template for="(step, index) in steps"> <div if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active"></div> <div elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"></div> <div elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"></div> <div else class="gc-pagination-item" @click="go(index, true, { event: $event })"></div> </template> </div> </template> </div> '}},{key:"createPaginationEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.currentStep,n=e.paginationTheme,r=void 0===n?this.options.paginationTheme:n,i=e.paginationCirclesMaxItems,o=void 0===i?this.options.paginationCirclesMaxItems:i,a=this.options.showPagination;return"boolean"==typeof this.currentStep.showPagination&&(a=this.currentStep.showPagination),this.createEl("pagination",this.getPaginationTmpl(),j(j({},this.getDefaultTmplData()),{},{showPagination:a,paginationTheme:r,paginationCirclesMaxItems:o},t))}},{key:"getPreviousTmpl",value:function(){return"<div class=\"gc-navigation-prev {{ (!previousStep || !showNavigation) ? 'gc-hidden': '' }}\" @click=\"previous({ event: $event })\"></div>"}},{key:"createPreviousEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.options.showNavigation;return"boolean"==typeof this.currentStep.showNavigation&&(e=this.currentStep.showNavigation),this.createEl("previous",this.getPreviousTmpl(),j(j({},this.getDefaultTmplData()),{},{showNavigation:e},t))}},{key:"getNextTmpl",value:function(){return"<div class=\"gc-navigation-next {{ (!nextStep || !showNavigation) ? 'gc-hidden': '' }}\" @click=\"next({ event: $event })\"></div>"}},{key:"createNextEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.options.showNavigation;return"boolean"==typeof this.currentStep.showNavigation&&(e=this.currentStep.showNavigation),this.createEl("next",this.getNextTmpl(),j(j({},this.getDefaultTmplData()),{},{showNavigation:e},t))}},{key:"getCopyrightTmpl",value:function(){return'<div class="gc-copyright">Made with AHD.JS</div> '}},{key:"createCopyrightEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("copyright",this.getCopyrightTmpl(),j(j({},this.getDefaultTmplData()),t))}},{key:"getNotificationTmpl",value:function(){return'<div html="{{ messages[0] }}" class="gc-notification"></div>'}},{key:"createNotificationEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("notification",this.getNotificationTmpl(),j(j({},this.getDefaultTmplData()),{},{messages:this.notifications},t))}},{key:"notify",value:function(t){this.notifications.push(t);var e=this.getEl("notification");return e&&this.mountEl(this.createNotificationEl(),e.parentElement),this}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.constructor.getEventListenersPriorities(),i=E(r,1),o=i[0];n.priority&&r.includes(n.priority)&&(o=n.priority);var a=t.trim();return this.listeners[a]=this.listeners[a]||{},this.listeners[a][o]=this.listeners[a][o]||[],this.listeners[a][o].push(e),this}},{key:"emit",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=k(this.constructor.getEventListenersPriorities()).reverse(),a=t.trim(),s=[],c=Promise.resolve(s);return this.listeners[a]&&o.forEach((function(t){var n=e.listeners[a][t];n&&(c=c.then((function(){return Promise.all(n.map((function(t){return Promise.resolve().then((function(){return t.apply(e,r)}))})))})).then((function(t){return s=[].concat(k(s),k(t))})))})),c}},{key:"addOnKeydownListener",value:function(){return this.cache.set("onKeydownListener",this.getOnKeydownListener()),window.addEventListener("keydown",this.cache.get("onKeydownListener"),!0),this}},{key:"getOnKeydownListener",value:function(){var t=this;return function(e){var n=e.keyCode,r=j(j({},t.constructor.getDefaultKeyboardCodes()),t.options.useKeyboard),i=r.previous,o=r.next,a=r.stop;a&&a.includes(n)?t.stop({event:e}):i&&i.includes(n)?t.previous({event:e}):o&&o.includes(n)&&t.next({event:e})}}},{key:"removeOnKeydownListener",value:function(){return this.cache.has("onKeydownListener")&&(window.removeEventListener("keydown",this.cache.get("onKeydownListener"),!0),this.cache.delete("onKeydownListener")),this}},{key:"addOnWindowResizeListener",value:function(){return this.cache.set("onWindowResizeListener",this.getOnWindowResizeListener()),window.addEventListener("resize",this.cache.get("onWindowResizeListener"),!0),this}},{key:"getOnWindowResizeListener",value:function(){var t=this;return function(){return t.refresh()}}},{key:"removeOnWindowResizeListener",value:function(){return this.cache.has("onWindowResizeListener")&&(window.removeEventListener("resize",this.cache.get("onWindowResizeListener"),!0),this.cache.delete("onWindowResizeListener")),this}},{key:"addOnWindowScrollListener",value:function(){return this.cache.set("onWindowScrollListener",this.getOnWindowScrollListener()),window.addEventListener("scroll",this.cache.get("onWindowScrollListener"),!0),this}},{key:"getOnWindowScrollListener",value:function(){var t=this;return function(){return t.refresh()}}},{key:"removeOnWindowScrollListener",value:function(){return this.cache.has("onWindowScrollListener")&&(window.removeEventListener("scroll",this.cache.get("onWindowScrollListener"),!0),this.cache.delete("onWindowScrollListener")),this}},{key:"removeListeners",value:function(){this.removeOnKeydownListener(),this.removeOnWindowResizeListener(),this.removeOnWindowScrollListener()}},{key:"observeStep",value:function(){this.observeResizing(),this.observeMutation()}},{key:"observeResizing",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{box:"border-box"},n=this.observers.resizingObserver;return n||"undefined"==typeof ResizeObserver||(n=new ResizeObserver((function(){(t||t.currentStep)&&t.refresh()})),this.observers.resizingObserver=n),!!n&&(n.observe(this.getStepEl(this.currentStep),e),!0)}},{key:"unobserveResizing",value:function(){var t=this.observers.resizingObserver;return!!t&&(t.disconnect(),!0)}},{key:"observeMutation",value:function(){var t=this,e=this.observers.mutationObserver;return e||(e=new MutationObserver((function(e){if((t||t.currentStep)&&t.currentStep.element){var n=t.getStepEl(t.currentStep),r=function(){return n&&!t.isEl(n,"fakeStep")};e.forEach((function(e){r()?"childList"===e.type&&e.removedNodes.length&&e.removedNodes.forEach((function(e){(e===n||e.contains(n))&&(n=t.getStepEl(t.currentStep),t.scrollParentsToStepEl(),t.refresh())})):"childList"===e.type&&e.addedNodes.length&&(n=t.getStepEl(t.currentStep),r()&&(t.scrollParentsToStepEl(),t.refresh()))}))}})),this.observers.mutationObserver=e),e.observe(this.getStepEl(this.currentStep).ownerDocument.body,{childList:!0,subtree:!0}),!0}},{key:"unobserveMutation",value:function(){var t=this.observers.mutationObserver;return!!t&&(t.disconnect(),!0)}},{key:"unobserveStep",value:function(){this.unobserveResizing(),this.unobserveMutation()}},{key:"beforeChangeStep",value:function(){this.unmountStep(),this.unobserveStep()}},{key:"refresh",value:function(){return this.currentStep?(this.highlightStepEl(),this.setControlPosition(this.getEl("control")),this.setInteractionPosition(this.getEl("interaction")),this.setTooltipPosition(this.getEl("tooltip")),this):this}}],i=[{key:"getDefaultOptions",value:function(){return{position:"bottom",useKeyboard:!0,exitEscape:!0,exitOverlay:!0,showPagination:!0,showNavigation:!0,showProgressbar:!0,paginationTheme:"circles",paginationCirclesMaxItems:10,interaction:!0,padding:8,scrollPadding:10,scrollBehavior:"auto"}}},{key:"getDefaultKeyboardCodes",value:function(){return{previous:[37],next:[39,13,32],stop:[27]}}},{key:"getEventListenersPriorities",value:function(){return["low","medium","high","critical"]}},{key:"getBodyClass",value:function(){return"gc"}},{key:"getLoadingClass",value:function(){return"gc-loading"}},{key:"getHighlightClass",value:function(){return"gc-highlight"}},{key:"getFixedClass",value:function(){return"gc-fixed"}},{key:"getRelativePositionClass",value:function(){return"gc-relative"}},{key:"getOffset",value:function(t){var e=t.ownerDocument,n=e.body,r=e.documentElement,i=e.defaultView,o=i.pageYOffset||r.scrollTop||n.scrollTop,a=i.pageXOffset||r.scrollLeft||n.scrollLeft,s=t.getBoundingClientRect(),c=s.top,l=s.right,u=s.bottom,p=s.left;return{right:l,bottom:u,width:s.width,height:s.height,x:s.x,y:s.y,top:c+o,left:p+a}}},{key:"isFixed",value:function(t){var e=t.parentNode;return!(!e||"HTML"===e.nodeName)&&("fixed"===getComputedStyle(t).getPropertyValue("position")||this.isFixed(e))}}],r&&D(n.prototype,r),i&&D(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),M=function(){function t(t){this.persistent=t,this._lootBag={},this._ttl=null}return Object.defineProperty(t.prototype,"timeoutInSeconds",{get:function(){return this._ttl},set:function(e){if(null!==e&&!t.isPositiveInteger(e))throw new Error("'".concat(e,"' is not a positive integer required when setting the top-level TTL"));this._ttl=e},enumerable:!1,configurable:!0}),t.prototype.put=function(e,n,r){if(void 0===r&&(r=null),null!==r&&!t.isPositiveInteger(r))throw new Error("'".concat(r,"' is not a positive integer required when setting a key-level TTL"));var i={v:n,t:this._getNow(),kt:r};this.persistent?localStorage.setItem(e,JSON.stringify(i)):this._lootBag[e]=i},t.prototype.get=function(t,e){if(void 0===e&&(e=null),!this.persistent){if(t in this._lootBag){r=this._lootBag[t];return null===this._ttl&&null===r.kt?r.v:this._isCacheStale(r)?(this.removeKey(t),e):r.v}return e}if(!(t in localStorage))return e;var n=localStorage.getItem(t);try{var r=JSON.parse(n);return null===this._ttl&&null===r.kt?r.v:this._isCacheStale(r)?(this.removeKey(t),e):r.v}catch(t){return null===e?n:e}},t.prototype.removeKey=function(t){this.persistent?t in localStorage&&localStorage.removeItem(t):t in this._lootBag&&delete this._lootBag[t]},t.prototype.keyExists=function(t){if(!this.persistent){if(t in this._lootBag){n=this._lootBag[t];return null===this._ttl&&null===n.kt||(!this._isCacheStale(n)||(this.removeKey(t),!1))}return!1}if(!(t in localStorage))return!1;var e=localStorage.getItem(t);try{var n=JSON.parse(e);return null===this._ttl&&null===n.kt||(!this._isCacheStale(n)||(this.removeKey(t),!1))}catch(t){return!0}},t.prototype.clear=function(){this.persistent?localStorage.clear():this._lootBag={}},t.prototype.keys=function(){return this.persistent?Object.keys(localStorage):Object.keys(this._lootBag)},t.prototype.runGarbageCollector=function(){var t=[];if(this.persistent)for(var e=0,n=Object.keys(localStorage);e<n.length;e++){var r=n[e],i=localStorage.getItem(r);try{var o=JSON.parse(i);if(!("v"in o&&"t"in o&&"kt"in o))continue;null===this._ttl&&null===o.kt||this._isCacheStale(o)&&(localStorage.removeItem(r),t.push(r))}catch(t){}}else for(var a=0,s=Object.keys(this._lootBag);a<s.length;a++){r=s[a];null===this._ttl&&null===this._lootBag[r].kt||this._isCacheStale(this._lootBag[r])&&(delete this._lootBag[r],t.push(r))}return t},t.prototype.isLocalStorageAvailable=function(){var t=(new Date).getTime().toString(),e=t;try{return localStorage.setItem(t,e),localStorage.removeItem(t),!0}catch(t){return!1}},t.prototype._getNow=function(){return Math.floor(Date.now()/1e3)},t.prototype._isCacheStale=function(t){var e=t.t,n=null===t.kt?this._ttl:t.kt;return this._getNow()-e>n},t.isPositiveInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&t>0},t}(),B=(N=function(t,e){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},N(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),$=(new(function(t){function e(){return t.call(this,false)||this}return B(e,t),e}(M)),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),F=new(function(t){function e(){return t.call(this,true)||this}return $(e,t),e}(M));function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function H(t,e,n){return H=Z()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&Y(i,n.prototype),i},H.apply(null,arguments)}function V(t){return function(t){if(Array.isArray(t))return z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function q(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */q=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,o=Object.create(i.prototype),a=new E(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,a),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function p(){}function h(){}function f(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&n.call(g,i)&&(d=g);var y=f.prototype=p.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(i,o,a,s){var c=l(t[i],t,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==W(p)&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(p).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return h.prototype=f,s(y,"constructor",f),s(f,"constructor",h),h.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},m(b.prototype),s(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new b(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(y),s(y,a,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=k,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function K(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function G(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){K(o,r,i,a,s,"next",t)}function s(t){K(o,r,i,a,s,"throw",t)}a(void 0)}))}}function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Y(t,e){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Y(t,e)}function X(t,e){if(e&&("object"===W(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Z(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Q(t)}F.timeoutInSeconds=600;var tt=n(68).match,et="AHD_TOUR_DATA",nt="AHD_TOUR_VISITED",rt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Y(t,e)}(l,t);var e,n,r,i,o,a,s,c=(e=l,n=Z(),function(){var t,r=Q(e);if(n){var i=Q(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return X(this,t)});function l(){return U(this,l),c.apply(this,arguments)}return r=l,i=[{key:"updatePageUrl",value:(s=G(q().mark((function t(e,n){var r,i,o;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.stop();case 2:if((r=F.get(et))&&!n){t.next=7;break}return t.next=6,this.fetchAndCacheData(r);case 6:r=t.sent;case 7:i=this.getApplicabeDataForUrl(r,e),o=i.map((function(t){return{element:t.selector,title:t.content.title,description:t.content.content}})),this.setTour(o),this.start();case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return s.apply(this,arguments)})},{key:"getApplicabeDataForUrl",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=F.get(nt)||[],i=new Set(r);return t.filter((function(t){if(n||!r||!r.includes(t.slug)){var o=tt(t.slug,{decode:decodeURIComponent})(e);return o&&!i.has(t.slug)&&(i.add(t.slug),F.put(nt,V(i),86400)),o}return!1}))}},{key:"fetchAndCacheData",value:(a=G(q().mark((function t(e){var n;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://ahd-be-jggub5n6qq-em.a.run.app/api/tenant/".concat(this.options.applicationId,"/contexttour?filter[isActive]=true")).then((function(t){return t.json()}));case 2:return(n=t.sent).rows&&(e=n.rows.filter((function(t){return!!t.content})),F.put(et,e)),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})}],i&&J(r.prototype,i),o&&J(r,o),Object.defineProperty(r,"prototype",{writable:!1}),l}(R),it=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return H(rt,e)};it.prototype=rt.prototype,it.plugins=new Set,it.extend=function(t){if(!it.plugins.has(t)){it.plugins.add(t);for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];t.apply(void 0,[rt,it].concat(n))}return it};const ot=it})(),r})()));
12
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.AHDjs=e():t.AHDjs=e()}(self,(()=>(()=>{var t={705:(t,e,n)=>{var r=n(639).Symbol;t.exports=r},932:t=>{t.exports=function(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}},239:(t,e,n)=>{var r=n(705),i=n(607),o=n(333),a=r?r.toStringTag:void 0;t.exports=function(t){return null==t?void 0===t?"[object Undefined]":"[object Null]":a&&a in Object(t)?i(t):o(t)}},531:(t,e,n)=>{var r=n(705),i=n(932),o=n(469),a=n(448),s=r?r.prototype:void 0,c=s?s.toString:void 0;t.exports=function t(e){if("string"==typeof e)return e;if(o(e))return i(e,t)+"";if(a(e))return c?c.call(e):"";var n=e+"";return"0"==n&&1/e==-Infinity?"-0":n}},957:(t,e,n)=>{var r="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g;t.exports=r},607:(t,e,n)=>{var r=n(705),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},333:t=>{var e=Object.prototype.toString;t.exports=function(t){return e.call(t)}},639:(t,e,n)=>{var r=n(957),i="object"==typeof self&&self&&self.Object===Object&&self,o=r||i||Function("return this")();t.exports=o},469:t=>{var e=Array.isArray;t.exports=e},220:t=>{t.exports=function(t){return null===t}},5:t=>{t.exports=function(t){return null!=t&&"object"==typeof t}},448:(t,e,n)=>{var r=n(239),i=n(5);t.exports=function(t){return"symbol"==typeof t||i(t)&&"[object Symbol]"==r(t)}},353:t=>{t.exports=function(t){return void 0===t}},833:(t,e,n)=>{var r=n(531);t.exports=function(t){return null==t?"":r(t)}},955:(t,e,n)=>{var r=n(833),i=0;t.exports=function(t){var e=++i;return r(t)+e}},68:(t,e,n)=>{"use strict";function r(t,e){void 0===e&&(e={});for(var n=function(t){for(var e=[],n=0;n<t.length;){var r=t[n];if("*"!==r&&"+"!==r&&"?"!==r)if("\\"!==r)if("{"!==r)if("}"!==r)if(":"!==r)if("("!==r)e.push({type:"CHAR",index:n,value:t[n++]});else{var i=1,o="";if("?"===t[s=n+1])throw new TypeError('Pattern cannot start with "?" at '.concat(s));for(;s<t.length;)if("\\"!==t[s]){if(")"===t[s]){if(0==--i){s++;break}}else if("("===t[s]&&(i++,"?"!==t[s+1]))throw new TypeError("Capturing groups are not allowed at ".concat(s));o+=t[s++]}else o+=t[s++]+t[s++];if(i)throw new TypeError("Unbalanced pattern at ".concat(n));if(!o)throw new TypeError("Missing pattern at ".concat(n));e.push({type:"PATTERN",index:n,value:o}),n=s}else{for(var a="",s=n+1;s<t.length;){var c=t.charCodeAt(s);if(!(c>=48&&c<=57||c>=65&&c<=90||c>=97&&c<=122||95===c))break;a+=t[s++]}if(!a)throw new TypeError("Missing parameter name at ".concat(n));e.push({type:"NAME",index:n,value:a}),n=s}else e.push({type:"CLOSE",index:n,value:t[n++]});else e.push({type:"OPEN",index:n,value:t[n++]});else e.push({type:"ESCAPED_CHAR",index:n++,value:t[n++]});else e.push({type:"MODIFIER",index:n,value:t[n++]})}return e.push({type:"END",index:n,value:""}),e}(t),r=e.prefixes,i=void 0===r?"./":r,o="[^".concat(c(e.delimiter||"/#?"),"]+?"),a=[],s=0,l=0,u="",p=function(t){if(l<n.length&&n[l].type===t)return n[l++].value},h=function(t){var e=p(t);if(void 0!==e)return e;var r=n[l],i=r.type,o=r.index;throw new TypeError("Unexpected ".concat(i," at ").concat(o,", expected ").concat(t))},f=function(){for(var t,e="";t=p("CHAR")||p("ESCAPED_CHAR");)e+=t;return e};l<n.length;){var d=p("CHAR"),v=p("NAME"),g=p("PATTERN");if(v||g){var y=d||"";-1===i.indexOf(y)&&(u+=y,y=""),u&&(a.push(u),u=""),a.push({name:v||s++,prefix:y,suffix:"",pattern:g||o,modifier:p("MODIFIER")||""})}else{var m=d||p("ESCAPED_CHAR");if(m)u+=m;else if(u&&(a.push(u),u=""),p("OPEN")){y=f();var b=p("NAME")||"",x=p("PATTERN")||"",S=f();h("CLOSE"),a.push({name:b||(x?s++:""),pattern:b&&!x?o:x,prefix:y,suffix:S,modifier:p("MODIFIER")||""})}else h("END")}}return a}function i(t,e){return o(r(t,e),e)}function o(t,e){void 0===e&&(e={});var n=l(e),r=e.encode,i=void 0===r?function(t){return t}:r,o=e.validate,a=void 0===o||o,s=t.map((function(t){if("object"==typeof t)return new RegExp("^(?:".concat(t.pattern,")$"),n)}));return function(e){for(var n="",r=0;r<t.length;r++){var o=t[r];if("string"!=typeof o){var c=e?e[o.name]:void 0,l="?"===o.modifier||"*"===o.modifier,u="*"===o.modifier||"+"===o.modifier;if(Array.isArray(c)){if(!u)throw new TypeError('Expected "'.concat(o.name,'" to not repeat, but got an array'));if(0===c.length){if(l)continue;throw new TypeError('Expected "'.concat(o.name,'" to not be empty'))}for(var p=0;p<c.length;p++){var h=i(c[p],o);if(a&&!s[r].test(h))throw new TypeError('Expected all "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(h,'"'));n+=o.prefix+h+o.suffix}}else if("string"!=typeof c&&"number"!=typeof c){if(!l){var f=u?"an array":"a string";throw new TypeError('Expected "'.concat(o.name,'" to be ').concat(f))}}else{h=i(String(c),o);if(a&&!s[r].test(h))throw new TypeError('Expected "'.concat(o.name,'" to match "').concat(o.pattern,'", but got "').concat(h,'"'));n+=o.prefix+h+o.suffix}}else n+=o}return n}}function a(t,e){var n=[];return s(p(t,n,e),n,e)}function s(t,e,n){void 0===n&&(n={});var r=n.decode,i=void 0===r?function(t){return t}:r;return function(n){var r=t.exec(n);if(!r)return!1;for(var o=r[0],a=r.index,s=Object.create(null),c=function(t){if(void 0===r[t])return"continue";var n=e[t-1];"*"===n.modifier||"+"===n.modifier?s[n.name]=r[t].split(n.prefix+n.suffix).map((function(t){return i(t,n)})):s[n.name]=i(r[t],n)},l=1;l<r.length;l++)c(l);return{path:o,index:a,params:s}}}function c(t){return t.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1")}function l(t){return t&&t.sensitive?"":"i"}function u(t,e,n){void 0===n&&(n={});for(var r=n.strict,i=void 0!==r&&r,o=n.start,a=void 0===o||o,s=n.end,u=void 0===s||s,p=n.encode,h=void 0===p?function(t){return t}:p,f=n.delimiter,d=void 0===f?"/#?":f,v=n.endsWith,g="[".concat(c(void 0===v?"":v),"]|$"),y="[".concat(c(d),"]"),m=a?"^":"",b=0,x=t;b<x.length;b++){var S=x[b];if("string"==typeof S)m+=c(h(S));else{var w=c(h(S.prefix)),E=c(h(S.suffix));if(S.pattern)if(e&&e.push(S),w||E)if("+"===S.modifier||"*"===S.modifier){var k="*"===S.modifier?"?":"";m+="(?:".concat(w,"((?:").concat(S.pattern,")(?:").concat(E).concat(w,"(?:").concat(S.pattern,"))*)").concat(E,")").concat(k)}else m+="(?:".concat(w,"(").concat(S.pattern,")").concat(E,")").concat(S.modifier);else"+"===S.modifier||"*"===S.modifier?m+="((?:".concat(S.pattern,")").concat(S.modifier,")"):m+="(".concat(S.pattern,")").concat(S.modifier);else m+="(?:".concat(w).concat(E,")").concat(S.modifier)}}if(u)i||(m+="".concat(y,"?")),m+=n.endsWith?"(?=".concat(g,")"):"$";else{var O=t[t.length-1],P="string"==typeof O?y.indexOf(O[O.length-1])>-1:void 0===O;i||(m+="(?:".concat(y,"(?=").concat(g,"))?")),P||(m+="(?=".concat(y,"|").concat(g,")"))}return new RegExp(m,l(n))}function p(t,e,n){return t instanceof RegExp?function(t,e){if(!e)return t;for(var n=/\((?:\?<(.*?)>)?(?!\?)/g,r=0,i=n.exec(t.source);i;)e.push({name:i[1]||r++,prefix:"",suffix:"",modifier:"",pattern:""}),i=n.exec(t.source);return t}(t,e):Array.isArray(t)?function(t,e,n){var r=t.map((function(t){return p(t,e,n).source}));return new RegExp("(?:".concat(r.join("|"),")"),l(n))}(t,e,n):function(t,e,n){return u(r(t,n),e,n)}(t,e,n)}n.r(e),n.d(e,{compile:()=>i,match:()=>a,parse:()=>r,pathToRegexp:()=>p,regexpToFunction:()=>s,tokensToFunction:()=>o,tokensToRegexp:()=>u})}},e={};function n(r){var i=e[r];if(void 0!==i)return i.exports;var o=e[r]={exports:{}};return t[r](o,o.exports,n),o.exports}n.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return n.d(e,{a:e}),e},n.d=(t,e)=>{for(var r in e)n.o(e,r)&&!n.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),n.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var r={};return(()=>{"use strict";n.r(r),n.d(r,{default:()=>ot});var t=n(955),e=n.n(t),i=n(353),o=n.n(i),a=n(220),s=n.n(a);const c=function(t){return t instanceof HTMLElement||/^\[object HTML(.+)Element\]$/.test("".concat(t))},l=function(t){return t instanceof SVGElement||/^\[object SVG(.+)Element\]$/.test("".concat(t))},u=function(t){return/^[object NodeList]$/.test("".concat(t))};function p(t){return function(t){if(Array.isArray(t))return y(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||g(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function f(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?h(Object(n),!0).forEach((function(e){d(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):h(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function d(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||g(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(t,e){if(t){if("string"==typeof t)return y(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?y(t,e):void 0}}function y(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function m(t,e,n){return m=b()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&x(i,n.prototype),i},m.apply(null,arguments)}function b(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function x(t,e){return x=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},x(t,e)}const S=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new DOMParser,r=t.replace(/<template/g,"<gc-template");r=r.replace(/<\/template/g,"</gc-template");var i=n.parseFromString(r,"text/html"),a=document.implementation.createHTMLDocument(),h=/{{([^}}]+)?}}/gm,g=/^@(.+)$/,y=new Map,b=function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:a.body,i=r,b=Object.keys(n),x=Object.values(n),S=function(t){return m(Function,b.concat(["return ".concat(t,";")])).apply(void 0,x)};if(e){if(e.nodeType===Node.ELEMENT_NODE){if(e.hasAttribute("if")){if(y.set(e.parentNode,!1),!S(e.getAttribute("if")))return;y.set(e.parentNode,!0)}if(e.hasAttribute("elseif")){if(y.get(e.parentNode)||!S(e.getAttribute("elseif")))return;y.set(e.parentNode,!0)}if(e.hasAttribute("else")){if(y.get(e.parentNode))return;y.set(e.parentNode,!0)}if(e.hasAttribute("for")){var w=e.getAttribute("for").split(" in "),E=v(w,2),k=E[0],O=E[1];e.removeAttribute("for");var P=k.replace(/\(|\)/g,"").split(","),T=v(P,2),L=T[0],A=T[1];L=L.trim(),A=A?A.trim():"";var I=S(O.trim()),j=Array.isArray(I);return void Object.keys(I).forEach((function(r){var o=f(f({},n),{},d({},L,I[r]));A&&(o[A]=j?parseInt(r,10):r),t(e,o,i)}))}e!==e.ownerDocument.body&&"GC-TEMPLATE"!==e.tagName&&(i=e.cloneNode(),r.append(i)),p(e.attributes).forEach((function(t){var e=t.name,n=t.value,r=g.exec(e);if(r){var a=v(r,2)[1];return i.addEventListener(a,(function(t){return m(Function,[].concat(b,["$event"]).concat(["return ".concat(n).concat(/\(.+\)/.test(n)?"":"()",";")])).apply(void 0,[].concat(x,[t]))})),void i.removeAttribute(e)}for(var c=h.exec(n),l=0,u="";c;){u+=n.slice(l,c.index);var p=v(c,2),f=p[0],d=p[1];d=d.trim();try{f=S(d),(o()(f)||s()(f))&&(f="")}catch(t){console.error(t)}u+=f,l=c.index+c[0].length,c=h.exec(n)}u+=n.substr(l,n.length-l),"html"===e?(i.innerHTML=u,i.removeAttribute(e)):["if","else","elseif"].includes(e)?i.removeAttribute(e):i.setAttribute(e,u)}))}else if(e.nodeType===Node.TEXT_NODE){var C=h.exec(e.nodeValue);if(C){for(var _=0;C;){i.append(document.createTextNode(e.nodeValue.slice(_,C.index)));var D=C,N=v(D,2),R=N[0],M=N[1];M=M.trim();try{R=S(M),(o()(R)||s()(R))&&(R="")}catch(t){console.error(t)}c(R)||l(R)?i.append(R):u(R)?R.forEach((function(t){i.append(t)})):i.append(document.createTextNode(R)),_=C.index+C[0].length,C=h.exec(e.nodeValue)}i.append(document.createTextNode(e.nodeValue.slice(_,e.nodeValue.length)))}else i.append(e.cloneNode())}var B=e.childNodes,$=void 0===B?[]:B;$.length&&$.forEach((function(e){t(e,n,i)}))}};return b(i.body,e,a.body),a.body.firstElementChild};function w(t){return w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},w(t)}function E(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(t,e)||O(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function k(t){return function(t){if(Array.isArray(t))return P(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||O(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(t,e){if(t){if("string"==typeof t)return P(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?P(t,e):void 0}}function P(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function T(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */T=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,o=Object.create(i.prototype),a=new k(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return P()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,a),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function p(){}function h(){}function f(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(O([])));g&&g!==e&&n.call(g,i)&&(d=g);var y=f.prototype=p.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(i,o,a,s){var c=l(t[i],t,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==w(p)&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(p).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function E(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function O(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:P}}function P(){return{value:void 0,done:!0}}return h.prototype=f,s(y,"constructor",f),s(f,"constructor",h),h.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},m(b.prototype),s(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new b(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(y),s(y,a,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=O,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(E),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),E(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;E(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:O(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function L(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function A(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){L(o,r,i,a,s,"next",t)}function s(t){L(o,r,i,a,s,"throw",t)}a(void 0)}))}}function I(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function j(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?I(Object(n),!0).forEach((function(e){C(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):I(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function C(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function _(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function D(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var N,R=function(){function t(n){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};_(this,t),Object.defineProperty(this,"uid",{value:e()(),enumerable:!1,configurable:!1,writable:!1}),this.setDefaults(),this.cache=new Map,this.listeners={},this.observers={},this.options={},this.setOptions(r),this.tour=null,this.setTour(n),this.notifications=[],this.elements=new Map,this.init()}var n,r,i,o,a,s,l,u;return n=t,r=[{key:"init",value:function(){}},{key:"setDefaults",value:function(){return this.previousStep=null,this.currentStep=null,this.nextStep=null,this.fromStep=null,this.toStep=null,this.previousStepIndex=-1,this.currentStepIndex=-1,this.nextStepIndex=-1,this.fromStepIndex=-1,this.toStepIndex=-1,this.steps=[],this.isDisplayed=!1,this}},{key:"setTour",value:function(t){return this.tour=t,this}},{key:"getTour",value:function(){return this.tour}},{key:"setOptions",value:function(t){return this.options=j(j({},this.constructor.getDefaultOptions()),t),this}},{key:"getOptions",value:function(){return this.options}},{key:"start",value:(u=A(T().mark((function t(){var e,n,r,i,o,a,s=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=s.length>0&&void 0!==s[0]?s[0]:0,n=!(s.length>1&&void 0!==s[1])||s[1],this.isDisplayed=!0,this.mountOverlayEl(),this.startPreloader(),r=s.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=s[o];return t.next=8,this.emit.apply(this,["onStart"].concat(i));case 8:if(this.stopPreloader(),this.tour&&this.tour.length){t.next=13;break}return this.removeOverlayEl(),this.isDisplayed=!1,t.abrupt("return",!1);case 13:if(this.steps=this.sortSteps(this.getSteps(this.tour)),this.steps.length){t.next=18;break}return this.removeOverlayEl(),this.isDisplayed=!1,t.abrupt("return",!1);case 18:return document.body.classList.add(this.constructor.getBodyClass()),t.next=21,this.go.apply(this,[e,n].concat(i));case 21:return a=t.sent,this.isDisplayed=a,document.body.classList.toggle(this.constructor.getBodyClass(),a),a&&(this.options.useKeyboard&&this.addOnKeydownListener(),this.addOnWindowResizeListener(),this.addOnWindowScrollListener()),t.abrupt("return",a);case 26:case"end":return t.stop()}}),t,this)}))),function(){return u.apply(this,arguments)})},{key:"go",value:(l=A(T().mark((function t(e){var n,r,i,o,a,s,c,l,u,p,h,f,d,v,g,y,m,b=this,x=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(n=!(x.length>1&&void 0!==x[1])||x[1],r=x.length,i=new Array(r>2?r-2:0),o=2;o<r;o++)i[o-2]=x[o];if(this.isDisplayed&&this.steps.length){t.next=4;break}return t.abrupt("return",!1);case 4:if(a=n?parseInt(e,10):e,!this.currentStep){t.next=9;break}if(!(n?this.currentStepIndex===a:this.currentStep.step===a)){t.next=9;break}return t.abrupt("return",!1);case 9:if(s=this.currentStep,c=this.currentStepIndex,l=n?this.steps[a]:this.steps.filter((function(t){return t.step===a}))[0]){t.next=14;break}return t.abrupt("return",!1);case 14:if(u=this.steps.indexOf(l),h=u,f=(p=l).onBeforeChange,d=p.onAfterChange,this.startPreloader(),v=!1,!f){t.next=26;break}return t.next=23,Promise.resolve().then((function(){return f.call.apply(f,[b,p,s].concat(i))}));case 23:if(t.t0=t.sent,!1!==t.t0){t.next=26;break}v=!0;case 26:return t.next=28,this.emit.apply(this,["onBeforeChange",p,s].concat(i));case 28:if(!t.sent.some((function(t){return!1===t}))){t.next=30;break}v=!0;case 30:if(this.stopPreloader(),!v){t.next=33;break}return t.abrupt("return",!1);case 33:return this.beforeChangeStep({toStep:p,toStepIndex:h,currentStep:l,currentStepIndex:u,fromStep:s,fromStepIndex:c}),this.toStep=p,this.toStepIndex=h,this.currentStep=l,this.currentStepIndex=u,this.fromStep=s,this.fromStepIndex=c,this.previousStep=this.steps[this.currentStepIndex-1]||null,this.previousStepIndex=this.previousStep?this.currentStepIndex-1:-1,this.nextStep=this.steps[this.currentStepIndex+1]||null,this.nextStepIndex=this.nextStep?this.currentStepIndex+1:-1,g=this.options.scrollBehavior,y=this.currentStep.scrollPadding,m=void 0===y?this.options.scrollPadding:y,this.scrollParentsToStepEl(),this.scrollTo(this.getStepEl(this.currentStep,!0),g,m),this.mountStep(),setTimeout((function(){b.getEl("tooltip")&&b.scrollTo(b.getEl("tooltip"),g,m)}),300),d&&d.call.apply(d,[this,this.toStep,this.fromStep].concat(i)),this.emit.apply(this,["onAfterChange",this.toStep,this.fromStep].concat(i)),t.abrupt("return",!0);case 53:case"end":return t.stop()}}),t,this)}))),function(t){return l.apply(this,arguments)})},{key:"previous",value:(s=A(T().mark((function t(){var e,n,r,i,o=this,a=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=a.length,n=new Array(e),r=0;r<e;r++)n[r]=a[r];if(this.isDisplayed&&this.currentStep&&this.previousStep){t.next=3;break}return t.abrupt("return",!1);case 3:if(i=this.currentStep.onPrevious,this.startPreloader(),!i){t.next=12;break}return t.next=8,Promise.resolve().then((function(){return i.call.apply(i,[o,o.previousStep,o.currentStep].concat(n))}));case 8:if(t.t0=t.sent,!1!==t.t0){t.next=12;break}return this.stopPreloader(),t.abrupt("return",!1);case 12:return t.next=14,this.emit.apply(this,["onPrevious",this.previousStep,this.currentStep].concat(n));case 14:if(!t.sent.some((function(t){return!1===t}))){t.next=17;break}return this.stopPreloader(),t.abrupt("return",!1);case 17:return this.stopPreloader(),t.abrupt("return",this.go.apply(this,[this.previousStepIndex,!0].concat(n)));case 19:case"end":return t.stop()}}),t,this)}))),function(){return s.apply(this,arguments)})},{key:"next",value:(a=A(T().mark((function t(){var e,n,r,i,o=this,a=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:for(e=a.length,n=new Array(e),r=0;r<e;r++)n[r]=a[r];if(this.isDisplayed&&this.currentStep&&this.nextStep){t.next=3;break}return t.abrupt("return",!1);case 3:if(i=this.currentStep.onNext,this.startPreloader(),!i){t.next=12;break}return t.next=8,Promise.resolve().then((function(){return i.call.apply(i,[o,o.nextStep,o.currentStep].concat(n))}));case 8:if(t.t0=t.sent,!1!==t.t0){t.next=12;break}return this.stopPreloader(),t.abrupt("return",!1);case 12:return t.next=14,this.emit.apply(this,["onNext",this.nextStep,this.currentStep].concat(n));case 14:if(!t.sent.some((function(t){return!1===t}))){t.next=17;break}return this.stopPreloader(),t.abrupt("return",!1);case 17:return this.stopPreloader(),t.abrupt("return",this.go.apply(this,[this.nextStepIndex,!0].concat(n)));case 19:case"end":return t.stop()}}),t,this)}))),function(){return a.apply(this,arguments)})},{key:"stop",value:(o=A(T().mark((function t(){var e,n,r,i=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.isDisplayed){t.next=2;break}return t.abrupt("return",this);case 2:for(e=i.length,n=new Array(e),r=0;r<e;r++)n[r]=i[r];if(this.currentStepIndex!==this.steps.length-1){t.next=8;break}return this.startPreloader(),t.next=7,this.emit.apply(this,["onComplete"].concat(n));case 7:this.stopPreloader();case 8:return this.startPreloader(),t.next=11,this.emit.apply(this,["onStop"].concat(n));case 11:return this.stopPreloader(),document.body.classList.remove(this.constructor.getBodyClass()),this.removeListeners(),this.unobserveStep(),this.unmountStep(),this.removeOverlayEl(),this.cache.clear(),this.elements.clear(),this.setDefaults(),t.abrupt("return",this);case 21:case"end":return t.stop()}}),t,this)}))),function(){return o.apply(this,arguments)})},{key:"getSteps",value:function(t){return t&&t.length?"string"==typeof t?this.getDataSteps(t):this.getJsSteps(t):[]}},{key:"getDataSteps",value:function(t){var e=this,n="data-guidechimp",r=Array.from(document.querySelectorAll("[".concat(n,"-tour*='").concat(t,"']")));r=r.filter((function(t){return t.getAttribute("".concat(n,"-tour")).split(",").includes(e.tour)}));var i=new RegExp("^".concat(n,"-").concat(t,"-[^-]+$")),o=new RegExp("^".concat(n,"-[^-]+$"));return r.map((function(r,a){for(var s={},c=0;c<r.attributes.length;c++){var l=r.attributes[c],u=l.name,p=l.value,h=i.test(u),f=!h&&o.test(u);if(h||f){var d=h?u.replace("".concat(n,"-").concat(t,"-"),""):u.replace("".concat(n,"-"),"");"tour"!==d&&(h||f&&!s[d])&&(s[d]=p)}}return j(j({step:a,title:"",description:"",position:e.options.position,interaction:e.options.interaction},s),{},{element:r})}))}},{key:"getJsSteps",value:function(t){return t.map((function(t,e){return j(j({},t),{},{step:t.step||e})}))}},{key:"sortSteps",value:function(t){return k(t).sort((function(t,e){return t.step<e.step?-1:t.step>e.step?1:0}))}},{key:"getStepEl",value:function(t){var e=(t||{}).element;if(!e)return this.mountFakeStepEl();var n=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n="string"==typeof t?document.querySelector(t):t;return n||e}(e);return n&&"none"!==n.style.display&&"hidden"!==n.style.visibility||(n=this.getEl("fakeStep")?this.getEl("fakeStep"):this.mountFakeStepEl()),n}},{key:"scrollParentsToStepEl",value:function(){var t=this.currentStep.scrollPadding,e=void 0===t?this.options.scrollPadding:t;return this.scrollParentsToEl(this.getStepEl(this.currentStep),e)}},{key:"getScrollableParentsEls",value:function(t){for(var e=[],n=t;n&&n!==n.ownerDocument.body;)n=this.getScrollableParentEl(n),e.push(n);return e}},{key:"getScrollableParentEl",value:function(t){var e=/(auto|scroll)/,n=getComputedStyle(t),r=t.ownerDocument;return"fixed"===n.getPropertyValue("position")?r.body:function t(i){if(!i||i===r.body)return r.body;var o=getComputedStyle(i);if("fixed"===n.getPropertyValue("position")&&"static"===o.getPropertyValue("position"))return t(i.parentElement);var a=o.getPropertyValue("overflow-x"),s=o.getPropertyValue("overflow-y");return e.test(a)||e.test(s)?i:t(i.parentElement)}(t.parentElement)}},{key:"scrollParentsToEl",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=this.getScrollableParentsEls(t);return n.forEach((function(n){n!==document.body&&(n.scrollTop=t.offsetTop-n.offsetTop-e,n.scrollLeft=t.offsetLeft-n.offsetLeft-e)})),this}},{key:"scrollTo",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"auto",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=t.getBoundingClientRect(),i=r.top,o=r.bottom,a=r.left,s=r.right,c=window,l=c.innerWidth,u=c.innerHeight;return a>=0&&s<=l||window.scrollBy({behavior:e,left:a-n}),i>=0&&o<=u||window.scrollBy({behavior:e,top:i-n}),this}},{key:"highlightStepEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],e=this.getStepEl(this.currentStep),n=this.getEl("overlay");if(n){var r=n.querySelector("path"),i=r.querySelector("animate"),o=this.isEl(e,"fakeStep"),a=o?this.getOverlayDocumentPath():this.getOverlayStepPath(this.currentStep);if(r.setAttribute("d",a),i){var s=i.getAttribute("lock");if(s||(i.setAttribute("from",a),i.setAttribute("to",a)),t){var c=this.isEl(this.getStepEl(this.fromStep),"fakeStep"),l=!this.fromStep||c||o?null:this.getOverlayStepPath(this.fromStep);l&&(i.setAttribute("from",l),i.setAttribute("to",a)),i.setAttribute("lock","true")}i.onend=function(){i.removeAttribute("lock")},i.beginElement()}}var u=getComputedStyle(e);return["absolute","relative","fixed"].includes(u.getPropertyValue("position"))||e.classList.add(this.constructor.getRelativePositionClass()),e.classList.add(this.constructor.getHighlightClass()),e.setAttribute("data-guidechimp-".concat(this.uid),"highlight"),this.elements.set("highlight",e),this}},{key:"resetHighlightStepEl",value:function(){var t=this.getEl("overlay");if(t){var e=t.querySelector("path"),n=t.querySelector("animate");e.setAttribute("d",this.getOverlayDocumentPath()),n&&(n.removeAttribute("from"),n.removeAttribute("to"))}var r=this.getStepEl(this.currentStep);return r.classList.remove(this.constructor.getRelativePositionClass()),r.classList.remove(this.constructor.getHighlightClass()),r.removeAttribute("data-guidechimp-".concat(this.uid)),this.elements.delete("highlight"),this}},{key:"setInteractionPosition",value:function(t){var e=this.getStepEl(this.currentStep);if(!t||!e)return this;var n=this.options.padding;"floating"===getComputedStyle(e).getPropertyValue("position")&&(n=0);var r=this.constructor.getOffset(e),i=r.width,o=r.height,a=r.top,s=r.left;return t.classList.toggle(this.constructor.getFixedClass(),this.constructor.isFixed(e)),t.style.cssText="width: ".concat(i+n,"px;\n height: ").concat(o+n,"px;\n top: ").concat(a-n/2,"px;\n left: ").concat(s-n/2,"px;"),this}},{key:"setControlPosition",value:function(t){var e=this.getStepEl(this.currentStep);if(!t||!e)return this;var n=this.options.padding;"floating"===getComputedStyle(e).getPropertyValue("position")&&(n=0);var r=e.ownerDocument.defaultView.pageXOffset,i=e.ownerDocument.documentElement.getBoundingClientRect().width,o=this.constructor.getOffset(e),a=o.height,s=o.top,c=o.left,l=o.right,u=a+n,p=s-n/2,h=r<r+(c-n/2)?r:c-n/2,f=r+i>r+(l+n/2)?i:l+n/2;return t.classList.toggle(this.constructor.getFixedClass(),this.constructor.isFixed(e)),t.style.cssText="width: ".concat(f,"px;\n height: ").concat(u,"px;\n top: ").concat(p,"px;\n left: ").concat(h,"px;"),this}},{key:"setTooltipPosition",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.currentStep)return this;var n=this.getStepEl(this.currentStep);if(!t||!n)return this;var r=e.boundary,i=e.position,o=this.options.padding;r=r||window;var a=(i=(i=i||this.currentStep.position)||this.options.position).split("-"),s=E(a,2),c=s[0],l=s[1],u=getComputedStyle(n);"floating"===u.getPropertyValue("position")&&(o=0);var p=t.style;p.top=null,p.right=null,p.bottom=null,p.left=null,p.transform=null;var h=n.getBoundingClientRect(),f=h.top,d=h.bottom,v=h.left,g=h.right,y=h.width,m=h.height,b=t.getBoundingClientRect(),x=b.height,S=b.width,w=t.cloneNode(!0);w.style.visibility="hidden",w.innerHTML="",t.parentElement.appendChild(w);var k=w.getBoundingClientRect(),O=k.width;w.parentElement.removeChild(w);var P=new DOMRect(0,0,window.innerWidth,window.innerHeight);if(!(r instanceof Window)){var T=r.getBoundingClientRect(),L=T.x,A=T.y;P=new DOMRect(L,A,r.scrollWidth,r.scrollHeight)}var I=P,j=I.top,C=I.bottom,_=I.left,D=I.right;if(this.isEl(n,"fakeStep"))c="floating";else{var N=["bottom","right","left","top"],R=getComputedStyle(t),M=R.marginTop,B=R.marginLeft,$=R.marginRight,F=R.marginBottom;if(M=parseInt(M,10),B=parseInt(B,10),$=parseInt($,10),x+M+(F=parseInt(F,10))>f-j&&N.splice(N.indexOf("top"),1),x+M+F>C-d&&N.splice(N.indexOf("bottom"),1),O+B+$>v-_&&N.splice(N.indexOf("left"),1),O+B+$>D-g&&N.splice(N.indexOf("right"),1),"top"===(c=N.length?N.includes(c)?c:N[0]:"floating")||"bottom"===c){var W=["left","right","middle"];D-v<O&&W.splice(W.indexOf("left"),1),g-_<O&&W.splice(W.indexOf("right"),1),(v+y/2-_<O/2||D-(g-y/2)<O/2)&&W.splice(W.indexOf("middle"),1),l=W.length?W.includes(l)?l:W[0]:"middle"}}t.setAttribute("data-guidechimp-position",c);var H=document.documentElement;switch(c){case"top":p.bottom="".concat(m+o,"px");break;case"right":p.left="".concat(g+o/2-H.clientLeft,"px");break;case"left":p.right="".concat(H.clientWidth-(v-o/2),"px");break;case"bottom":p.top="".concat(m+o,"px");break;default:p.left="50%",p.top="50%",p.transform="translate(-50%,-50%)"}if(t.removeAttribute("data-guidechimp-alignment"),l)switch(t.setAttribute("data-guidechimp-alignment",l),l){case"left":p.left="".concat(v-o/2,"px");break;case"right":p.right="".concat(H.clientWidth-g-o/2,"px");break;default:v+y/2<S/2||v+y/2+S/2>H.clientWidth?p.left="".concat(H.clientWidth/2-S/2,"px"):p.left="".concat(v+y/2-S/2,"px")}return this}},{key:"startPreloader",value:function(){document.body.classList.add(this.constructor.getLoadingClass());var t=this.getEl("overlay");if(t){var e=t.querySelector("path"),n=t.querySelector("animate"),r=new Map;r.set("d",e.getAttribute("d")),e.setAttribute("d",this.getOverlayDocumentPath()),n&&(r.set("from",n.getAttribute("from")),r.set("to",n.getAttribute("to")),n.removeAttribute("from"),n.removeAttribute("to")),this.cache.set("preloaderCache",r)}var i=this.mountPreloaderEl();return i.hidden=!0,setTimeout((function(){i.hidden=!1}),100),this}},{key:"stopPreloader",value:function(){document.body.classList.remove(this.constructor.getLoadingClass());var t=this.getEl("overlay");if(t){var e=t.querySelector("path"),n=t.querySelector("animate"),r=this.cache.get("preloaderCache")||new Map;r.has("d")&&e.setAttribute("d",r.get("d")),n&&(r.has("from")&&n.setAttribute("from",r.get("from")),r.has("to")&&n.setAttribute("to",r.get("to"))),this.cache.delete("preloaderCache")}return this.removePreloaderEl(),this}},{key:"getDefaultTmplData",value:function(){var t=this;return{previousStep:this.previousStep,currentStep:this.currentStep,nextStep:this.nextStep,fromStep:this.fromStep,toStep:this.toStep,previousStepIndex:this.previousStepIndex,currentStepIndex:this.currentStepIndex,nextStepIndex:this.nextStepIndex,fromStepIndex:this.fromStepIndex,toStepIndex:this.toStepIndex,steps:this.steps,go:function(){return t.go.apply(t,arguments)},previous:function(){return t.previous.apply(t,arguments)},next:function(){return t.next.apply(t,arguments)},stop:function(){return t.stop.apply(t,arguments)}}}},{key:"mountStep",value:function(){var t=this.mountInteractionEl(),e=this.mountControlEl();return this.setInteractionPosition(t),this.setControlPosition(e),this.setTooltipPosition(this.getEl("tooltip")),this.observeStep(),this.highlightStepEl(!0),this}},{key:"unmountStep",value:function(){return this.resetHighlightStepEl(),this.removeInteractionEl(),this.removeControlEl(),this.removePreloaderEl(),this.removeFakeStepEl(),this}},{key:"createEl",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=S(e,n);return r&&r.setAttribute("data-quidechimp-".concat(this.uid),t),r}},{key:"getEl",value:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=this.elements.get(t);return n||(n=document.querySelector("[data-quidechimp-".concat(this.uid,'="').concat(t,'"]'))),n||e}},{key:"mountEl",value:function(t,e){var n=this;if(t){var r=t.querySelectorAll("[data-quidechimp-".concat(this.uid,"]"));[t].concat(k(r)).forEach((function(t){var e=t.getAttribute("data-quidechimp-".concat(n.uid));e&&(n.removeEl(e),n.elements.set(e,t))})),e.appendChild(t)}return t}},{key:"removeEl",value:function(t){var e=this.getEl(t);return e&&e.parentElement.removeChild(e),this.elements.delete(t),this}},{key:"isEl",value:function(t,e){return this.getEl(e)?t===this.getEl(e):t.getAttribute("data-quidechimp-".concat(this.uid))===e}},{key:"getFakeStepTmpl",value:function(){return'<div class="gc-fake-step"></div>'}},{key:"createFakeStepEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("fakeStep",this.getFakeStepTmpl(),j(j({},this.getDefaultTmplData()),t))}},{key:"mountFakeStepEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createFakeStepEl(t),document.body)}},{key:"removeFakeStepEl",value:function(){return this.removeEl("fakeStep")}},{key:"getPreloaderTmpl",value:function(){return'<div class="gc-preloader"></div>'}},{key:"createPreloaderEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("preloader",this.getPreloaderTmpl(),t)}},{key:"mountPreloaderEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createPreloaderEl(t),document.body)}},{key:"removePreloaderEl",value:function(){return this.removeEl("preloader")}},{key:"getOverlayDocumentPath",value:function(){var t=window,e=t.innerWidth,n=t.innerHeight,r=document.body,i=r.scrollWidth,o=r.scrollHeight,a=n>o?n:o;return"M 0 0 H ".concat(e>i?e:i," V ").concat(a," H 0 V 0 Z")}},{key:"getOverlayStepPath",value:function(t){return this.getOverlayElPath(this.getStepEl(t))}},{key:"getOverlayElPath",value:function(t){var e=this.options.padding;e=e?e/2:0;var n=t.getBoundingClientRect(),r=n.left,i=n.top,o=n.width,a=n.height,s=this.getOverlayDocumentPath();return s+="M ".concat(r-e+4," ").concat(i-e,"\n a ").concat(4,",").concat(4," 0 0 0 -").concat(4,",").concat(4,"\n V ").concat(a+i+e-4,"\n a ").concat(4,",").concat(4," 0 0 0 ").concat(4,",").concat(4,"\n H ").concat(o+r+e-4,"\n a ").concat(4,",").concat(4," 0 0 0 ").concat(4,",-").concat(4,"\n V ").concat(i-e+4,"\n a ").concat(4,",").concat(4," 0 0 0 -").concat(4,",-").concat(4,"Z")}},{key:"getOverlayTmpl",value:function(){return'<div class="gc-overlay" @click="stop({ event: $event })"> <svg class="svg-overlay"> <path d="{{path}}"> <animate attributeName="d" dur="200ms"/> </path> </svg> </div>'}},{key:"createOverlayEl",value:function(){var t,e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r={stop:(t=A(T().mark((function t(){var n=arguments;return T().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e.options.exitOverlay){t.next=3;break}return t.next=3,e.stop.apply(e,n);case 3:case"end":return t.stop()}}),t)}))),function(){return t.apply(this,arguments)}),path:this.getOverlayDocumentPath()};return this.createEl("overlay",this.getOverlayTmpl(),j(j({},r),n))}},{key:"mountOverlayEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createOverlayEl(t),document.body)}},{key:"removeOverlayEl",value:function(){return this.removeEl("overlay")}},{key:"getInteractionTmpl",value:function(){return'<div if="!interaction" class="gc-interaction gc-disable"> </div>'}},{key:"createInteractionEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.options.interaction;"boolean"==typeof this.currentStep.interaction&&(e=this.currentStep.interaction);var n=j(j({},this.getDefaultTmplData()),{},{interaction:e});return this.createEl("interaction",this.getInteractionTmpl(),j(j({},n),t))}},{key:"mountInteractionEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createInteractionEl(t),document.body)}},{key:"removeInteractionEl",value:function(){return this.removeEl("interaction")}},{key:"getControlTmpl",value:function(){return'<div class="gc-control"> {{ tooltipEl }} </div>'}},{key:"createControlEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("control",this.getControlTmpl(),j(j({},this.getDefaultTmplData()),{},{tooltipEl:this.createTooltipEl(t)},t))}},{key:"mountControlEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.mountEl(this.createControlEl(t),document.body)}},{key:"removeControlEl",value:function(){return this.removeEl("control")}},{key:"getTooltipTmpl",value:function(){return'<div class="gc-tooltip"> <div class="gc-tooltip-tail"></div> {{ progressbar }} {{ title }} {{ description }} {{ close }} {{ customButtons }} <div if="previous || pagination || next" class="gc-navigation"> {{ previous }} {{ pagination }} {{ next }} </div> {{ copyright }} {{ notification }} </div>'}},{key:"createTooltipEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=j(j({},this.getDefaultTmplData()),{},{progressbar:this.createProgressbarEl(t),title:this.createTitleEl(t),description:this.createDescriptionEl(t),close:this.createCloseEl(t),customButtons:this.createCustomButtonsEl(t),previous:this.createPreviousEl(t),pagination:this.createPaginationEl(t),next:this.createNextEl(t),copyright:this.createCopyrightEl(t),notification:this.createNotificationEl(t)});return this.createEl("tooltip",this.getTooltipTmpl(),j(j({},e),t))}},{key:"getCloseTmpl",value:function(){return'<div class="gc-close" @click="stop({ event: $event })"></div>'}},{key:"createCloseEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("close",this.getCloseTmpl(),j(j({},this.getDefaultTmplData()),t))}},{key:"getProgressbarTmpl",value:function(){return'<div if="showProgressbar" class="gc-progressbar" role="progressbar" aria-valuemin="{{ progressMin }}" aria-valuemax="{{ progressMax }}" aria-valuenow="{{ progress }}" style="width:{{ progress }}%;"></div>'}},{key:"createProgressbarEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.options.showProgressbar;"boolean"==typeof this.currentStep.showProgressbar&&(e=this.currentStep.showProgressbar);var n=100,r=0,i=(this.currentStepIndex+1)/this.steps.length*100,o=j(j({},this.getDefaultTmplData()),{},{showProgressbar:e,progressMax:n,progressMin:r,progress:i});return this.createEl("progressbar",this.getProgressbarTmpl(),j(j({},o),t))}},{key:"getTitleTmpl",value:function(){return'<div if="title" html="{{ title }}" class="gc-title"> </div>'}},{key:"createTitleEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.currentStep.title,n=void 0===e?"":e;return this.createEl("title",this.getTitleTmpl(),j(j({},this.getDefaultTmplData()),{},{title:n},t))}},{key:"getDescriptionTmpl",value:function(){return'<div if="description" html="{{ description }}" class="gc-description"></div>'}},{key:"createDescriptionEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.currentStep.description,n=void 0===e?"":e;return this.createEl("description",this.getDescriptionTmpl(),j(j({},this.getDefaultTmplData()),{},{description:n},t))}},{key:"getCustomButtonsTmpl",value:function(){return'<div if="buttons.length" class="gc-custom-buttons"> <template for="button in buttons"> {{ button }} </template> </div>'}},{key:"createCustomButtonsEl",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=[];return this.currentStep.buttons&&this.currentStep.buttons.forEach((function(e){var r=e;if(!c(r)){var i=e.onClick,o=e.tagName,a=void 0===o?"button":o,s=e.title,l=void 0===s?"":s,u=e.class;(r=document.createElement(a)).innerHTML=l,u&&(r.className=u),i&&r.addEventListener("click",(function(e){i.call(t,e)}))}n.push(r)})),this.createEl("customButtons",this.getCustomButtonsTmpl(),j(j({},this.getDefaultTmplData()),{},{buttons:n},e))}},{key:"getPaginationTmpl",value:function(){return'<div if="showPagination && steps.length > 1" class="gc-pagination"> <template if="paginationTheme === \'numbers\' || steps.length >= paginationCirclesMaxItems"> <ul class="gc-pagination-theme-numbers"> <template for="(step, index) in steps"> <template if="index === 0"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> <template if="currentStepIndex < 3"> <template if="index > 0 && index < 5"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> <li elseif="index === 5 && index !== steps.length - 1" class="gc-pagination-dots"> ... </li> </template> <template elseif="steps.length - currentStepIndex < 5"> <template if="steps.length - index < 6 && steps.length - 1 !== index"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> <li elseif="steps.length - index === 6 && index !== 0" class="gc-pagination-dots"> ... </li> </template> <template else> <li if="currentStepIndex - index === 3 && index !== 0" class="gc-pagination-dots"> ... </li> <template elseif="(currentStepIndex - index >= 0 && currentStepIndex - index < 3)\n || ( index - currentStepIndex >= 0 && index - currentStepIndex < 3)"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> <li elseif="index - currentStepIndex === 3 && steps.length -1 !== index" class="gc-pagination-dots"> ... </li> </template> <template if="index + 1 === steps.length"> <li if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> <li elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"> {{ index + 1 }} </li> <li elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"> {{ index + 1 }} </li> <li else class="gc-pagination-item" @click="go(index, true, { event: $event })"> {{ index + 1 }} </li> </template> </template> </ul> </template> <template else> <div class="gc-pagination-theme-circles"> <template for="(step, index) in steps"> <div if="index === currentStepIndex" class="gc-pagination-item gc-pagination-item-current gc-pagination-active"></div> <div elseif="index === previousStepIndex" class="gc-pagination-item gc-pagination-item-previous" @click="previous({ event: $event })"></div> <div elseif="index === nextStepIndex" class="gc-pagination-item gc-pagination-item-next" @click="next({ event: $event })"></div> <div else class="gc-pagination-item" @click="go(index, true, { event: $event })"></div> </template> </div> </template> </div> '}},{key:"createPaginationEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.currentStep,n=e.paginationTheme,r=void 0===n?this.options.paginationTheme:n,i=e.paginationCirclesMaxItems,o=void 0===i?this.options.paginationCirclesMaxItems:i,a=this.options.showPagination;return"boolean"==typeof this.currentStep.showPagination&&(a=this.currentStep.showPagination),this.createEl("pagination",this.getPaginationTmpl(),j(j({},this.getDefaultTmplData()),{},{showPagination:a,paginationTheme:r,paginationCirclesMaxItems:o},t))}},{key:"getPreviousTmpl",value:function(){return"<div class=\"gc-navigation-prev {{ (!previousStep || !showNavigation) ? 'gc-hidden': '' }}\" @click=\"previous({ event: $event })\"></div>"}},{key:"createPreviousEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.options.showNavigation;return"boolean"==typeof this.currentStep.showNavigation&&(e=this.currentStep.showNavigation),this.createEl("previous",this.getPreviousTmpl(),j(j({},this.getDefaultTmplData()),{},{showNavigation:e},t))}},{key:"getNextTmpl",value:function(){return"<div class=\"gc-navigation-next {{ (!nextStep || !showNavigation) ? 'gc-hidden': '' }}\" @click=\"next({ event: $event })\"></div>"}},{key:"createNextEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=this.options.showNavigation;return"boolean"==typeof this.currentStep.showNavigation&&(e=this.currentStep.showNavigation),this.createEl("next",this.getNextTmpl(),j(j({},this.getDefaultTmplData()),{},{showNavigation:e},t))}},{key:"getCopyrightTmpl",value:function(){return'<div class="gc-copyright">Made with AHD.JS</div> '}},{key:"createCopyrightEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("copyright",this.getCopyrightTmpl(),j(j({},this.getDefaultTmplData()),t))}},{key:"getNotificationTmpl",value:function(){return'<div html="{{ messages[0] }}" class="gc-notification"></div>'}},{key:"createNotificationEl",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return this.createEl("notification",this.getNotificationTmpl(),j(j({},this.getDefaultTmplData()),{},{messages:this.notifications},t))}},{key:"notify",value:function(t){this.notifications.push(t);var e=this.getEl("notification");return e&&this.mountEl(this.createNotificationEl(),e.parentElement),this}},{key:"on",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=this.constructor.getEventListenersPriorities(),i=E(r,1),o=i[0];n.priority&&r.includes(n.priority)&&(o=n.priority);var a=t.trim();return this.listeners[a]=this.listeners[a]||{},this.listeners[a][o]=this.listeners[a][o]||[],this.listeners[a][o].push(e),this}},{key:"emit",value:function(t){for(var e=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=k(this.constructor.getEventListenersPriorities()).reverse(),a=t.trim(),s=[],c=Promise.resolve(s);return this.listeners[a]&&o.forEach((function(t){var n=e.listeners[a][t];n&&(c=c.then((function(){return Promise.all(n.map((function(t){return Promise.resolve().then((function(){return t.apply(e,r)}))})))})).then((function(t){return s=[].concat(k(s),k(t))})))})),c}},{key:"addOnKeydownListener",value:function(){return this.cache.set("onKeydownListener",this.getOnKeydownListener()),window.addEventListener("keydown",this.cache.get("onKeydownListener"),!0),this}},{key:"getOnKeydownListener",value:function(){var t=this;return function(e){var n=e.keyCode,r=j(j({},t.constructor.getDefaultKeyboardCodes()),t.options.useKeyboard),i=r.previous,o=r.next,a=r.stop;a&&a.includes(n)?t.stop({event:e}):i&&i.includes(n)?t.previous({event:e}):o&&o.includes(n)&&t.next({event:e})}}},{key:"removeOnKeydownListener",value:function(){return this.cache.has("onKeydownListener")&&(window.removeEventListener("keydown",this.cache.get("onKeydownListener"),!0),this.cache.delete("onKeydownListener")),this}},{key:"addOnWindowResizeListener",value:function(){return this.cache.set("onWindowResizeListener",this.getOnWindowResizeListener()),window.addEventListener("resize",this.cache.get("onWindowResizeListener"),!0),this}},{key:"getOnWindowResizeListener",value:function(){var t=this;return function(){return t.refresh()}}},{key:"removeOnWindowResizeListener",value:function(){return this.cache.has("onWindowResizeListener")&&(window.removeEventListener("resize",this.cache.get("onWindowResizeListener"),!0),this.cache.delete("onWindowResizeListener")),this}},{key:"addOnWindowScrollListener",value:function(){return this.cache.set("onWindowScrollListener",this.getOnWindowScrollListener()),window.addEventListener("scroll",this.cache.get("onWindowScrollListener"),!0),this}},{key:"getOnWindowScrollListener",value:function(){var t=this;return function(){return t.refresh()}}},{key:"removeOnWindowScrollListener",value:function(){return this.cache.has("onWindowScrollListener")&&(window.removeEventListener("scroll",this.cache.get("onWindowScrollListener"),!0),this.cache.delete("onWindowScrollListener")),this}},{key:"removeListeners",value:function(){this.removeOnKeydownListener(),this.removeOnWindowResizeListener(),this.removeOnWindowScrollListener()}},{key:"observeStep",value:function(){this.observeResizing(),this.observeMutation()}},{key:"observeResizing",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{box:"border-box"},n=this.observers.resizingObserver;return n||"undefined"==typeof ResizeObserver||(n=new ResizeObserver((function(){(t||t.currentStep)&&t.refresh()})),this.observers.resizingObserver=n),!!n&&(n.observe(this.getStepEl(this.currentStep),e),!0)}},{key:"unobserveResizing",value:function(){var t=this.observers.resizingObserver;return!!t&&(t.disconnect(),!0)}},{key:"observeMutation",value:function(){var t=this,e=this.observers.mutationObserver;return e||(e=new MutationObserver((function(e){if((t||t.currentStep)&&t.currentStep.element){var n=t.getStepEl(t.currentStep),r=function(){return n&&!t.isEl(n,"fakeStep")};e.forEach((function(e){r()?"childList"===e.type&&e.removedNodes.length&&e.removedNodes.forEach((function(e){(e===n||e.contains(n))&&(n=t.getStepEl(t.currentStep),t.scrollParentsToStepEl(),t.refresh())})):"childList"===e.type&&e.addedNodes.length&&(n=t.getStepEl(t.currentStep),r()&&(t.scrollParentsToStepEl(),t.refresh()))}))}})),this.observers.mutationObserver=e),e.observe(this.getStepEl(this.currentStep).ownerDocument.body,{childList:!0,subtree:!0}),!0}},{key:"unobserveMutation",value:function(){var t=this.observers.mutationObserver;return!!t&&(t.disconnect(),!0)}},{key:"unobserveStep",value:function(){this.unobserveResizing(),this.unobserveMutation()}},{key:"beforeChangeStep",value:function(){this.unmountStep(),this.unobserveStep()}},{key:"refresh",value:function(){return this.currentStep?(this.highlightStepEl(),this.setControlPosition(this.getEl("control")),this.setInteractionPosition(this.getEl("interaction")),this.setTooltipPosition(this.getEl("tooltip")),this):this}}],i=[{key:"getDefaultOptions",value:function(){return{position:"bottom",useKeyboard:!0,exitEscape:!0,exitOverlay:!0,showPagination:!0,showNavigation:!0,showProgressbar:!0,paginationTheme:"circles",paginationCirclesMaxItems:10,interaction:!0,padding:8,scrollPadding:10,scrollBehavior:"auto"}}},{key:"getDefaultKeyboardCodes",value:function(){return{previous:[37],next:[39,13,32],stop:[27]}}},{key:"getEventListenersPriorities",value:function(){return["low","medium","high","critical"]}},{key:"getBodyClass",value:function(){return"gc"}},{key:"getLoadingClass",value:function(){return"gc-loading"}},{key:"getHighlightClass",value:function(){return"gc-highlight"}},{key:"getFixedClass",value:function(){return"gc-fixed"}},{key:"getRelativePositionClass",value:function(){return"gc-relative"}},{key:"getOffset",value:function(t){var e=t.ownerDocument,n=e.body,r=e.documentElement,i=e.defaultView,o=i.pageYOffset||r.scrollTop||n.scrollTop,a=i.pageXOffset||r.scrollLeft||n.scrollLeft,s=t.getBoundingClientRect(),c=s.top,l=s.right,u=s.bottom,p=s.left;return{right:l,bottom:u,width:s.width,height:s.height,x:s.x,y:s.y,top:c+o,left:p+a}}},{key:"isFixed",value:function(t){var e=t.parentNode;return!(!e||"HTML"===e.nodeName)&&("fixed"===getComputedStyle(t).getPropertyValue("position")||this.isFixed(e))}}],r&&D(n.prototype,r),i&&D(n,i),Object.defineProperty(n,"prototype",{writable:!1}),t}(),M=function(){function t(t){this.persistent=t,this._lootBag={},this._ttl=null}return Object.defineProperty(t.prototype,"timeoutInSeconds",{get:function(){return this._ttl},set:function(e){if(null!==e&&!t.isPositiveInteger(e))throw new Error("'".concat(e,"' is not a positive integer required when setting the top-level TTL"));this._ttl=e},enumerable:!1,configurable:!0}),t.prototype.put=function(e,n,r){if(void 0===r&&(r=null),null!==r&&!t.isPositiveInteger(r))throw new Error("'".concat(r,"' is not a positive integer required when setting a key-level TTL"));var i={v:n,t:this._getNow(),kt:r};this.persistent?localStorage.setItem(e,JSON.stringify(i)):this._lootBag[e]=i},t.prototype.get=function(t,e){if(void 0===e&&(e=null),!this.persistent){if(t in this._lootBag){r=this._lootBag[t];return null===this._ttl&&null===r.kt?r.v:this._isCacheStale(r)?(this.removeKey(t),e):r.v}return e}if(!(t in localStorage))return e;var n=localStorage.getItem(t);try{var r=JSON.parse(n);return null===this._ttl&&null===r.kt?r.v:this._isCacheStale(r)?(this.removeKey(t),e):r.v}catch(t){return null===e?n:e}},t.prototype.removeKey=function(t){this.persistent?t in localStorage&&localStorage.removeItem(t):t in this._lootBag&&delete this._lootBag[t]},t.prototype.keyExists=function(t){if(!this.persistent){if(t in this._lootBag){n=this._lootBag[t];return null===this._ttl&&null===n.kt||(!this._isCacheStale(n)||(this.removeKey(t),!1))}return!1}if(!(t in localStorage))return!1;var e=localStorage.getItem(t);try{var n=JSON.parse(e);return null===this._ttl&&null===n.kt||(!this._isCacheStale(n)||(this.removeKey(t),!1))}catch(t){return!0}},t.prototype.clear=function(){this.persistent?localStorage.clear():this._lootBag={}},t.prototype.keys=function(){return this.persistent?Object.keys(localStorage):Object.keys(this._lootBag)},t.prototype.runGarbageCollector=function(){var t=[];if(this.persistent)for(var e=0,n=Object.keys(localStorage);e<n.length;e++){var r=n[e],i=localStorage.getItem(r);try{var o=JSON.parse(i);if(!("v"in o&&"t"in o&&"kt"in o))continue;null===this._ttl&&null===o.kt||this._isCacheStale(o)&&(localStorage.removeItem(r),t.push(r))}catch(t){}}else for(var a=0,s=Object.keys(this._lootBag);a<s.length;a++){r=s[a];null===this._ttl&&null===this._lootBag[r].kt||this._isCacheStale(this._lootBag[r])&&(delete this._lootBag[r],t.push(r))}return t},t.prototype.isLocalStorageAvailable=function(){var t=(new Date).getTime().toString(),e=t;try{return localStorage.setItem(t,e),localStorage.removeItem(t),!0}catch(t){return!1}},t.prototype._getNow=function(){return Math.floor(Date.now()/1e3)},t.prototype._isCacheStale=function(t){var e=t.t,n=null===t.kt?this._ttl:t.kt;return this._getNow()-e>n},t.isPositiveInteger=function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t&&t>0},t}(),B=(N=function(t,e){return N=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},N(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function n(){this.constructor=t}N(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}),$=(new(function(t){function e(){return t.call(this,false)||this}return B(e,t),e}(M)),function(){var t=function(e,n){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},t(e,n)};return function(e,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=e}t(e,n),e.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}}()),F=new(function(t){function e(){return t.call(this,true)||this}return $(e,t),e}(M));function W(t){return W="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},W(t)}function H(t,e,n){return H=Z()?Reflect.construct.bind():function(t,e,n){var r=[null];r.push.apply(r,e);var i=new(Function.bind.apply(t,r));return n&&Y(i,n.prototype),i},H.apply(null,arguments)}function V(t){return function(t){if(Array.isArray(t))return z(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return z(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return z(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function z(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function q(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */q=function(){return t};var t={},e=Object.prototype,n=e.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{s({},"")}catch(t){s=function(t,e,n){return t[e]=n}}function c(t,e,n,r){var i=e&&e.prototype instanceof p?e:p,o=Object.create(i.prototype),a=new E(r||[]);return o._invoke=function(t,e,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return O()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=x(a,n);if(s){if(s===u)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(t,e,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===u)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(t,n,a),o}function l(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}t.wrap=c;var u={};function p(){}function h(){}function f(){}var d={};s(d,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(k([])));g&&g!==e&&n.call(g,i)&&(d=g);var y=f.prototype=p.prototype=Object.create(d);function m(t){["next","throw","return"].forEach((function(e){s(t,e,(function(t){return this._invoke(e,t)}))}))}function b(t,e){function r(i,o,a,s){var c=l(t[i],t,o);if("throw"!==c.type){var u=c.arg,p=u.value;return p&&"object"==W(p)&&n.call(p,"__await")?e.resolve(p.__await).then((function(t){r("next",t,a,s)}),(function(t){r("throw",t,a,s)})):e.resolve(p).then((function(t){u.value=t,a(u)}),(function(t){return r("throw",t,a,s)}))}s(c.arg)}var i;this._invoke=function(t,n){function o(){return new e((function(e,i){r(t,n,e,i)}))}return i=i?i.then(o,o):o()}}function x(t,e){var n=t.iterator[e.method];if(void 0===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=void 0,x(t,e),"throw"===e.method))return u;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return u}var r=l(n,t.iterator,e.arg);if("throw"===r.type)return e.method="throw",e.arg=r.arg,e.delegate=null,u;var i=r.arg;return i?i.done?(e[t.resultName]=i.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=void 0),e.delegate=null,u):i:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,u)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function w(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function k(t){if(t){var e=t[i];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r<t.length;)if(n.call(t,r))return e.value=t[r],e.done=!1,e;return e.value=void 0,e.done=!0,e};return o.next=o}}return{next:O}}function O(){return{value:void 0,done:!0}}return h.prototype=f,s(y,"constructor",f),s(f,"constructor",h),h.displayName=s(f,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===h||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,f):(t.__proto__=f,s(t,a,"GeneratorFunction")),t.prototype=Object.create(y),t},t.awrap=function(t){return{__await:t}},m(b.prototype),s(b.prototype,o,(function(){return this})),t.AsyncIterator=b,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new b(c(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},m(y),s(y,a,"Generator"),s(y,i,(function(){return this})),s(y,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=k,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(w),!t)for(var e in this)"t"===e.charAt(0)&&n.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=void 0)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(n,r){return a.type="throw",a.arg=t,e.next=n,r&&(e.method="next",e.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),c=n.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,u):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),u},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),w(n),u}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;w(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:k(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),u}},t}function K(t,e,n,r,i,o,a){try{var s=t[o](a),c=s.value}catch(t){return void n(t)}s.done?e(c):Promise.resolve(c).then(r,i)}function G(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var o=t.apply(e,n);function a(t){K(o,r,i,a,s,"next",t)}function s(t){K(o,r,i,a,s,"throw",t)}a(void 0)}))}}function U(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function J(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Y(t,e){return Y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},Y(t,e)}function X(t,e){if(e&&("object"===W(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t)}function Z(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(t){return!1}}function Q(t){return Q=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},Q(t)}F.timeoutInSeconds=600;var tt=n(68).match,et="AHD_TOUR_DATA",nt="AHD_TOUR_VISITED",rt=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Y(t,e)}(l,t);var e,n,r,i,o,a,s,c=(e=l,n=Z(),function(){var t,r=Q(e);if(n){var i=Q(this).constructor;t=Reflect.construct(r,arguments,i)}else t=r.apply(this,arguments);return X(this,t)});function l(){return U(this,l),c.apply(this,arguments)}return r=l,i=[{key:"updatePageUrl",value:(s=G(q().mark((function t(e,n){var r,i,o;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.stop();case 2:if((r=F.get(et))&&!n){t.next=7;break}return t.next=6,this.fetchAndCacheData(r);case 6:r=t.sent;case 7:i=this.getApplicabeDataForUrl(r,e),o=i.map((function(t){return{element:t.selector,title:t.content.title,description:t.content.content,position:t.position}})),this.setTour(o),this.start();case 11:case"end":return t.stop()}}),t,this)}))),function(t,e){return s.apply(this,arguments)})},{key:"getApplicabeDataForUrl",value:function(t,e){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=F.get(nt)||[],i=new Set(r);return t.filter((function(t){if(n||!r||!r.includes(t.slug)){var o=tt(t.slug,{decode:decodeURIComponent})(e);return o&&!i.has(t.slug)&&(i.add(t.slug),F.put(nt,V(i),86400)),o}return!1}))}},{key:"fetchAndCacheData",value:(a=G(q().mark((function t(e){var n;return q().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,fetch("https://ahd-be-jggub5n6qq-em.a.run.app/api/tenant/".concat(this.options.applicationId,"/contexttour?filter[isActive]=true")).then((function(t){return t.json()}));case 2:return(n=t.sent).rows&&(e=n.rows.filter((function(t){return!!t.content})),F.put(et,e)),t.abrupt("return",e);case 5:case"end":return t.stop()}}),t,this)}))),function(t){return a.apply(this,arguments)})}],i&&J(r.prototype,i),o&&J(r,o),Object.defineProperty(r,"prototype",{writable:!1}),l}(R),it=function(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return H(rt,e)};it.prototype=rt.prototype,it.plugins=new Set,it.extend=function(t){if(!it.plugins.has(t)){it.plugins.add(t);for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];t.apply(void 0,[rt,it].concat(n))}return it};const ot=it})(),r})()));
13
13
  //# sourceMappingURL=index.js.map