@telia-ace/knowledge-widget-types-grid 1.0.54 → 1.1.1-rc.1

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.
@@ -0,0 +1,6 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var p=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof global<"u"&&global||{},b={searchParams:"URLSearchParams"in p,iterable:"Symbol"in p&&"iterator"in Symbol,blob:"FileReader"in p&&"Blob"in p&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in p,arrayBuffer:"ArrayBuffer"in p};function re(t){return t&&DataView.prototype.isPrototypeOf(t)}if(b.arrayBuffer)var ne=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],se=ArrayBuffer.isView||function(t){return t&&ne.indexOf(Object.prototype.toString.call(t))>-1};function S(t){if(typeof t!="string"&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||t==="")throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function M(t){return typeof t!="string"&&(t=String(t)),t}function G(t){var e={next:function(){var r=t.shift();return{done:r===void 0,value:r}}};return b.iterable&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach(function(e,r){this.append(r,e)},this):Array.isArray(t)?t.forEach(function(e){if(e.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}d.prototype.append=function(t,e){t=S(t),e=M(e);var r=this.map[t];this.map[t]=r?r+", "+e:e};d.prototype.delete=function(t){delete this.map[S(t)]};d.prototype.get=function(t){return t=S(t),this.has(t)?this.map[t]:null};d.prototype.has=function(t){return this.map.hasOwnProperty(S(t))};d.prototype.set=function(t,e){this.map[S(t)]=M(e)};d.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)};d.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),G(t)};d.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),G(t)};d.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),G(t)};b.iterable&&(d.prototype[Symbol.iterator]=d.prototype.entries);function L(t){if(!t._noBody){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}}function W(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function oe(t){var e=new FileReader,r=W(e);return e.readAsArrayBuffer(t),r}function ie(t){var e=new FileReader,r=W(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}function ae(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}function V(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function K(){return this.bodyUsed=!1,this._initBody=function(t){this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?typeof t=="string"?this._bodyText=t:b.blob&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:b.formData&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():b.arrayBuffer&&b.blob&&re(t)?(this._bodyArrayBuffer=V(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):b.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(t)||se(t))?this._bodyArrayBuffer=V(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||(typeof t=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):b.searchParams&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},b.blob&&(this.blob=function(){var t=L(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=L(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}else{if(b.blob)return this.blob().then(oe);throw new Error("could not read as ArrayBuffer")}},this.text=function(){var t=L(this);if(t)return t;if(this._bodyBlob)return ie(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(ae(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},b.formData&&(this.formData=function(){return this.text().then(ue)}),this.json=function(){return this.text().then(JSON.parse)},this}var ce=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function he(t){var e=t.toUpperCase();return ce.indexOf(e)>-1?e:t}function j(t,e){if(!(this instanceof j))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var r=e.body;if(t instanceof j){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!r&&t._bodyInit!=null&&(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new d(e.headers)),this.method=he(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in p){var s=new AbortController;return s.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}j.prototype.clone=function(){return new j(this,{body:this._bodyInit})};function ue(t){var e=new FormData;return t.trim().split("&").forEach(function(r){if(r){var n=r.split("="),o=n.shift().replace(/\+/g," "),s=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(s))}}),e}function fe(t){var e=new d,r=t.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(`
2
+ `)===0?n.substr(1,n.length):n}).forEach(function(n){var o=n.split(":"),s=o.shift().trim();if(s){var a=o.join(":").trim();try{e.append(s,a)}catch(c){console.warn("Response "+c.message)}}}),e}K.call(j.prototype);function P(t,e){if(!(this instanceof P))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}K.call(P.prototype);P.prototype.clone=function(){return new P(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})};P.error=function(){var t=new P(null,{status:200,statusText:""});return t.status=0,t.type="error",t};var le=[301,302,303,307,308];P.redirect=function(t,e){if(le.indexOf(e)===-1)throw new RangeError("Invalid status code");return new P(null,{status:e,headers:{location:t}})};var O=p.DOMException;try{new O}catch{O=function(e,r){this.message=e,this.name=r;var n=Error(e);this.stack=n.stack},O.prototype=Object.create(Error.prototype),O.prototype.constructor=O}function Y(t,e){return new Promise(function(r,n){var o=new j(t,e);if(o.signal&&o.signal.aborted)return n(new O("Aborted","AbortError"));var s=new XMLHttpRequest;function a(){s.abort()}s.onload=function(){var i={statusText:s.statusText,headers:fe(s.getAllResponseHeaders()||"")};o.url.startsWith("file://")&&(s.status<200||s.status>599)?i.status=200:i.status=s.status,i.url="responseURL"in s?s.responseURL:i.headers.get("X-Request-URL");var u="response"in s?s.response:s.responseText;setTimeout(function(){r(new P(u,i))},0)},s.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},s.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},s.onabort=function(){setTimeout(function(){n(new O("Aborted","AbortError"))},0)};function c(i){try{return i===""&&p.location.href?p.location.href:i}catch{return i}}if(s.open(o.method,c(o.url),!0),o.credentials==="include"?s.withCredentials=!0:o.credentials==="omit"&&(s.withCredentials=!1),"responseType"in s&&(b.blob?s.responseType="blob":b.arrayBuffer&&(s.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof d||p.Headers&&e.headers instanceof p.Headers)){var h=[];Object.getOwnPropertyNames(e.headers).forEach(function(i){h.push(S(i)),s.setRequestHeader(i,M(e.headers[i]))}),o.headers.forEach(function(i,u){h.indexOf(u)===-1&&s.setRequestHeader(u,i)})}else o.headers.forEach(function(i,u){s.setRequestHeader(u,i)});o.signal&&(o.signal.addEventListener("abort",a),s.onreadystatechange=function(){s.readyState===4&&o.signal.removeEventListener("abort",a)}),s.send(typeof o._bodyInit>"u"?null:o._bodyInit)})}Y.polyfill=!0;p.fetch||(p.fetch=Y,p.Headers=d,p.Request=j,p.Response=P);self.fetch.bind(self);const F="functional",U="Humany__parameters";function de(t){const e={};return t&&Object.keys(t).forEach(r=>{const n=t[r];(_(n)==="array"?n:[n]).forEach(o=>{typeof e[r]>"u"&&(e[r]=[]),e[r].push(o)})}),e}class pe{constructor(e,r){this.isLoaded=!!e,this.parameters=de(e),r&&typeof r.get=="function"&&(this.container=r)}getAll(){return this.ensureIsLoaded(),l(!0,{},this.parameters)}add(e,r){this.ensureIsLoaded(),this.parameters[e]||(this.parameters[e]=[]),this.parameters[e].push(r),this.persist()}set(e,r){this.ensureIsLoaded(),this.parameters[e]=[r],this.persist()}remove(e,r){if(this.ensureIsLoaded(),typeof r>"u")delete this.parameters[e];else{const n=this.parameters[e]||[];n.forEach((o,s)=>{o===r&&n.splice(s,1)}),this.parameters[e]=n}this.persist()}clear(){this.ensureIsLoaded(),this.parameters={},this.persist()}persist(){try{R(this.container).indexOf(F)>-1?C(U,this.parameters,1):C(U,"",-1)}catch(e){window.console&&window.console.warn&&window.console.warn("Error occured when persisting parameter bag.",e)}}ensureIsLoaded(){if(!this.isLoaded){try{const e=q(U);this.parameters=e||{},R(this.container).indexOf(F)===-1&&C(U,"",-1)}catch(e){window.console&&window.console.warn&&window.console.warn("Error occured when loading parameter bag.",e)}this.isLoaded=!0}}}function E(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}function z(){return E()+E()+"-"+E()+"-"+E()+"-"+E()+"-"+E()+E()+E()}const Z="analytical",k="Humany__clientId";let T="";function ye(t){if(R(t).indexOf(Z)===-1)return C(k,"",-1),T.length||(T=z()),T;const e=q(k);return e||(T.length||(T=z()),C(k,T,1)),e||T}function be(){return"Default"}function me(...t){const e=window.location;return[t[0]!==!1?"http:":e.protocol,"//",e.host,e.pathname].join("")}function ge(){}const we={"[object Array]":"array","[object Boolean]":"boolean","[object Date]":"date","[object Function]":"function","[object Number]":"number","[object Object]":"object","[object RegExp]":"regexp","[object String]":"string"};function _(t){return t==null?t+"":typeof t=="object"||typeof t=="function"?we[{}.toString.call(t)]||"object":typeof t}function f(t){return _(t)==="function"}function J(t){let e;if(!t||_(t)!=="object"||t.nodeType)return!1;try{if(t.constructor&&!Object.prototype.hasOwnProperty.call(t,"constructor")&&!Object.prototype.hasOwnProperty.call(t.constructor.prototype,"isPrototypeOf"))return!1}catch{return!1}for(e in t);return e===void 0||Object.prototype.hasOwnProperty.call(t,e)}function l(...t){let e,r,n,o,s,a,c=t[0]||{},h=1;const i=t.length;let u=!1;for(typeof c=="boolean"&&(u=c,c=t[1]||{},h=2),typeof c!="object"&&!f(c)&&(c={});h<i;h++)if((e=t[h])!=null)for(r in e)n=c[r],o=e[r],c!==o&&(u&&o&&(J(o)||(s=_(o)==="array"))?(s?(s=!1,a=n&&_(n)==="array"?n:[]):a=n&&J(n)?n:{},c[r]=l(u,a,o)):o!==void 0&&(c[r]=o));return c}const q=t=>{const e=new RegExp(`(?:^|;)\\s?${t}=(.*?)(?:;|$)`,"i"),r=document.cookie.match(e),n=r&&r[1];if(n){if(t==="Humany__clientId")try{return JSON.parse(n)}catch{const s=JSON.stringify(n);return JSON.parse(s)}return JSON.parse(n)}},C=(t,e,r)=>{const n=JSON.stringify(e).trim().replace(/^"+|"+$/g,""),o=`${t}=${n}`,s=`expires=${ve(r)}`,a="path=/",c="SameSite=None",h="Secure";return document.cookie=`${o}; ${s}; ${a}; ${c}; ${h}`},R=t=>{const e=["necessary"];if(!t)return e;const r=t.get("$widget");if(!r||!r.implementation||!r.implementation.tenant)return e;const{implementation:{tenant:n}}=r,o=q(`humany_${n}`);return!o||!o.storagePolicy||!o.storagePolicy.value||!Array.isArray(o.storagePolicy.value)||!o.storagePolicy.value.length?e:o.storagePolicy.value},ve=(t=1)=>{const e=new Date;return e.setTime(e.getTime()+t*24*60*60*1e3),e.toUTCString()},Pe=(t=["necessary"])=>{t.indexOf(F)===-1&&C(U,"",-1),t.indexOf(Z)===-1&&C(k,"",-1)};function $(t,e,r){if(typeof e>"u"||typeof r>"u")return t;const n=t&&t.indexOf("?")!==-1?"&":"?";return`${t}${n}${encodeURIComponent(e)}=${encodeURIComponent(r)}`}const X="p.";function ee(t,e){let r=t;return Object.keys(e).forEach(n=>{const o=e[n];_(o)==="array"?o.forEach(s=>{r=$(r,`${X}${n}`,s)}):r=$(r,`${X}${n}`,o)}),r}class Q{constructor(e,r){l(!0,this,e,{_client:r})}}class H{constructor(e,r){l(!0,this,e,{_client:r})}}function A(t,e,r,n){const o=[];return t[e].forEach(s=>{const a=new r(s,n),c=s[e],h=_(c);s[e]&&(h==="array"||h==="object")&&(a[e]=A(s,e,r,n)),o.push(a)}),o}class N{constructor(e,r){l(!0,this,e,{_client:r})}}function x(t,e){return f(t)?e?t.call(e):t.call(window):t}function I(t,e,r,n){let o=Promise.resolve(r);for(let s=0,a=t.length;s<a;s++){const c=t[s][e];f(c)&&(o=o.then(()=>c(r,n)))}return o}class Ee{constructor(e,r={}){this.setBaseUrl(e),this.globalOptions=r,this.interceptors=r.interceptors||[]}constructUrl(e){return this.baseUrl+e}setBaseUrl(e){this.baseUrl=e+(e[e.length-1]!=="/"?"/":"")}request(e,r){const n=l(!0,{},this.globalOptions,r);let o=this.constructUrl(e);const s=this.interceptors;return n.credentials==="include"&&(o=$(o,"credentials","true")),new Promise((a,c)=>{I(s,"request",{url:o,options:n}).then(h=>fetch(h.url,h.options).then(i=>({response:i,request:h}))).then(({response:h,request:i})=>{if(h.ok){const u=h;return h.json().then(w=>{I(s,"response",{response:h,json:w,request:i}).then(()=>{n.envelope?a({json:w,response:u}):a(w),I(s,"responseEnd",{response:h,json:w,request:i})})})}else I(s,"responseError",h).then(u=>{f(n.onError)&&n.onError(u),c(u)})}).catch(h=>{I(s,"responseError",h).then(i=>{f(n.onError)&&n.onError(i),c(i)})})})}}const te=Ee;/*!
3
+ * Humany Service Client Library
4
+ * Version: 2.0
5
+ * Copyright 2017, Telia Company AB, http://www.humany.com/
6
+ */class B{constructor(...e){const r=e[1]||{};if(this.proxy=typeof e[0]=="string"?new te(e[0]):e[0],this.settings=l(!0,{},B.defaults,e[1]||{}),this.parameters=new pe(e[2],e[3]),this.current={phrase:r.phrase},this.guideCache={},this.feedbackTypes={positive:"Positive",negative:"Negative",comment:"Comment"},this.handoverTypes={email:"Email",chat:"Chat",callback:"Callback",phone:"Phone",emailComplementary:"ComplementaryEmail",chatComplementary:"ComplementaryChat",callbackComplementary:"ComplementaryCallback",phoneComplementary:"ComplementaryPhone"},this.subscriptions=[],e[3]&&typeof e[3].get=="function"){this.container=e[3];const n=this.container.get("$widget");n&&n.events&&this.subscriptions.push(n.events.subscribe("storage:policy-changed",(o,s)=>Pe(s)))}}getConfiguration(){return{language:x(this.settings.language,this),client:x(()=>this.settings.client(this.container),this),funnel:x(this.settings.funnel,this),site:x(this.settings.site,this),reader:x(this.settings.reader,this),perspective:x(this.settings.perspective,this)}}customRequest(e,r,n={}){const o=n.configuration||{},s=n.parameters;return e=this.constructPath(e,o,s),this.proxy.request(e,{method:r,body:n.body}).then(a=>(n.success&&n.success(a),a)).catch(a=>(n.error&&n.error(a),a))}constructPath(e,r,n=!0){let o=e;const s=l(this.getConfiguration(),r);if(Object.keys(s).filter(a=>{const c=s[a];return c!==null&&typeof c<"u"}).forEach(a=>o=$(o,a,x(s[a]))),n){const a=n===!0?this.parameters.getAll():n;o=ee(o,a)}return o}match(...e){const r=e[0];let n={},o,s;typeof e[1]=="object"?(n=e[1]||{},o=e[2],s=e[3]):(o=e[1],s=e[2]);function a(y){if(f(o)){const v=this;y=this.settings.useProxyClasses&&y?(()=>(y.Matches=A(y,"Matches",N,v),y))():y,o(y)}return y}function c(y){f(s)&&s(y)}const h=l(!0,this.getConfiguration(),this.settings.paging,n),i={};let u="GET";i.categories=h.categories||h.categoryId,i.language=h.language,i.phrase=r,i.attributes=h.attributes,i.skip=h.skip,i.take=h.take,i.reader=h.reader,i.disableNotices=h.disableNotices,i.tags=h.tags,i.includeCategories=h.includeCategories,i.groupByCategory=h.groupByCategory,n.statisticsDisabled||(u="POST",i.funnel=h.funnel,i.client=h.client,i.site=h.site,this.current.phrase=r);const w="guides";n.sorting&&(i["sorting.type"]=n.sorting.type,i["sorting.direction"]=n.sorting.direction);const m=this.constructPath(w,i);return this.proxy.request(m,{method:u}).then(a.bind(this)).catch(c.bind(this))}getGuide(...e){const r=e[0];let n,o={},s,a;typeof e[1]=="function"?(s=e[1],a=e[2]):typeof e[1]=="object"?(o=e[1]||{},s=e[2],a=e[3]):typeof e[1]=="string"?(n=e[1],typeof e[2]=="function"?(s=e[2],a=e[3]):(o=e[2]||{},s=e[3],a=e[4])):!e[1]&&typeof e[2]=="function"&&(s=e[2],a=e[3]);function c(v){if(f(s)){const g=this.settings.useProxyClasses&&v?new N(v,this):v;this.guideCache[g.Id]=g,s(g)}return v}function h(v){return f(a)&&a(v),Promise.reject(v)}const i=l(!0,this.getConfiguration(),o),u={};let w="GET";u.connectionId=n||i.connectionId,u.perspective=i.perspective,u.reader=i.reader,u.phrase=this.current.phrase,this.parameters.remove("LastGuideId"),this.parameters.add("LastGuideId",r);let m=`guides/${r}`;u.connectionId&&(m+=`/${u.connectionId}`);let y="";return!o.statisticsDisabled&&!u.connectionId?(w="POST",y=this.constructPath(m,l({},this.current,o))):y=this.constructPath(m,l({},this.current,o),!1),this.proxy.request(y,{method:w}).then(c.bind(this)).catch(h.bind(this))}getCategories(...e){let r={},n,o;typeof e[0]=="object"?(r=e[0]||{},n=e[1],o=e[2]):(n=e[0],o=e[1]);function s(i){if(f(n)){const u=this;i=this.settings.useProxyClasses&&i?(()=>(i.Children=A(i,"Children",Q,u),i))():i,n(i)}return i}function a(i){f(o)&&o(i)}let c="categories";r.categoryId&&(c+="/"+r.categoryId);const h=this.constructPath(c,l({},this.current,r));return this.proxy.request(h,{method:"GET"}).then(s.bind(this)).catch(a.bind(this))}answer(...e){const r=e[0],n=e[1];let o={},s,a,c;typeof e[2]=="object"?(o=e[2]||{},s=e[3],a=e[4]):(s=e[2],a=e[3]);const h=!!o.persist;function i(){!h&&c&&this.parameters.remove(c.Condition.ParameterName,c.Condition.Value)}function u(g){if(i(),f(s)){const D=this.settings.useProxyClasses&&g?new N(g,this):g;this.guideCache[D.Id]=D,s(D)}}function w(g){i(),f(a)&&a(g)}const m=this.guideCache[r];m.Options&&m.Options.forEach(g=>{this.parameters.remove(g.Condition.ParameterName,g.Condition.Value),g.ConnectionId===n&&(c=g)}),this.parameters.add(c.Condition.ParameterName,c.Condition.Value);const y=`guides/${r}/${n}`,v=this.constructPath(y,l({},this.current,o));return this.proxy.request(v,{method:"GET"}).then(u.bind(this)).catch(w.bind(this))}giveFeedback(...e){const r=e[0];let n,o,s={},a,c;typeof e[2]=="string"?(n=e[1],o=e[2],typeof e[3]=="object"?(s=e[3]||{},a=e[4],c=e[5]):(a=e[3],c=e[4])):(o=e[1],typeof e[2]=="object"&&(s=e[2]||{},a=e[3],c=e[4]));function h(m){return f(a)&&a(m),m}function i(m){return f(c)&&c(m),m}const u=`guides/${r}${n?"/"+n:""}/feedback`,w=this.constructPath(u,l({},s,{feedbackType:o}));return this.proxy.request(w,{method:"POST"}).then(h.bind(this)).catch(i.bind(this))}completeContactMethod(...e){const r=e[0];let n={},o,s;typeof e[1]=="object"?(n=e[1],o=e[2],s=e[3]):(o=e[1],s=e[2]);function a(u){f(o)&&o(u)}function c(u){f(s)&&s(u)}const h=`contactmethods/${r}/completed`,i=this.constructPath(h,n);return this.proxy.request(i,{method:"PUT"}).then(a.bind(this)).catch(c.bind(this))}getContactMethod(...e){const r=e[0];let n={},o,s;typeof e[1]=="object"?(n=e[1],o=e[2],s=e[3]):(o=e[1],s=e[2]);function a(u){if(f(o))o(u.ContactMethod);else return u}function c(u){if(f(s))s(u);else return u}const h=`contactmethods/${r}`,i=this.constructPath(h,l({},this.current,n));return this.proxy.request(i,{method:"GET"}).then(a.bind(this)).catch(c.bind(this))}contactMethods(...e){let r,n={},o,s;typeof e[0]=="number"?(r=e[0],n=e[1]||{},o=e[2],s=e[3]):typeof e[0]=="object"?(n=e[0]||{},o=e[1],s=e[2]):(o=e[0],s=e[1]);function a(u){return f(o)&&(u=this.settings.useProxyClasses&&u?(()=>(u.Matches=A(u,"Matches",H),u))():u,o(u)),u}function c(u){return f(s)&&s(u),u}const h=r?`guides/${r}/contactmethods`:"contactmethods",i=this.constructPath(h,l({},this.current,n));return this.proxy.request(i,{method:"GET"}).then(a.bind(this)).catch(c.bind(this))}contacts(...e){let r,n={},o,s;typeof e[0]=="number"?(r=e[0],typeof e[1]=="object"?(n=e[1],o=e[2],s=e[3]):(o=e[1],s=e[2])):typeof e[0]=="object"?(n=e[0]||{},o=e[1],s=e[2]):(o=e[0],s=e[1]);function a(i){if(f(o))i&&this.settings.useProxyClasses&&(i.Children&&(i.Children=A(i,"Children",Q)),i.Matches&&(i.Matches=A(i,"Matches",H)),i.Highlighted&&(i.Highlighted=A(i,"Highlighted",H))),o(i);else return i}function c(i){if(f(s))s(i);else return i}const h=this.constructPath(`contacts/${r||""}`,l({},this.current,n));return this.proxy.request(h,{method:"GET"}).then(a.bind(this)).catch(c.bind(this))}getSettings(e){const r=this.constructPath("config",this.current);return this.proxy.request(r,{method:"GET"}).then(e)}getAuthorized(e,r){const n=this.constructPath("interfaceauthorized",this.current);return this.proxy.request(n,{method:"GET",credentials:"include"}).then(e).catch(r)}submitForm(e,r,n,o,s){let a="forms/"+e;return n&&(a+="/"+n),a=this.constructPath("config",l({},this.current,r)),this.proxy.request(a,"POST",r,o,s)}getTab(e,r,n,o){var s=arguments;typeof s[1]=="object"?(r=s[1],n=s[2],o=s[3]):(r={},n=s[1],o=s[2]);const a=`tabs/${e}`;return this.proxy.request(a,{method:"GET"}).then(n).catch(o)}dispose(){this.subscriptions.forEach(e=>e())}}B.feedbackTypes={positive:"Positive",negative:"Negative",comment:"Comment"};B.handoverTypes={email:"Email",chat:"Chat",callback:"Callback",phone:"Phone",emailComplementary:"ComplementaryEmail",chatComplementary:"ComplementaryChat",callbackComplementary:"ComplementaryCallback",phoneComplementary:"ComplementaryPhone"};B.defaults={client:ye,funnel:be,site:me,language:ge,paging:{skip:0,take:10},useProxyClasses:!1};B.version="1.0";const Ce=B;exports.ServiceClient=Ce;exports.ServiceProxy=te;exports.appendParameters=ee;exports.appendQueryString=$;exports.getCookie=q;exports.getStoragePolicyConsent=R;exports.setCookie=C;
@@ -0,0 +1 @@
1
+ "use strict";var mt=Object.defineProperty;var vt=(i,t,e)=>t in i?mt(i,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[t]=e;var R=(i,t,e)=>(vt(i,typeof t!="symbol"?t+"":t,e),e);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-6e1f4d54.js"),yt=require("./create-params-13c11e30.js");require("react/jsx-runtime");require("react");require("react-dom");var wt=function(i,t,e,n,s,a,h,p){if(process.env.NODE_ENV!=="production"&&t===void 0)throw new Error("invariant requires an error message argument");if(!i){var u;if(t===void 0)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[e,n,s,a,h,p],b=0;u=new Error(t.replace(/%s/g,function(){return l[b++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}},Pt=wt;const St=r.getDefaultExportFromCjs(Pt);var bt=function(t){return t.charAt(0)==="/"?t:"/"+t},ft=function(t,e){return new RegExp("^"+e+"(\\/|\\?|#|$)","i").test(t)},xt=function(t,e){return ft(t,e)?t.substr(e.length):t},Lt=function(t){return t.charAt(t.length-1)==="/"?t.slice(0,-1):t},Ht=function(t){var e=t||"/",n="",s="",a=e.indexOf("#");a!==-1&&(s=e.substr(a),e=e.substr(0,a));var h=e.indexOf("?");return h!==-1&&(n=e.substr(h),e=e.substr(0,h)),{pathname:e,search:n==="?"?"":n,hash:s==="#"?"":s}},lt=function(t){var e=t.pathname,n=t.search,s=t.hash,a=e||"/";return n&&n!=="?"&&(a+=n.charAt(0)==="?"?n:"?"+n),s&&s!=="#"&&(a+=s.charAt(0)==="#"?s:"#"+s),a},Ot=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},V=function(t,e,n,s){var a=void 0;typeof t=="string"?(a=Ht(t),a.state=e):(a=Ot({},t),a.pathname===void 0&&(a.pathname=""),a.search?a.search.charAt(0)!=="?"&&(a.search="?"+a.search):a.search="",a.hash?a.hash.charAt(0)!=="#"&&(a.hash="#"+a.hash):a.hash="",e!==void 0&&a.state===void 0&&(a.state=e));try{a.pathname=decodeURI(a.pathname)}catch(h){throw h instanceof URIError?new URIError('Pathname "'+a.pathname+'" could not be decoded. This is likely caused by an invalid percent-encoding.'):h}return n&&(a.key=n),s?a.pathname?a.pathname.charAt(0)!=="/"&&(a.pathname=r.resolvePathname(a.pathname,s.pathname)):a.pathname=s.pathname:a.pathname||(a.pathname="/"),a},gt=function(){var t=null,e=function(u){return r.warning(t==null,"A history supports only one prompt at a time"),t=u,function(){t===u&&(t=null)}},n=function(u,l,b,y){if(t!=null){var _=typeof t=="function"?t(u,l):t;typeof _=="string"?typeof b=="function"?b(_,y):(r.warning(!1,"A history needs a getUserConfirmation function in order to use a prompt message"),y(!0)):y(_!==!1)}else y(!0)},s=[],a=function(u){var l=!0,b=function(){l&&u.apply(void 0,arguments)};return s.push(b),function(){l=!1,s=s.filter(function(y){return y!==b})}},h=function(){for(var u=arguments.length,l=Array(u),b=0;b<u;b++)l[b]=arguments[b];s.forEach(function(y){return y.apply(void 0,l)})};return{setPrompt:e,confirmTransitionTo:n,appendListener:a,notifyListeners:h}},Mt=!!(typeof window<"u"&&window.document&&window.document.createElement),tt=function(t,e,n){return t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent("on"+e,n)},et=function(t,e,n){return t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent("on"+e,n)},Et=function(t,e){return e(window.confirm(t))},Rt=function(){var t=window.navigator.userAgent;return(t.indexOf("Android 2.")!==-1||t.indexOf("Android 4.0")!==-1)&&t.indexOf("Mobile Safari")!==-1&&t.indexOf("Chrome")===-1&&t.indexOf("Windows Phone")===-1?!1:window.history&&"pushState"in window.history},kt=function(){return window.navigator.userAgent.indexOf("Trident")===-1},Tt=function(t){return t.state===void 0&&navigator.userAgent.indexOf("CriOS")===-1},nt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},Ct=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},at="popstate",rt="hashchange",it=function(){try{return window.history.state||{}}catch{return{}}},_t=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};St(Mt,"Browser history needs a DOM");var e=window.history,n=Rt(),s=!kt(),a=t.forceRefresh,h=a===void 0?!1:a,p=t.getUserConfirmation,u=p===void 0?Et:p,l=t.keyLength,b=l===void 0?6:l,y=t.basename?Lt(bt(t.basename)):"",_=function(o){var g=o||{},w=g.key,m=g.state,O=window.location,S=O.pathname,T=O.search,B=O.hash,C=S+T+B;return r.warning(!y||ft(C,y),'You are attempting to use a basename on a page whose URL path does not begin with the basename. Expected path "'+C+'" to begin with "'+y+'".'),y&&(C=xt(C,y)),V(C,m,w)},F=function(){return Math.random().toString(36).substr(2,b)},I=gt(),U=function(o){Ct(f,o),f.length=e.length,I.notifyListeners(f.location,f.action)},k=function(o){Tt(o)||j(_(o.state))},N=function(){j(_(it()))},W=!1,j=function(o){if(W)W=!1,U();else{var g="POP";I.confirmTransitionTo(o,g,u,function(w){w?U({action:g,location:o}):Y(o)})}},Y=function(o){var g=f.location,w=D.indexOf(g.key);w===-1&&(w=0);var m=D.indexOf(o.key);m===-1&&(m=0);var O=w-m;O&&(W=!0,x(O))},K=_(it()),D=[K.key],v=function(o){return y+lt(o)},L=function(o,g){r.warning(!((typeof o>"u"?"undefined":nt(o))==="object"&&o.state!==void 0&&g!==void 0),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var w="PUSH",m=V(o,g,F(),f.location);I.confirmTransitionTo(m,w,u,function(O){if(O){var S=v(m),T=m.key,B=m.state;if(n)if(e.pushState({key:T,state:B},null,S),h)window.location.href=S;else{var C=D.indexOf(f.location.key),G=D.slice(0,C===-1?0:C+1);G.push(m.key),D=G,U({action:w,location:m})}else r.warning(B===void 0,"Browser history cannot push state in browsers that do not support HTML5 history"),window.location.href=S}})},P=function(o,g){r.warning(!((typeof o>"u"?"undefined":nt(o))==="object"&&o.state!==void 0&&g!==void 0),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var w="REPLACE",m=V(o,g,F(),f.location);I.confirmTransitionTo(m,w,u,function(O){if(O){var S=v(m),T=m.key,B=m.state;if(n)if(e.replaceState({key:T,state:B},null,S),h)window.location.replace(S);else{var C=D.indexOf(f.location.key);C!==-1&&(D[C]=m.key),U({action:w,location:m})}else r.warning(B===void 0,"Browser history cannot replace state in browsers that do not support HTML5 history"),window.location.replace(S)}})},x=function(o){e.go(o)},E=function(){return x(-1)},H=function(){return x(1)},A=0,z=function(o){A+=o,A===1?(tt(window,at,k),s&&tt(window,rt,N)):A===0&&(et(window,at,k),s&&et(window,rt,N))},$=!1,M=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=I.setPrompt(o);return $||(z(1),$=!0),function(){return $&&($=!1,z(-1)),g()}},d=function(o){var g=I.appendListener(o);return z(1),function(){z(-1),g()}},f={length:e.length,action:"POP",location:K,createHref:v,push:L,replace:P,go:x,goBack:E,goForward:H,block:M,listen:d};return f},ot=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},It=Object.assign||function(i){for(var t=1;t<arguments.length;t++){var e=arguments[t];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(i[n]=e[n])}return i},st=function(t,e,n){return Math.min(Math.max(t,e),n)},Dt=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=t.getUserConfirmation,n=t.initialEntries,s=n===void 0?["/"]:n,a=t.initialIndex,h=a===void 0?0:a,p=t.keyLength,u=p===void 0?6:p,l=gt(),b=function(P){It(v,P),v.length=v.entries.length,l.notifyListeners(v.location,v.action)},y=function(){return Math.random().toString(36).substr(2,u)},_=st(h,0,s.length-1),F=s.map(function(L){return typeof L=="string"?V(L,void 0,y()):V(L,void 0,L.key||y())}),I=lt,U=function(P,x){r.warning(!((typeof P>"u"?"undefined":ot(P))==="object"&&P.state!==void 0&&x!==void 0),"You should avoid providing a 2nd state argument to push when the 1st argument is a location-like object that already has state; it is ignored");var E="PUSH",H=V(P,x,y(),v.location);l.confirmTransitionTo(H,E,e,function(A){if(A){var z=v.index,$=z+1,M=v.entries.slice(0);M.length>$?M.splice($,M.length-$,H):M.push(H),b({action:E,location:H,index:$,entries:M})}})},k=function(P,x){r.warning(!((typeof P>"u"?"undefined":ot(P))==="object"&&P.state!==void 0&&x!==void 0),"You should avoid providing a 2nd state argument to replace when the 1st argument is a location-like object that already has state; it is ignored");var E="REPLACE",H=V(P,x,y(),v.location);l.confirmTransitionTo(H,E,e,function(A){A&&(v.entries[v.index]=H,b({action:E,location:H}))})},N=function(P){var x=st(v.index+P,0,v.entries.length-1),E="POP",H=v.entries[x];l.confirmTransitionTo(H,E,e,function(A){A?b({action:E,location:H,index:x}):b()})},W=function(){return N(-1)},j=function(){return N(1)},Y=function(P){var x=v.index+P;return x>=0&&x<v.entries.length},K=function(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;return l.setPrompt(P)},D=function(P){return l.appendListener(P)},v={length:F.length,action:"POP",location:F[_],index:_,entries:F,createHref:I,push:U,replace:k,go:N,goBack:W,goForward:j,canGo:Y,block:K,listen:D};return v};const ct="hashchange",At={hashbang:{encodePath:i=>i.charAt(0)==="!"?i:"!/"+r.stripLeadingSlash_1(i),decodePath:i=>i.charAt(0)==="!"?i.substr(1):i},noslash:{encodePath:r.stripLeadingSlash_1,decodePath:r.addLeadingSlash_1},slash:{encodePath:r.addLeadingSlash_1,decodePath:r.addLeadingSlash_1}},q=()=>{const i=window.location.href,t=i.indexOf("#");return t===-1?"":i.substring(t+1)},ht=i=>window.location.hash=i,ut=i=>{const t=window.location.href.indexOf("#");window.location.replace(window.location.href.slice(0,t>=0?t:0)+"#"+i)},Q=(i="")=>{const t=i.replace(";","?"),e=[{from:/\;+/gi,to:"&"},{from:/:+/gi,to:"="}];let n=t;return e.forEach(({to:s,from:a})=>{n=n.replace(a,s)}),n},pt=(i={})=>{const t=window.history,{getUserConfirmation:e=r.getConfirmation_1,hashType:n="slash"}=i,s=i.basename?r.stripTrailingSlash_1(r.addLeadingSlash_1(i.basename)):"",{encodePath:a}=At[n],h=()=>{const d=q(),f=b(d);return r.createLocation(f,Q)},p=i.transitionManager||r._default(),u=d=>{Object.assign(M,d),M.length=t.length,p.notifyListeners(M.location,M.action,i.widgetName)};let l=!1;const b=d=>{const f=g=>{function w(m,O){const S={};let T;for(;T=O.exec(m);)S[T[1]]=T[2];return S}return w(g,/([^#?&=]+)=([^&#]*)(?!.*?\#)/gi)||null},c="humany-"+i.widgetName;return f(d)[c]},y=()=>{const d=h(),f=M.location;!l&&r.locationsAreEqual_1(f,d)||_(d)},_=d=>{if(l)l=!1,u();else{const f="POP";p.confirmTransitionTo(d,f,e,c=>{c?u({action:f,location:d}):F(d)})}},F=d=>{const f=M.location;let c=k.lastIndexOf(r.createPath_1(f));c===-1&&(c=0);let o=k.lastIndexOf(r.createPath_1(d));o===-1&&(o=0);const g=c-o;g&&(l=!0,v(g))},I=q(),U=a(I);I!==U&&ut(U);let k=[];const N=h();N.pathname!==null&&k.push(r.createPath_1(N));const W=(d="")=>{const f=[{from:/\?+/gi,to:";"},{from:/\&amp;+/gi,to:";"},{from:/\&+/gi,to:";"},{from:/=+/gi,to:":"}];let c=d;return f.forEach(({to:o,from:g})=>{c=c.replace(g,o)}),c},j=(d,f,c)=>{let o="",g=!1;return d.split("&").forEach(m=>{const O=m.split("="),S=O[0],T=O[1];if(S===f){if(g=!0,c===null)return;o.length>0&&(o+="&"),typeof c<"u"?o+=S+"="+c:o+=S}else S&&(o.length>0&&(o+="&"),o+=S+"="+T)}),!g&&c!==null&&(o.length>0&&(o+="&"),typeof c<"u"?o+=f+"="+c:o+=f),o},Y=d=>{const f=d.pathname,c=W(d.search),o=f+(c?`;${c}`:""),w=`humany-${i.widgetName}`,m=q();return`#${j(m,w,o).replace(";;",";")}`},K=(d,f)=>{const c="PUSH",o=r.createLocation(d,Q),g=o.pathname,w=W(o.search),m=g+(w?`${w}`:""),S=`humany-${i.widgetName}`,T=q(),B=j(T,S,m);p.confirmTransitionTo(o,c,e,C=>{if(!C)return;const G=r.createPath_1(o),J=a(B);if(q()!==J){ht(J);const X=k.lastIndexOf(r.createPath_1(M.location)),Z=k.slice(0,X===-1?0:X+1);Z.push(G),k=Z,u({action:c,location:o})}else u()})},D=(d,f)=>{const c="REPLACE",o=r.createLocation(d,Q);p.confirmTransitionTo(o,c,e,g=>{if(!g)return;const w=r.createPath_1(o),m=a(s+w);q()!==m&&ut(m);const S=k.indexOf(r.createPath_1(M.location));S!==-1&&(k[S]=w),u({action:c,location:o})})},v=d=>{t.go(d)},L=()=>v(-1),P=()=>v(1);let x=0;const E=d=>{x+=d,x===1?window.addEventListener(ct,y):x===0&&window.removeEventListener(ct,y)};let H=!1;const A=(d=!1)=>{const f=p.setPrompt(d);return H||(E(1),H=!0),()=>(H&&(H=!1,E(-1)),f())},z=d=>{const f=p.appendListener(d);return E(1),()=>{E(-1),f()}},$=()=>{const d=q(),f=j(d,`humany-${i.widgetName}`,null),c=a(f);ht(c)},M={createHref:Y,createLocation:r.createLocation,push:K,replace:D,go:v,goBack:L,goForward:P,block:A,listen:z,stop:$,length:t.length,action:"POP",location:N};return M},$t=Object.freeze(Object.defineProperty({__proto__:null,decodeSearch:Q,default:pt,getHashPath:q},Symbol.toStringTag,{value:"Module"})),dt="routeData";class Nt{constructor(t,e){R(this,"settings");R(this,"routes");R(this,"steps",[]);R(this,"location");R(this,"history");R(this,"widget");R(this,"match");R(this,"currentRoute");R(this,"historyListenSubscription",()=>{});R(this,"initialized");R(this,"sticky",!1);R(this,"storageWriter",null);R(this,"storageMedium");this.container=t,this.widget=t.get("$widget");const{routes:n,...s}=e;this.settings={...s,...t.get("routingSettings")},this.sticky=r.determineIfSticky(this.settings),this.storageMedium=this.sticky?r.StorageMedium.Local:r.StorageMedium.Session,r.createStorageWriter(t,dt,r.StorageCategory.Necessary,{medium:this.storageMedium}).then(a=>this.storageWriter=a),this.routes=n}initialize(){return this.initialized=this.initialized||this.createHistory().then(t=>{this.history=t,this.location=t.location,this.historyListenSubscription=t.listen((e,n,s)=>this.handleLocationChange(e,s))})}setMatch(t){if(this.match=t,this.location){const e=this.getRouteData(),n={routeData:e,location:this.location},s=this.steps[0],a=e.name===(s==null?void 0:s.routeData.name),h=r.shallowCompare(e.params,(s==null?void 0:s.routeData.params)||{});(!a||!h)&&(this.widget.events.dispatch("router:change",{next:n,previous:s}),this.steps.unshift(n),this.storageWriter&&this.storageWriter(n.routeData),this.widget.events.dispatch("router:changed",{previous:s,current:n}))}}onRouteChange(t){return this.widget.events.subscribe("router:change",t)}isSticky(){return this.sticky}generate(t,e={}){const n=r.findRoute(t,this.routes);if(!n||!this.history)throw`No route found for ${t}`;const s=r.createParamsPath(e,n.path);if(!s)throw`Unable to generate path for "${t}".`;const a=r.createLocation(s,this.settings.decodeSearch);let h=this.history.createHref(a);const{mode:p,basePath:u}=this.settings;return p==="browser"&&u&&(h=h.replace(u,"")),h.charAt(0)!=="/"&&(h=`/${h}`),h}navigate(t,e={}){const n=r.findRoute(t,this.routes);if(!n||!this.history)return;const s=r.createParamsPath(e,n.path);if(!s)return;const a=this.getRouteData(),h=a&&a.name===t&&r.compareParams(a.params,e);if(this.steps[0]&&h)return;const{decodeSearch:u}=this.settings,l=u?u(s):s;this.widget.events.dispatch("router:navigate",{decodedPath:l}),l.charAt(0)!=="/"?this.history.push(`/${l}`):this.history.push(l)}hasBack(){if(this.steps.length>1)return!0;const t=this.getRouteData(this.settings.initialPath),e=this.getRouteData(),n=e.name===t.name,s=r.shallowCompare(e.params,t.params);return!n||!s}goBack(t=1){if(this.steps.length<2){const e=this.getRouteData(this.settings.initialPath);e&&e.name&&(this.navigate(e.name,e.params),this.steps=[])}else{const e=t>=this.steps.length?this.steps.length-1:t,{routeData:n}=this.steps[e];this.steps=[...this.steps.slice(e+1)],this.navigate(n.name,yt.createParams(n.params))}}goForward(){this.history&&this.history.goForward()}current(){return this.location}getInitialRoute(){const{name:t}=this.getRouteData(this.settings.initialPath),e=this.routes.find(n=>n.name===t);return e||(this.routes.length>0?this.routes[0]:(process.env.NODE_ENV!=="production"&&r.Logger.warn("Unable to get initial route as no routes are defined."),null))}getRouteData(t){const e=r.getNotFoundRoute(this.container);if(t){const n=r.matchRoute(t,this.routes);return n?{params:r.removeNullAndUndefinedValues(r.matchParams(t,n.path)),name:n.name}:e||{name:"",params:{}}}if(this.location){const{pathname:n,search:s}=this.location;if(this.currentRoute=this.currentRoute||r.matchRoute(n,this.routes),this.currentRoute){const{path:a,name:h}=this.currentRoute;this.match||(this.match={params:r.matchParams(n,a),isExact:!0,path:a,url:n});const p=r.removeNullAndUndefinedValues({...this.match.params,...s.length>0&&r.queryStringAsObject(s)});return{name:h,params:p}}}return e||{name:"",params:{}}}dispose(){return this.historyListenSubscription(),this.stop()}setupInitialRoute(){return r.readStorage(this.container,dt,this.storageMedium).then(t=>{if(!this.location||!this.history)return;const{initialPath:e,mode:n}=this.settings;switch((()=>{const a=r.onWidgetUrl(this.container);return n===r.HistoryMode.browser||a?r.InitializationMode.path:n===r.HistoryMode.memory&&t?r.InitializationMode.storage:r.InitializationMode.initialPath})()){case r.InitializationMode.initialPath:{const a=this.getRouteData(e);return a&&a.name?this.navigate(a.name,a.params):void 0}case r.InitializationMode.path:{const{pathname:a}=this.location;if(this.currentRoute=r.matchRoute(a,this.routes),this.currentRoute){const{path:p}=this.currentRoute;return this.setMatch({params:r.matchParams(a,p),isExact:!0,path:p,url:a})}const h=r.getNotFoundRoute(this.container);return h?this.setMatch({params:{},isExact:!0,path:h.name,url:a}):void 0}case r.InitializationMode.storage:{const{pathname:a}=this.location;this.currentRoute=r.matchRoute(a,this.routes);const{name:h="",params:p={}}=t||{},u=r.findRoute(h,this.routes);if(u){const l=r.createParamsPath(p,u.path);if(l)return this.history.push(l),this.location={...this.location,pathname:l},this.currentRoute=r.matchRoute(l,this.routes),this.setMatch({params:p,isExact:!0,path:u.path,url:l})}return}}})}start(){return this.setupInitialRoute()}stop(){return this.history&&(this.settings.mode===r.HistoryMode.scopedHash&&this.history.stop(),this.steps=[],this.storageWriter)?this.storageWriter():Promise.resolve()}handleLocationChange(t,e){const{pathname:n}=t,{mode:s}=this.settings;if(n.indexOf("?")>-1||n.indexOf(";")>-1||s===r.HistoryMode.scopedHash&&e!==this.widget.name)return;this.location=t,this.currentRoute=r.matchRoute(n,this.routes);const a=r.getNotFoundRoute(this.container);if(this.currentRoute){const{path:h}=this.currentRoute;this.setMatch({params:r.matchParams(n,h),isExact:!0,path:h,url:n})}else a&&this.setMatch({params:{},isExact:!0,path:a.name,url:n})}createHistory(){return new Promise(t=>{const{mode:e,basePath:n}=this.settings;if(e===r.HistoryMode.scopedHash){const s=this.widget.name,a=r.getTransitionManager(this.container);return Promise.resolve().then(()=>$t).then(h=>{const p=h.default({widgetName:s,transitionManager:a,hashType:"noslash"});return t(p)})}if(e===r.HistoryMode.memory)return t(Dt());if(e===r.HistoryMode.browser)return t(_t({basename:n}));throw"RoutingService: History could not be created."})}}exports.HistoryMode=r.HistoryMode;exports.getScopedHashDOMLocation=r.getScopedHashDOMLocation;exports.getSpecificWidgetPath=r.getSpecificWidgetPath;exports.matchParams=r.matchParams;exports.onWidgetUrl=r.onWidgetUrl;exports.RoutingService=Nt;exports.createHashHistory=pt;