@seamly/web-ui 24.3.0 → 24.4.0
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.
- package/build/dist/lib/index.debug.js +25784 -24384
- package/build/dist/lib/index.debug.js.map +1 -1
- package/build/dist/lib/index.debug.min.js +1 -1
- package/build/dist/lib/index.debug.min.js.LICENSE.txt +216 -0
- package/build/dist/lib/index.debug.min.js.map +1 -1
- package/build/dist/lib/index.js +2898 -1802
- package/build/dist/lib/index.js.map +1 -1
- package/build/dist/lib/index.min.js +1 -1
- package/build/dist/lib/index.min.js.map +1 -1
- package/build/dist/lib/style-guide.js +1992 -909
- package/build/dist/lib/style-guide.js.map +1 -1
- package/build/dist/lib/style-guide.min.js +1 -1
- package/build/dist/lib/style-guide.min.js.map +1 -1
- package/build/dist/lib/styles.css +1 -1
- package/package.json +21 -22
- package/src/javascripts/core/api/index.ts +1 -4
- package/src/javascripts/core/domains/store/slice.ts +32 -5
- package/src/javascripts/core/lib/debug.ts +1 -4
- package/src/javascripts/core/ui/components/conversation/event/choice-prompt.tsx +8 -5
- package/src/javascripts/core/ui/components/conversation/event/conversation-suggestions.tsx +15 -1
- package/src/javascripts/core/ui/components/entry/entry-container.tsx +2 -6
- package/src/javascripts/core/ui/components/entry/upload/index.tsx +19 -0
- package/src/javascripts/core/ui/components/suggestions/index.tsx +8 -0
- package/src/javascripts/core/ui/hooks/use-seamly-commands.ts +0 -22
- package/src/javascripts/style-guide/states.ts +20 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(()=>{"use strict";var e={9306:(e,t,i)=>{var a=i(4901),n=i(6823),o=TypeError;e.exports=function(e){if(a(e))return e;throw new o(n(e)+" is not a function")}},8551:(e,t,i)=>{var a=i(34),n=String,o=TypeError;e.exports=function(e){if(a(e))return e;throw new o(n(e)+" is not an object")}},9617:(e,t,i)=>{var a=i(5397),n=i(5610),o=i(6198),r=function(e){return function(t,i,r){var s=a(t),l=o(s);if(0===l)return!e&&-1;var d,c=n(r,l);if(e&&i!=i){for(;l>c;)if((d=s[c++])!=d)return!0}else for(;l>c;c++)if((e||c in s)&&s[c]===i)return e||c||0;return!e&&-1}};e.exports={includes:r(!0),indexOf:r(!1)}},4527:(e,t,i)=>{var a=i(3724),n=i(4376),o=TypeError,r=Object.getOwnPropertyDescriptor,s=a&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(n(e)&&!r(e,"length").writable)throw new o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},2195:(e,t,i)=>{var a=i(9504),n=a({}.toString),o=a("".slice);e.exports=function(e){return o(n(e),8,-1)}},7740:(e,t,i)=>{var a=i(9297),n=i(5031),o=i(7347),r=i(4913);e.exports=function(e,t,i){for(var s=n(t),l=r.f,d=o.f,c=0;c<s.length;c++){var p=s[c];a(e,p)||i&&a(i,p)||l(e,p,d(t,p))}}},6699:(e,t,i)=>{var a=i(3724),n=i(4913),o=i(6980);e.exports=a?function(e,t,i){return n.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},6980:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},6840:(e,t,i)=>{var a=i(4901),n=i(4913),o=i(283),r=i(9433);e.exports=function(e,t,i,s){s||(s={});var l=s.enumerable,d=void 0!==s.name?s.name:t;if(a(i)&&o(i,d,s),s.global)l?e[t]=i:r(t,i);else{try{s.unsafe?e[t]&&(l=!0):delete e[t]}catch(e){}l?e[t]=i:n.f(e,t,{value:i,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},9433:(e,t,i)=>{var a=i(4576),n=Object.defineProperty;e.exports=function(e,t){try{n(a,e,{value:t,configurable:!0,writable:!0})}catch(i){a[e]=t}return t}},3724:(e,t,i)=>{var a=i(9039);e.exports=!a((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},4055:(e,t,i)=>{var a=i(4576),n=i(34),o=a.document,r=n(o)&&n(o.createElement);e.exports=function(e){return r?o.createElement(e):{}}},6837:e=>{var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},8727:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},2839:(e,t,i)=>{var a=i(4576).navigator,n=a&&a.userAgent;e.exports=n?String(n):""},9519:(e,t,i)=>{var a,n,o=i(4576),r=i(2839),s=o.process,l=o.Deno,d=s&&s.versions||l&&l.version,c=d&&d.v8;c&&(n=(a=c.split("."))[0]>0&&a[0]<4?1:+(a[0]+a[1])),!n&&r&&(!(a=r.match(/Edge\/(\d+)/))||a[1]>=74)&&(a=r.match(/Chrome\/(\d+)/))&&(n=+a[1]),e.exports=n},6518:(e,t,i)=>{var a=i(4576),n=i(7347).f,o=i(6699),r=i(6840),s=i(9433),l=i(7740),d=i(2796);e.exports=function(e,t){var i,c,p,u,y,m=e.target,g=e.global,f=e.stat;if(i=g?a:f?a[m]||s(m,{}):a[m]&&a[m].prototype)for(c in t){if(u=t[c],p=e.dontCallGetSet?(y=n(i,c))&&y.value:i[c],!d(g?c:m+(f?".":"#")+c,e.forced)&&void 0!==p){if(typeof u==typeof p)continue;l(u,p)}(e.sham||p&&p.sham)&&o(u,"sham",!0),r(i,c,u,e)}}},9039:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},616:(e,t,i)=>{var a=i(9039);e.exports=!a((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},9565:(e,t,i)=>{var a=i(616),n=Function.prototype.call;e.exports=a?n.bind(n):function(){return n.apply(n,arguments)}},350:(e,t,i)=>{var a=i(3724),n=i(9297),o=Function.prototype,r=a&&Object.getOwnPropertyDescriptor,s=n(o,"name"),l=s&&"something"===function(){}.name,d=s&&(!a||a&&r(o,"name").configurable);e.exports={EXISTS:s,PROPER:l,CONFIGURABLE:d}},9504:(e,t,i)=>{var a=i(616),n=Function.prototype,o=n.call,r=a&&n.bind.bind(o,o);e.exports=a?r:function(e){return function(){return o.apply(e,arguments)}}},7751:(e,t,i)=>{var a=i(4576),n=i(4901);e.exports=function(e,t){return arguments.length<2?(i=a[e],n(i)?i:void 0):a[e]&&a[e][t];var i}},5966:(e,t,i)=>{var a=i(9306),n=i(4117);e.exports=function(e,t){var i=e[t];return n(i)?void 0:a(i)}},4576:function(e,t,i){var a=function(e){return e&&e.Math===Math&&e};e.exports=a("object"==typeof globalThis&&globalThis)||a("object"==typeof window&&window)||a("object"==typeof self&&self)||a("object"==typeof i.g&&i.g)||a("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297:(e,t,i)=>{var a=i(9504),n=i(8981),o=a({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(n(e),t)}},421:e=>{e.exports={}},5917:(e,t,i)=>{var a=i(3724),n=i(9039),o=i(4055);e.exports=!a&&!n((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},7055:(e,t,i)=>{var a=i(9504),n=i(9039),o=i(2195),r=Object,s=a("".split);e.exports=n((function(){return!r("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):r(e)}:r},3706:(e,t,i)=>{var a=i(9504),n=i(4901),o=i(7629),r=a(Function.toString);n(o.inspectSource)||(o.inspectSource=function(e){return r(e)}),e.exports=o.inspectSource},1181:(e,t,i)=>{var a,n,o,r=i(8622),s=i(4576),l=i(34),d=i(6699),c=i(9297),p=i(7629),u=i(6119),y=i(421),m="Object already initialized",g=s.TypeError,f=s.WeakMap;if(r||p.state){var h=p.state||(p.state=new f);h.get=h.get,h.has=h.has,h.set=h.set,a=function(e,t){if(h.has(e))throw new g(m);return t.facade=e,h.set(e,t),t},n=function(e){return h.get(e)||{}},o=function(e){return h.has(e)}}else{var v=u("state");y[v]=!0,a=function(e,t){if(c(e,v))throw new g(m);return t.facade=e,d(e,v,t),t},n=function(e){return c(e,v)?e[v]:{}},o=function(e){return c(e,v)}}e.exports={set:a,get:n,has:o,enforce:function(e){return o(e)?n(e):a(e,{})},getterFor:function(e){return function(t){var i;if(!l(t)||(i=n(t)).type!==e)throw new g("Incompatible receiver, "+e+" required");return i}}}},4376:(e,t,i)=>{var a=i(2195);e.exports=Array.isArray||function(e){return"Array"===a(e)}},4901:e=>{var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796:(e,t,i)=>{var a=i(9039),n=i(4901),o=/#|\.prototype\./,r=function(e,t){var i=l[s(e)];return i===c||i!==d&&(n(t)?a(t):!!t)},s=r.normalize=function(e){return String(e).replace(o,".").toLowerCase()},l=r.data={},d=r.NATIVE="N",c=r.POLYFILL="P";e.exports=r},4117:e=>{e.exports=function(e){return null==e}},34:(e,t,i)=>{var a=i(4901);e.exports=function(e){return"object"==typeof e?null!==e:a(e)}},6395:e=>{e.exports=!1},757:(e,t,i)=>{var a=i(7751),n=i(4901),o=i(1625),r=i(7040),s=Object;e.exports=r?function(e){return"symbol"==typeof e}:function(e){var t=a("Symbol");return n(t)&&o(t.prototype,s(e))}},6198:(e,t,i)=>{var a=i(8014);e.exports=function(e){return a(e.length)}},283:(e,t,i)=>{var a=i(9504),n=i(9039),o=i(4901),r=i(9297),s=i(3724),l=i(350).CONFIGURABLE,d=i(3706),c=i(1181),p=c.enforce,u=c.get,y=String,m=Object.defineProperty,g=a("".slice),f=a("".replace),h=a([].join),v=s&&!n((function(){return 8!==m((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=e.exports=function(e,t,i){"Symbol("===g(y(t),0,7)&&(t="["+f(y(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!r(e,"name")||l&&e.name!==t)&&(s?m(e,"name",{value:t,configurable:!0}):e.name=t),v&&i&&r(i,"arity")&&e.length!==i.arity&&m(e,"length",{value:i.arity});try{i&&r(i,"constructor")&&i.constructor?s&&m(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var a=p(e);return r(a,"source")||(a.source=h(b,"string"==typeof t?t:"")),e};Function.prototype.toString=w((function(){return o(this)&&u(this).source||d(this)}),"toString")},741:e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var a=+e;return(a>0?i:t)(a)}},4913:(e,t,i)=>{var a=i(3724),n=i(5917),o=i(8686),r=i(8551),s=i(6969),l=TypeError,d=Object.defineProperty,c=Object.getOwnPropertyDescriptor,p="enumerable",u="configurable",y="writable";t.f=a?o?function(e,t,i){if(r(e),t=s(t),r(i),"function"==typeof e&&"prototype"===t&&"value"in i&&y in i&&!i[y]){var a=c(e,t);a&&a[y]&&(e[t]=i.value,i={configurable:u in i?i[u]:a[u],enumerable:p in i?i[p]:a[p],writable:!1})}return d(e,t,i)}:d:function(e,t,i){if(r(e),t=s(t),r(i),n)try{return d(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new l("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},7347:(e,t,i)=>{var a=i(3724),n=i(9565),o=i(8773),r=i(6980),s=i(5397),l=i(6969),d=i(9297),c=i(5917),p=Object.getOwnPropertyDescriptor;t.f=a?p:function(e,t){if(e=s(e),t=l(t),c)try{return p(e,t)}catch(e){}if(d(e,t))return r(!n(o.f,e,t),e[t])}},8480:(e,t,i)=>{var a=i(1828),n=i(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return a(e,n)}},3717:(e,t)=>{t.f=Object.getOwnPropertySymbols},1625:(e,t,i)=>{var a=i(9504);e.exports=a({}.isPrototypeOf)},1828:(e,t,i)=>{var a=i(9504),n=i(9297),o=i(5397),r=i(9617).indexOf,s=i(421),l=a([].push);e.exports=function(e,t){var i,a=o(e),d=0,c=[];for(i in a)!n(s,i)&&n(a,i)&&l(c,i);for(;t.length>d;)n(a,i=t[d++])&&(~r(c,i)||l(c,i));return c}},8773:(e,t)=>{var i={}.propertyIsEnumerable,a=Object.getOwnPropertyDescriptor,n=a&&!i.call({1:2},1);t.f=n?function(e){var t=a(this,e);return!!t&&t.enumerable}:i},4270:(e,t,i)=>{var a=i(9565),n=i(4901),o=i(34),r=TypeError;e.exports=function(e,t){var i,s;if("string"===t&&n(i=e.toString)&&!o(s=a(i,e)))return s;if(n(i=e.valueOf)&&!o(s=a(i,e)))return s;if("string"!==t&&n(i=e.toString)&&!o(s=a(i,e)))return s;throw new r("Can't convert object to primitive value")}},5031:(e,t,i)=>{var a=i(7751),n=i(9504),o=i(8480),r=i(3717),s=i(8551),l=n([].concat);e.exports=a("Reflect","ownKeys")||function(e){var t=o.f(s(e)),i=r.f;return i?l(t,i(e)):t}},7750:(e,t,i)=>{var a=i(4117),n=TypeError;e.exports=function(e){if(a(e))throw new n("Can't call method on "+e);return e}},6119:(e,t,i)=>{var a=i(5745),n=i(3392),o=a("keys");e.exports=function(e){return o[e]||(o[e]=n(e))}},7629:(e,t,i)=>{var a=i(6395),n=i(4576),o=i(9433),r="__core-js_shared__",s=e.exports=n[r]||o(r,{});(s.versions||(s.versions=[])).push({version:"3.40.0",mode:a?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.40.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745:(e,t,i)=>{var a=i(7629);e.exports=function(e,t){return a[e]||(a[e]=t||{})}},4495:(e,t,i)=>{var a=i(9519),n=i(9039),o=i(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!n((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&a&&a<41}))},5610:(e,t,i)=>{var a=i(1291),n=Math.max,o=Math.min;e.exports=function(e,t){var i=a(e);return i<0?n(i+t,0):o(i,t)}},5397:(e,t,i)=>{var a=i(7055),n=i(7750);e.exports=function(e){return a(n(e))}},1291:(e,t,i)=>{var a=i(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:a(t)}},8014:(e,t,i)=>{var a=i(1291),n=Math.min;e.exports=function(e){var t=a(e);return t>0?n(t,9007199254740991):0}},8981:(e,t,i)=>{var a=i(7750),n=Object;e.exports=function(e){return n(a(e))}},2777:(e,t,i)=>{var a=i(9565),n=i(34),o=i(757),r=i(5966),s=i(4270),l=i(8227),d=TypeError,c=l("toPrimitive");e.exports=function(e,t){if(!n(e)||o(e))return e;var i,l=r(e,c);if(l){if(void 0===t&&(t="default"),i=a(l,e,t),!n(i)||o(i))return i;throw new d("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},6969:(e,t,i)=>{var a=i(2777),n=i(757);e.exports=function(e){var t=a(e,"string");return n(t)?t:t+""}},6823:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392:(e,t,i)=>{var a=i(9504),n=0,o=Math.random(),r=a(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++n+o,36)}},7040:(e,t,i)=>{var a=i(4495);e.exports=a&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},8686:(e,t,i)=>{var a=i(3724),n=i(9039);e.exports=a&&n((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8622:(e,t,i)=>{var a=i(4576),n=i(4901),o=a.WeakMap;e.exports=n(o)&&/native code/.test(String(o))},8227:(e,t,i)=>{var a=i(4576),n=i(5745),o=i(9297),r=i(3392),s=i(4495),l=i(7040),d=a.Symbol,c=n("wks"),p=l?d.for||d:d&&d.withoutSetter||r;e.exports=function(e){return o(c,e)||(c[e]=s&&o(d,e)?d[e]:p("Symbol."+e)),c[e]}},4114:(e,t,i)=>{var a=i(6518),n=i(8981),o=i(6198),r=i(4527),s=i(6837);a({target:"Array",proto:!0,arity:1,forced:i(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=n(this),i=o(t),a=arguments.length;s(i+a);for(var l=0;l<a;l++)t[i]=arguments[l],i++;return r(t,i),i}})}},t={};function i(a){var n=t[a];if(void 0!==n)return n.exports;var o=t[a]={exports:{}};return e[a].call(o.exports,o,o.exports,i),o.exports}i.d=(e,t)=>{for(var a in t)i.o(t,a)&&!i.o(e,a)&&Object.defineProperty(e,a,{enumerable:!0,get:t[a]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var a={};i.r(a),i.d(a,{SeamlyStaticCore:()=>ze,default:()=>Ue}),i(4114);const n=require("@seamly/web-ui"),o=require("preact"),r=require("preact/hooks"),s={direction:"to_translation_locale",locale:"nl",translatedBy:"deep_l",data:{}};function l(e){switch(e.payload.type){case"cta":case"image":case"text":case"choice_prompt":return{...e,payload:{...e.payload,translatedBody:{...s,data:{...e.payload.body,text:e.payload.body.text?`NL - ${e.payload.body.text}`:void 0,description:e.payload.body.description?`NL - ${e.payload.body.description}`:void 0,buttonText:e.payload.body.buttonText?`NL - ${e.payload.body.buttonText}`:void 0,choices:e.payload.body.choices?e.payload.body.choices.map((e=>({...e,text:`NL - ${e.text}`}))):void 0,prompt:e.payload.body.prompt?{...e.payload.body.prompt,text:`NL - ${e.payload.body.prompt.text}`}:void 0}}}};default:return e}}const d={events:[],config:{layoutMode:"inline",accountConfig:{},hideOnNoUserResponse:!1,showDisclaimer:!1,showSuggestions:!0,preChat:!0},context:{},initialState:{},unreadEvents:0,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1},resumeConversationPrompt:!1,visibility:{visibility:n.visibilityStates.open},serviceInfo:{activeServiceSessionId:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:"Test title",subTitle:"Test subtitle"},interrupt:{error:void 0},historyLoaded:!1,skiplinkTargetId:(0,n.randomId)(),optionsButtonId:(0,n.randomId)(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},entryMeta:{default:"text",active:"text",userSelected:null,options:{},optionsOverride:{}},currentUploads:[],processingFileUploads:[]},c={participants:{agent:{id:"agent",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},user:{id:"user",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}}},currentAgent:"agent"},p={type:"info",payload:{body:{subtype:"new_topic",type:"divider"},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),transactionId:"_1y9pz5fbyly",type:"divider"}},u={type:"info",payload:{body:{language:"Nederlands",restartButtonText:null,subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",title:"[NL] Translating to Dutch",translationEnabled:!0,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},y={type:"info",payload:{body:{language:"Nederlands",subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",translationEnabled:!0,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},m={type:"info",payload:{body:{language:"Nederlands",restartButtonText:"[NL] Start again",subtype:"new_translation",text:null,title:"[NL] Automatic translation to Dutch ended",translationEnabled:!1,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},g={type:"info",payload:{body:{text:"This is a system generated info message",type:"text"},fromClient:!1,id:(0,n.randomId)(),participant:null,service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:null,type:"text"}},f={type:"info",payload:{body:{key:["info","sendTranscript","accepted"],variables:{emailAddress:"test@test.com"}},fromClient:!1,id:(0,n.randomId)(),participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,type:"translation"}},h={title:"You're talking to",subTitle:"Mrs. Bot"},v={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"received",participant:{avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAsMTQuOGMtMS4xLDAtMi0wLjktMi0yczAuOS0yLDItMnMyLDAuOSwyLDJTMTEuMSwxNC44LDEwLDE0Ljh6IE0xNS45LDE0LjhjMS4xLDAsMi0wLjksMi0ycy0wLjktMi0yLTIKCXMtMiwwLjktMiwyUzE0LjgsMTQuOCwxNS45LDE0Ljh6IE0yMS44LDEwLjhjLTEuMSwwLTIsMC45LTIsMnMwLjksMiwyLDJzMi0wLjksMi0yUzIyLjksMTAuOCwyMS44LDEwLjh6IE0yMS4zLDE4LjFIMTAuNwoJQzExLjcsMjMuOSwyMC4yLDIzLjksMjEuMywxOC4xeiIvPgo8L3N2Zz4K",id:"agent",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},b={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"received",participant:{introduction:"Welcome, you are now chatting with Mrs. Bot 2, give me a minit to read back the chat history.",id:"agent",avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAuMSwxNC45Yy0xLjEsMC0yLTAuOS0yLTJzMC45LTIsMi0yczIsMC45LDIsMlMxMS4yLDE0LjksMTAuMSwxNC45eiBNMjEuOSwxMC45Yy0xLjEsMC0yLDAuOS0yLDIKCXMwLjksMiwyLDJzMi0wLjksMi0yUzIzLDEwLjksMjEuOSwxMC45eiBNMjEuNCwxOC4ySDEwLjhDMTEuOCwyNCwyMC4zLDI0LDIxLjQsMTguMnogTTE3LjIsMjUuM2gtMi40Yy0wLjYsMC0xLjIsMC40LTEuNCwxCgljLTUuMS0wLjItOS4yLTQuNC05LjQtOS42YzAuMSwwLDAuMiwwLjEsMC40LDAuMWgwLjFjMC44LDAsMS40LTAuNiwxLjQtMS40di00LjdjMC0wLjgtMC42LTEuNC0xLjQtMS40aDBjLTAuOCwwLTEuNCwwLjYtMS40LDEuNAoJdjIuN3YydjEuMWMwLDUuOSw0LjcsMTAuNiwxMC41LDEwLjhjMC4yLDAuNSwwLjcsMC44LDEuMiwwLjhoMi40YzAuOCwwLDEuNC0wLjYsMS40LTEuNFMxOCwyNS4zLDE3LjIsMjUuM3oiLz4KPC9zdmc+Cg==",name:"Two",service:{expose:{map:{},version:3},meta:{},name:"new service",serviceSessionId:(0,n.randomId)(),settings:{}}},transactionId:(0,n.randomId)(),type:"participant"}},w={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"received",participant:{id:"user",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},x=({type:e,data:t,text:i})=>({type:"message",payload:{body:{type:e,text:i,data:t},participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},fromClient:!1,fromHistory:!0,id:"4efacb4d-28a0-454e-8e36-3f17eb598c5d",messageStatus:"read",transactionId:"6f9beee7-ce82-418e-9bec-8001079aa769",transactionLast:!0,type:"custom"}}),S={type:"message",payload:{body:{text:"What do you want to do?",type:"text",data:void 0},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},I={type:"message",payload:{type:"splash",id:(0,n.randomId)(),body:{text:"Example splash message ✨",type:"text",variables:{}}}},T={type:"message",payload:{body:{description:"Thanks for chatting!\n\nMore info about our <strong>products</strong>?",buttonLink:"https://seamly.ai",buttonText:"View website",buttonNewTab:!0},type:"cta",fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792z",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1}},M={type:"message",payload:{body:{text:"What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am.",type:"text"},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},L={type:"message",payload:{body:{text:"Bubble with <strong>bold</strong> <em>italic</em> <u>underline</u>",type:"text"},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},j={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},C={type:"message",payload:{body:{text:'Here is a long link <a href="https://google.com" data-link-id="1">click me click me please click me yoohoooo please please click me here I am click me now what are you waiting for click me now now now now now click meeeeeeeeeeeeee</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:"a964e54e-ea98-46ff-a952-979a47f162c0",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},E={type:"message",payload:{body:{text:"\n <ul>\n <li>Short list item</li>\n <li>This list item is longer to showcase different type lengths of text in list items and how they reflow in the browser</li>\n <li>\n This list item has a nested list with 3 items in it.\n <ul>\n <li>First item</li>\n <li>second item</li>\n <li>Third item</li>\n </ul>\n </li>\n <li>Another one just to be sure :)</li>\n </ul>\n ",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},N={type:"message",payload:{body:{text:"\n <ol>\n <li>Short list item</li>\n <li>This list item is longer to showcase different type lengths of text in list items and how they reflow in the browser</li>\n <li>\n This list item has a nested list with 3 items in it.\n <ol>\n <li>First item</li>\n <li>second item</li>\n <li>Third item</li>\n </ol>\n </li>\n <li>Another one just to be sure :)</li>\n </ol>\n ",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},A={type:"message",payload:{body:{description:"Plaatje",isZoomable:!1,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f7",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},O={type:"message",payload:{body:{description:"Plaatje",isZoomable:!0,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-portrait.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f8",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},z={type:"message",payload:{body:{description:"test",source:"youtube",type:"video",url:"https://www.youtube.com/embed/K7Hn1rPQouU"},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"video"}},k={type:"message",payload:{body:{choices:[{id:"703db9b3-2157-4d4a-9f9b-c382c6a10531",text:"Dialog (this is intentionally made longer for testing purposes)",type:"choice"},{id:"1eff6098-f14f-4683-a2b8-30d1c573d45e",text:"T-Dialog",type:"choice"},{id:"a8ba3ce8-3324-4e7a-accc-944ff78ac890",text:"Customers",type:"choice"},{id:"c89956ab-cf98-4b7e-9282-7087c988153d",text:"Features",type:"choice"},{id:"9fd9a28f-462d-4f07-9661-606dbe3b9466",category:"secondary",text:"Something else",type:"choice"}],chooseAgain:!0,prompt:{text:"Type "start" at any time to see this menu again",type:"text",variables:{}},type:"choice_prompt"},fromClient:!1,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!0,type:"choice_prompt"}},D={type:"message",payload:{body:{text:"This is what the user typed",type:"text"},fromClient:!0,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},P={type:"message",payload:{body:{text:"This is what the user typed. And sometimes the user has quite a lot to say and then we get longer lines that need to wrap well and not break the styling so here goes with just such a line right here!!",type:"text"},fromClient:!0,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},_={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!0,fromHistory:!0,id:(0,n.randomId)(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},B={type:"upload",transactionId:(0,n.randomId)(),meta:{},body:{contentType:"plain/text",filename:"This-is-an-example.txt",filesize:12,id:(0,n.randomId)(),isDeleted:!1}},G={type:"upload",transactionId:(0,n.randomId)(),meta:{},body:{contentType:"application/pdf",filename:"This-is-a-sample.pdf",filesize:18810,id:"",isDeleted:!1,url:"https://pdfobject.com/pdf/sample.pdf"}},F={type:"upload",transactionId:(0,n.randomId)(),meta:{},body:{contentType:"image/jpeg",filename:"image-square-small.jpg",filesize:12020,id:"",isDeleted:!1,url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"}},U={type:"message",payload:{...B,fromClient:!1,participant:"agent",id:(0,n.randomId)()}},H={type:"message",payload:{...G,fromClient:!1,participant:"agent",id:(0,n.randomId)()}},R={type:"message",payload:{...F,fromClient:!1,participant:"agent",id:(0,n.randomId)()}};sessionStorage.setItem(`image-${R.payload.id}`,R.payload.body.url);const W={...R,payload:{...R.payload,body:{...R.payload.body,isDeleted:!0,url:void 0},id:(0,n.randomId)()}},q={type:"message",payload:{...F,fromClient:!0,participant:"user",id:(0,n.randomId)()}};sessionStorage.setItem(`image-${q.payload.id}`,q.payload.body.url);const $={...q,payload:{...q.payload,id:(0,n.randomId)(),body:{...q.payload.body,url:null}}},X={isActive:!1,currentLocale:void 0,isAvailable:!1,showTranslationProposal:!1,languages:[],translatedEventGroups:{},containerId:(0,n.randomId)()},J=[{id:"1",question:"Invoices",categories:["mixed","short"]},{id:"2",question:"Temporary subscription pause",categories:["mixed","medium"]},{id:"3",question:"Cancellation",categories:["mixed","short"]},{id:"4",question:"Apps",categories:["mixed","medium"]},{id:"5",question:"At what date will my subscription end?",categories:["mixed","long"]},{id:"A",question:"Quotes",categories:["short"]},{id:"B",question:"How to get in touch with us",categories:["long"]}],Z="unstarted",Y="messages",K="errors",Q="uploads",V="features",ee="options",te="suggestions",ie="minimizedWindow",ae="minimizedInline",ne="translations",oe={[Z]:{heading:"Unstarted UI",description:"Test the loader here"},[Y]:{heading:"Messages",description:""},[K]:{heading:"UI errors",description:""},[Q]:{heading:"File uploads",description:""},[V]:{heading:"Other features",description:""},[ee]:{heading:"Options",description:""},[te]:{heading:"Suggestions",description:""},[ie]:{heading:"Minimized window",desciption:""},[ae]:{heading:"Minimized Inline",description:""},[ne]:{heading:"Translations",description:""}},re={type:"message",payload:{type:"card",id:(0,n.randomId)(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-square.jpg",title:"Pizza Margherita"}}},se={type:"message",payload:{type:"card",id:(0,n.randomId)(),body:{action:{link:"https://seamly.ai",newTab:!0,type:"navigate"},buttonText:"Order now!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-landscape.jpg",title:"Pizza Margherita"}}},le={type:"message",payload:{type:"card",id:(0,n.randomId)(),body:{action:{topic:"Set topic",type:"topic"},buttonText:"Set topic! (title & description optional)",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-portrait.jpg"}}},de={type:"message",payload:{type:"card",id:(0,n.randomId)(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",title:"Pizza Margherita"}}},ce={base:{category:Z,headingText:"Standard with loader",description:"",...d,isLoading:!0},fullConversation:{category:Y,headingText:"Full demo conversation",description:"",...d,participantInfo:c,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[v,g,S,{...k,payload:{...k.payload,id:`${k.payload.id}XXX`}},M,b,D,L,_,p,A,U,H,R,W,P,z,j,C,O,q,$,E,N,k,T]},userMessages:{category:Y,headingText:"User messages",description:"",...d,participantInfo:c,events:[D,P,q,$,_]},withParticipants:{category:Y,headingText:"Messages with participant info",description:"",...d,config:{...d.config,overrideMessages:{agent:{showAvatar:!0,showName:!0},user:{showName:!0,showAvatar:!0}}},participantInfo:c,events:[S,D,M,P]},textMessages:{category:Y,headingText:"Text messages",description:"",...d,participantInfo:c,events:[S,M,L,j,C,E,N]},ctaMessages:{category:Y,headingText:"CTA (call to action) messages",description:"",...d,participantInfo:c,events:[T]},imageVideoMessages:{category:Y,headingText:"Download, image and video messages",description:"",...d,participantInfo:c,events:[A,z,O,U,H,R,W,q,$]},systemMessages:{category:Y,headingText:"System messages",description:"",...d,config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:c,events:[{type:"message",payload:{...S.payload,occurredAt:1e3*(Date.now()-432e6),id:(0,n.randomId)(),body:{text:"Long ago when a dialog started",type:"text"}}},v,w,b,p,f,...[u,m].map(l),g]},choicePromptMessages:{category:Y,headingText:"Choice prompt messages",description:"",...d,participantInfo:c,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{...k,payload:{...k.payload,id:`${k.payload.id}XXX`}},S,k]},timeIndicators:{category:Y,headingText:"Time Indicators",description:"",...d,config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:c,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{...S.payload,occurredAt:1e3*(Date.now()-432e6),id:(0,n.randomId)(),body:{text:"Long ago when a dialog started",type:"text"}}},{type:"message",payload:{...S.payload,occurredAt:1e3*(Date.now()-3456e5),id:(0,n.randomId)(),body:{text:"Above me should be a time indicator showing the full date",type:"text"}}},{type:"message",payload:{...S.payload,occurredAt:1e3*(Date.now()+1-3456e5),id:(0,n.randomId)(),body:{text:"Another message",type:"text"}}},{type:"message",payload:{...S.payload,occurredAt:1e3*(Date.now()+2-3456e5),id:(0,n.randomId)(),body:{text:"And another message",type:"text"}}},{type:"message",payload:{...S.payload,occurredAt:1e3*(Date.now()-864e5),id:(0,n.randomId)(),body:{text:'Above me should be a time indicator showing "yesterday"',type:"text"}}},{type:"message",payload:{...S.payload,occurredAt:1e3*(Date.now()+1-864e5),id:(0,n.randomId)(),body:{text:"Another message",type:"text"}}},{type:"message",payload:{...S.payload,occurredAt:1e3*(Date.now()+2-864e5),id:(0,n.randomId)(),body:{text:"And another message",type:"text"}}},{type:"message",payload:{...S.payload,occurredAt:1e3*Date.now(),id:(0,n.randomId)(),body:{text:"Above me should be a time indicator showing me the dialog continues today",type:"text"}}}]},cards:{category:Y,headingText:"Cards",description:"",...d,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[re,se,le,de]},carousel:{category:Y,headingText:"Carousel",description:"",...d,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{type:"carousel",id:(0,n.randomId)(),body:{cards:[re.payload.body,se.payload.body,le.payload.body,de.payload.body]}}}]},errorWithAction:{category:K,headingText:"Error with a user action",description:"",...d,interrupt:{error:new n.SeamlyGeneralError(new Error("general error"))}},errorWithoutAction:{category:K,headingText:"Error without a user action",description:"",...d,interrupt:{error:new n.SeamlyOfflineError(new Error("seamly offline error"))}},privacyDisclaimer:{category:V,headingText:"Privacy disclaimer",description:"",...d,config:{...d.config,showDisclaimer:!0}},characterLimit:{category:V,headingText:"Input character limit",description:"",...d,entryMeta:{default:"text",active:"text",userSelected:null,options:{text:{limit:120}},optionsOverride:{}}},inputLabel:{category:V,headingText:"Input label",...d,entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{text:{label:"What is your name?",limit:null,placeholder:"Please enter your name"}}}},inputLabelWithFileUploadToggle:{category:V,headingText:"Input label with file upload toggle button",...d,options:{...d.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{text:{label:"What is the title of the uploaded document?",limit:null,placeholder:"Please enter the title of the document"}}}},abortTransactional:{category:V,headingText:"Abort transaction",...d,events:[S,D],entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{},actions:{abortTransaction:{label:"Ask for another question",topicFallbackMessage:"Oops...",topicName:"abort_transaction"}},translatedActions:{}}},fileUploadToggle:{category:Q,headingText:"File upload toggle button",description:"",...d,options:{...d.options,features:{uploads:{enabled:!0}}}},fileUploadToggleHidden:{category:Q,headingText:"File upload toggle button hidden",description:"",...d,options:{...d.options,features:{uploads:{enabled:!1}}}},fileUploadInput:{category:Q,headingText:"File upload input",description:"Click on upload button to see an error",styleGuideReset:!0,...d,config:{...d.config,accountConfig:{features:{uploads:!0}}},options:{...d.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}}},fileUploadBusy:{category:Q,headingText:"File upload in progress",description:"",styleGuideReset:!0,...d,config:{...d.config,accountConfig:{features:{uploads:!0}}},options:{...d.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:29,uploading:!0,complete:!1,error:"",uploadHandle:{abort:()=>{}}}]},fileUploadError:{category:Q,headingText:"File upload errored",description:"",styleGuideReset:!0,...d,config:{...d.config,accountConfig:{features:{uploads:!0}}},options:{...d.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:0,uploading:!1,complete:!1,error:"Something went wrong with the upload",uploadHandle:{abort:()=>{}}}]},idleTimerCountdown:{category:V,headingText:"Idle timer with countdown",description:"",...d,idleDetachCountdown:{hasCountdown:!0,isActive:!0,count:120,remaining:91,timer:{minutes:1,seconds:31}}},idleTimerNoCountdown:{category:V,headingText:"Idle timer without countdown",description:"",...d,idleDetachCountdown:{hasCountdown:!0,isActive:!1,count:120,remaining:91,timer:{minutes:1,seconds:31}}},resumeConversationPrompt:{category:V,headingText:"Resume conversation prompt",description:"",...d,participantInfo:c,resumeConversationPrompt:!0},optionsSingleTriggerAvailable:{category:ee,headingText:"Single option available",description:"",...d,options:{...d.options,features:{sendTranscript:{enabled:!0}}}},optionsSingleTriggerUnavailable:{category:ee,headingText:"Single option",description:"Option unavailable",...d,options:{...d.options,features:{sendTranscript:{enabled:!1}}}},optionsMultiple:{category:ee,headingText:"Multiple options",description:"All options available",...d,options:{...d.options,features:{extraMenuItem:{enabled:!0},sendTranscript:{enabled:!0}}}},optionsMultipleUnavailable:{category:ee,headingText:"Multiple options",description:"Some unavailable",...d,options:{...d.options,features:{extraMenuItem:{enabled:!1},sendTranscript:{enabled:!0}}}},optionSendTranscript:{category:ee,headingText:"Send transcript option",description:"Press submit to view error message",...d,options:{...d.options,optionActive:"sendTranscript",panelActive:!0,features:{sendTranscript:{enabled:!0}}}},translationsAvailable:{category:ne,headingText:"Show translations available",description:"",...d,translations:{...X,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationsAvailableWithOptions:{category:ne,headingText:"Show translations available with other options available",description:"",...d,options:{...d.options,features:{sendTranscript:{enabled:!0}}},config:{...d.config,context:{...d.context,contentLocale:"nl",userLocale:"en"}},translations:{...X,isAvailable:!0,currentLocale:"lv",isActive:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]}},translationsActive:{category:ne,headingText:"Show translations active",description:"",...d,translations:{...X,currentLocale:"nl",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationsActiveLarge:{category:ne,headingText:"Show translations active (large list)",description:"",...d,config:{...d.config,context:{...d.context,contentLocale:"nl",userLocale:"en"}},translations:{...X,currentLocale:"lv",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]}},translationsFullConversation:{category:ne,headingText:"Show translated messages",description:"",...d,participantInfo:c,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[u,g,S,{...k,payload:{...k.payload,id:`${k.payload.id}XXX`}},M,D,L,p,y,m,A,U,H,R,W,P,z,j,C,O,q,$,E,N,k,T,m].map(l),translations:{...X,currentLocale:"nl",isActive:!0,isAvailable:!0,translatedEventGroups:{[u.payload.id]:[g,S,{...k,payload:{...k.payload,id:`${k.payload.id}XXX`}},M,D,L,p].map((e=>e.payload.id)),[y.payload.id]:[A,U,H,R,W,P,z,j,C,O,q,$,E,N,k,T].map((e=>e.payload.id))},languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationProposal:{category:ne,headingText:"Show translation proposal",description:"",...d,events:[S,D,P],config:{...d.config,showDisclaimer:!0,context:{contentLocale:"nl-informal",userLocale:"en-GB"}},translations:{...X,translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal",titleLabel:"Do you want to chat in English?"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]}},translationProposalWithoutTitle:{category:ne,headingText:"Show translation proposal without title",description:"",...d,events:[S,D,P],config:{...d.config,showDisclaimer:!0,context:{contentLocale:"nl-informal",userLocale:"en-GB"}},translations:{...X,translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]}}},pe={minimizedInline:{category:ae,headingText:"Inline minimized",description:"",inline:{...d,config:{...d.config,layoutMode:"inline"},visibility:{...d.visibility,visibility:n.visibilityStates.minimized}}},minimizedInlineCharacterLimit:{category:ae,headingText:"Inline minimized with limited characters",description:"",inline:{...d,config:{...d.config,layoutMode:"inline"},visibility:{...d.visibility,visibility:n.visibilityStates.minimized},entryMeta:{...d.entryMeta,options:{text:{limit:120}}}}},minimizedInlinePrechat:{category:ae,headingText:"Inline minimized with pre-chat messages",description:"",inline:{...d,config:{...d.config,layoutMode:"inline",preChatEvents:[I]},visibility:{...d.visibility,visibility:n.visibilityStates.minimized}}},minimizedInlinePrechatSuggestions:{category:ae,headingText:"Inline minimized with pre-chat messages & suggestions",description:"",inline:{...d,config:{...d.config,layoutMode:"inline",preChatEvents:[I]},serviceData:{suggestion:{body:J}},visibility:{...d.visibility,visibility:n.visibilityStates.minimized}}},inlineWithSuggestions:{category:te,headingText:"Suggestions",description:"",inline:{...d,config:{...d.config,layoutMode:"inline"},visibility:{...d.visibility,visibility:n.visibilityStates.open},serviceData:{suggestion:{body:J}}}},minimizedInlineWithError:{category:ae,headingText:"Inline minimized with error",description:"",inline:{...d,config:{...d.config,layoutMode:"inline"},visibility:{...d.visibility,visibility:n.visibilityStates.minimized},interrupt:{error:new n.SeamlyOfflineError(new Error("seamly offline error"))}}}},ue={minimizedWindow:{category:ie,headingText:"Unstarted minimized",description:"",window:{...d,config:{...d.config,layoutMode:"window"},visibility:{...d.visibility,visibility:n.visibilityStates.minimized}}},minimizedWindowStarted:{category:ie,headingText:"Started minimized",description:"",window:{...d,config:{...d.config,layoutMode:"window"},visibility:{...d.visibility,visibility:n.visibilityStates.minimized},participantInfo:c,headerTitles:h}},minimizedWindowStartedUnread:{category:ie,headingText:"Minimized with unread messages",description:"",window:{...d,config:{...d.config,layoutMode:"window"},visibility:{...d.visibility,visibility:n.visibilityStates.minimized},participantInfo:c,headerTitles:h,unreadEvents:12}}},ye={suggestionsMessage:{category:Y,headingText:"Suggestions message",description:"",...d,events:[x(S.payload.body),{type:"service_data",payload:{type:"suggestion",body:J}}]}},me=(e,t=[])=>{const i={...ce,fullConversation:{...ce.fullConversation,events:[I,...ce.fullConversation.events]},...ye,...t.reduce(((e,t)=>{const{key:i,headingText:a,description:n,body:o}=t;return{...e,[i]:{category:Y,headingText:a,description:n,...d,participantInfo:c,events:[x(o)]}}}),{})};return Object.keys(i).reduce(((t,a)=>{const{headingText:n,category:o,description:r,...s}=i[a];return{...t,[a]:{headingText:n,description:r,category:o,...e.reduce(((e,t)=>({...e,[t]:{...s,config:{...s.config,layoutMode:t}}})),{})}}}),{})},ge=(require("preact/compat"),require("preact/jsx-runtime")),fe=({setSelectedState:e,states:t,headingLevel:i})=>{const a=`h${i.toString()}`,o=`h${(parseInt(i,10)+1).toString()}`,r=(0,n.getUrlSearchParams)();return(0,ge.jsx)("nav",{"aria-label":"Style guide navigation",className:"nav--styleguide",children:(0,ge.jsx)("ol",{className:"list--styleguidestates",children:Object.keys(oe).map((i=>{const{heading:s,description:l}=oe[i],d=Object.keys(t).filter((e=>{const{category:a}=t[e];return a===i}));return d.length>0&&(0,ge.jsxs)("li",{children:[(0,ge.jsx)(a,{children:s}),(0,ge.jsx)("span",{className:"category__description",children:l}),(0,ge.jsx)("ol",{children:d.map((i=>{const a={...t[i]};delete a.category;const{headingText:s,descriptionId:l,description:d,...c}=a;return(0,ge.jsxs)("li",{children:[(0,ge.jsx)(o,{id:l,children:s}),d&&(0,ge.jsx)("span",{className:"feature__description",children:d}),(0,ge.jsx)("ul",{className:"list--styleguidelayouts",children:Object.keys(c).map((t=>(0,ge.jsx)("li",{className:t===r?.layoutMode&&i===r?.feature?"state__selected":void 0,children:(0,ge.jsx)("a",{"aria-describedby":l,href:`${window.location.pathname}?${(0,n.getUrlSearchString)({layoutMode:t,feature:i})}`,"aria-current":t===r?.layoutMode&&i===r?.feature?"page":void 0,onClick:a=>{if(a.preventDefault(),"inline"===t){const e=window.document.querySelector(".chat-inline");e&&window.scroll({top:e.offsetTop,behavior:"smooth"})}var o;o={layoutMode:t,feature:i},window.history.pushState(null,"",`${window.location.pathname}?${(0,n.getUrlSearchString)(o)}`),e(o)},children:t.charAt(0).toUpperCase()+t.slice(1)})},t)))})]},i)}))})]},i)}))})})};function he(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var ve=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),be=()=>Math.random().toString(36).substring(7).split("").join("."),we={INIT:`@@redux/INIT${be()}`,REPLACE:`@@redux/REPLACE${be()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${be()}`};function xe(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Se(e,t,i){if("function"!=typeof e)throw new Error(he(2));if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(he(0));if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error(he(1));return i(Se)(e,t)}let a=e,n=t,o=new Map,r=o,s=0,l=!1;function d(){r===o&&(r=new Map,o.forEach(((e,t)=>{r.set(t,e)})))}function c(){if(l)throw new Error(he(3));return n}function p(e){if("function"!=typeof e)throw new Error(he(4));if(l)throw new Error(he(5));let t=!0;d();const i=s++;return r.set(i,e),function(){if(t){if(l)throw new Error(he(6));t=!1,d(),r.delete(i),o=null}}}function u(e){if(!xe(e))throw new Error(he(7));if(void 0===e.type)throw new Error(he(8));if("string"!=typeof e.type)throw new Error(he(17));if(l)throw new Error(he(9));try{l=!0,n=a(n,e)}finally{l=!1}return(o=r).forEach((e=>{e()})),e}return u({type:we.INIT}),{dispatch:u,subscribe:p,getState:c,replaceReducer:function(e){if("function"!=typeof e)throw new Error(he(10));a=e,u({type:we.REPLACE})},[ve]:function(){const e=p;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(he(11));function i(){const e=t;e.next&&e.next(c())}return i(),{unsubscribe:e(i)}},[ve](){return this}}}}}function Ie(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...i)=>e(t(...i))))}function Te(e){return({dispatch:t,getState:i})=>a=>n=>"function"==typeof n?n(t,i,e):a(n)}var Me=Te(),Le=Te,je="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Ie:Ie.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Ce=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}},Ee=e=>t=>{setTimeout(t,e)};function Ne(e){const t=function(e){const{thunk:t=!0,immutableCheck:i=!0,serializableCheck:a=!0,actionCreatorCheck:n=!0}=e??{};let o=new Ce;return t&&("boolean"==typeof t?o.push(Me):o.push(Le(t.extraArgument))),o},{reducer:i,middleware:a,devTools:n=!0,preloadedState:o,enhancers:r}=e||{};let s,l;if("function"==typeof i)s=i;else{if(!xe(i))throw new Error(`Minified Redux Toolkit error #${d=1}; visit https://redux-toolkit.js.org/Errors?code=${d} for the full message or use the non-minified dev environment for full errors. `);s=function(e){const t=Object.keys(e),i={};for(let a=0;a<t.length;a++){const n=t[a];"function"==typeof e[n]&&(i[n]=e[n])}const a=Object.keys(i);let n;try{!function(e){Object.keys(e).forEach((t=>{const i=e[t];if(void 0===i(void 0,{type:we.INIT}))throw new Error(he(12));if(void 0===i(void 0,{type:we.PROBE_UNKNOWN_ACTION()}))throw new Error(he(13))}))}(i)}catch(e){n=e}return function(e={},t){if(n)throw n;let o=!1;const r={};for(let n=0;n<a.length;n++){const s=a[n],l=i[s],d=e[s],c=l(d,t);if(void 0===c)throw t&&t.type,new Error(he(14));r[s]=c,o=o||c!==d}return o=o||a.length!==Object.keys(e).length,o?r:e}}(i)}var d;l="function"==typeof a?a(t):t();let c=Ie;n&&(c=je({trace:!1,..."object"==typeof n&&n}));const p=function(...e){return t=>(i,a)=>{const n=t(i,a);let o=()=>{throw new Error(he(15))};const r={getState:n.getState,dispatch:(e,...t)=>o(e,...t)},s=e.map((e=>e(r)));return o=Ie(...s)(n.dispatch),{...n,dispatch:o}}}(...l),u=(e=>function(t){const{autoBatch:i=!0}=t??{};let a=new Ce(e);return i&&a.push(((e={type:"raf"})=>t=>(...i)=>{const a=t(...i);let n=!0,o=!1,r=!1;const s=new Set,l="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ee(10):"callback"===e.type?e.queueNotification:Ee(e.timeout),d=()=>{r=!1,o&&(o=!1,s.forEach((e=>e())))};return Object.assign({},a,{subscribe(e){const t=a.subscribe((()=>n&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return n=!e?.meta?.RTK_autoBatch,o=!n,o&&(r||(r=!0,l(d))),a.dispatch(e)}finally{n=!0}}})})("object"==typeof i?i:void 0)),a})(p);return Se(s,o,c(..."function"==typeof r?r(u):u()))}var{assign:Ae}=Object;Symbol.for("rtk-state-proxy-original");const Oe={send:()=>{},store:{get:e=>e,set:e=>e,delete:e=>e},sendContext:()=>{},hasConversation:()=>!1,connected:!1},ze=({state:e,translations:t,participants:i=[],children:a})=>{const o=(0,r.useRef)((()=>{})),s=(0,r.useRef)({emit:()=>{},on:()=>{},off:()=>{}}),l=(0,r.useMemo)((()=>{const{translations:a,interrupt:o,config:r,visibility:l,...d}=e||{},c=Ne({reducer:{state:n.stateReducer,app:n.appReducer,config:n.configReducer,i18n:n.i18nReducer,translations:n.translationReducer,visibility:n.visibilityReducer,forms:n.formsReducer,interrupt:n.interruptReducer},preloadedState:{state:d,config:r,translations:a,interrupt:o,visibility:l},middleware:e=>e({thunk:{extraArgument:{api:Oe,eventBus:s.current}},serializableCheck:!1})}),{config:p}=c.getState();return c.dispatch((0,n.setConfig)(p)),p.preChatEvents&&c.dispatch((0,n.setPreChatEvents)(p.preChatEvents)),c.dispatch((0,n.setInitialLocale)("en-GB")),c.dispatch((0,n.setTranslations)(t)),i.forEach((e=>{c.dispatch((0,n.setParticipant)({participant:e,fromClient:"user"===e?.id}))})),c}),[i,e,t]);return e&&(0,ge.jsx)(n.SeamlyStoreProvider,{store:l,children:(0,ge.jsx)(n.SeamlyEventBusContext.Provider,{value:s.current,children:(0,ge.jsx)(n.SeamlyApiContext.Provider,{value:Oe,children:(0,ge.jsx)(n.SeamlyLiveRegionContext.Provider,{value:o.current,children:(0,ge.jsx)(n.ComponentFilter,{children:(0,ge.jsx)(n.SeamlyActivityEventContext.Provider,{value:()=>{},children:(0,ge.jsx)(n.SeamlyFileUpload,{children:a})})})})})})})},ke=({state:e,customComponents:t={},translations:i,participants:a})=>{const[o,s]=(0,r.useState)(!0),{config:l}=e||{},{layoutMode:d}=l||{},c=t[d];return(0,r.useEffect)((()=>{s(!1),requestAnimationFrame((async()=>{await(0,n.timeout)(60),s(!0)}))}),[e]),o?c?(0,ge.jsx)(ze,{state:e,translations:i,participants:a,children:(0,ge.jsx)(c,{})}):(0,ge.jsx)(ze,{state:e,translations:i,participants:a,children:(0,ge.jsx)(n.View,{})}):null},De=({tag:e,id:t,children:i})=>{const a=e;return(0,ge.jsx)(a,{id:t,children:i})},Pe=({config:e,styleGuideConfig:t,translations:i,headingLevel:a=2,participants:o})=>{const[s,l]=(0,r.useState)(null),[p,u]=(0,r.useState)(""),[y,m]=(0,r.useState)(!0),[g]=(0,r.useState)((0,n.randomId)()),{stateUpdateCallback:f,customMessageEventBodies:v}=t,[b]=(0,r.useState)((()=>{const e=(i=t.showLayoutModes||["inline","window"],{...me(i,v),...-1!==i.indexOf("window")?{...ue,minimizedWindowPrechat:{category:ie,headingText:"Minimized with pre-chat messages",description:"",window:{...d,config:{...d.config,layoutMode:"window",preChatEvents:[I]},visibility:{...d.visibility,visibility:n.visibilityStates.minimized},participantInfo:c,headerTitles:h}},minimizedWindowPrechatDelayed:{category:ie,headingText:"Minimized with delayed pre-chat messages",description:"",window:{...d,config:{...d.config,layoutMode:"window",preChatEvents:[I],preChat:{enterDelay:1e3,exitAfter:3e3}},visibility:{...d.visibility,visibility:n.visibilityStates.minimized},participantInfo:c,headerTitles:h}},minimizedWindowPrechatDisabled:{category:ie,headingText:"Minimized with disabled pre-chat messages",description:"",window:{...d,config:{...d.config,layoutMode:"window",preChatEvents:[I],preChat:!1},visibility:{...d.visibility,visibility:n.visibilityStates.minimized},participantInfo:c,headerTitles:h}}}:{},...pe});var i;return Object.keys(e).reduce(((t,i)=>({...t,[i]:{...e[i],descriptionId:(0,n.randomId)()}})),{})})),w=(0,r.useCallback)((e=>{l(f?f(e):e)}),[l,f]),x=(0,r.useCallback)(((t,i)=>{const a=(0,n.getSearchParamsByKeys)("apiKey","locale"),r=new URLSearchParams({...a,layoutMode:t,feature:i});window.history.replaceState(null,"",`?${r}`);const{headingText:s}=b[i];u(s);const l=b[i][t],{overrideMessages:d,showSuggestions:c}=l.config,p=o.find((e=>"agent"===e.id));return{...l,config:{...l.config,...e,showDisclaimer:l.config.showDisclaimer||e.showDisclaimer,context:{...e.context,...l.config?.context},layoutMode:l.config.layoutMode,...d?{messages:d}:{},showSuggestions:c},headerTitles:{...l.headerTitles,subTitle:p?.name||l.headerTitles.subTitle}}}),[b,o,e]);(0,r.useEffect)((()=>{if(y){const e=document.querySelector('[aria-modal="true"]');e&&e.addEventListener("click",(()=>{l((e=>e?{...e,visibility:{...e.visibility,visible:"minimized"}}:e))}))}}),[s,l,y]);const S=(0,r.useCallback)((()=>{const e=(0,n.getUrlSearchParams)(),{layoutMode:t,feature:i}={layoutMode:"inline",feature:"base",...e};w(x(t,i)),window.document.title="Style"}),[x,w]);return(0,r.useEffect)((()=>{S()}),[S]),(0,r.useEffect)((()=>{window.onpopstate=()=>{S()}}),[S]),(0,ge.jsxs)(ge.Fragment,{children:[(0,ge.jsxs)("section",{className:"chat-inline","aria-labelledby":g,children:[(0,ge.jsxs)(De,{tag:`h${a.toString()}`,id:g,children:[(0,ge.jsx)("span",{className:"heading__context",children:"Current selected state:"}),`${p}`]}),(0,ge.jsx)("div",{children:y&&(0,ge.jsx)(ke,{customComponents:t.customComponents,translations:i,state:s,participants:o})})]}),(0,ge.jsx)("aside",{className:"page-aside markdown",children:(0,ge.jsx)("nav",{className:"page-controls",children:(0,ge.jsx)(fe,{headingLevel:a,setSelectedState:({layoutMode:e,feature:t})=>{const i=x(e,t);w(i),i.styleGuideReset&&(m(!1),setTimeout((()=>{m(!0)})))},states:b})})})]})};class _e extends n.Engine{constructor({styleGuideConfig:e,...t},i){super(t,i),this.styleGuideConfig=e||{}}async render(){const e={...this.config.customComponents||{},view:void 0},t=new n.API({namespace:this.config.namespace||"",config:this.config.api,context:this.config.context,layoutMode:this.config.layoutMode}),i=await t.getTranslations(this.config.context?.userLocale||"en-GB"),{agentParticipant:a,userParticipant:r}=await t.getConfig(),s=[{id:"user",...r},{id:"agent",introduction:"I am {{name}}",...a}],l={...this.config,customComponents:Object.keys(e).length?e:void 0};(0,o.render)((0,ge.jsx)(Pe,{config:l,styleGuideConfig:this.styleGuideConfig,translations:i,participants:s}),this.parentElement)}}const Be=_e;class Ge extends n.ExternalApi{constructor(e,t){super(e),this.styleGuideConfig=t}createInstance(e){const{userStyleGuideConfig:t,...i}=e;return new Be({styleGuideConfig:{...this.styleGuideConfig,...t},...i},this)}getUserConfig(e={},t){return super.getUserConfig({...e,...t})}}const Fe=Ge,Ue=function(e,t){if(window.seamlyStyleGuide&&!Array.isArray(window.seamlyStyleGuide))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const i=Array.isArray(window.seamlyStyleGuide)?window.seamlyStyleGuide:[],a=new Fe(e,t);window.seamly=a,window.seamlyStyleGuide={push:a.push.bind(a)},a.push(...i)};module.exports=a})();
|
|
1
|
+
(()=>{"use strict";var e={34:(e,t,i)=>{var n=i(4901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},81:(e,t,i)=>{var n=i(9565),a=i(9306),o=i(8551),r=i(6823),s=i(851),c=TypeError;e.exports=function(e,t){var i=arguments.length<2?s(e):t;if(a(i))return o(n(i,e));throw new c(r(e)+" is not iterable")}},116:(e,t,i)=>{var n=i(6518),a=i(2652),o=i(9306),r=i(8551),s=i(1767);n({target:"Iterator",proto:!0,real:!0},{find:function(e){r(this),o(e);var t=s(this),i=0;return a(t,(function(t,n){if(e(t,i++))return n(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},283:(e,t,i)=>{var n=i(9504),a=i(9039),o=i(4901),r=i(9297),s=i(3724),c=i(350).CONFIGURABLE,l=i(3706),d=i(1181),p=d.enforce,u=d.get,y=String,f=Object.defineProperty,m=n("".slice),g=n("".replace),h=n([].join),v=s&&!a((function(){return 8!==f((function(){}),"length",{value:8}).length})),b=String(String).split("String"),w=e.exports=function(e,t,i){"Symbol("===m(y(t),0,7)&&(t="["+g(y(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(t="get "+t),i&&i.setter&&(t="set "+t),(!r(e,"name")||c&&e.name!==t)&&(s?f(e,"name",{value:t,configurable:!0}):e.name=t),v&&i&&r(i,"arity")&&e.length!==i.arity&&f(e,"length",{value:i.arity});try{i&&r(i,"constructor")&&i.constructor?s&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=p(e);return r(n,"source")||(n.source=h(b,"string"==typeof t?t:"")),e};Function.prototype.toString=w((function(){return o(this)&&u(this).source||l(this)}),"toString")},350:(e,t,i)=>{var n=i(3724),a=i(9297),o=Function.prototype,r=n&&Object.getOwnPropertyDescriptor,s=a(o,"name"),c=s&&"something"===function(){}.name,l=s&&(!n||n&&r(o,"name").configurable);e.exports={EXISTS:s,PROPER:c,CONFIGURABLE:l}},397:(e,t,i)=>{var n=i(7751);e.exports=n("document","documentElement")},421:e=>{e.exports={}},616:(e,t,i)=>{var n=i(9039);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},679:(e,t,i)=>{var n=i(1625),a=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new a("Incorrect invocation")}},713:(e,t,i)=>{var n=i(9565),a=i(9306),o=i(8551),r=i(1767),s=i(9462),c=i(6319),l=s((function(){var e=this.iterator,t=o(n(this.next,e));if(!(this.done=!!t.done))return c(e,this.mapper,[t.value,this.counter++],!0)}));e.exports=function(e){return o(this),a(e),new l(r(this),{mapper:e})}},741:e=>{var t=Math.ceil,i=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?i:t)(n)}},757:(e,t,i)=>{var n=i(7751),a=i(4901),o=i(1625),r=i(7040),s=Object;e.exports=r?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return a(t)&&o(t.prototype,s(e))}},851:(e,t,i)=>{var n=i(6955),a=i(5966),o=i(4117),r=i(6269),s=i(8227)("iterator");e.exports=function(e){if(!o(e))return a(e,s)||a(e,"@@iterator")||r[n(e)]}},1072:(e,t,i)=>{var n=i(1828),a=i(8727);e.exports=Object.keys||function(e){return n(e,a)}},1181:(e,t,i)=>{var n,a,o,r=i(8622),s=i(4576),c=i(34),l=i(6699),d=i(9297),p=i(7629),u=i(6119),y=i(421),f="Object already initialized",m=s.TypeError,g=s.WeakMap;if(r||p.state){var h=p.state||(p.state=new g);h.get=h.get,h.has=h.has,h.set=h.set,n=function(e,t){if(h.has(e))throw new m(f);return t.facade=e,h.set(e,t),t},a=function(e){return h.get(e)||{}},o=function(e){return h.has(e)}}else{var v=u("state");y[v]=!0,n=function(e,t){if(d(e,v))throw new m(f);return t.facade=e,l(e,v,t),t},a=function(e){return d(e,v)?e[v]:{}},o=function(e){return d(e,v)}}e.exports={set:n,get:a,has:o,enforce:function(e){return o(e)?a(e):n(e,{})},getterFor:function(e){return function(t){var i;if(!c(t)||(i=a(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return i}}}},1291:(e,t,i)=>{var n=i(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:n(t)}},1454:(e,t,i)=>{i(1701)},1625:(e,t,i)=>{var n=i(9504);e.exports=n({}.isPrototypeOf)},1701:(e,t,i)=>{var n=i(6518),a=i(713);n({target:"Iterator",proto:!0,real:!0,forced:i(6395)},{map:a})},1767:e=>{e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},1828:(e,t,i)=>{var n=i(9504),a=i(9297),o=i(5397),r=i(9617).indexOf,s=i(421),c=n([].push);e.exports=function(e,t){var i,n=o(e),l=0,d=[];for(i in n)!a(s,i)&&a(n,i)&&c(d,i);for(;t.length>l;)a(n,i=t[l++])&&(~r(d,i)||c(d,i));return d}},2106:(e,t,i)=>{var n=i(283),a=i(4913);e.exports=function(e,t,i){return i.get&&n(i.get,t,{getter:!0}),i.set&&n(i.set,t,{setter:!0}),a.f(e,t,i)}},2140:(e,t,i)=>{var n={};n[i(8227)("toStringTag")]="z",e.exports="[object z]"===String(n)},2195:(e,t,i)=>{var n=i(9504),a=n({}.toString),o=n("".slice);e.exports=function(e){return o(a(e),8,-1)}},2211:(e,t,i)=>{var n=i(9039);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},2360:(e,t,i)=>{var n,a=i(8551),o=i(6801),r=i(8727),s=i(421),c=i(397),l=i(4055),d=i(6119),p="prototype",u="script",y=d("IE_PROTO"),f=function(){},m=function(e){return"<"+u+">"+e+"</"+u+">"},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},h=function(){try{n=new ActiveXObject("htmlfile")}catch(e){}var e,t,i;h="undefined"!=typeof document?document.domain&&n?g(n):(t=l("iframe"),i="java"+u+":",t.style.display="none",c.appendChild(t),t.src=String(i),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):g(n);for(var a=r.length;a--;)delete h[p][r[a]];return h()};s[y]=!0,e.exports=Object.create||function(e,t){var i;return null!==e?(f[p]=a(e),i=new f,f[p]=null,i[y]=e):i=h(),void 0===t?i:o.f(i,t)}},2489:(e,t,i)=>{var n=i(6518),a=i(9565),o=i(9306),r=i(8551),s=i(1767),c=i(9462),l=i(6319),d=i(6395),p=c((function(){for(var e,t,i=this.iterator,n=this.predicate,o=this.next;;){if(e=r(a(o,i)),this.done=!!e.done)return;if(t=e.value,l(i,n,[t,this.counter++],!0))return t}}));n({target:"Iterator",proto:!0,real:!0,forced:d},{filter:function(e){return r(this),o(e),new p(s(this),{predicate:e})}})},2529:e=>{e.exports=function(e,t){return{value:e,done:t}}},2577:(e,t,i)=>{i(116)},2652:(e,t,i)=>{var n=i(6080),a=i(9565),o=i(8551),r=i(6823),s=i(4209),c=i(6198),l=i(1625),d=i(81),p=i(851),u=i(9539),y=TypeError,f=function(e,t){this.stopped=e,this.result=t},m=f.prototype;e.exports=function(e,t,i){var g,h,v,b,w,x,I,S=i&&i.that,T=!(!i||!i.AS_ENTRIES),M=!(!i||!i.IS_RECORD),j=!(!i||!i.IS_ITERATOR),E=!(!i||!i.INTERRUPTED),L=n(t,S),C=function(e){return g&&u(g,"normal",e),new f(!0,e)},O=function(e){return T?(o(e),E?L(e[0],e[1],C):L(e[0],e[1])):E?L(e,C):L(e)};if(M)g=e.iterator;else if(j)g=e;else{if(!(h=p(e)))throw new y(r(e)+" is not iterable");if(s(h)){for(v=0,b=c(e);b>v;v++)if((w=O(e[v]))&&l(m,w))return w;return new f(!1)}g=d(e,h)}for(x=M?e.next:g.next;!(I=a(x,g)).done;){try{w=O(I.value)}catch(e){u(g,"throw",e)}if("object"==typeof w&&w&&l(m,w))return w}return new f(!1)}},2777:(e,t,i)=>{var n=i(9565),a=i(34),o=i(757),r=i(5966),s=i(4270),c=i(8227),l=TypeError,d=c("toPrimitive");e.exports=function(e,t){if(!a(e)||o(e))return e;var i,c=r(e,d);if(c){if(void 0===t&&(t="default"),i=n(c,e,t),!a(i)||o(i))return i;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),s(e,t)}},2787:(e,t,i)=>{var n=i(9297),a=i(4901),o=i(8981),r=i(6119),s=i(2211),c=r("IE_PROTO"),l=Object,d=l.prototype;e.exports=s?l.getPrototypeOf:function(e){var t=o(e);if(n(t,c))return t[c];var i=t.constructor;return a(i)&&t instanceof i?i.prototype:t instanceof l?d:null}},2796:(e,t,i)=>{var n=i(9039),a=i(4901),o=/#|\.prototype\./,r=function(e,t){var i=c[s(e)];return i===d||i!==l&&(a(t)?n(t):!!t)},s=r.normalize=function(e){return String(e).replace(o,".").toLowerCase()},c=r.data={},l=r.NATIVE="N",d=r.POLYFILL="P";e.exports=r},2839:(e,t,i)=>{var n=i(4576).navigator,a=n&&n.userAgent;e.exports=a?String(a):""},3392:(e,t,i)=>{var n=i(9504),a=0,o=Math.random(),r=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+r(++a+o,36)}},3706:(e,t,i)=>{var n=i(9504),a=i(4901),o=i(7629),r=n(Function.toString);a(o.inspectSource)||(o.inspectSource=function(e){return r(e)}),e.exports=o.inspectSource},3717:(e,t)=>{t.f=Object.getOwnPropertySymbols},3724:(e,t,i)=>{var n=i(9039);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},3949:(e,t,i)=>{i(7588)},4055:(e,t,i)=>{var n=i(4576),a=i(34),o=n.document,r=a(o)&&a(o.createElement);e.exports=function(e){return r?o.createElement(e):{}}},4114:(e,t,i)=>{var n=i(6518),a=i(8981),o=i(6198),r=i(4527),s=i(6837);n({target:"Array",proto:!0,arity:1,forced:i(9039)((function(){return 4294967297!==[].push.call({length:4294967296},1)}))||!function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}}()},{push:function(e){var t=a(this),i=o(t),n=arguments.length;s(i+n);for(var c=0;c<n;c++)t[i]=arguments[c],i++;return r(t,i),i}})},4117:e=>{e.exports=function(e){return null==e}},4209:(e,t,i)=>{var n=i(8227),a=i(6269),o=n("iterator"),r=Array.prototype;e.exports=function(e){return void 0!==e&&(a.Array===e||r[o]===e)}},4270:(e,t,i)=>{var n=i(9565),a=i(4901),o=i(34),r=TypeError;e.exports=function(e,t){var i,s;if("string"===t&&a(i=e.toString)&&!o(s=n(i,e)))return s;if(a(i=e.valueOf)&&!o(s=n(i,e)))return s;if("string"!==t&&a(i=e.toString)&&!o(s=n(i,e)))return s;throw new r("Can't convert object to primitive value")}},4376:(e,t,i)=>{var n=i(2195);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4495:(e,t,i)=>{var n=i(9519),a=i(9039),o=i(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!a((function(){var e=Symbol("symbol detection");return!o(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4520:(e,t,i)=>{i(2489)},4527:(e,t,i)=>{var n=i(3724),a=i(4376),o=TypeError,r=Object.getOwnPropertyDescriptor,s=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=s?function(e,t){if(a(e)&&!r(e,"length").writable)throw new o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4576:function(e,t,i){var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof i.g&&i.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4659:(e,t,i)=>{var n=i(3724),a=i(4913),o=i(6980);e.exports=function(e,t,i){n?a.f(e,t,o(0,i)):e[t]=i}},4901:e=>{var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},4913:(e,t,i)=>{var n=i(3724),a=i(5917),o=i(8686),r=i(8551),s=i(6969),c=TypeError,l=Object.defineProperty,d=Object.getOwnPropertyDescriptor,p="enumerable",u="configurable",y="writable";t.f=n?o?function(e,t,i){if(r(e),t=s(t),r(i),"function"==typeof e&&"prototype"===t&&"value"in i&&y in i&&!i[y]){var n=d(e,t);n&&n[y]&&(e[t]=i.value,i={configurable:u in i?i[u]:n[u],enumerable:p in i?i[p]:n[p],writable:!1})}return l(e,t,i)}:l:function(e,t,i){if(r(e),t=s(t),r(i),a)try{return l(e,t,i)}catch(e){}if("get"in i||"set"in i)throw new c("Accessors not supported");return"value"in i&&(e[t]=i.value),e}},5031:(e,t,i)=>{var n=i(7751),a=i(9504),o=i(8480),r=i(3717),s=i(8551),c=a([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(s(e)),i=r.f;return i?c(t,i(e)):t}},5397:(e,t,i)=>{var n=i(7055),a=i(7750);e.exports=function(e){return n(a(e))}},5610:(e,t,i)=>{var n=i(1291),a=Math.max,o=Math.min;e.exports=function(e,t){var i=n(e);return i<0?a(i+t,0):o(i,t)}},5745:(e,t,i)=>{var n=i(7629);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},5917:(e,t,i)=>{var n=i(3724),a=i(9039),o=i(4055);e.exports=!n&&!a((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},5966:(e,t,i)=>{var n=i(9306),a=i(4117);e.exports=function(e,t){var i=e[t];return a(i)?void 0:n(i)}},6080:(e,t,i)=>{var n=i(7476),a=i(9306),o=i(616),r=n(n.bind);e.exports=function(e,t){return a(e),void 0===t?e:o?r(e,t):function(){return e.apply(t,arguments)}}},6119:(e,t,i)=>{var n=i(5745),a=i(3392),o=n("keys");e.exports=function(e){return o[e]||(o[e]=a(e))}},6198:(e,t,i)=>{var n=i(8014);e.exports=function(e){return n(e.length)}},6269:e=>{e.exports={}},6279:(e,t,i)=>{var n=i(6840);e.exports=function(e,t,i){for(var a in t)n(e,a,t[a],i);return e}},6319:(e,t,i)=>{var n=i(8551),a=i(9539);e.exports=function(e,t,i,o){try{return o?t(n(i)[0],i[1]):t(i)}catch(t){a(e,"throw",t)}}},6395:e=>{e.exports=!1},6518:(e,t,i)=>{var n=i(4576),a=i(7347).f,o=i(6699),r=i(6840),s=i(9433),c=i(7740),l=i(2796);e.exports=function(e,t){var i,d,p,u,y,f=e.target,m=e.global,g=e.stat;if(i=m?n:g?n[f]||s(f,{}):n[f]&&n[f].prototype)for(d in t){if(u=t[d],p=e.dontCallGetSet?(y=a(i,d))&&y.value:i[d],!l(m?d:f+(g?".":"#")+d,e.forced)&&void 0!==p){if(typeof u==typeof p)continue;c(u,p)}(e.sham||p&&p.sham)&&o(u,"sham",!0),r(i,d,u,e)}}},6699:(e,t,i)=>{var n=i(3724),a=i(4913),o=i(6980);e.exports=n?function(e,t,i){return a.f(e,t,o(1,i))}:function(e,t,i){return e[t]=i,e}},6801:(e,t,i)=>{var n=i(3724),a=i(8686),o=i(4913),r=i(8551),s=i(5397),c=i(1072);t.f=n&&!a?Object.defineProperties:function(e,t){r(e);for(var i,n=s(t),a=c(t),l=a.length,d=0;l>d;)o.f(e,i=a[d++],n[i]);return e}},6823:e=>{var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},6837:e=>{var t=TypeError;e.exports=function(e){if(e>9007199254740991)throw t("Maximum allowed index exceeded");return e}},6840:(e,t,i)=>{var n=i(4901),a=i(4913),o=i(283),r=i(9433);e.exports=function(e,t,i,s){s||(s={});var c=s.enumerable,l=void 0!==s.name?s.name:t;if(n(i)&&o(i,l,s),s.global)c?e[t]=i:r(t,i);else{try{s.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=i:a.f(e,t,{value:i,enumerable:!1,configurable:!s.nonConfigurable,writable:!s.nonWritable})}return e}},6955:(e,t,i)=>{var n=i(2140),a=i(4901),o=i(2195),r=i(8227)("toStringTag"),s=Object,c="Arguments"===o(function(){return arguments}());e.exports=n?o:function(e){var t,i,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(i=function(e,t){try{return e[t]}catch(e){}}(t=s(e),r))?i:c?o(t):"Object"===(n=o(t))&&a(t.callee)?"Arguments":n}},6969:(e,t,i)=>{var n=i(2777),a=i(757);e.exports=function(e){var t=n(e,"string");return a(t)?t:t+""}},6980:e=>{e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7040:(e,t,i)=>{var n=i(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:(e,t,i)=>{var n=i(9504),a=i(9039),o=i(2195),r=Object,s=n("".split);e.exports=a((function(){return!r("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?s(e,""):r(e)}:r},7347:(e,t,i)=>{var n=i(3724),a=i(9565),o=i(8773),r=i(6980),s=i(5397),c=i(6969),l=i(9297),d=i(5917),p=Object.getOwnPropertyDescriptor;t.f=n?p:function(e,t){if(e=s(e),t=c(t),d)try{return p(e,t)}catch(e){}if(l(e,t))return r(!a(o.f,e,t),e[t])}},7476:(e,t,i)=>{var n=i(2195),a=i(9504);e.exports=function(e){if("Function"===n(e))return a(e)}},7588:(e,t,i)=>{var n=i(6518),a=i(2652),o=i(9306),r=i(8551),s=i(1767);n({target:"Iterator",proto:!0,real:!0},{forEach:function(e){r(this),o(e);var t=s(this),i=0;a(t,(function(t){e(t,i++)}),{IS_RECORD:!0})}})},7629:(e,t,i)=>{var n=i(6395),a=i(4576),o=i(9433),r="__core-js_shared__",s=e.exports=a[r]||o(r,{});(s.versions||(s.versions=[])).push({version:"3.41.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7657:(e,t,i)=>{var n,a,o,r=i(9039),s=i(4901),c=i(34),l=i(2360),d=i(2787),p=i(6840),u=i(8227),y=i(6395),f=u("iterator"),m=!1;[].keys&&("next"in(o=[].keys())?(a=d(d(o)))!==Object.prototype&&(n=a):m=!0),!c(n)||r((function(){var e={};return n[f].call(e)!==e}))?n={}:y&&(n=l(n)),s(n[f])||p(n,f,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:m}},7740:(e,t,i)=>{var n=i(9297),a=i(5031),o=i(7347),r=i(4913);e.exports=function(e,t,i){for(var s=a(t),c=r.f,l=o.f,d=0;d<s.length;d++){var p=s[d];n(e,p)||i&&n(i,p)||c(e,p,l(t,p))}}},7750:(e,t,i)=>{var n=i(4117),a=TypeError;e.exports=function(e){if(n(e))throw new a("Can't call method on "+e);return e}},7751:(e,t,i)=>{var n=i(4576),a=i(4901);e.exports=function(e,t){return arguments.length<2?(i=n[e],a(i)?i:void 0):n[e]&&n[e][t];var i}},8014:(e,t,i)=>{var n=i(1291),a=Math.min;e.exports=function(e){var t=n(e);return t>0?a(t,9007199254740991):0}},8111:(e,t,i)=>{var n=i(6518),a=i(4576),o=i(679),r=i(8551),s=i(4901),c=i(2787),l=i(2106),d=i(4659),p=i(9039),u=i(9297),y=i(8227),f=i(7657).IteratorPrototype,m=i(3724),g=i(6395),h="constructor",v="Iterator",b=y("toStringTag"),w=TypeError,x=a[v],I=g||!s(x)||x.prototype!==f||!p((function(){x({})})),S=function(){if(o(this,f),c(this)===f)throw new w("Abstract class Iterator not directly constructable")},T=function(e,t){m?l(f,e,{configurable:!0,get:function(){return t},set:function(t){if(r(this),this===f)throw new w("You can't redefine this property");u(this,e)?this[e]=t:d(this,e,t)}}):f[e]=t};u(f,b)||T(b,v),!I&&u(f,h)&&f[h]!==Object||T(h,S),S.prototype=f,n({global:!0,constructor:!0,forced:I},{Iterator:S})},8227:(e,t,i)=>{var n=i(4576),a=i(5745),o=i(9297),r=i(3392),s=i(4495),c=i(7040),l=n.Symbol,d=a("wks"),p=c?l.for||l:l&&l.withoutSetter||r;e.exports=function(e){return o(d,e)||(d[e]=s&&o(l,e)?l[e]:p("Symbol."+e)),d[e]}},8237:(e,t,i)=>{var n=i(6518),a=i(2652),o=i(9306),r=i(8551),s=i(1767),c=TypeError;n({target:"Iterator",proto:!0,real:!0},{reduce:function(e){r(this),o(e);var t=s(this),i=arguments.length<2,n=i?void 0:arguments[1],l=0;if(a(t,(function(t){i?(i=!1,n=t):n=e(n,t,l),l++}),{IS_RECORD:!0}),i)throw new c("Reduce of empty iterator with no initial value");return n}})},8480:(e,t,i)=>{var n=i(1828),a=i(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,a)}},8551:(e,t,i)=>{var n=i(34),a=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(a(e)+" is not an object")}},8622:(e,t,i)=>{var n=i(4576),a=i(4901),o=n.WeakMap;e.exports=a(o)&&/native code/.test(String(o))},8686:(e,t,i)=>{var n=i(3724),a=i(9039);e.exports=n&&a((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8727:e=>{e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8773:(e,t)=>{var i={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,a=n&&!i.call({1:2},1);t.f=a?function(e){var t=n(this,e);return!!t&&t.enumerable}:i},8872:(e,t,i)=>{i(8237)},8981:(e,t,i)=>{var n=i(7750),a=Object;e.exports=function(e){return a(n(e))}},8992:(e,t,i)=>{i(8111)},9039:e=>{e.exports=function(e){try{return!!e()}catch(e){return!0}}},9297:(e,t,i)=>{var n=i(9504),a=i(8981),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(a(e),t)}},9306:(e,t,i)=>{var n=i(4901),a=i(6823),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(a(e)+" is not a function")}},9433:(e,t,i)=>{var n=i(4576),a=Object.defineProperty;e.exports=function(e,t){try{a(n,e,{value:t,configurable:!0,writable:!0})}catch(i){n[e]=t}return t}},9462:(e,t,i)=>{var n=i(9565),a=i(2360),o=i(6699),r=i(6279),s=i(8227),c=i(1181),l=i(5966),d=i(7657).IteratorPrototype,p=i(2529),u=i(9539),y=s("toStringTag"),f="IteratorHelper",m="WrapForValidIterator",g=c.set,h=function(e){var t=c.getterFor(e?m:f);return r(a(d),{next:function(){var i=t(this);if(e)return i.nextHandler();if(i.done)return p(void 0,!0);try{var n=i.nextHandler();return i.returnHandlerResult?n:p(n,i.done)}catch(e){throw i.done=!0,e}},return:function(){var i=t(this),a=i.iterator;if(i.done=!0,e){var o=l(a,"return");return o?n(o,a):p(void 0,!0)}if(i.inner)try{u(i.inner.iterator,"normal")}catch(e){return u(a,"throw",e)}return a&&u(a,"normal"),p(void 0,!0)}})},v=h(!0),b=h(!1);o(b,y,"Iterator Helper"),e.exports=function(e,t,i){var n=function(n,a){a?(a.iterator=n.iterator,a.next=n.next):a=n,a.type=t?m:f,a.returnHandlerResult=!!i,a.nextHandler=e,a.counter=0,a.done=!1,g(this,a)};return n.prototype=t?v:b,n}},9504:(e,t,i)=>{var n=i(616),a=Function.prototype,o=a.call,r=n&&a.bind.bind(o,o);e.exports=n?r:function(e){return function(){return o.apply(e,arguments)}}},9519:(e,t,i)=>{var n,a,o=i(4576),r=i(2839),s=o.process,c=o.Deno,l=s&&s.versions||c&&c.version,d=l&&l.v8;d&&(a=(n=d.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!a&&r&&(!(n=r.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=r.match(/Chrome\/(\d+)/))&&(a=+n[1]),e.exports=a},9539:(e,t,i)=>{var n=i(9565),a=i(8551),o=i(5966);e.exports=function(e,t,i){var r,s;a(e);try{if(!(r=o(e,"return"))){if("throw"===t)throw i;return i}r=n(r,e)}catch(e){s=!0,r=e}if("throw"===t)throw i;if(s)throw r;return a(r),i}},9565:(e,t,i)=>{var n=i(616),a=Function.prototype.call;e.exports=n?a.bind(a):function(){return a.apply(a,arguments)}},9617:(e,t,i)=>{var n=i(5397),a=i(5610),o=i(6198),r=function(e){return function(t,i,r){var s=n(t),c=o(s);if(0===c)return!e&&-1;var l,d=a(r,c);if(e&&i!=i){for(;c>d;)if((l=s[d++])!=l)return!0}else for(;c>d;d++)if((e||d in s)&&s[d]===i)return e||d||0;return!e&&-1}};e.exports={includes:r(!0),indexOf:r(!1)}}},t={};function i(n){var a=t[n];if(void 0!==a)return a.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,i),o.exports}i.d=(e,t)=>{for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),i.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),i.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};i.r(n),i.d(n,{SeamlyStaticCore:()=>ze,default:()=>Ue}),i(4114);const a=require("@seamly/web-ui"),o=require("preact");i(8992),i(2577),i(8872);const r=require("preact/hooks");i(1454);const s={direction:"to_translation_locale",locale:"nl",translatedBy:"deep_l",data:{}};function c(e){switch(e.payload.type){case"cta":case"image":case"text":case"choice_prompt":return{...e,payload:{...e.payload,translatedBody:{...s,data:{...e.payload.body,text:e.payload.body.text?`NL - ${e.payload.body.text}`:void 0,description:e.payload.body.description?`NL - ${e.payload.body.description}`:void 0,buttonText:e.payload.body.buttonText?`NL - ${e.payload.body.buttonText}`:void 0,choices:e.payload.body.choices?e.payload.body.choices.map((e=>({...e,text:`NL - ${e.text}`}))):void 0,prompt:e.payload.body.prompt?{...e.payload.body.prompt,text:`NL - ${e.payload.body.prompt.text}`}:void 0}}}};default:return e}}const l={events:[],config:{layoutMode:"inline",accountConfig:{},hideOnNoUserResponse:!1,showDisclaimer:!1,showSuggestions:!0,preChat:!0},context:{},initialState:{},unreadEvents:0,loadedImageEventIds:[],isLoading:!1,idleDetachCountdown:{hasCountdown:!1,isActive:!1},resumeConversationPrompt:!1,visibility:{visibility:a.visibilityStates.open},serviceInfo:{activeServiceSessionId:""},participantInfo:{participants:{},currentAgent:""},headerTitles:{title:"Test title",subTitle:"Test subtitle"},interrupt:{error:void 0},historyLoaded:!1,skiplinkTargetId:(0,a.randomId)(),optionsButtonId:(0,a.randomId)(),serviceData:{},options:{features:{},panelActive:!1,optionActive:"",userSelectedOptions:{}},entryMeta:{default:"text",active:"text",userSelected:null,options:{},optionsOverride:{}},currentUploads:[],processingFileUploads:[]},d={participants:{agent:{id:"agent",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},user:{id:"user",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}}},currentAgent:"agent"},p={type:"info",payload:{body:{subtype:"new_topic",type:"divider"},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),transactionId:"_1y9pz5fbyly",type:"divider"}},u={type:"info",payload:{body:{language:"Nederlands",restartButtonText:null,subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",title:"[NL] Translating to Dutch",translationEnabled:!0,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},y={type:"info",payload:{body:{language:"Nederlands",subtype:"new_translation",text:"[NL] Automatic translation to Dutch started. Please note that automatic translations may contain errors.",translationEnabled:!0,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},f={type:"info",payload:{body:{language:"Nederlands",restartButtonText:"[NL] Start again",subtype:"new_translation",text:null,title:"[NL] Automatic translation to Dutch ended",translationEnabled:!1,userLocale:"nl"},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),occurredAt:0x5c68711878df3,participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,translatedBody:null,type:"divider"}},m={type:"info",payload:{body:{text:"This is a system generated info message",type:"text"},fromClient:!1,id:(0,a.randomId)(),participant:null,service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:null,type:"text"}},g={type:"info",payload:{body:{key:["info","sendTranscript","accepted"],variables:{emailAddress:"test@test.com"}},fromClient:!1,id:(0,a.randomId)(),participant:null,service:{meta:{},name:null,serviceSessionId:null},transactionId:null,type:"translation"}},h={title:"You're talking to",subTitle:"Mrs. Bot"},v={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"received",participant:{avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAsMTQuOGMtMS4xLDAtMi0wLjktMi0yczAuOS0yLDItMnMyLDAuOSwyLDJTMTEuMSwxNC44LDEwLDE0Ljh6IE0xNS45LDE0LjhjMS4xLDAsMi0wLjksMi0ycy0wLjktMi0yLTIKCXMtMiwwLjktMiwyUzE0LjgsMTQuOCwxNS45LDE0Ljh6IE0yMS44LDEwLjhjLTEuMSwwLTIsMC45LTIsMnMwLjksMiwyLDJzMi0wLjksMi0yUzIyLjksMTAuOCwyMS44LDEwLjh6IE0yMS4zLDE4LjFIMTAuNwoJQzExLjcsMjMuOSwyMC4yLDIzLjksMjEuMywxOC4xeiIvPgo8L3N2Zz4K",id:"agent",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},b={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"received",participant:{introduction:"Welcome, you are now chatting with Mrs. Bot 2, give me a minit to read back the chat history.",id:"agent",avatar:"data:image/svg+xml;base64,PHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHg9IjBweCIgeT0iMHB4IgoJIHZpZXdCb3g9IjAgMCAzMiAzMiIgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMzIgMzIiIHhtbDpzcGFjZT0icHJlc2VydmUiPgo8cGF0aCBmaWxsPSIjNEE0OEMxIiBkPSJNMTAuMSwxNC45Yy0xLjEsMC0yLTAuOS0yLTJzMC45LTIsMi0yczIsMC45LDIsMlMxMS4yLDE0LjksMTAuMSwxNC45eiBNMjEuOSwxMC45Yy0xLjEsMC0yLDAuOS0yLDIKCXMwLjksMiwyLDJzMi0wLjksMi0yUzIzLDEwLjksMjEuOSwxMC45eiBNMjEuNCwxOC4ySDEwLjhDMTEuOCwyNCwyMC4zLDI0LDIxLjQsMTguMnogTTE3LjIsMjUuM2gtMi40Yy0wLjYsMC0xLjIsMC40LTEuNCwxCgljLTUuMS0wLjItOS4yLTQuNC05LjQtOS42YzAuMSwwLDAuMiwwLjEsMC40LDAuMWgwLjFjMC44LDAsMS40LTAuNiwxLjQtMS40di00LjdjMC0wLjgtMC42LTEuNC0xLjQtMS40aDBjLTAuOCwwLTEuNCwwLjYtMS40LDEuNAoJdjIuN3YydjEuMWMwLDUuOSw0LjcsMTAuNiwxMC41LDEwLjhjMC4yLDAuNSwwLjcsMC44LDEuMiwwLjhoMi40YzAuOCwwLDEuNC0wLjYsMS40LTEuNFMxOCwyNS4zLDE3LjIsMjUuM3oiLz4KPC9zdmc+Cg==",name:"Two",service:{expose:{map:{},version:3},meta:{},name:"new service",serviceSessionId:(0,a.randomId)(),settings:{}}},transactionId:(0,a.randomId)(),type:"participant"}},w={type:"participant",payload:{fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"received",participant:{id:"user",introduction:"You're now talking to Mrs. Bot gimme a minit",name:"Mrs. Bot",service:{expose:{map:{},version:2},meta:{},name:null,service_session_id:null,settings:{}}},transactionId:"d63655bf-1d3d-42cf-b14e-4da9e2b6a642",type:"participant"}},x=({type:e,data:t,text:i})=>({type:"message",payload:{body:{type:e,text:i,data:t},participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},fromClient:!1,fromHistory:!0,id:"4efacb4d-28a0-454e-8e36-3f17eb598c5d",messageStatus:"read",transactionId:"6f9beee7-ce82-418e-9bec-8001079aa769",transactionLast:!0,type:"custom"}}),I={type:"message",payload:{body:{text:"What do you want to do?",type:"text",data:void 0},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},S={type:"message",payload:{type:"splash",id:(0,a.randomId)(),body:{text:"Example splash message ✨",type:"text",variables:{}}}},T={type:"message",payload:{body:{description:"Thanks for chatting!\n\nMore info about our <strong>products</strong>?",buttonLink:"https://seamly.ai",buttonText:"View website",buttonNewTab:!0},type:"cta",fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792z",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1}},M={type:"message",payload:{body:{text:"What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am. What do you want to do? This is a really long message from a bot that has a lot to say about a lot of things. Currently I am contemplating my own bot existence and constantly asking myself who I am.",type:"text"},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!1,type:"text"}},j={type:"message",payload:{body:{text:"Bubble with <strong>bold</strong> <em>italic</em> <u>underline</u>",type:"text"},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},E={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},L={type:"message",payload:{body:{text:'Here is a long link <a href="https://google.com" data-link-id="1">click me click me please click me yoohoooo please please click me here I am click me now what are you waiting for click me now now now now now click meeeeeeeeeeeeee</a> embedded in text',type:"text"},fromClient:!1,fromHistory:!0,id:"a964e54e-ea98-46ff-a952-979a47f162c0",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},C={type:"message",payload:{body:{text:"\n <ul>\n <li>Short list item</li>\n <li>This list item is longer to showcase different type lengths of text in list items and how they reflow in the browser</li>\n <li>\n This list item has a nested list with 3 items in it.\n <ul>\n <li>First item</li>\n <li>second item</li>\n <li>Third item</li>\n </ul>\n </li>\n <li>Another one just to be sure :)</li>\n </ul>\n ",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},O={type:"message",payload:{body:{text:"\n <ol>\n <li>Short list item</li>\n <li>This list item is longer to showcase different type lengths of text in list items and how they reflow in the browser</li>\n <li>\n This list item has a nested list with 3 items in it.\n <ol>\n <li>First item</li>\n <li>second item</li>\n <li>Third item</li>\n </ol>\n </li>\n <li>Another one just to be sure :)</li>\n </ol>\n ",type:"text"},fromClient:!1,fromHistory:!0,id:"f5351010-0def-452d-818f-ca22ac61792a",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"text"}},N={type:"message",payload:{body:{description:"Plaatje",isZoomable:!1,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f7",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},A={type:"message",payload:{body:{description:"Plaatje",isZoomable:!0,type:"image",url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-portrait.jpg"},fromClient:!1,fromHistory:!0,id:"b44ef42c-880c-43ff-b067-499e7f2e81f8",messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"image"}},z={type:"message",payload:{body:{description:"test",source:"youtube",type:"video",url:"https://www.youtube.com/embed/K7Hn1rPQouU"},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{hideFeedback:"true"}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"d0cc13da-337a-4108-9db1-cb8a3b3a1446",transactionLast:!1,type:"video"}},k={type:"message",payload:{body:{choices:[{id:"703db9b3-2157-4d4a-9f9b-c382c6a10531",text:"Dialog (this is intentionally made longer for testing purposes)",type:"choice"},{id:"1eff6098-f14f-4683-a2b8-30d1c573d45e",text:"T-Dialog",type:"choice"},{id:"a8ba3ce8-3324-4e7a-accc-944ff78ac890",text:"Customers",type:"choice"},{id:"c89956ab-cf98-4b7e-9282-7087c988153d",text:"Features",type:"choice"},{id:"9fd9a28f-462d-4f07-9661-606dbe3b9466",category:"secondary",text:"Something else",type:"choice"}],chooseAgain:!0,prompt:{text:"Here are some choice prompt options to choose from",type:"text",variables:{}},type:"choice_prompt"},fromClient:!1,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"read",participant:"agent",service:{meta:{additions:{}},name:"bot",serviceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},transactionId:"b947b684-93df-4bd9-a8ea-e2f1b5a7a480",transactionLast:!0,type:"choice_prompt"}},P={type:"message",payload:{body:{text:"This is what the user typed",type:"text"},fromClient:!0,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},D={type:"message",payload:{body:{text:"This is what the user typed. And sometimes the user has quite a lot to say and then we get longer lines that need to wrap well and not break the styling so here goes with just such a line right here!!",type:"text"},fromClient:!0,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},_={type:"message",payload:{body:{text:'<a href="https://google.com" data-link-id="1">Link in same window</a> and <a href="https://google.com" data-link-id="2" target="_blank">link in new window</a> embedded in text',type:"text"},fromClient:!0,fromHistory:!0,id:(0,a.randomId)(),messageStatus:"read",participant:"user",transactionId:"1cdefea9-7437-4672-bcf8-2c75dc99244c",transactionLast:null,type:"text"}},R={type:"upload",transactionId:(0,a.randomId)(),meta:{},body:{contentType:"plain/text",filename:"This-is-an-example.txt",filesize:12,id:(0,a.randomId)(),isDeleted:!1}},F={type:"upload",transactionId:(0,a.randomId)(),meta:{},body:{contentType:"application/pdf",filename:"This-is-a-sample.pdf",filesize:18810,id:"",isDeleted:!1,url:"https://pdfobject.com/pdf/sample.pdf"}},H={type:"upload",transactionId:(0,a.randomId)(),meta:{},body:{contentType:"image/jpeg",filename:"image-square-small.jpg",filesize:12020,id:"",isDeleted:!1,url:"https://developers.seamly.ai/clients/web-ui/static/photos/image-square-small.jpg"}},U={type:"message",payload:{...R,fromClient:!1,participant:"agent",id:(0,a.randomId)()}},G={type:"message",payload:{...F,fromClient:!1,participant:"agent",id:(0,a.randomId)()}},B={type:"message",payload:{...H,fromClient:!1,participant:"agent",id:(0,a.randomId)()}};sessionStorage.setItem(`image-${B.payload.id}`,B.payload.body.url);const W={...B,payload:{...B.payload,body:{...B.payload.body,isDeleted:!0,url:void 0},id:(0,a.randomId)()}},$={type:"message",payload:{...H,fromClient:!0,participant:"user",id:(0,a.randomId)()}};sessionStorage.setItem(`image-${$.payload.id}`,$.payload.body.url);const q={...$,payload:{...$.payload,id:(0,a.randomId)(),body:{...$.payload.body,url:null}}},X={isActive:!1,currentLocale:void 0,isAvailable:!1,showTranslationProposal:!1,languages:[],translatedEventGroups:{},containerId:(0,a.randomId)()},J=[{id:"1",question:"Invoices",categories:["mixed","short"]},{id:"2",question:"Temporary subscription pause",categories:["mixed","medium"]},{id:"3",question:"Cancellation",categories:["mixed","short"]},{id:"4",question:"Apps",categories:["mixed","medium"]},{id:"5",question:"At what date will my subscription end?",categories:["mixed","long"]},{id:"A",question:"Quotes",categories:["short"]},{id:"B",question:"How to get in touch with us",categories:["long"]}],Y="unstarted",Z="messages",K="errors",Q="uploads",V="features",ee="options",te="suggestions",ie="minimizedWindow",ne="minimizedInline",ae="translations",oe={[Y]:{heading:"Unstarted UI",description:"Test the loader here"},[Z]:{heading:"Messages",description:""},[K]:{heading:"UI errors",description:""},[Q]:{heading:"File uploads",description:""},[V]:{heading:"Other features",description:""},[ee]:{heading:"Options",description:""},[te]:{heading:"Suggestions",description:""},[ie]:{heading:"Minimized window",desciption:""},[ne]:{heading:"Minimized Inline",description:""},[ae]:{heading:"Translations",description:""}},re={type:"message",payload:{type:"card",id:(0,a.randomId)(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-square.jpg",title:"Pizza Margherita"}}},se={type:"message",payload:{type:"card",id:(0,a.randomId)(),body:{action:{link:"https://seamly.ai",newTab:!0,type:"navigate"},buttonText:"Order now!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-landscape.jpg",title:"Pizza Margherita"}}},ce={type:"message",payload:{type:"card",id:(0,a.randomId)(),body:{action:{topic:"Set topic",type:"topic"},buttonText:"Set topic! (title & description optional)",image:"https://developers.seamly.ai/clients/web-ui/static/photos/card-portrait.jpg"}}},le={type:"message",payload:{type:"card",id:(0,a.randomId)(),body:{action:{ask:"",type:"ask"},buttonText:"Ask about pizzas!",description:"Pizza Margherita is a <strong>typical Neapolitan pizza</strong>.\n\nIt is made with San Marzano tomatoes, mozzarella cheese, fresh basil, salt, and extra-virgin olive oil.",title:"Pizza Margherita"}}},de={base:{category:Y,headingText:"Standard with loader",description:"",...l,isLoading:!0},fullConversation:{category:Z,headingText:"Full demo conversation",description:"",...l,participantInfo:d,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[v,m,I,{...k,payload:{...k.payload,id:`${k.payload.id}XXX`}},M,b,P,j,_,p,N,U,G,B,W,D,z,E,L,A,$,q,C,O,k,T]},userMessages:{category:Z,headingText:"User messages",description:"",...l,participantInfo:d,events:[P,D,$,q,_]},withParticipants:{category:Z,headingText:"Messages with participant info",description:"",...l,config:{...l.config,overrideMessages:{agent:{showAvatar:!0,showName:!0},user:{showName:!0,showAvatar:!0}}},participantInfo:d,events:[I,P,M,D]},textMessages:{category:Z,headingText:"Text messages",description:"",...l,participantInfo:d,events:[I,M,j,E,L,C,O]},ctaMessages:{category:Z,headingText:"CTA (call to action) messages",description:"",...l,participantInfo:d,events:[T]},imageVideoMessages:{category:Z,headingText:"Download, image and video messages",description:"",...l,participantInfo:d,events:[N,z,A,U,G,B,W,$,q]},systemMessages:{category:Z,headingText:"System messages",description:"",...l,config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:d,events:[{type:"message",payload:{...I.payload,occurredAt:1e3*(Date.now()-432e6),id:(0,a.randomId)(),body:{text:"Long ago when a dialog started",type:"text"}}},v,w,b,p,g,...[u,f].map(c),m]},choicePromptMessages:{category:Z,headingText:"Choice prompt messages",description:"",...l,participantInfo:d,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{...k,payload:{...k.payload,id:`${k.payload.id}XXX`}},I,k]},choicePromptMessageWithoutManualInput:{category:Z,headingText:"Choice prompt message without manual input",description:"",...l,entryMeta:{...l.entryMeta,options:{text:{allowManualInput:!1}}},events:[k],participantInfo:d,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"}},timeIndicators:{category:Z,headingText:"Time Indicators",description:"",...l,config:{overrideMessages:{timeIndicator:{enabled:!0,threshold:36e5}}},participantInfo:d,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{...I.payload,occurredAt:1e3*(Date.now()-432e6),id:(0,a.randomId)(),body:{text:"Long ago when a dialog started",type:"text"}}},{type:"message",payload:{...I.payload,occurredAt:1e3*(Date.now()-3456e5),id:(0,a.randomId)(),body:{text:"Above me should be a time indicator showing the full date",type:"text"}}},{type:"message",payload:{...I.payload,occurredAt:1e3*(Date.now()+1-3456e5),id:(0,a.randomId)(),body:{text:"Another message",type:"text"}}},{type:"message",payload:{...I.payload,occurredAt:1e3*(Date.now()+2-3456e5),id:(0,a.randomId)(),body:{text:"And another message",type:"text"}}},{type:"message",payload:{...I.payload,occurredAt:1e3*(Date.now()-864e5),id:(0,a.randomId)(),body:{text:'Above me should be a time indicator showing "yesterday"',type:"text"}}},{type:"message",payload:{...I.payload,occurredAt:1e3*(Date.now()+1-864e5),id:(0,a.randomId)(),body:{text:"Another message",type:"text"}}},{type:"message",payload:{...I.payload,occurredAt:1e3*(Date.now()+2-864e5),id:(0,a.randomId)(),body:{text:"And another message",type:"text"}}},{type:"message",payload:{...I.payload,occurredAt:1e3*Date.now(),id:(0,a.randomId)(),body:{text:"Above me should be a time indicator showing me the dialog continues today",type:"text"}}}]},cards:{category:Z,headingText:"Cards",description:"",...l,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[re,se,ce,le]},carousel:{category:Z,headingText:"Carousel",description:"",...l,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[{type:"message",payload:{type:"carousel",id:(0,a.randomId)(),body:{cards:[re.payload.body,se.payload.body,ce.payload.body,le.payload.body]}}}]},errorWithAction:{category:K,headingText:"Error with a user action",description:"",...l,interrupt:{error:new a.SeamlyGeneralError(new Error("general error"))}},errorWithoutAction:{category:K,headingText:"Error without a user action",description:"",...l,interrupt:{error:new a.SeamlyOfflineError(new Error("seamly offline error"))}},privacyDisclaimer:{category:V,headingText:"Privacy disclaimer",description:"",...l,config:{...l.config,showDisclaimer:!0}},characterLimit:{category:V,headingText:"Input character limit",description:"",...l,entryMeta:{default:"text",active:"text",userSelected:null,options:{text:{limit:120}},optionsOverride:{}}},inputLabel:{category:V,headingText:"Input label",...l,entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{text:{label:"What is your name?",limit:null,placeholder:"Please enter your name"}}}},inputLabelWithFileUploadToggle:{category:V,headingText:"Input label with file upload toggle button",...l,options:{...l.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{text:{label:"What is the title of the uploaded document?",limit:null,placeholder:"Please enter the title of the document"}}}},abortTransactional:{category:V,headingText:"Abort transaction",...l,events:[I,P],entryMeta:{default:"text",active:"text",options:{text:{limit:null}},optionsOverride:{},actions:{abortTransaction:{label:"Ask for another question",topicFallbackMessage:"Oops...",topicName:"abort_transaction"}},translatedActions:{}}},fileUploadToggle:{category:Q,headingText:"File upload toggle button",description:"",...l,options:{...l.options,features:{uploads:{enabled:!0}}}},fileUploadToggleHidden:{category:Q,headingText:"File upload toggle button hidden",description:"",...l,options:{...l.options,features:{uploads:{enabled:!1}}}},fileUploadInput:{category:Q,headingText:"File upload input",description:"Click on upload button to see an error",styleGuideReset:!0,...l,config:{...l.config,accountConfig:{features:{uploads:!0}}},options:{...l.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}}},fileUploadBusy:{category:Q,headingText:"File upload in progress",description:"",styleGuideReset:!0,...l,config:{...l.config,accountConfig:{features:{uploads:!0}}},options:{...l.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:29,uploading:!0,complete:!1,error:"",uploadHandle:{abort:()=>{}}}]},fileUploadError:{category:Q,headingText:"File upload errored",description:"",styleGuideReset:!0,...l,config:{...l.config,accountConfig:{features:{uploads:!0}}},options:{...l.options,features:{uploads:{enabled:!0}}},entryMeta:{default:"text",active:"text",userSelected:"upload",options:{upload:{allowedMimeTypes:["image/*","application/pdf"],maxSize:10485760}},optionsOverride:{}},currentUploads:[{id:"_2olggurqhb4",name:"gGeyr3WepujbGn7khx.gif",progress:0,uploading:!1,complete:!1,error:"Something went wrong with the upload",uploadHandle:{abort:()=>{}}}]},idleTimerCountdown:{category:V,headingText:"Idle timer with countdown",description:"",...l,idleDetachCountdown:{hasCountdown:!0,isActive:!0,count:120,remaining:91,timer:{minutes:1,seconds:31}}},idleTimerNoCountdown:{category:V,headingText:"Idle timer without countdown",description:"",...l,idleDetachCountdown:{hasCountdown:!0,isActive:!1,count:120,remaining:91,timer:{minutes:1,seconds:31}}},resumeConversationPrompt:{category:V,headingText:"Resume conversation prompt",description:"",...l,participantInfo:d,resumeConversationPrompt:!0},optionsSingleTriggerAvailable:{category:ee,headingText:"Single option available",description:"",...l,options:{...l.options,features:{sendTranscript:{enabled:!0}}}},optionsSingleTriggerUnavailable:{category:ee,headingText:"Single option",description:"Option unavailable",...l,options:{...l.options,features:{sendTranscript:{enabled:!1}}}},optionsMultiple:{category:ee,headingText:"Multiple options",description:"All options available",...l,options:{...l.options,features:{extraMenuItem:{enabled:!0},sendTranscript:{enabled:!0}}}},optionsMultipleUnavailable:{category:ee,headingText:"Multiple options",description:"Some unavailable",...l,options:{...l.options,features:{extraMenuItem:{enabled:!1},sendTranscript:{enabled:!0}}}},optionSendTranscript:{category:ee,headingText:"Send transcript option",description:"Press submit to view error message",...l,options:{...l.options,optionActive:"sendTranscript",panelActive:!0,features:{sendTranscript:{enabled:!0}}}},translationsAvailable:{category:ae,headingText:"Show translations available",description:"",...l,translations:{...X,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationsAvailableWithOptions:{category:ae,headingText:"Show translations available with other options available",description:"",...l,options:{...l.options,features:{sendTranscript:{enabled:!0}}},config:{...l.config,context:{...l.context,contentLocale:"nl",userLocale:"en"}},translations:{...X,isAvailable:!0,currentLocale:"lv",isActive:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]}},translationsActive:{category:ae,headingText:"Show translations active",description:"",...l,translations:{...X,currentLocale:"nl",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationsActiveLarge:{category:ae,headingText:"Show translations active (large list)",description:"",...l,config:{...l.config,context:{...l.context,contentLocale:"nl",userLocale:"en"}},translations:{...X,currentLocale:"lv",isActive:!0,isAvailable:!0,languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"},{locale:"ar",nativeName:"Arabic"},{locale:"bg",nativeName:"Bulgarian"},{locale:"zh",nativeName:"Chinese"},{locale:"cs",nativeName:"Czech"},{locale:"da",nativeName:"Danish"},{locale:"et",nativeName:"Estonian"},{locale:"fi",nativeName:"Finnish"},{locale:"fr",nativeName:"French"},{locale:"de-informal",nativeName:"German"},{locale:"el",nativeName:"Greek"},{locale:"hu",nativeName:"Hungarian"},{locale:"it",nativeName:"Italian"},{locale:"ja",nativeName:"Japanese"},{locale:"lv",nativeName:"Latvian"},{locale:"pl",nativeName:"Polish"},{locale:"ro",nativeName:"Romanian"},{locale:"ru",nativeName:"Russian"},{locale:"sk",nativeName:"Slovak"},{locale:"sl",nativeName:"Slovenian"},{locale:"es-informal",nativeName:"Spanish"},{locale:"sv",nativeName:"Swedish"},{locale:"ti",nativeName:"Tigrinya"},{locale:"tr",nativeName:"Turkish"},{locale:"uk",nativeName:"Ukrainian"}]}},translationsFullConversation:{category:ae,headingText:"Show translated messages",description:"",...l,participantInfo:d,serviceInfo:{activeServiceSessionId:"3942159e-9878-469e-9120-f44fd6be0f35"},events:[u,m,I,{...k,payload:{...k.payload,id:`${k.payload.id}XXX`}},M,P,j,p,y,f,N,U,G,B,W,D,z,E,L,A,$,q,C,O,k,T,f].map(c),translations:{...X,currentLocale:"nl",isActive:!0,isAvailable:!0,translatedEventGroups:{[u.payload.id]:[m,I,{...k,payload:{...k.payload,id:`${k.payload.id}XXX`}},M,P,j,p].map((e=>e.payload.id)),[y.payload.id]:[N,U,G,B,W,D,z,E,L,A,$,q,C,O,k,T].map((e=>e.payload.id))},languages:[{locale:"nl",nativeName:"Dutch"},{locale:"en",nativeName:"English"}]}},translationProposal:{category:ae,headingText:"Show translation proposal",description:"",...l,events:[I,P,D],config:{...l.config,showDisclaimer:!0,context:{contentLocale:"nl-informal",userLocale:"en-GB"}},translations:{...X,translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal",titleLabel:"Do you want to chat in English?"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]}},translationProposalWithoutTitle:{category:ae,headingText:"Show translation proposal without title",description:"",...l,events:[I,P,D],config:{...l.config,showDisclaimer:!0,context:{contentLocale:"nl-informal",userLocale:"en-GB"}},translations:{...X,translationProposal:{buttonLabel:"Activate",proposedLocale:"en-GB",srDismissButtonText:"Dismiss translation proposal"},isAvailable:!0,isActive:!1,languages:[{locale:"nl-informal",nativeName:"Dutch"},{locale:"en-GB",nativeName:"English"}]}}},pe={minimizedInline:{category:ne,headingText:"Inline minimized",description:"",inline:{...l,config:{...l.config,layoutMode:"inline"},visibility:{...l.visibility,visibility:a.visibilityStates.minimized}}},minimizedInlineCharacterLimit:{category:ne,headingText:"Inline minimized with limited characters",description:"",inline:{...l,config:{...l.config,layoutMode:"inline"},visibility:{...l.visibility,visibility:a.visibilityStates.minimized},entryMeta:{...l.entryMeta,options:{text:{limit:120}}}}},minimizedInlinePrechat:{category:ne,headingText:"Inline minimized with pre-chat messages",description:"",inline:{...l,config:{...l.config,layoutMode:"inline",preChatEvents:[S]},visibility:{...l.visibility,visibility:a.visibilityStates.minimized}}},minimizedInlinePrechatSuggestions:{category:ne,headingText:"Inline minimized with pre-chat messages & suggestions",description:"",inline:{...l,config:{...l.config,layoutMode:"inline",preChatEvents:[S]},serviceData:{suggestion:{body:J}},visibility:{...l.visibility,visibility:a.visibilityStates.minimized}}},inlineWithSuggestions:{category:te,headingText:"Suggestions",description:"",inline:{...l,config:{...l.config,layoutMode:"inline"},visibility:{...l.visibility,visibility:a.visibilityStates.open},serviceData:{suggestion:{body:J}}}},minimizedInlineWithError:{category:ne,headingText:"Inline minimized with error",description:"",inline:{...l,config:{...l.config,layoutMode:"inline"},visibility:{...l.visibility,visibility:a.visibilityStates.minimized},interrupt:{error:new a.SeamlyOfflineError(new Error("seamly offline error"))}}}},ue={minimizedWindow:{category:ie,headingText:"Unstarted minimized",description:"",window:{...l,config:{...l.config,layoutMode:"window"},visibility:{...l.visibility,visibility:a.visibilityStates.minimized}}},minimizedWindowStarted:{category:ie,headingText:"Started minimized",description:"",window:{...l,config:{...l.config,layoutMode:"window"},visibility:{...l.visibility,visibility:a.visibilityStates.minimized},participantInfo:d,headerTitles:h}},minimizedWindowStartedUnread:{category:ie,headingText:"Minimized with unread messages",description:"",window:{...l,config:{...l.config,layoutMode:"window"},visibility:{...l.visibility,visibility:a.visibilityStates.minimized},participantInfo:d,headerTitles:h,unreadEvents:12}}},ye={suggestionsMessage:{category:Z,headingText:"Suggestions message",description:"",...l,events:[x(I.payload.body),{type:"service_data",payload:{type:"suggestion",body:J}}]}},fe=(e,t=[])=>{const i={...de,fullConversation:{...de.fullConversation,events:[S,...de.fullConversation.events]},...ye,...t.reduce(((e,t)=>{const{key:i,headingText:n,description:a,body:o}=t;return{...e,[i]:{category:Z,headingText:n,description:a,...l,participantInfo:d,events:[x(o)]}}}),{})};return Object.keys(i).reduce(((t,n)=>{const{headingText:a,category:o,description:r,...s}=i[n];return{...t,[n]:{headingText:a,description:r,category:o,...e.reduce(((e,t)=>({...e,[t]:{...s,config:{...s.config,layoutMode:t}}})),{})}}}),{})};i(4520),require("preact/compat");const me=require("preact/jsx-runtime"),ge=({setSelectedState:e,states:t,headingLevel:i})=>{const n=`h${i.toString()}`,o=`h${(parseInt(i,10)+1).toString()}`,r=(0,a.getUrlSearchParams)();return(0,me.jsx)("nav",{"aria-label":"Style guide navigation",className:"nav--styleguide",children:(0,me.jsx)("ol",{className:"list--styleguidestates",children:Object.keys(oe).map((i=>{const{heading:s,description:c}=oe[i],l=Object.keys(t).filter((e=>{const{category:n}=t[e];return n===i}));return l.length>0&&(0,me.jsxs)("li",{children:[(0,me.jsx)(n,{children:s}),(0,me.jsx)("span",{className:"category__description",children:c}),(0,me.jsx)("ol",{children:l.map((i=>{const n={...t[i]};delete n.category;const{headingText:s,descriptionId:c,description:l,...d}=n;return(0,me.jsxs)("li",{children:[(0,me.jsx)(o,{id:c,children:s}),l&&(0,me.jsx)("span",{className:"feature__description",children:l}),(0,me.jsx)("ul",{className:"list--styleguidelayouts",children:Object.keys(d).map((t=>(0,me.jsx)("li",{className:t===r?.layoutMode&&i===r?.feature?"state__selected":void 0,children:(0,me.jsx)("a",{"aria-describedby":c,href:`${window.location.pathname}?${(0,a.getUrlSearchString)({layoutMode:t,feature:i})}`,"aria-current":t===r?.layoutMode&&i===r?.feature?"page":void 0,onClick:n=>{if(n.preventDefault(),"inline"===t){const e=window.document.querySelector(".chat-inline");e&&window.scroll({top:e.offsetTop,behavior:"smooth"})}var o;o={layoutMode:t,feature:i},window.history.pushState(null,"",`${window.location.pathname}?${(0,a.getUrlSearchString)(o)}`),e(o)},children:t.charAt(0).toUpperCase()+t.slice(1)})},t)))})]},i)}))})]},i)}))})})};function he(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}i(3949);var ve=(()=>"function"==typeof Symbol&&Symbol.observable||"@@observable")(),be=()=>Math.random().toString(36).substring(7).split("").join("."),we={INIT:`@@redux/INIT${be()}`,REPLACE:`@@redux/REPLACE${be()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${be()}`};function xe(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function Ie(e,t,i){if("function"!=typeof e)throw new Error(he(2));if("function"==typeof t&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw new Error(he(0));if("function"==typeof t&&void 0===i&&(i=t,t=void 0),void 0!==i){if("function"!=typeof i)throw new Error(he(1));return i(Ie)(e,t)}let n=e,a=t,o=new Map,r=o,s=0,c=!1;function l(){r===o&&(r=new Map,o.forEach(((e,t)=>{r.set(t,e)})))}function d(){if(c)throw new Error(he(3));return a}function p(e){if("function"!=typeof e)throw new Error(he(4));if(c)throw new Error(he(5));let t=!0;l();const i=s++;return r.set(i,e),function(){if(t){if(c)throw new Error(he(6));t=!1,l(),r.delete(i),o=null}}}function u(e){if(!xe(e))throw new Error(he(7));if(void 0===e.type)throw new Error(he(8));if("string"!=typeof e.type)throw new Error(he(17));if(c)throw new Error(he(9));try{c=!0,a=n(a,e)}finally{c=!1}return(o=r).forEach((e=>{e()})),e}return u({type:we.INIT}),{dispatch:u,subscribe:p,getState:d,replaceReducer:function(e){if("function"!=typeof e)throw new Error(he(10));n=e,u({type:we.REPLACE})},[ve]:function(){const e=p;return{subscribe(t){if("object"!=typeof t||null===t)throw new Error(he(11));function i(){const e=t;e.next&&e.next(d())}return i(),{unsubscribe:e(i)}},[ve](){return this}}}}}function Se(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce(((e,t)=>(...i)=>e(t(...i))))}function Te(e){return({dispatch:t,getState:i})=>n=>a=>"function"==typeof a?a(t,i,e):n(a)}var Me=Te(),je=Te,Ee="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"==typeof arguments[0]?Se:Se.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;var Le=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}},Ce=e=>t=>{setTimeout(t,e)};function Oe(e){const t=function(e){const{thunk:t=!0,immutableCheck:i=!0,serializableCheck:n=!0,actionCreatorCheck:a=!0}=e??{};let o=new Le;return t&&("boolean"==typeof t?o.push(Me):o.push(je(t.extraArgument))),o},{reducer:i,middleware:n,devTools:a=!0,preloadedState:o,enhancers:r}=e||{};let s,c;if("function"==typeof i)s=i;else{if(!xe(i))throw new Error(`Minified Redux Toolkit error #${l=1}; visit https://redux-toolkit.js.org/Errors?code=${l} for the full message or use the non-minified dev environment for full errors. `);s=function(e){const t=Object.keys(e),i={};for(let n=0;n<t.length;n++){const a=t[n];"function"==typeof e[a]&&(i[a]=e[a])}const n=Object.keys(i);let a;try{!function(e){Object.keys(e).forEach((t=>{const i=e[t];if(void 0===i(void 0,{type:we.INIT}))throw new Error(he(12));if(void 0===i(void 0,{type:we.PROBE_UNKNOWN_ACTION()}))throw new Error(he(13))}))}(i)}catch(e){a=e}return function(e={},t){if(a)throw a;let o=!1;const r={};for(let a=0;a<n.length;a++){const s=n[a],c=i[s],l=e[s],d=c(l,t);if(void 0===d)throw t&&t.type,new Error(he(14));r[s]=d,o=o||d!==l}return o=o||n.length!==Object.keys(e).length,o?r:e}}(i)}var l;c="function"==typeof n?n(t):t();let d=Se;a&&(d=Ee({trace:!1,..."object"==typeof a&&a}));const p=function(...e){return t=>(i,n)=>{const a=t(i,n);let o=()=>{throw new Error(he(15))};const r={getState:a.getState,dispatch:(e,...t)=>o(e,...t)},s=e.map((e=>e(r)));return o=Se(...s)(a.dispatch),{...a,dispatch:o}}}(...c),u=(e=>function(t){const{autoBatch:i=!0}=t??{};let n=new Le(e);return i&&n.push(((e={type:"raf"})=>t=>(...i)=>{const n=t(...i);let a=!0,o=!1,r=!1;const s=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:Ce(10):"callback"===e.type?e.queueNotification:Ce(e.timeout),l=()=>{r=!1,o&&(o=!1,s.forEach((e=>e())))};return Object.assign({},n,{subscribe(e){const t=n.subscribe((()=>a&&e()));return s.add(e),()=>{t(),s.delete(e)}},dispatch(e){try{return a=!e?.meta?.RTK_autoBatch,o=!a,o&&(r||(r=!0,c(l))),n.dispatch(e)}finally{a=!0}}})})("object"==typeof i?i:void 0)),n})(p);return Ie(s,o,d(..."function"==typeof r?r(u):u()))}var{assign:Ne}=Object;Symbol.for("rtk-state-proxy-original");const Ae={send:()=>{},store:{get:e=>e,set:e=>e,delete:e=>e},sendContext:()=>{},hasConversation:()=>!1,connected:!1},ze=({state:e,translations:t,participants:i=[],children:n})=>{const o=(0,r.useRef)((()=>{})),s=(0,r.useRef)({emit:()=>{},on:()=>{},off:()=>{}}),c=(0,r.useMemo)((()=>{const{translations:n,interrupt:o,config:r,visibility:c,...l}=e||{},d=Oe({reducer:{state:a.stateReducer,app:a.appReducer,config:a.configReducer,i18n:a.i18nReducer,translations:a.translationReducer,visibility:a.visibilityReducer,forms:a.formsReducer,interrupt:a.interruptReducer},preloadedState:{state:l,config:r,translations:n,interrupt:o,visibility:c},middleware:e=>e({thunk:{extraArgument:{api:Ae,eventBus:s.current}},serializableCheck:!1})}),{config:p}=d.getState();return d.dispatch((0,a.setConfig)(p)),p.preChatEvents&&d.dispatch((0,a.setPreChatEvents)(p.preChatEvents)),d.dispatch((0,a.setInitialLocale)("en-GB")),d.dispatch((0,a.setTranslations)(t)),i.forEach((e=>{d.dispatch((0,a.setParticipant)({participant:e,fromClient:"user"===e?.id}))})),d}),[i,e,t]);return e&&(0,me.jsx)(a.SeamlyStoreProvider,{store:c,children:(0,me.jsx)(a.SeamlyEventBusContext.Provider,{value:s.current,children:(0,me.jsx)(a.SeamlyApiContext.Provider,{value:Ae,children:(0,me.jsx)(a.SeamlyLiveRegionContext.Provider,{value:o.current,children:(0,me.jsx)(a.ComponentFilter,{children:(0,me.jsx)(a.SeamlyActivityEventContext.Provider,{value:()=>{},children:(0,me.jsx)(a.SeamlyFileUpload,{children:n})})})})})})})},ke=({state:e,customComponents:t={},translations:i,participants:n})=>{const[o,s]=(0,r.useState)(!0),{config:c}=e||{},{layoutMode:l}=c||{},d=t[l];return(0,r.useEffect)((()=>{s(!1),requestAnimationFrame((async()=>{await(0,a.timeout)(60),s(!0)}))}),[e]),o?d?(0,me.jsx)(ze,{state:e,translations:i,participants:n,children:(0,me.jsx)(d,{})}):(0,me.jsx)(ze,{state:e,translations:i,participants:n,children:(0,me.jsx)(a.View,{})}):null},Pe=({tag:e,id:t,children:i})=>{const n=e;return(0,me.jsx)(n,{id:t,children:i})},De=({config:e,styleGuideConfig:t,translations:i,headingLevel:n=2,participants:o})=>{const[s,c]=(0,r.useState)(null),[p,u]=(0,r.useState)(""),[y,f]=(0,r.useState)(!0),[m]=(0,r.useState)((0,a.randomId)()),{stateUpdateCallback:g,customMessageEventBodies:v}=t,[b]=(0,r.useState)((()=>{const e=(i=t.showLayoutModes||["inline","window"],{...fe(i,v),...-1!==i.indexOf("window")?{...ue,minimizedWindowPrechat:{category:ie,headingText:"Minimized with pre-chat messages",description:"",window:{...l,config:{...l.config,layoutMode:"window",preChatEvents:[S]},visibility:{...l.visibility,visibility:a.visibilityStates.minimized},participantInfo:d,headerTitles:h}},minimizedWindowPrechatDelayed:{category:ie,headingText:"Minimized with delayed pre-chat messages",description:"",window:{...l,config:{...l.config,layoutMode:"window",preChatEvents:[S],preChat:{enterDelay:1e3,exitAfter:3e3}},visibility:{...l.visibility,visibility:a.visibilityStates.minimized},participantInfo:d,headerTitles:h}},minimizedWindowPrechatDisabled:{category:ie,headingText:"Minimized with disabled pre-chat messages",description:"",window:{...l,config:{...l.config,layoutMode:"window",preChatEvents:[S],preChat:!1},visibility:{...l.visibility,visibility:a.visibilityStates.minimized},participantInfo:d,headerTitles:h}}}:{},...pe});var i;return Object.keys(e).reduce(((t,i)=>({...t,[i]:{...e[i],descriptionId:(0,a.randomId)()}})),{})})),w=(0,r.useCallback)((e=>{c(g?g(e):e)}),[c,g]),x=(0,r.useCallback)(((t,i)=>{const n=(0,a.getSearchParamsByKeys)("apiKey","locale"),r=new URLSearchParams({...n,layoutMode:t,feature:i});window.history.replaceState(null,"",`?${r}`);const{headingText:s}=b[i];u(s);const c=b[i][t],{overrideMessages:l,showSuggestions:d}=c.config,p=o.find((e=>"agent"===e.id));return{...c,config:{...c.config,...e,showDisclaimer:c.config.showDisclaimer||e.showDisclaimer,context:{...e.context,...c.config?.context},layoutMode:c.config.layoutMode,...l?{messages:l}:{},showSuggestions:d},headerTitles:{...c.headerTitles,subTitle:p?.name||c.headerTitles.subTitle}}}),[b,o,e]);(0,r.useEffect)((()=>{if(y){const e=document.querySelector('[aria-modal="true"]');e&&e.addEventListener("click",(()=>{c((e=>e?{...e,visibility:{...e.visibility,visible:"minimized"}}:e))}))}}),[s,c,y]);const I=(0,r.useCallback)((()=>{const e=(0,a.getUrlSearchParams)(),{layoutMode:t,feature:i}={layoutMode:"inline",feature:"base",...e};w(x(t,i)),window.document.title="Style"}),[x,w]);return(0,r.useEffect)((()=>{I()}),[I]),(0,r.useEffect)((()=>{window.onpopstate=()=>{I()}}),[I]),(0,me.jsxs)(me.Fragment,{children:[(0,me.jsxs)("section",{className:"chat-inline","aria-labelledby":m,children:[(0,me.jsxs)(Pe,{tag:`h${n.toString()}`,id:m,children:[(0,me.jsx)("span",{className:"heading__context",children:"Current selected state:"}),`${p}`]}),(0,me.jsx)("div",{children:y&&(0,me.jsx)(ke,{customComponents:t.customComponents,translations:i,state:s,participants:o})})]}),(0,me.jsx)("aside",{className:"page-aside markdown",children:(0,me.jsx)("nav",{className:"page-controls",children:(0,me.jsx)(ge,{headingLevel:n,setSelectedState:({layoutMode:e,feature:t})=>{const i=x(e,t);w(i),i.styleGuideReset&&(f(!1),setTimeout((()=>{f(!0)})))},states:b})})})]})};class _e extends a.Engine{constructor({styleGuideConfig:e,...t},i){super(t,i),this.styleGuideConfig=e||{}}async render(){const e={...this.config.customComponents||{},view:void 0},t=new a.API({namespace:this.config.namespace||"",config:this.config.api,context:this.config.context,layoutMode:this.config.layoutMode}),i=await t.getTranslations(this.config.context?.userLocale||"en-GB"),{agentParticipant:n,userParticipant:r}=await t.getConfig(),s=[{id:"user",...r},{id:"agent",introduction:"I am {{name}}",...n}],c={...this.config,customComponents:Object.keys(e).length?e:void 0};(0,o.render)((0,me.jsx)(De,{config:c,styleGuideConfig:this.styleGuideConfig,translations:i,participants:s}),this.parentElement)}}const Re=_e;class Fe extends a.ExternalApi{constructor(e,t){super(e),this.styleGuideConfig=t}createInstance(e){const{userStyleGuideConfig:t,...i}=e;return new Re({styleGuideConfig:{...this.styleGuideConfig,...t},...i},this)}getUserConfig(e={},t){return super.getUserConfig({...e,...t})}}const He=Fe,Ue=function(e,t){if(window.seamlyStyleGuide&&!Array.isArray(window.seamlyStyleGuide))throw new Error("Seamly UI has already been initialised. Use the window.seamly object to start new instances instead.");const i=Array.isArray(window.seamlyStyleGuide)?window.seamlyStyleGuide:[],n=new He(e,t);window.seamly=n,window.seamlyStyleGuide={push:n.push.bind(n)},n.push(...i)};module.exports=n})();
|
|
2
2
|
//# sourceMappingURL=~/style-guide.min.js.map
|