userflow.js-self-hosted 0.1.1004182 → 0.1.1004191
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/ResourceCenterApp.js +1 -1
- package/ResourceCenterAssistantChat.js +1 -1
- package/client-context.js +1 -1
- package/hash.txt +1 -1
- package/package.json +1 -1
- package/userflow.js +1 -1
package/ResourceCenterApp.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as e,C as t,i as n,j as r,c as s,k as o,l as c,E as a,m as l,n as i,p as u,S as d,A as m,_ as f}from"./userflow.js";import{r as w}from"./vendor.react.js";import{u as h,i as E}from"./client-context.js";import{u as b,w as k,f as p,C as v}from"./flow-host.styl.js";import{S as g,b as C,R as j,h as N,s as S,a as y,n as I}from"./bubble-frame.styl.js";import{M as _,g as x,a as T,b as R}from"./flow-condition-types.js";import{D as A,u as M,a as L,g as B}from"./stylesheets.js";import{u as H,F}from"./use-window-resize.js";import{o as O}from"./vendor.obj-str.js";import{S as P}from"./logomark.js";import{f as D,C as U}from"./ChecklistUI.js";import{f as W,a as $,b as z,c as q,d as V,e as K,g as G,h as Q,i as Z,j as Y,k as J}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{B as X}from"./BubbleToolbar.js";import{u as ee}from"./use-element-rect.js";import{u as te}from"./vendor.react-i18next.js";function ne(t){return t!==e.ACTION&&t!==e.ANNOUNCEMENTS&&t!==e.ASSISTANT&&t!==e.CONTACT&&t!==e.FLOWS&&t!==e.KNOWLEDGE_BASE&&t!==e.SUBPAGE}const re=window,se={[t.CRISP]:{configure:({onShow:e,onHide:t})=>{!function(){if(oe)return;oe=!0,re.$crisp||(re.$crisp=[]);re.$crisp.push(["do","chat:hide"])}();let n=!1,r=!1;const s=()=>{n||r?(re.$crisp.push(["do","chat:show"]),e()):(re.$crisp.push(["do","chat:hide"]),t())},o=()=>{n=!0,s()};re.$crisp.push(["on","chat:opened",o]);const c=()=>{n=!1,s()};re.$crisp.push(["on","chat:closed",c]);const a=()=>{r=!0,s()};re.$crisp.push(["on","message:received",a]);const l=window.setInterval((()=>{const e=(()=>{const e=document.getElementById("crisp-chatbox");if(!e||"block"!==window.getComputedStyle(e).display)return!1;const t=e.querySelector('[data-id="new_messages"]');return!(!t||"block"!==window.getComputedStyle(t).display)})();e!==r&&(r=e,s())}),200);return()=>{re.$crisp.push(["off","chat:opened",o]),re.$crisp.push(["off","chat:closed",c]),re.$crisp.push(["off","message:received",a]),window.clearInterval(l)}},show:()=>{re.$crisp.push(["do","chat:show"]),re.$crisp.push(["do","chat:open"])},hide:()=>{re.$crisp.push(["do","chat:hide"]),re.$crisp.push(["do","chat:close"])}},[t.CUSTOM]:{configure:()=>()=>{},show:({block:e})=>{try{new Function('"use strict";\n'+e.chatCode)()}catch(t){console.error(`Userflow.js: Showing custom chat provider failed. Code: ${e.chatCode}`,t)}},hide:()=>{}},[t.FRESHCHAT]:{configure:({onShow:e,onHide:t})=>{if(!re.fcWidget)throw new Error("Freshchat is not installed");let n=!1,r=!1;const s=()=>{n||r?e():t()},o=()=>{n=!0,s()};re.fcWidget.on("widget:opened",o);const c=()=>{n=!1,s()};re.fcWidget.on("widget:closed",c);const a=()=>{const e=!!document.querySelector("#fc_frame.h-open-notify");e!==r&&(r=e,s())},l=window.setInterval(a,200);return re.fcWidget.on("unreadCount:notify",a),()=>{re.fcWidget.off("widget:opened",o),re.fcWidget.off("widget:closed",c),re.fcWidget.off("unreadCount:notify",a),window.clearInterval(l)}},show:()=>{re.fcWidget.open()},hide:()=>{re.fcWidget.close()}},[t.HELPSCOUT]:{configure:({onShow:e,onHide:t})=>{if(!re.Beacon)throw new Error("Help Scout is not installed");!function(){if(ce)return;ce=!0,le()}();let n=!1,r=!1;const s=()=>{n||r?(ae(),e()):(le(),t())},o=()=>{n=!0,s()};re.Beacon("on","open",o),re.Beacon("info")?.status.isOpened&&o();const c=()=>{n=!1,s()};re.Beacon("on","close",c);const a=window.setInterval((()=>{const e=!!document.querySelector(".BeaconNotificationsFrame");e!==r&&(r=e,s())}),200);return()=>{re.Beacon("off","open",o),re.Beacon("off","close",c),window.clearInterval(a)}},show:()=>{ae(),re.Beacon("open")},hide:()=>{le(),re.Beacon("close")}},[t.HUBSPOT]:{configure:({onShow:e,onHide:t})=>{const n=()=>{const n=document.getElementById("hubspot-messages-iframe-container");if(!re.HubSpotConversations||!n)return;window.clearInterval(s),function(){if(ie)return;ie=!0,ue?de():me()}();let o=!1,c=!1;const a=()=>{o||c?(de(),e()):(me(),t())},l=()=>{const e=!!document.querySelector("#hubspot-messages-iframe-container .hs-shadow-container.active");e!==o&&(o=e,a())},i=new _(l);i.observe(n,{attributes:!0,subtree:!0,attributeFilter:["class"]}),l();const u=({unreadCount:e})=>{const t=e>0;t!==c&&(c=t,a())};re.HubSpotConversations.on("unreadConversationCountChanged",u),r=()=>{i.disconnect(),re.HubSpotConversations.off("unreadConversationCountChanged",u)}};let r=()=>{window.clearInterval(s)};const s=window.setInterval(n,100);return n(),()=>{r()}},show:()=>{de(),re.HubSpotConversations.widget.open()},hide:()=>{me(),re.HubSpotConversations.widget.close()}},[t.INTERCOM]:{configure:({onShow:e,onHide:t})=>{if(!re.Intercom)throw new Error("Intercom is not installed");return function(){if(fe)return;fe=!0,be();let e=!1,t=!1;const n=()=>{Ee();for(const e of we)e()},r=()=>{be();for(const e of he)e()},s=()=>{e||t?n():r()};re.Intercom("onShow",(()=>{e=!0,s()})),re.Intercom("onHide",(()=>{e=!1,s()}));const o=()=>{const e=!!document.querySelector('iframe[name="intercom-borderless-frame"], iframe[name="intercom-notifications-frame"]');t!==e&&(t=e,s())};re.Intercom("onUnreadCountChange",(()=>{o()})),window.setInterval(o,200)}(),we.add(e),he.add(t),()=>{we.delete(e),he.delete(t)}},show:()=>{Ee(),re.Intercom("show")},hide:()=>{be(),re.Intercom("hide")}},[t.ZENDESK]:{configure:({onShow:e,onHide:t})=>{if(!re.zE)throw new Error("Zendesk is not installed");!function(){if(ke)return;ke=!0,re.zE("webWidget","hide"),re.zE("webWidget","close"),re.zE("webWidget:on","open",(()=>{for(const e of pe)e()})),re.zE("webWidget:on","close",(()=>{for(const e of ve)e()})),re.zE("webWidget:on","chat:unreadMessages",(e=>{for(const t of ge)t(e)}))}();let n=!1,r=!1;const s=()=>{n||r?(re.zE("webWidget","show"),e()):(re.zE("webWidget","hide"),t())},o=()=>{n=!0,r=!1,s()};pe.add(o);const c=()=>{n=!1,r=!1,s()};ve.add(c);const a=e=>{const t=e>0;t!==r&&(r=t,s())};return ge.add(a),()=>{pe.delete(o),ve.delete(c),ge.delete(a)}},show:()=>{re.zE("webWidget","show"),re.zE("webWidget","open")},hide:()=>{re.zE("webWidget","hide"),re.zE("webWidget","close")}},[t.ZENDESK_MESSENGER]:{configure:({onShow:e,onHide:t})=>{if(!re.zE)throw new Error("Zendesk is not installed");let n=!1;const r=window.setInterval((()=>{const r=(()=>{const e=document.querySelector('iframe[title="Messaging window"]');return!!e&&"0px"!==window.getComputedStyle(e).height})();r!==n&&(n=r,n?e():t())}),200);return()=>{window.clearInterval(r)}},show:()=>{re.zE("messenger","open")},hide:()=>{re.zE("messenger","close")}}};let oe=!1;let ce=!1;function ae(){re.Beacon("config",{display:{style:"icon"}})}function le(){re.Beacon("config",{display:{style:"manual"}})}let ie=!1,ue=!1;function de(){ue=!0;document.getElementById("hubspot-messages-iframe-container")?.style.setProperty("visibility","visible","important")}function me(){ue=!1;document.getElementById("hubspot-messages-iframe-container")?.style.setProperty("visibility","hidden","important")}let fe=!1,we=new Set,he=new Set;function Ee(){re.Intercom("update",{hide_default_launcher:!1,vertical_padding:20})}function be(){re.Intercom("update",{hide_default_launcher:!0,vertical_padding:100})}let ke=!1,pe=new Set,ve=new Set,ge=new Set;const Ce=e=>w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},e),w.createElement("path",{fill:"currentColor",d:"M24.049 79.74h36.003c8.185 0 15.985-6.621 17.43-14.814l6.091-34.556h3.997c8.149 0 13.645 6.63 12.2 14.815l-7.051 40C91.274 93.363 83.474 100 75.288 100h-40c-8.185 0-13.645-6.667-12.2-14.815l.96-5.444Z"}),w.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.437 69.63h40c8.148 0 15.978-6.637 17.422-14.815l7.052-40C78.355 6.63 72.896 0 64.711 0h-40C16.533 0 8.726 6.63 7.281 14.815l-7.052 40C-1.215 62.963 4.252 69.63 12.437 69.63Zm33.628-33.798c3.756-2.064 8.725-4.795 9.907-11.844C57.385 15.458 50.065 8.983 42.168 9c-7.452 0-12.771 3.195-17.508 8.892-.858 1.034-.884 2.45-.053 3.212l3.472 3.196c.847.767 2.25.589 3.176-.406 2.842-3.068 4.869-4.83 8.51-4.83 2.864 0 6.077 1.934 5.59 4.847-.37 2.223-2.292 3.334-5.4 5.001l-.28.151c-3.582 1.92-8.134 4.362-9.124 10.247l-.16.956c-.055.28-.05.571.014.85.065.278.188.538.362.76.173.222.391.4.639.522.247.121.518.183.79.18h6.744a2.709 2.709 0 0 0 1.712-.688c.481-.426.81-1.01.934-1.657l.095-.556c.266-1.582 2.101-2.59 4.384-3.845ZM32.837 59c3.552 0 6.955-3.034 7.58-6.769.63-3.729-1.742-6.763-5.293-6.763-3.552 0-6.934 3.028-7.58 6.763C26.9 55.966 29.286 59 32.837 59Z"})),je=({center:e,fadeIn:t})=>{const n=12;return w.createElement("div",{className:O({"userflowjs-spinner":!0,"userflowjs-spinner--center":!!e,"userflowjs-spinner--fade-in":!!t})},w.createElement("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},w.createElement("circle",{className:"userflowjs-spinner__bg",fill:"none",cx:n,cy:n,r:10,style:{strokeWidth:"4px"}}),w.createElement("circle",{className:"userflowjs-spinner__fill",fill:"none",cx:n,cy:n,r:10,transform:"translate(12, 12) rotate(-90) translate(-12, -12)",style:{strokeWidth:"4px",strokeDasharray:20*Math.PI*.25+"px, 1000"}})))};function Ne({message:e,skip:t}){const n=h(),[r,s]=w.useState(!0),[o,c]=w.useState(!1),[a,l]=w.useState(null),[i,u]=w.useState(null),[d,m]=w.useState(null),f=w.useRef(0),E=w.useRef(null),b=w.useRef((()=>{}));return w.useEffect((()=>{if(t)return;const r=JSON.stringify(e);if(r===E.current)return;E.current=r;const o=++f.current;let a,i;let d=!1;b.current=async(e,t)=>{if(!d){d=!0,c(!0);try{const r=e(a,i);i=r;const s=await n.send(r,{handlesRejection:!0});if(o!==f.current)return;a=t(a,s),l(a),m(null)}catch(r){if(o!==f.current)return;m(r)}finally{d=!1,c(!1)}}},(async()=>{s(!0);try{i=e;const t=await n.send(e,{handlesRejection:!0});if(o!==f.current)return;a=t,l(a),u(e),m(null)}catch(t){if(o!==f.current)return;m(t)}finally{s(!1)}})()}),[t,n,e]),{loading:r,loadingMore:o,data:a,messageForData:i,error:d,loadMore:b.current}}function Se(e,t){const[n,r]=w.useState(e),s=w.useRef(void 0),o=w.useCallback((e=>{window.clearTimeout(s.current),r(e),t(e)}),[t]),c=w.useCallback((e=>{window.clearTimeout(s.current),r(e),s.current=window.setTimeout((()=>{t(e)}),200)}),[t]);return w.useEffect((()=>()=>{window.clearTimeout(s.current)}),[]),[n,c,o]}const ye=({textareaRef:e,value:t,onChange:n,onBlur:r,onKeyDown:s,onMouseDown:o,placeholder:c,disabled:a,readOnly:l,className:i,mirrorClassName:u,textareaClassName:d,children:m})=>{let f=t||c||"";return(""===f||f.endsWith("\n"))&&(f+=" "),i=i||"growing-textarea",u=u||i+"__mirror",w.createElement("div",{className:i},w.createElement("div",{className:u+" "+(d||"")},f),w.createElement("textarea",{ref:e,value:t,onChange:e=>n&&n(e.target.value),onBlur:r,onKeyDown:s,onMouseDown:o,placeholder:c,disabled:a,readOnly:l,className:d}),m)},Ie=({textareaRef:e,value:t,onChange:n,onSubmit:r,placeholder:s,readOnly:o})=>{const c=()=>{r&&r()};return w.createElement("div",{className:"userflowjs-assistant-chat-input"},w.createElement(ye,{textareaRef:e,className:"userflowjs-growing-textarea",mirrorClassName:"userflowjs-growing-textarea__mirror",textareaClassName:"userflowjs-textarea userflowjs-assistant-chat-input__textarea",placeholder:s,readOnly:o,value:t||"",onChange:n,onKeyDown:e=>{e.shiftKey||"Enter"!==e.key||(e.preventDefault(),c())}}),w.createElement("button",{"data-testid":"assistant-chat-input-submit",className:"userflowjs-assistant-chat-input__submit",onClick:()=>c()},w.createElement(A,{icon:W})))};const _e=async()=>(await f((()=>import("./ResourceCenterAssistantChat.js")),[new URL("ResourceCenterAssistantChat.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("userflow.js",import.meta.url).toString(),new URL("vendor.phoenix.js",import.meta.url).toString(),new URL("vendor.uuid.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-regular-svg-icons.js",import.meta.url).toString(),new URL("vendor.dompurify.js",import.meta.url).toString(),new URL("vendor.marked.js",import.meta.url).toString(),new URL("vendor.obj-str.js",import.meta.url).toString(),new URL("bubble-frame.styl.js",import.meta.url).toString(),new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString(),new URL("stylesheets.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-solid-svg-icons.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("flow-host.styl.js",import.meta.url).toString(),new URL("use-window-resize.js",import.meta.url).toString(),new URL("logomark.js",import.meta.url).toString(),new URL("ChecklistUI.js",import.meta.url).toString(),new URL("BubbleToolbar.js",import.meta.url).toString(),new URL("use-element-rect.js",import.meta.url).toString()])).ResourceCenterAssistantChat,xe=({session:l,isOpen:i,flowSession:u,checklistSession:d})=>{const m=h(),{t:f}=te(),{company:j}=l.flow,{version:N}=l,S=N.resourceCenter,y=M(N.theme),I=l.locale?l.locale.standardLocaleId:l.version.theme.languageId;w.useEffect((()=>{E.changeLanguage(I)}),[I]);const{loaded:R}=L(window,p,y),[U,W]=w.useState(!1),K=R&&U,[G,Q]=w.useState(x()),[Z,Y]=w.useState(T()),J=w.useCallback((()=>{Q(x()),Y(T())}),[]);H(J);const{zIndex:X,bringToFront:ee}=b(),[re,oe]=w.useState(null),[ce,ae]=w.useState(null),[le,ie]=w.useState(null),ue=w.useRef(null),[de,me]=w.useState(null),[fe,we]=w.useState(null),[he,Ee]=w.useState(null),[be,ke]=w.useState(0),[pe,ve]=w.useState(0),ge=w.useCallback((()=>{ce&&ke(ce.offsetWidth),ve((le?.offsetHeight||0)+(de?.offsetHeight||0)+(fe?.offsetHeight||0)+(he?.offsetHeight||0))}),[ce,le,de,fe,he]);w.useLayoutEffect((()=>{if(!re||"function"!=typeof _)return;const e=new _((()=>{ge()}));return e.observe(re,{childList:!0,attributes:!0,subtree:!0}),()=>{e.disconnect()}}),[re,ge]),w.useLayoutEffect((()=>{ge()}));const[je,Ne]=w.useState(!1),Se=w.useRef(),ye=w.useCallback((()=>{Ne(!0),window.clearTimeout(Se.current),Se.current=window.setTimeout((()=>{Ne(!1)}),y.resourceCenterTransitionDuration)}),[y.resourceCenterTransitionDuration]);w.useEffect((()=>()=>{window.clearTimeout(Se.current)}),[]);const Ie=w.useCallback((()=>{ee(),ye(),m.openResourceCenter()}),[ee,m,ye]),_e=w.useCallback((()=>{ye(),m.closeResourceCenter()}),[m,ye]),[xe,Re]=w.useState(!1);w.useEffect((()=>{if(xe){if(!("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0))if(i){const e='button:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"]), input, textarea';let t=de?.querySelector(".userflowjs-assistant-chat-input textarea")||de?.querySelector(e)||le?.querySelector(e);if(t){const e=t.closest&&t.closest(".userflowjs-resource-center-checklist")||null;e?D(e):t.focus({preventScroll:!0})}}else ce?.focus({preventScroll:!0});Re(!1)}}),[xe,i,de,le,ce]),w.useEffect((()=>{const e=re?.ownerDocument.defaultView;if(!i||!e)return;const t=e=>{"Escape"===e.key&&(_e(),Re(!0))};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}),[i,re,Re,_e]);const[Be,He]=w.useState((()=>function(e,t){if(!t)return null;const n=JSON.parse(t);let r;n.blockCvid&&(r=e.version.resourceCenter?.blocks.find((e=>e.cvid===n.blockCvid)));if(!r&&"search"!==n.kind)return null;const s={kind:n.kind,block:r};switch(s.kind){case"announcementShow":s.announcementId=n.announcementId}return s}(l,n.getItem(`resourceCenterRoute:v1:${l.id}`)))),Ue=w.useCallback(((e,t)=>{He(e);const r=function(e){if(!e)return null;let t;"block"in e&&null!=e.block&&(t=e.block.cvid);const n={kind:e.kind,blockCvid:t};switch(e.kind){case"announcementShow":n.announcementId=e.announcementId}return JSON.stringify(n)}(e);r?n.setItem(`resourceCenterRoute:v1:${l.id}`,r):n.removeItem(`resourceCenterRoute:v1:${l.id}`),0===t?.detail&&Re(!0)}),[l.id]),We=w.useMemo((()=>S.blocks.filter((t=>!(t.type===e.CHECKLIST&&!d)&&((t.type!==e.DIVIDER||!y.resourceCenterAutoDividers)&&(!t.hiddenWhenFlowsActive||!t.hiddenWhenFlowsActive.some((e=>e===u?.flow.id||e===d?.flow.id))))))),[S,u,d,y.resourceCenterAutoDividers]),ze=w.useMemo((()=>Me(We)),[We]),Ke=w.useMemo((()=>d&&S.blocks.some((t=>t.type===e.CHECKLIST))?r(d):0),[S,d]),Ge=w.useMemo((()=>S.blocks.find((t=>t.type===e.CONTACT&&t.chatEnabled&&t.chatProvider))),[S]),[Qe,Ze]=w.useState(!1),Ye=w.useCallback((()=>{m.closeResourceCenter(),Ge&&Ge.chatProvider!==t.CUSTOM&&Ze(!0)}),[m,Ge]),et=w.useCallback((()=>{Ze(!1)}),[]),tt=w.useCallback((()=>{if(Ge)try{se[Ge.chatProvider].hide({block:Ge}),et()}catch(e){console.error(`Userflow.js: Error when hiding ${Ge.chatProvider}:`,e)}}),[Ge,et]);w.useEffect((()=>{if(!Ge)return;s.autoHide3pDisabled=!0;const e=se[Ge.chatProvider];try{const t=e.configure({block:Ge,onShow:Ye,onHide:et});return()=>{t()}}catch(t){return void console.error(`Userflow.js: Error when configuring ${Ge.chatProvider}:`,t)}}),[Ge,Ye,et]),w.useEffect((()=>{i&&tt()}),[tt,i]);const nt=w.useMemo((()=>S.blocks.find((t=>t.type===e.ANNOUNCEMENTS))),[S]),rt=!!Be&&("search"===Be.kind||"flows"===Be.kind||"knowledgeBase"===Be.kind),st="assistant"===Be?.kind||"announcementList"===Be?.kind||"announcementShow"===Be?.kind,ot=Math.min(st?y.resourceCenterFullWidth:y.resourceCenterWidth,G-2*y.resourceCenterPaddingX),ct={zIndex:null!=y.resourceCenterZIndex?y.resourceCenterZIndex:i?X:k(v),position:K?void 0:"absolute",visibility:K&&!Qe?void 0:"hidden"},at={width:(i?ot:be)+"px",height:i?Math.min(rt?540:st?720:pe,Z-2*y.resourceCenterPaddingY,null==y.resourceCenterMaxHeight?Number.MAX_VALUE:y.resourceCenterMaxHeight)+"px":void 0},[lt,it]=w.useState(!1),ut=()=>{Ie(),Re(!0)},dt=y.resourceCenterDisplayChecklistProgress&&d&&Ke>0?w.createElement("div",{"data-testid":"resource-center-launcher-badge",className:"userflowjs-resource-center-launcher-badge"},Ke,w.createElement("div",{className:"userflowjs-a11y-only"},"uncompleted tasks")):null;let mt="",ft="";return y.resourceCenterLauncherTextMode===o.CHECKLIST_OVERRIDE&&d&&Ke>0?mt=d.version.checklist?.launcherText||"Get Started":y.resourceCenterLauncherTextMode!==o.NONE&&(ft=S.buttonText),w.createElement(g.Provider,{value:l},w.createElement("div",{"data-testid":"resource-center-app",className:"userflowjs-resource-center-app userflowjs-theme-root",style:B(y),dir:E.dir()},w.createElement("div",{className:O({"userflowjs-resource-center":!0,"userflowjs-resource-center--fixed":!0,[`userflowjs-resource-center--placement-${y.resourceCenterPlacement.toLowerCase().replace(/_/g,"-")}`]:!0}),style:ct},w.createElement("div",{className:"userflowjs-resource-center-frame-wrapper",onMouseEnter:()=>it(!0),onMouseLeave:()=>it(!1)},w.createElement(F,{className:O({"userflowjs-resource-center-frame":!0,"userflowjs-resource-center-frame--animating":je,"userflowjs-resource-center-frame--open":i,"userflowjs-resource-center-frame--closed":!i}),style:at,stylesheet:C,theme:y,onStylesheetsLoad:W},K&&w.createElement(w.Fragment,null,w.createElement("div",{ref:oe,className:O({"userflowjs-resource-center-frame-root":!0,[`userflowjs-resource-center-frame-root--placement-${y.resourceCenterPlacement.toLowerCase().replace(/_/g,"-")}`]:!0,"userflowjs-resource-center-frame-root--animating":je,"userflowjs-resource-center-frame-root--open":i,"userflowjs-resource-center-frame-root--closed":!i}),role:i?"dialog":void 0,"aria-label":i?S.headerText:void 0},w.createElement("div",{className:"userflowjs-resource-center-launcher-container"},w.createElement("button",{ref:ae,className:O({"userflowjs-resource-center-launcher-button":!0,"userflowjs-resource-center-launcher-button--hover":lt}),onClick:ut,"aria-label":`Open ${S.headerText}`},dt,mt&&w.createElement("div",{"data-testid":"resource-center-launcher-text",className:"userflowjs-resource-center-launcher-text"},mt),(dt||mt)&&w.createElement("div",{className:"userflowjs-resource-center-launcher-divider"}),ft&&w.createElement("div",{"data-testid":"resource-center-launcher-text",className:"userflowjs-resource-center-launcher-text"},ft),w.createElement("div",{className:"userflowjs-resource-center-launcher-icon"},y.resourceCenterLauncherIconType===c.PLAINTEXT?"?":w.createElement(Ce,null)))),w.createElement("div",{ref:ue,className:"userflowjs-resource-center-body",style:{width:ot+"px"}},w.createElement("div",{ref:me,className:O({"userflowjs-resource-center-body-content":!0,"userflowjs-resource-center-body-content--padding":"assistant"!==Be?.kind,"userflowjs-resource-center-body-content--same-background":y.sameBackground,"userflowjs-resource-center-body-content--with-made-with-userflow":j.resourceCenterBranding})},i&&w.createElement(w.Fragment,null,Be?"search"===Be.kind?w.createElement(Fe,{session:l,navigate:Ue}):"email"===Be.kind?w.createElement(Oe,{block:Be.block,session:l}):"phone"===Be.kind?w.createElement(Pe,{block:Be.block,session:l}):"flows"===Be.kind?w.createElement(De,{block:Be.block,initialQ:Be.initialQ,session:l,navigate:Ue}):"knowledgeBase"===Be.kind?w.createElement($e,{block:Be.block,initialQ:Be.initialQ,session:l,bodyRef:ue}):"subpage"===Be.kind?w.createElement(qe,{block:Be.block,session:l}):"announcementList"===Be.kind||"announcementShow"===Be.kind?w.createElement(Ve,{bodyRef:ue,session:l,route:Be,navigate:Ue}):"assistant"===Be.kind?w.createElement(Je,{block:Be.block,initialUserContent:Be.initialUserContent,session:l,navigate:Ue}):null:w.createElement(w.Fragment,null,We.map(((e,t)=>{const n=Le[e.type],r=We[t+1];return n?w.createElement(w.Fragment,{key:e.id},w.createElement(n.View,{session:l,flowSession:u,checklistSession:d,block:e,navigate:Ue,onChatShow:Ye}),r&&function(e,t,n){return!!e.resourceCenterAutoDividers&&(ne(t)||ne(n))}(y,e.type,r.type)&&w.createElement("div",{className:"userflowjs-resource-center-divider"})):null})))))),j.resourceCenterBranding&&w.createElement("div",{className:"userflowjs-resource-center-made-with-userflow"},w.createElement("div",{className:"userflowjs-resource-center-made-with-userflow-content",ref:we},w.createElement("a",{href:"https://userflow.com/?utm_source=made-with-userflow&utm_medium=link&utm_campaign=made-with-userflow-"+j.slug+"&utm_content=resource-center",target:"_blank",rel:"noopener noreferrer"},w.createElement(P,null),w.createElement("div",null,"Made with Userflow")))),l.draftMode&&w.createElement("div",{className:"userflowjs-resource-center-preview"},w.createElement("div",{ref:Ee,className:"userflowjs-resource-center-preview-content"},w.createElement("div",{className:"userflowjs-resource-center-preview-text"},"Preview"),w.createElement("button",{className:"userflowjs-resource-center-preview-button",onClick:()=>{m.endFlow(l,{endReason:a.USER_CLOSED})}},w.createElement(A,{icon:$})))),w.createElement("div",{className:"userflowjs-resource-center-header",style:{width:ot+"px"}},w.createElement("div",{ref:ie,className:"userflowjs-resource-center-header-content"},null==Be?w.createElement("div",{className:"userflowjs-resource-center-header-text"},S.headerText):w.createElement("button",{className:"userflowjs-resource-center-icon-button",onClick:e=>Ue("announcementShow"===Be?.kind?{kind:"announcementList",block:Be.block}:null,e)},w.createElement("div",{className:"userflowjs-rtl-mirrored"},w.createElement(A,{icon:z})),w.createElement("div",{className:"userflowjs-resource-center-icon-button__text"},f("resource_center.back"))),w.createElement("div",{className:"flex-1"}),ze.length>0&&w.createElement("button",{className:"userflowjs-resource-center-icon-button",onClick:()=>{let e={kind:"search"};if(1===ze.length){const t=ze[0],n=Le[t.type];n.routeTo&&(e=n.routeTo({block:t}))}"search"===Be?.kind?Ue(null):(Xe(m,l,null,"Search icon"),Ue(e))},"aria-label":"Search"},w.createElement(A,{icon:q})),w.createElement("button",{className:"userflowjs-resource-center-icon-button userflowjs-resource-center-close-button",onClick:e=>{_e(),0===e.detail&&Re(!0)},"aria-label":`Close ${S.headerText}`},w.createElement(A,{icon:V}))))))),!i&&!u&&nt&&nt.unreadAnnouncementCount>0&&w.createElement(Te,{theme:y,count:nt.unreadAnnouncementCount,onClick:ut})),!i&&!u&&nt?.popoutAnnouncement&&w.createElement(Ae,{session:l,open:Ie,navigate:Ue,theme:y,block:nt}))))},Te=({theme:e,count:t,onClick:n})=>{const[r,s]=w.useState(!1);return w.createElement(F,{className:O({"userflowjs-resource-center-launcher-unread-badge":!0}),noScroll:!0,style:{position:r?void 0:"absolute",visibility:r?void 0:"hidden"},stylesheet:C,theme:e,onStylesheetsLoad:s},w.createElement(Re,{count:t,onClick:n}))},Re=({count:e,onClick:t})=>{let n=null;return e>9&&(e=9,n=w.createElement("span",{className:"userflowjs-unread-badge-plus"},"+")),w.createElement("div",{className:O({"userflowjs-unread-badge":!0,"userflowjs-unread-badge--clickable":!!t}),onClick:t},w.createElement("span",null,e),n)},Ae=({session:e,open:t,navigate:n,theme:r,block:s})=>{const o=s.popoutAnnouncement,c=h(),[a,l]=w.useState(!1),{height:i,setEl:u}=ee();return w.createElement("div",{className:"userflowjs-resource-center-popout"},w.createElement(F,{className:O({"userflowjs-resource-center-popout-frame":!0}),style:{height:`calc(min(${i}px, 100vh - 2 * var(--userflow-resource-center-padding-y) - var(--userflow-resource-center-collapsed-height) - 20px)`,position:a?void 0:"absolute",visibility:a?void 0:"hidden"},stylesheet:C,theme:r,onStylesheetsLoad:l},w.createElement("div",{ref:u,className:"userflowjs-resource-center-popout-frame-root"},w.createElement("h2",{className:"userflowjs-announcement-title"},w.createElement("span",{className:"userflowjs-unread-dot"}),w.createElement("span",null,o.title)),w.createElement("div",{className:"userflowjs-announcement-time"},w.createElement("div",{className:"userflowjs-announcement-time-text"},tt(o.time))),w.createElement("div",{className:"userflowjs-announcement-content userflowjs-bubble-content"},w.createElement(j,{doc:o.content,buttons:o.buttons})),o.moreEnabled&&w.createElement("div",{className:"userflowjs-announcement-more"},w.createElement("button",{className:"userflowjs-announcement-more-button",onClick:()=>{Qe(c,o),Xe(c,e,s,o.title),n({kind:"announcementShow",block:s,announcementId:o.id}),t()}},w.createElement("div",null,(o.moreEnabled?o.moreButtonText:null)||"Read more"),w.createElement("span",{className:"userflowjs-rtl-mirrored"},w.createElement(A,{icon:K})))),w.createElement("div",{className:"userflowjs-bubble-toolbar"},w.createElement("button",{className:"userflowjs-bubble-toolbar-button",onClick:()=>{Qe(c,o)},"aria-label":"Dismiss announcement"},w.createElement(A,{icon:$}))))),w.createElement("div",{className:"userflowjs-resource-center-popout-notch"}))};function Me(e){return e.filter((e=>{const t=Le[e.type];return t.isSearchable?t.isSearchable(e):!!t.search}))}const Le={[e.ACTION]:{View:e=>{const{block:t,session:n,flowSession:r,checklistSession:s}=e,o=h(),[c,a]=w.useState(!1),i=r?.id,u=s?.id;return w.useEffect((()=>{a(!1)}),[i,u]),w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:c?void 0:()=>{Xe(o,n,t);const e=t.actions.find((e=>e.type===l.START_FLOW));if(e){e.otherFlow?.id!==s?.flow.id&&a(!0)}else o.closeResourceCenter();N(o,n,t.actions)},disabled:c},w.createElement(Be,{...e}),w.createElement(He,{...e}),c&&w.createElement(je,null))}},[e.ANNOUNCEMENTS]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h();return w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:e=>{Xe(s,n,t),r({kind:"announcementList",block:t},e)}},t.unreadAnnouncementCount>0?w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(Re,{count:t.unreadAnnouncementCount})):w.createElement(Be,{...e}),w.createElement(He,{...e}),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(A,{icon:G})))}},[e.ASSISTANT]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h(),[o,c]=w.useState("");return t.assistantAppearance===i.INPUT?w.createElement("div",{className:"userflowjs-resource-center-assistant-block"},w.createElement(Ie,{value:o,onChange:c,placeholder:S(t.name,{lookupAttribute:R(n.data)}),onSubmit:()=>{Xe(s,n,t),r({kind:"assistant",block:t,initialUserContent:o})}})):w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:()=>{Xe(s,n,t),r({kind:"assistant",block:t,initialUserContent:""})}},w.createElement(Be,{...e}),w.createElement(He,{...e}))}},[e.CHECKLIST]:{View:({checklistSession:e})=>w.createElement("div",{"data-testid":"resource-center-checklist",className:"userflowjs-resource-center-checklist"},w.createElement(U,{session:e}),w.createElement(X,{draftMode:!!e.draftMode&&"CHECKLIST PREVIEW"}))},[e.CONTACT]:{View:e=>{const{block:t,session:n,navigate:r,onChatShow:s}=e,o=h(),c=[];return t.emailEnabled&&c.push({icon:Z,label:"Email",isRoute:!0,onClick:e=>{Xe(o,n,t,"Email"),r({kind:"email",block:t},e)}}),t.phoneEnabled&&c.push({icon:Y,label:"Phone",isRoute:!0,onClick:e=>{Xe(o,n,t,"Phone"),r({kind:"phone",block:t},e)}}),t.chatEnabled&&c.push({icon:J,label:"Live-chat",isRoute:!1,onClick:()=>{if(Xe(o,n,t,"Chat"),t.chatProvider){const n=se[t.chatProvider];try{n.show({block:t})}catch(e){console.error(`Userflow.js: Error when showing ${t.chatProvider}:`,e)}s()}else n.draftMode&&window.alert("You have not selected a chat provider. Go to the resource center builder in Userflow. Click the Contact block. Pick a chat provider in the side panel.")}}),w.createElement("div",{className:O({"userflowjs-resource-center-block":!0,"userflowjs-resource-center-block--clickable":1===c.length}),onClick:1===c.length?c[0].onClick:void 0},1===c.length&&w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(A,{icon:c[0].icon})),w.createElement(He,{...e}),c.length>1&&c.map((({icon:e,label:t,onClick:n},r)=>w.createElement("button",{key:r,className:"userflowjs-resource-center-icon-button",onClick:n,"aria-label":t},w.createElement(A,{icon:e})))),1===c.length&&c[0].isRoute&&w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(A,{icon:G})))}},[e.DIVIDER]:{View:()=>w.createElement("div",{className:"userflowjs-resource-center-divider"})},[e.FLOWS]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h();return w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:e=>{Xe(s,n,t),r({kind:"flows",block:t},e)}},w.createElement(Be,{...e}),w.createElement(He,{...e}),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(A,{icon:G})))},routeTo:({block:e,initialQ:t})=>({kind:"flows",block:e,initialQ:t}),isSearchable:e=>!!e.searchEnabled,search:async({client:e,session:t,block:n,q:r})=>{const{flows:s}=await e.send({kind:"ListResourceCenterBlockFlows",sessionId:t.id,blockCvid:n.cvid},{handlesRejection:!0}),o=Ue(s,r),c=o.slice(0,5);return{block:n,truncated:c.length===o.length,results:c.map((e=>({kind:"flow",flow:e})))}}},[e.KNOWLEDGE_BASE]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h();return w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:e=>{Xe(s,n,t),r({kind:"knowledgeBase",block:t},e)}},w.createElement(Be,{...e}),w.createElement(He,{...e}),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(A,{icon:G})))},routeTo:({block:e,initialQ:t})=>({kind:"knowledgeBase",block:e,initialQ:t}),search:async({client:e,session:t,block:n,q:r})=>{const{truncated:s,articles:o}=await e.send({kind:"SearchKnowledgeBase",sessionId:t.id,blockCvid:n.cvid,q:r,offset:0,limit:5},{handlesRejection:!0});return{block:n,truncated:s,results:o.map((e=>({kind:"article",article:e})))}}},[e.MESSAGE]:{View:({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-block"},w.createElement("div",{className:"userflowjs-resource-center-block-text userflowjs-bubble-content"},w.createElement(j,{doc:e.content,lookupAttribute:R(t.data)})))},[e.SUBPAGE]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h();return w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:e=>{Xe(s,n,t),r({kind:"subpage",block:t},e)}},w.createElement(Be,{...e}),w.createElement(He,{...e}),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(A,{icon:G})))}}},Be=({block:e})=>e.icon?w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(A,{icon:e.icon,size:16})):null,He=({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-block-text"},w.createElement(y,{doc:e.name,lookupAttribute:R(t.data)}));const Fe=({session:e,navigate:t})=>{const n=h(),r=e.version.resourceCenter.blocks,s=Me(r),{t:o}=te(),c=w.useRef(null),[a,l]=w.useState(""),[i,u]=Se(a,l),[d,m]=w.useState(null);return w.useEffect((()=>{if(""===a.trim())return void m(null);let t=!1;return(async()=>{m(null);const s=await Promise.all(r.map((async t=>{const{search:r}=Le[t.type];if(!r)return null;try{return await r({client:n,session:e,block:t,q:a})}catch(s){return console.error(`Userflow.js: Global search failed for ${t.type} block=`,t,"error=",s),null}})));t||m(s.filter((e=>null!=e&&e.results.length>0)))})(),()=>{t=!0}}),[n,e,r,a]),w.useEffect((()=>{c.current?.focus({preventScroll:!0})}),[]),w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-resource-center-list-route-search"},w.createElement("input",{ref:c,className:"userflowjs-text-input",type:"text",value:i,onChange:e=>u(e.target.value),placeholder:o("resource_center.search_placeholder")})),""===a.trim()?w.createElement("div",{"data-testid":"resource-center-empty-query",className:"userflowjs-resource-center-list-route-error"},o("resource_center.search_in")," ",s.map(((t,n)=>w.createElement(w.Fragment,{key:t.cvid},n>0&&(n===s.length-1?` ${o("and")} `:", "),w.createElement("b",null,w.createElement(y,{doc:t.name,lookupAttribute:R(e.data)}))))),"."):d?0===d.length?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},o("resource_center.no_results_found")):d.map((({block:r,truncated:s,results:c},l)=>{const i=Le[r.type],u=i.routeTo&&i.routeTo({block:r,initialQ:a});return w.createElement(w.Fragment,{key:r.cvid},l>0&&w.createElement("div",{className:"userflowjs-resource-center-divider"}),w.createElement("div",{className:"userflowjs-resource-center-label"},w.createElement(y,{doc:r.name,lookupAttribute:R(e.data)})),c.map(((n,s)=>"flow"===n.kind?w.createElement(We,{key:n.flow.id,block:r,session:e,flow:n.flow,navigate:t}):"article"===n.kind?w.createElement(ze,{key:s,block:r,session:e,article:n.article}):null)),!s&&u&&w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:s=>{Xe(n,e,r),t(u,s)}},w.createElement("div",{className:"userflowjs-resource-center-block-text"},o("more"),":"," ",w.createElement(y,{doc:r.name,lookupAttribute:R(e.data)})),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(A,{icon:G}))))})):w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null)))},Oe=({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-content-route userflowjs-bubble-content"},w.createElement(j,{doc:e.emailContent,lookupAttribute:R(t.data)})),Pe=({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-content-route userflowjs-bubble-content"},w.createElement(j,{doc:e.phoneContent,lookupAttribute:R(t.data)})),De=({block:e,initialQ:t,session:n,navigate:r})=>{const{t:s}=te(),o=w.useRef(null),[c,a]=w.useState(t||""),[l,i]=Se(c,a),{data:u,error:d}=Ne({message:{kind:"ListResourceCenterBlockFlows",sessionId:n.id,blockCvid:e.cvid}}),m=u?.flows,f=w.useMemo((()=>m?Ue(m,c):null),[m,c]);return w.useEffect((()=>{o.current?.focus({preventScroll:!0})}),[]),w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-resource-center-list-route-header"},w.createElement("div",{className:"userflowjs-resource-center-list-route-title"},w.createElement(y,{doc:e.name,lookupAttribute:R(n.data)}))),e.searchEnabled&&w.createElement("div",{className:"userflowjs-resource-center-list-route-search"},w.createElement("input",{ref:o,className:"userflowjs-text-input",type:"text",value:l,onChange:e=>i(e.target.value),placeholder:s("resource_center.search_placeholder")})),d?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},s("resource_center.generic_error")):f?0===f.length?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},s("resource_center.no_results_found")):f.map((t=>w.createElement(We,{key:t.id,block:e,session:n,flow:t,navigate:r}))):w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,{fadeIn:!0})))};function Ue(e,t){const n=t.toLowerCase().trim();return""===n?e:e.filter((e=>e.name.toLowerCase().includes(n)))}const We=({block:e,session:t,flow:n,navigate:r})=>{const s=h(),[o,c]=w.useState(!1);return w.useEffect((()=>{if(!o||n.type!==u.CHECKLIST)return;const e=()=>{s.checklistSession?.flow.id===n.id&&(t(),r(null))},t=()=>{s.off("checklistChanged",e)};return s.on("checklistChanged",e),t}),[s,o,n.type,n.id,r]),w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:()=>{if(Xe(s,t,e,n.name),s.checklistSession?.flow.id===n.id)return void r(null);s.startFlow({flowId:n.id,startReason:d.RESOURCE_CENTER,replaceCurrent:!0}),c(!0);const o=S(n.url,{lookupAttribute:R(t.data)});o&&I(o)},disabled:o},w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(A,{icon:n.type===u.CHECKLIST?"regular/tasks":"regular/shoe-prints",size:16})),w.createElement("div",{className:"userflowjs-resource-center-block-text"},n.name),o&&w.createElement(je,null))},$e=({block:e,initialQ:t,session:n,bodyRef:r})=>{const{t:s}=te(),o=w.useRef(null),[c,a]=w.useState(t||""),[l,i]=Se(c,a),{loading:u,loadingMore:d,data:m,messageForData:f,error:h,loadMore:E}=Ne({message:{kind:"SearchKnowledgeBase",sessionId:n.id,blockCvid:e.cvid,q:c,offset:0}});et({bodyRef:r,loading:u,loadingMore:d,truncated:m?.truncated,loadMoreHelper:w.useCallback((()=>{E(((e,t)=>({...t,offset:e.articles.length})),((e,t)=>({...t,articles:[...e.articles,...t.articles]})))}),[E])}),w.useEffect((()=>{o.current?.focus({preventScroll:!0})}),[]);let b=e.knowledgeBaseUrl||"";return b.match(/^https?:\/\//)||(b=`http://${b}`),w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-resource-center-list-route-header"},w.createElement("div",{className:"userflowjs-resource-center-list-route-title"},w.createElement(y,{doc:e.name,lookupAttribute:R(n.data)})),w.createElement("a",{className:"userflowjs-resource-center-icon-button",href:b,target:"_blank",rel:"noopener noreferrer"},w.createElement(A,{icon:Q}))),w.createElement("div",{className:"userflowjs-resource-center-list-route-search"},w.createElement("input",{ref:o,className:"userflowjs-text-input",type:"text",value:l,onChange:e=>i(e.target.value),placeholder:s("resource_center.search_placeholder")})),h?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},"quota_exceeded"===h.code?"Sorry, this company has reached its max number of searches. Consider asking Userflow to be moved to a dedicated search engine for a higher quota.":h.humanMessage||s("resource_center.generic_error")):u||!m?w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null)):0===m.articles.length?""===f?.q?null:w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},s("resource_center.no_results_found")):w.createElement(w.Fragment,null,""===f?.q&&w.createElement("div",{className:"userflowjs-resource-center-label"},s("resource_center.suggested_articles")),m.articles.map(((t,r)=>w.createElement(ze,{key:r,block:e,session:n,article:t}))),d&&w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null))))},ze=({block:e,article:t,session:n})=>{const r=h();return w.createElement("a",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:()=>{Xe(r,n,e,t.title)},href:t.url,target:"_blank",rel:"noopener noreferrer"},w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(A,{icon:"regular/file-alt",size:16})),w.createElement("div",{className:"userflowjs-resource-center-block-text"},w.createElement("span",{dangerouslySetInnerHTML:{__html:t.htmlTitle}}),w.createElement("div",{className:"userflowjs-resource-center-block-subtext",dangerouslySetInnerHTML:{__html:t.htmlSnippet}})))},qe=({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-content-route userflowjs-bubble-content"},w.createElement(j,{doc:e.content,lookupAttribute:R(t.data)})),Ve=({bodyRef:e,session:t,route:n,navigate:r})=>{const s=h(),o=Ne({message:{kind:"ListAnnouncements",beforeAnnouncementId:null},skip:"announcementList"!==n?.kind}),{loading:c,loadingMore:a,data:l,loadMore:i}=o,u=l?.truncated,d=w.useCallback((()=>{i(((e,t)=>e.announcements.length>0?{...t,beforeAnnouncementId:e.announcements[e.announcements.length-1].id}:t),((e,t)=>({...t,announcements:[...e.announcements,...t.announcements]})))}),[i]);et({bodyRef:e,loading:c,loadingMore:a,truncated:u,loadMoreHelper:d});const[m,f]=w.useState(void 0);return w.useLayoutEffect((()=>{e.current&&null!=m&&"announcementList"===n?.kind&&(e.current.scrollTop=m)}),[e,m,n?.kind]),"announcementList"===n?.kind?w.createElement(Ke,{bodyRef:e,session:t,block:n.block,onMoreClick:o=>{f(e.current?.scrollTop),Xe(s,t,n.block,o.title),r({kind:"announcementShow",block:n.block,announcementId:o.id})},...o}):"announcementShow"===n?.kind?w.createElement(Ye,{block:n.block,announcementId:n.announcementId}):null},Ke=({bodyRef:e,block:t,session:n,onMoreClick:r,error:s,loading:o,loadingMore:c,data:a})=>{const{t:l}=te(),[i,u]=w.useMemo((()=>{const e=[],t=[];if(a){let n=-1;for(const r of a.announcements)n++,n<a.pageSize&&!r.seen&&r.level!==m.SILENT?e.push(r):t.push(r)}return[e,t]}),[a]),d=i.length;return w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-resource-center-list-route-header"},w.createElement("div",{className:"userflowjs-resource-center-list-route-title"},w.createElement(y,{doc:t.name,lookupAttribute:R(n.data)}))),s?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},s.humanMessage||l("resource_center.generic_error")):o||!a?w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null)):0===a.announcements.length?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},l("resource_center.no_results_found")):w.createElement(w.Fragment,null,d>0&&w.createElement("div",{className:"userflowjs-announcement-unread-header"},l("resource_center.unread",{count:d})),i.map(((t,n)=>w.createElement(Ze,{key:n,bodyRef:e,onMoreClick:()=>r(t),announcement:t}))),i.length>0&&u.length>0&&w.createElement("div",{className:"userflowjs-announcement-seen-divider"}),u.map(((t,n)=>w.createElement(Ze,{key:n,bodyRef:e,onMoreClick:()=>r(t),announcement:t}))),c&&w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null))))},Ge=new Set;function Qe(t,n){Ge.has(n.id)||(Ge.add(n.id),t.setResourceCenterSession((t=>t?{...t,version:{...t.version,resourceCenter:{...t.version.resourceCenter,blocks:t.version.resourceCenter.blocks.map((t=>t.type===e.ANNOUNCEMENTS?{...t,unreadAnnouncementCount:t.unreadAnnouncementCount-1,popoutAnnouncement:t.popoutAnnouncement?.id===n.id?null:t.popoutAnnouncement}:t))}}}:null)),t.toggleUI(),t.send({kind:"MarkAnnouncementSeen",announcementId:n.id,versionId:n.versionId}))}const Ze=({bodyRef:e,onMoreClick:t,announcement:n})=>{const r=h(),s=w.useRef(null),o=w.useRef(!1);return w.useEffect((()=>{if(o.current||n.seen)return;const t=new IntersectionObserver((e=>{const t=e[0];t&&t.isIntersecting&&(Qe(r,n),o.current=!0,c())}),{root:e.current,threshold:1}),c=()=>{t.disconnect()};return t.observe(s.current),c}),[e,r,n]),w.createElement("div",{className:"userflowjs-announcement-list-item"},w.createElement("div",{className:"userflowjs-announcement-time-divider"},w.createElement("div",{className:"userflowjs-announcement-time-divider-line"}),w.createElement("div",{className:"userflowjs-announcement-time-text"},tt(n.time)),w.createElement("div",{className:"userflowjs-announcement-time-divider-line"})),w.createElement("h2",{ref:s,className:"userflowjs-announcement-title"},!n.seen&&n.level!==m.SILENT&&w.createElement("span",{className:"userflowjs-unread-dot"}),w.createElement("span",null,n.title)),w.createElement("div",{className:"userflowjs-announcement-content userflowjs-bubble-content"},w.createElement(j,{doc:n.content,buttons:n.buttons})),w.createElement("div",{className:"userflowjs-announcement-more"},n.moreEnabled&&w.createElement("button",{className:"userflowjs-announcement-more-button",onClick:t},w.createElement("div",null,n.moreButtonText||"Read more"),w.createElement("span",{className:"userflowjs-rtl-mirrored"},w.createElement(A,{icon:K})))))},Ye=({announcementId:e})=>{const t=h(),{t:n}=te(),{loading:r,data:s,error:o}=Ne({message:{kind:"GetAnnouncement",announcementId:e}}),c=s?.announcement;return w.useEffect((()=>{c&&!c.seen&&Qe(t,c)}),[t,c]),w.createElement(w.Fragment,null,o?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},o.humanMessage||n("resource_center.generic_error")):r||!c?w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null)):w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-announcement-show"},w.createElement("h2",{className:"userflowjs-announcement-title"},c?.title),w.createElement("div",{className:"userflowjs-announcement-time"},w.createElement("div",{className:"userflowjs-announcement-time-text"},tt(c.time))),w.createElement("div",{className:"userflowjs-bubble-content"},w.createElement(j,{doc:c.content,buttons:c.buttons}),c.moreEnabled&&w.createElement(j,{doc:c.moreContent,buttons:c.moreButtons})))))},Je=({block:e,initialUserContent:t,session:r,navigate:s})=>{const o=e.assistantFlowId,c=h(),[a,l]=w.useState(null),[i,u]=w.useState(null),[d,m]=w.useState(null),[f]=w.useState(t);return w.useEffect((()=>{t&&s({kind:"assistant",block:e,initialUserContent:""})}),[t,e,s]),w.useEffect((()=>{let e=!1;return(async()=>{try{const t=n.getItem("assistantConversationId:"+o),[r,s]=await Promise.all([_e(),c.send({kind:"GetAssistant",assistantFlowId:o,conversationId:t},{handlesRejection:!0,endBatch:!0})]);if(e)return;l((()=>r)),u(s)}catch(t){console.error("Resource center assistant route failed to load:",t),m(t.humanMessage||"Sorry, something went wrong. Please try again or contact my human friends.")}})(),()=>{e=!0}}),[c,o]),d?w.createElement("div",{className:"userflowjs-assistant-chat"},w.createElement("div",{className:"userflowjs-assistant-chat__content"},w.createElement("div",{className:"userflowjs-assistant-chat__error"},d))):a&&i?w.createElement(a,{block:e,session:r,assistantReply:i,initialUserContent:f}):w.createElement(je,{center:!0,fadeIn:!0})};function Xe(e,t,n,r){e.send({kind:"ClickResourceCenter",sessionId:t.id,description:n?S(n.name,{lookupAttribute:R(t.data)})+(r?` - ${r}`:""):r},{batch:!0})}function et({bodyRef:e,loading:t,loadingMore:n,truncated:r,loadMoreHelper:s}){w.useEffect((()=>{const o=e.current;if(!o||t||n||r)return;const c=()=>{o.scrollHeight-o.clientHeight-o.scrollTop>400||s()};return o.addEventListener("scroll",c),()=>{o.removeEventListener("scroll",c)}}),[e,t,n,r,s])}function tt(e){const t=e?new Date(e):new Date;let n=new Intl.DateTimeFormat(E.language,{weekday:"long",day:"numeric",month:"short",year:t.getFullYear()===(new Date).getFullYear()?void 0:"numeric"}).format(t);return n.substring(0,1).toUpperCase()+n.substring(1)}var nt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",ResourceCenterApp:xe,default:xe});export{Ie as A,ye as G,nt as R};
|
|
1
|
+
import{h as e,C as t,i as n,j as r,c as s,k as o,l as c,E as a,m as l,n as i,p as u,S as d,A as m,_ as f}from"./userflow.js";import{r as w}from"./vendor.react.js";import{u as h,i as E}from"./client-context.js";import{u as b,w as k,f as p,C as v}from"./flow-host.styl.js";import{S as g,b as C,R as j,h as N,s as S,a as y,n as I}from"./bubble-frame.styl.js";import{M as _,g as x,a as T,b as R}from"./flow-condition-types.js";import{D as M,u as A,a as L,g as B}from"./stylesheets.js";import{u as H,F}from"./use-window-resize.js";import{o as O}from"./vendor.obj-str.js";import{S as P}from"./logomark.js";import{f as D,C as U}from"./ChecklistUI.js";import{f as W,a as $,b as z,c as q,d as V,e as K,g as G,h as Q,i as Z,j as Y,k as J}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{B as X}from"./BubbleToolbar.js";import{u as ee}from"./use-element-rect.js";import{u as te}from"./vendor.react-i18next.js";function ne(t){return t!==e.ACTION&&t!==e.ANNOUNCEMENTS&&t!==e.ASSISTANT&&t!==e.CONTACT&&t!==e.FLOWS&&t!==e.KNOWLEDGE_BASE&&t!==e.SUBPAGE}const re=window,se={[t.CRISP]:{configure:({onShow:e,onHide:t})=>{!function(){if(oe)return;oe=!0,re.$crisp||(re.$crisp=[]);re.$crisp.push(["do","chat:hide"])}();let n=!1,r=!1;const s=()=>{n||r?(re.$crisp.push(["do","chat:show"]),e()):(re.$crisp.push(["do","chat:hide"]),t())},o=()=>{n=!0,s()};re.$crisp.push(["on","chat:opened",o]);const c=()=>{n=!1,s()};re.$crisp.push(["on","chat:closed",c]);const a=()=>{r=!0,s()};re.$crisp.push(["on","message:received",a]);const l=window.setInterval((()=>{const e=(()=>{const e=document.getElementById("crisp-chatbox");if(!e||"block"!==window.getComputedStyle(e).display)return!1;const t=e.querySelector('[data-id="new_messages"]');return!(!t||"block"!==window.getComputedStyle(t).display)})();e!==r&&(r=e,s())}),200);return()=>{re.$crisp.push(["off","chat:opened",o]),re.$crisp.push(["off","chat:closed",c]),re.$crisp.push(["off","message:received",a]),window.clearInterval(l)}},show:()=>{re.$crisp.push(["do","chat:show"]),re.$crisp.push(["do","chat:open"])},hide:()=>{re.$crisp.push(["do","chat:hide"]),re.$crisp.push(["do","chat:close"])}},[t.CUSTOM]:{configure:()=>()=>{},show:({block:e})=>{try{new Function('"use strict";\n'+e.chatCode)()}catch(t){console.error(`Userflow.js: Showing custom chat provider failed. Code: ${e.chatCode}`,t)}},hide:()=>{}},[t.FRESHCHAT]:{configure:({onShow:e,onHide:t})=>{if(!re.fcWidget)throw new Error("Freshchat is not installed");let n=!1,r=!1;const s=()=>{n||r?e():t()},o=()=>{n=!0,s()};re.fcWidget.on("widget:opened",o);const c=()=>{n=!1,s()};re.fcWidget.on("widget:closed",c);const a=()=>{const e=!!document.querySelector("#fc_frame.h-open-notify");e!==r&&(r=e,s())},l=window.setInterval(a,200);return re.fcWidget.on("unreadCount:notify",a),()=>{re.fcWidget.off("widget:opened",o),re.fcWidget.off("widget:closed",c),re.fcWidget.off("unreadCount:notify",a),window.clearInterval(l)}},show:()=>{re.fcWidget.open()},hide:()=>{re.fcWidget.close()}},[t.HELPSCOUT]:{configure:({onShow:e,onHide:t})=>{if(!re.Beacon)throw new Error("Help Scout is not installed");!function(){if(ce)return;ce=!0,le()}();let n=!1,r=!1;const s=()=>{n||r?(ae(),e()):(le(),t())},o=()=>{n=!0,s()};re.Beacon("on","open",o),re.Beacon("info")?.status.isOpened&&o();const c=()=>{n=!1,s()};re.Beacon("on","close",c);const a=window.setInterval((()=>{const e=!!document.querySelector(".BeaconNotificationsFrame");e!==r&&(r=e,s())}),200);return()=>{re.Beacon("off","open",o),re.Beacon("off","close",c),window.clearInterval(a)}},show:()=>{ae(),re.Beacon("open")},hide:()=>{le(),re.Beacon("close")}},[t.HUBSPOT]:{configure:({onShow:e,onHide:t})=>{const n=()=>{const n=document.getElementById("hubspot-messages-iframe-container");if(!re.HubSpotConversations||!n)return;window.clearInterval(s),function(){if(ie)return;ie=!0,ue?de():me()}();let o=!1,c=!1;const a=()=>{o||c?(de(),e()):(me(),t())},l=()=>{const e=!!document.querySelector("#hubspot-messages-iframe-container .hs-shadow-container.active");e!==o&&(o=e,a())},i=new _(l);i.observe(n,{attributes:!0,subtree:!0,attributeFilter:["class"]}),l();const u=({unreadCount:e})=>{const t=e>0;t!==c&&(c=t,a())};re.HubSpotConversations.on("unreadConversationCountChanged",u),r=()=>{i.disconnect(),re.HubSpotConversations.off("unreadConversationCountChanged",u)}};let r=()=>{window.clearInterval(s)};const s=window.setInterval(n,100);return n(),()=>{r()}},show:()=>{de(),re.HubSpotConversations.widget.open()},hide:()=>{me(),re.HubSpotConversations.widget.close()}},[t.INTERCOM]:{configure:({onShow:e,onHide:t})=>{if(!re.Intercom)throw new Error("Intercom is not installed");return function(){if(fe)return;fe=!0,be();let e=!1,t=!1;const n=()=>{Ee();for(const e of we)e()},r=()=>{be();for(const e of he)e()},s=()=>{e||t?n():r()};re.Intercom("onShow",(()=>{e=!0,s()})),re.Intercom("onHide",(()=>{e=!1,s()}));const o=()=>{const e=!!document.querySelector('iframe[name="intercom-borderless-frame"], iframe[name="intercom-notifications-frame"]');t!==e&&(t=e,s())};re.Intercom("onUnreadCountChange",(()=>{o()})),window.setInterval(o,200)}(),we.add(e),he.add(t),()=>{we.delete(e),he.delete(t)}},show:()=>{Ee(),re.Intercom("show")},hide:()=>{be(),re.Intercom("hide")}},[t.ZENDESK]:{configure:({onShow:e,onHide:t})=>{if(!re.zE)throw new Error("Zendesk is not installed");!function(){if(ke)return;ke=!0,re.zE("webWidget","hide"),re.zE("webWidget","close"),re.zE("webWidget:on","open",(()=>{for(const e of pe)e()})),re.zE("webWidget:on","close",(()=>{for(const e of ve)e()})),re.zE("webWidget:on","chat:unreadMessages",(e=>{for(const t of ge)t(e)}))}();let n=!1,r=!1;const s=()=>{n||r?(re.zE("webWidget","show"),e()):(re.zE("webWidget","hide"),t())},o=()=>{n=!0,r=!1,s()};pe.add(o);const c=()=>{n=!1,r=!1,s()};ve.add(c);const a=e=>{const t=e>0;t!==r&&(r=t,s())};return ge.add(a),()=>{pe.delete(o),ve.delete(c),ge.delete(a)}},show:()=>{re.zE("webWidget","show"),re.zE("webWidget","open")},hide:()=>{re.zE("webWidget","hide"),re.zE("webWidget","close")}},[t.ZENDESK_MESSENGER]:{configure:({onShow:e,onHide:t})=>{if(!re.zE)throw new Error("Zendesk is not installed");let n=!1;const r=window.setInterval((()=>{const r=(()=>{const e=document.querySelector('iframe[title="Messaging window"]');return!!e&&"0px"!==window.getComputedStyle(e).height})();r!==n&&(n=r,n?e():t())}),200);return()=>{window.clearInterval(r)}},show:()=>{re.zE("messenger","open")},hide:()=>{re.zE("messenger","close")}}};let oe=!1;let ce=!1;function ae(){re.Beacon("config",{display:{style:"icon"}})}function le(){re.Beacon("config",{display:{style:"manual"}})}let ie=!1,ue=!1;function de(){ue=!0;document.getElementById("hubspot-messages-iframe-container")?.style.setProperty("visibility","visible","important")}function me(){ue=!1;document.getElementById("hubspot-messages-iframe-container")?.style.setProperty("visibility","hidden","important")}let fe=!1,we=new Set,he=new Set;function Ee(){re.Intercom("update",{hide_default_launcher:!1,vertical_padding:20})}function be(){re.Intercom("update",{hide_default_launcher:!0,vertical_padding:100})}let ke=!1,pe=new Set,ve=new Set,ge=new Set;const Ce=e=>w.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 100 100"},e),w.createElement("path",{fill:"currentColor",d:"M24.049 79.74h36.003c8.185 0 15.985-6.621 17.43-14.814l6.091-34.556h3.997c8.149 0 13.645 6.63 12.2 14.815l-7.051 40C91.274 93.363 83.474 100 75.288 100h-40c-8.185 0-13.645-6.667-12.2-14.815l.96-5.444Z"}),w.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12.437 69.63h40c8.148 0 15.978-6.637 17.422-14.815l7.052-40C78.355 6.63 72.896 0 64.711 0h-40C16.533 0 8.726 6.63 7.281 14.815l-7.052 40C-1.215 62.963 4.252 69.63 12.437 69.63Zm33.628-33.798c3.756-2.064 8.725-4.795 9.907-11.844C57.385 15.458 50.065 8.983 42.168 9c-7.452 0-12.771 3.195-17.508 8.892-.858 1.034-.884 2.45-.053 3.212l3.472 3.196c.847.767 2.25.589 3.176-.406 2.842-3.068 4.869-4.83 8.51-4.83 2.864 0 6.077 1.934 5.59 4.847-.37 2.223-2.292 3.334-5.4 5.001l-.28.151c-3.582 1.92-8.134 4.362-9.124 10.247l-.16.956c-.055.28-.05.571.014.85.065.278.188.538.362.76.173.222.391.4.639.522.247.121.518.183.79.18h6.744a2.709 2.709 0 0 0 1.712-.688c.481-.426.81-1.01.934-1.657l.095-.556c.266-1.582 2.101-2.59 4.384-3.845ZM32.837 59c3.552 0 6.955-3.034 7.58-6.769.63-3.729-1.742-6.763-5.293-6.763-3.552 0-6.934 3.028-7.58 6.763C26.9 55.966 29.286 59 32.837 59Z"})),je=({center:e,fadeIn:t})=>{const n=12;return w.createElement("div",{className:O({"userflowjs-spinner":!0,"userflowjs-spinner--center":!!e,"userflowjs-spinner--fade-in":!!t})},w.createElement("svg",{viewBox:"0 0 24 24",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},w.createElement("circle",{className:"userflowjs-spinner__bg",fill:"none",cx:n,cy:n,r:10,style:{strokeWidth:"4px"}}),w.createElement("circle",{className:"userflowjs-spinner__fill",fill:"none",cx:n,cy:n,r:10,transform:"translate(12, 12) rotate(-90) translate(-12, -12)",style:{strokeWidth:"4px",strokeDasharray:20*Math.PI*.25+"px, 1000"}})))};function Ne({message:e,skip:t}){const n=h(),[r,s]=w.useState(!0),[o,c]=w.useState(!1),[a,l]=w.useState(null),[i,u]=w.useState(null),[d,m]=w.useState(null),f=w.useRef(0),E=w.useRef(null),b=w.useRef((()=>{}));return w.useEffect((()=>{if(t)return;const r=JSON.stringify(e);if(r===E.current)return;E.current=r;const o=++f.current;let a,i;let d=!1;b.current=async(e,t)=>{if(!d){d=!0,c(!0);try{const r=e(a,i);i=r;const s=await n.send(r,{handlesRejection:!0});if(o!==f.current)return;a=t(a,s),l(a),m(null)}catch(r){if(o!==f.current)return;m(r)}finally{d=!1,c(!1)}}},(async()=>{s(!0);try{i=e;const t=await n.send(e,{handlesRejection:!0});if(o!==f.current)return;a=t,l(a),u(e),m(null)}catch(t){if(o!==f.current)return;m(t)}finally{s(!1)}})()}),[t,n,e]),{loading:r,loadingMore:o,data:a,messageForData:i,error:d,loadMore:b.current}}function Se(e,t){const[n,r]=w.useState(e),s=w.useRef(void 0),o=w.useCallback((e=>{window.clearTimeout(s.current),r(e),t(e)}),[t]),c=w.useCallback((e=>{window.clearTimeout(s.current),r(e),s.current=window.setTimeout((()=>{t(e)}),200)}),[t]);return w.useEffect((()=>()=>{window.clearTimeout(s.current)}),[]),[n,c,o]}const ye=({textareaRef:e,value:t,onChange:n,onBlur:r,onKeyDown:s,onMouseDown:o,placeholder:c,disabled:a,readOnly:l,className:i,mirrorClassName:u,textareaClassName:d,children:m})=>{let f=t||c||"";return(""===f||f.endsWith("\n"))&&(f+=" "),i=i||"growing-textarea",u=u||i+"__mirror",w.createElement("div",{className:i},w.createElement("div",{className:u+" "+(d||"")},f),w.createElement("textarea",{ref:e,value:t,onChange:e=>n&&n(e.target.value),onBlur:r,onKeyDown:s,onMouseDown:o,placeholder:c,disabled:a,readOnly:l,className:d}),m)},Ie=({textareaRef:e,value:t,onChange:n,onSubmit:r,placeholder:s,readOnly:o})=>{const c=()=>{r&&r()};return w.createElement("div",{className:"userflowjs-assistant-chat-input"},w.createElement(ye,{textareaRef:e,className:"userflowjs-growing-textarea",mirrorClassName:"userflowjs-growing-textarea__mirror",textareaClassName:"userflowjs-textarea userflowjs-assistant-chat-input__textarea",placeholder:s,readOnly:o,value:t||"",onChange:n,onKeyDown:e=>{e.shiftKey||"Enter"!==e.key||(e.preventDefault(),c())}}),w.createElement("button",{"data-testid":"assistant-chat-input-submit",className:"userflowjs-assistant-chat-input__submit",onClick:()=>c()},w.createElement(M,{icon:W})))};const _e=async()=>(await f((()=>import("./ResourceCenterAssistantChat.js")),[new URL("ResourceCenterAssistantChat.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("userflow.js",import.meta.url).toString(),new URL("vendor.phoenix.js",import.meta.url).toString(),new URL("vendor.uuid.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-regular-svg-icons.js",import.meta.url).toString(),new URL("vendor.dompurify.js",import.meta.url).toString(),new URL("vendor.marked.js",import.meta.url).toString(),new URL("vendor.obj-str.js",import.meta.url).toString(),new URL("bubble-frame.styl.js",import.meta.url).toString(),new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString(),new URL("stylesheets.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-solid-svg-icons.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("flow-host.styl.js",import.meta.url).toString(),new URL("use-window-resize.js",import.meta.url).toString(),new URL("logomark.js",import.meta.url).toString(),new URL("ChecklistUI.js",import.meta.url).toString(),new URL("BubbleToolbar.js",import.meta.url).toString(),new URL("use-element-rect.js",import.meta.url).toString()])).ResourceCenterAssistantChat,xe=({session:l,isOpen:i,flowSession:u,checklistSession:d})=>{const m=h(),{t:f}=te(),{company:j}=l.flow,{version:N}=l,S=N.resourceCenter,y=A(N.theme),I=l.locale?l.locale.standardLocaleId:l.version.theme.languageId;w.useEffect((()=>{E.changeLanguage(I)}),[I]);const{loaded:R}=L(window,p,y),[U,W]=w.useState(!1),K=R&&U,[G,Q]=w.useState(x()),[Z,Y]=w.useState(T()),J=w.useCallback((()=>{Q(x()),Y(T())}),[]);H(J);const{zIndex:X,bringToFront:ee}=b(),[re,oe]=w.useState(null),[ce,ae]=w.useState(null),[le,ie]=w.useState(null),ue=w.useRef(null),[de,me]=w.useState(null),[fe,we]=w.useState(null),[he,Ee]=w.useState(null),[be,ke]=w.useState(0),[pe,ve]=w.useState(0),ge=w.useCallback((()=>{ce&&ke(Math.round(ce.offsetWidth)),ve(Math.round((le?.offsetHeight||0)+(de?.offsetHeight||0)+(fe?.offsetHeight||0)+(he?.offsetHeight||0)))}),[ce,le,de,fe,he]);w.useLayoutEffect((()=>{if(!re||"function"!=typeof _)return;const e=new _((()=>{ge()}));return e.observe(re,{childList:!0,attributes:!0,subtree:!0}),()=>{e.disconnect()}}),[re,ge]),w.useLayoutEffect((()=>{ge()}));const[je,Ne]=w.useState(!1),Se=w.useRef(),ye=w.useCallback((()=>{Ne(!0),window.clearTimeout(Se.current),Se.current=window.setTimeout((()=>{Ne(!1)}),y.resourceCenterTransitionDuration)}),[y.resourceCenterTransitionDuration]);w.useEffect((()=>()=>{window.clearTimeout(Se.current)}),[]);const Ie=w.useCallback((()=>{ee(),ye(),m.openResourceCenter()}),[ee,m,ye]),_e=w.useCallback((()=>{ye(),m.closeResourceCenter()}),[m,ye]),[xe,Re]=w.useState(!1);w.useEffect((()=>{if(xe){if(!("ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0))if(i){const e='button:not([tabindex="-1"]), [tabindex]:not([tabindex="-1"]), input, textarea';let t=de?.querySelector(".userflowjs-assistant-chat-input textarea")||de?.querySelector(e)||le?.querySelector(e);if(t){const e=t.closest&&t.closest(".userflowjs-resource-center-checklist")||null;e?D(e):t.focus({preventScroll:!0})}}else ce?.focus({preventScroll:!0});Re(!1)}}),[xe,i,de,le,ce]),w.useEffect((()=>{const e=re?.ownerDocument.defaultView;if(!i||!e)return;const t=e=>{"Escape"===e.key&&(_e(),Re(!0))};return e.addEventListener("keydown",t),()=>e.removeEventListener("keydown",t)}),[i,re,Re,_e]);const[Be,He]=w.useState((()=>function(e,t){if(!t)return null;const n=JSON.parse(t);let r;n.blockCvid&&(r=e.version.resourceCenter?.blocks.find((e=>e.cvid===n.blockCvid)));if(!r&&"search"!==n.kind)return null;const s={kind:n.kind,block:r};switch(s.kind){case"announcementShow":s.announcementId=n.announcementId}return s}(l,n.getItem(`resourceCenterRoute:v1:${l.id}`)))),Ue=w.useCallback(((e,t)=>{He(e);const r=function(e){if(!e)return null;let t;"block"in e&&null!=e.block&&(t=e.block.cvid);const n={kind:e.kind,blockCvid:t};switch(e.kind){case"announcementShow":n.announcementId=e.announcementId}return JSON.stringify(n)}(e);r?n.setItem(`resourceCenterRoute:v1:${l.id}`,r):n.removeItem(`resourceCenterRoute:v1:${l.id}`),0===t?.detail&&Re(!0)}),[l.id]),We=w.useMemo((()=>S.blocks.filter((t=>!(t.type===e.CHECKLIST&&!d)&&((t.type!==e.DIVIDER||!y.resourceCenterAutoDividers)&&(!t.hiddenWhenFlowsActive||!t.hiddenWhenFlowsActive.some((e=>e===u?.flow.id||e===d?.flow.id))))))),[S,u,d,y.resourceCenterAutoDividers]),ze=w.useMemo((()=>Ae(We)),[We]),Ke=w.useMemo((()=>d&&S.blocks.some((t=>t.type===e.CHECKLIST))?r(d):0),[S,d]),Ge=w.useMemo((()=>S.blocks.find((t=>t.type===e.CONTACT&&t.chatEnabled&&t.chatProvider))),[S]),[Qe,Ze]=w.useState(!1),Ye=w.useCallback((()=>{m.closeResourceCenter(),Ge&&Ge.chatProvider!==t.CUSTOM&&Ze(!0)}),[m,Ge]),et=w.useCallback((()=>{Ze(!1)}),[]),tt=w.useCallback((()=>{if(Ge)try{se[Ge.chatProvider].hide({block:Ge}),et()}catch(e){console.error(`Userflow.js: Error when hiding ${Ge.chatProvider}:`,e)}}),[Ge,et]);w.useEffect((()=>{if(!Ge)return;s.autoHide3pDisabled=!0;const e=se[Ge.chatProvider];try{const t=e.configure({block:Ge,onShow:Ye,onHide:et});return()=>{t()}}catch(t){return void console.error(`Userflow.js: Error when configuring ${Ge.chatProvider}:`,t)}}),[Ge,Ye,et]),w.useEffect((()=>{i&&tt()}),[tt,i]);const nt=w.useMemo((()=>S.blocks.find((t=>t.type===e.ANNOUNCEMENTS))),[S]),rt=!!Be&&("search"===Be.kind||"flows"===Be.kind||"knowledgeBase"===Be.kind),st="assistant"===Be?.kind||"announcementList"===Be?.kind||"announcementShow"===Be?.kind,ot=Math.min(st?y.resourceCenterFullWidth:y.resourceCenterWidth,G-2*y.resourceCenterPaddingX),ct={zIndex:null!=y.resourceCenterZIndex?y.resourceCenterZIndex:i?X:k(v),position:K?void 0:"absolute",visibility:K&&!Qe?void 0:"hidden"},at={width:(i?ot:be)+"px",height:i?Math.min(rt?540:st?720:pe,Z-2*y.resourceCenterPaddingY,null==y.resourceCenterMaxHeight?Number.MAX_VALUE:y.resourceCenterMaxHeight)+"px":void 0},[lt,it]=w.useState(!1),ut=()=>{Ie(),Re(!0)},dt=y.resourceCenterDisplayChecklistProgress&&d&&Ke>0?w.createElement("div",{"data-testid":"resource-center-launcher-badge",className:"userflowjs-resource-center-launcher-badge"},Ke,w.createElement("div",{className:"userflowjs-a11y-only"},"uncompleted tasks")):null;let mt="",ft="";return y.resourceCenterLauncherTextMode===o.CHECKLIST_OVERRIDE&&d&&Ke>0?mt=d.version.checklist?.launcherText||"Get Started":y.resourceCenterLauncherTextMode!==o.NONE&&(ft=S.buttonText),w.createElement(g.Provider,{value:l},w.createElement("div",{"data-testid":"resource-center-app",className:"userflowjs-resource-center-app userflowjs-theme-root",style:B(y),dir:E.dir()},w.createElement("div",{className:O({"userflowjs-resource-center":!0,"userflowjs-resource-center--fixed":!0,[`userflowjs-resource-center--placement-${y.resourceCenterPlacement.toLowerCase().replace(/_/g,"-")}`]:!0}),style:ct},w.createElement("div",{className:"userflowjs-resource-center-frame-wrapper",onMouseEnter:()=>it(!0),onMouseLeave:()=>it(!1)},w.createElement(F,{className:O({"userflowjs-resource-center-frame":!0,"userflowjs-resource-center-frame--animating":je,"userflowjs-resource-center-frame--open":i,"userflowjs-resource-center-frame--closed":!i}),style:at,stylesheet:C,theme:y,onStylesheetsLoad:W},K&&w.createElement(w.Fragment,null,w.createElement("div",{ref:oe,className:O({"userflowjs-resource-center-frame-root":!0,[`userflowjs-resource-center-frame-root--placement-${y.resourceCenterPlacement.toLowerCase().replace(/_/g,"-")}`]:!0,"userflowjs-resource-center-frame-root--animating":je,"userflowjs-resource-center-frame-root--open":i,"userflowjs-resource-center-frame-root--closed":!i}),role:i?"dialog":void 0,"aria-label":i?S.headerText:void 0},w.createElement("div",{className:"userflowjs-resource-center-launcher-container"},w.createElement("button",{ref:ae,className:O({"userflowjs-resource-center-launcher-button":!0,"userflowjs-resource-center-launcher-button--hover":lt}),onClick:ut,"aria-label":`Open ${S.headerText}`},dt,mt&&w.createElement("div",{"data-testid":"resource-center-launcher-text",className:"userflowjs-resource-center-launcher-text"},mt),(dt||mt)&&w.createElement("div",{className:"userflowjs-resource-center-launcher-divider"}),ft&&w.createElement("div",{"data-testid":"resource-center-launcher-text",className:"userflowjs-resource-center-launcher-text"},ft),w.createElement("div",{className:"userflowjs-resource-center-launcher-icon"},y.resourceCenterLauncherIconType===c.PLAINTEXT?"?":w.createElement(Ce,null)))),w.createElement("div",{ref:ue,className:"userflowjs-resource-center-body",style:{width:ot+"px"}},w.createElement("div",{ref:me,className:O({"userflowjs-resource-center-body-content":!0,"userflowjs-resource-center-body-content--padding":"assistant"!==Be?.kind,"userflowjs-resource-center-body-content--same-background":y.sameBackground,"userflowjs-resource-center-body-content--with-made-with-userflow":j.resourceCenterBranding})},i&&w.createElement(w.Fragment,null,Be?"search"===Be.kind?w.createElement(Fe,{session:l,navigate:Ue}):"email"===Be.kind?w.createElement(Oe,{block:Be.block,session:l}):"phone"===Be.kind?w.createElement(Pe,{block:Be.block,session:l}):"flows"===Be.kind?w.createElement(De,{block:Be.block,initialQ:Be.initialQ,session:l,navigate:Ue}):"knowledgeBase"===Be.kind?w.createElement($e,{block:Be.block,initialQ:Be.initialQ,session:l,bodyRef:ue}):"subpage"===Be.kind?w.createElement(qe,{block:Be.block,session:l}):"announcementList"===Be.kind||"announcementShow"===Be.kind?w.createElement(Ve,{bodyRef:ue,session:l,route:Be,navigate:Ue}):"assistant"===Be.kind?w.createElement(Je,{block:Be.block,initialUserContent:Be.initialUserContent,session:l,navigate:Ue}):null:w.createElement(w.Fragment,null,We.map(((e,t)=>{const n=Le[e.type],r=We[t+1];return n?w.createElement(w.Fragment,{key:e.id},w.createElement(n.View,{session:l,flowSession:u,checklistSession:d,block:e,navigate:Ue,onChatShow:Ye}),r&&function(e,t,n){return!!e.resourceCenterAutoDividers&&(ne(t)||ne(n))}(y,e.type,r.type)&&w.createElement("div",{className:"userflowjs-resource-center-divider"})):null})))))),j.resourceCenterBranding&&w.createElement("div",{className:"userflowjs-resource-center-made-with-userflow"},w.createElement("div",{className:"userflowjs-resource-center-made-with-userflow-content",ref:we},w.createElement("a",{href:"https://userflow.com/?utm_source=made-with-userflow&utm_medium=link&utm_campaign=made-with-userflow-"+j.slug+"&utm_content=resource-center",target:"_blank",rel:"noopener noreferrer"},w.createElement(P,null),w.createElement("div",null,"Made with Userflow")))),l.draftMode&&w.createElement("div",{className:"userflowjs-resource-center-preview"},w.createElement("div",{ref:Ee,className:"userflowjs-resource-center-preview-content"},w.createElement("div",{className:"userflowjs-resource-center-preview-text"},"Preview"),w.createElement("button",{className:"userflowjs-resource-center-preview-button",onClick:()=>{m.endFlow(l,{endReason:a.USER_CLOSED})}},w.createElement(M,{icon:$})))),w.createElement("div",{className:"userflowjs-resource-center-header",style:{width:ot+"px"}},w.createElement("div",{ref:ie,className:"userflowjs-resource-center-header-content"},null==Be?w.createElement("div",{className:"userflowjs-resource-center-header-text"},S.headerText):w.createElement("button",{className:"userflowjs-resource-center-icon-button",onClick:e=>Ue("announcementShow"===Be?.kind?{kind:"announcementList",block:Be.block}:null,e)},w.createElement("div",{className:"userflowjs-rtl-mirrored"},w.createElement(M,{icon:z})),w.createElement("div",{className:"userflowjs-resource-center-icon-button__text"},f("resource_center.back"))),w.createElement("div",{className:"flex-1"}),ze.length>0&&w.createElement("button",{className:"userflowjs-resource-center-icon-button",onClick:()=>{let e={kind:"search"};if(1===ze.length){const t=ze[0],n=Le[t.type];n.routeTo&&(e=n.routeTo({block:t}))}"search"===Be?.kind?Ue(null):(Xe(m,l,null,"Search icon"),Ue(e))},"aria-label":"Search"},w.createElement(M,{icon:q})),w.createElement("button",{className:"userflowjs-resource-center-icon-button userflowjs-resource-center-close-button",onClick:e=>{_e(),0===e.detail&&Re(!0)},"aria-label":`Close ${S.headerText}`},w.createElement(M,{icon:V}))))))),!i&&!u&&nt&&nt.unreadAnnouncementCount>0&&w.createElement(Te,{theme:y,count:nt.unreadAnnouncementCount,onClick:ut})),!i&&!u&&nt?.popoutAnnouncement&&w.createElement(Me,{session:l,open:Ie,navigate:Ue,theme:y,block:nt}))))},Te=({theme:e,count:t,onClick:n})=>{const[r,s]=w.useState(!1);return w.createElement(F,{className:O({"userflowjs-resource-center-launcher-unread-badge":!0}),noScroll:!0,style:{position:r?void 0:"absolute",visibility:r?void 0:"hidden"},stylesheet:C,theme:e,onStylesheetsLoad:s},w.createElement(Re,{count:t,onClick:n}))},Re=({count:e,onClick:t})=>{let n=null;return e>9&&(e=9,n=w.createElement("span",{className:"userflowjs-unread-badge-plus"},"+")),w.createElement("div",{className:O({"userflowjs-unread-badge":!0,"userflowjs-unread-badge--clickable":!!t}),onClick:t},w.createElement("span",null,e),n)},Me=({session:e,open:t,navigate:n,theme:r,block:s})=>{const o=s.popoutAnnouncement,c=h(),[a,l]=w.useState(!1),{height:i,setEl:u}=ee();return w.createElement("div",{className:"userflowjs-resource-center-popout"},w.createElement(F,{className:O({"userflowjs-resource-center-popout-frame":!0}),style:{height:`calc(min(${i}px, 100vh - 2 * var(--userflow-resource-center-padding-y) - var(--userflow-resource-center-collapsed-height) - 20px)`,position:a?void 0:"absolute",visibility:a?void 0:"hidden"},stylesheet:C,theme:r,onStylesheetsLoad:l},w.createElement("div",{ref:u,className:"userflowjs-resource-center-popout-frame-root"},w.createElement("h2",{className:"userflowjs-announcement-title"},w.createElement("span",{className:"userflowjs-unread-dot"}),w.createElement("span",null,o.title)),w.createElement("div",{className:"userflowjs-announcement-time"},w.createElement("div",{className:"userflowjs-announcement-time-text"},tt(o.time))),w.createElement("div",{className:"userflowjs-announcement-content userflowjs-bubble-content"},w.createElement(j,{doc:o.content,buttons:o.buttons})),o.moreEnabled&&w.createElement("div",{className:"userflowjs-announcement-more"},w.createElement("button",{className:"userflowjs-announcement-more-button",onClick:()=>{Qe(c,o),Xe(c,e,s,o.title),n({kind:"announcementShow",block:s,announcementId:o.id}),t()}},w.createElement("div",null,(o.moreEnabled?o.moreButtonText:null)||"Read more"),w.createElement("span",{className:"userflowjs-rtl-mirrored"},w.createElement(M,{icon:K})))),w.createElement("div",{className:"userflowjs-bubble-toolbar"},w.createElement("button",{className:"userflowjs-bubble-toolbar-button",onClick:()=>{Qe(c,o)},"aria-label":"Dismiss announcement"},w.createElement(M,{icon:$}))))),w.createElement("div",{className:"userflowjs-resource-center-popout-notch"}))};function Ae(e){return e.filter((e=>{const t=Le[e.type];return t.isSearchable?t.isSearchable(e):!!t.search}))}const Le={[e.ACTION]:{View:e=>{const{block:t,session:n,flowSession:r,checklistSession:s}=e,o=h(),[c,a]=w.useState(!1),i=r?.id,u=s?.id;return w.useEffect((()=>{a(!1)}),[i,u]),w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:c?void 0:()=>{Xe(o,n,t);const e=t.actions.find((e=>e.type===l.START_FLOW));if(e){e.otherFlow?.id!==s?.flow.id&&a(!0)}else o.closeResourceCenter();N(o,n,t.actions)},disabled:c},w.createElement(Be,{...e}),w.createElement(He,{...e}),c&&w.createElement(je,null))}},[e.ANNOUNCEMENTS]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h();return w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:e=>{Xe(s,n,t),r({kind:"announcementList",block:t},e)}},t.unreadAnnouncementCount>0?w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(Re,{count:t.unreadAnnouncementCount})):w.createElement(Be,{...e}),w.createElement(He,{...e}),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(M,{icon:G})))}},[e.ASSISTANT]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h(),[o,c]=w.useState("");return t.assistantAppearance===i.INPUT?w.createElement("div",{className:"userflowjs-resource-center-assistant-block"},w.createElement(Ie,{value:o,onChange:c,placeholder:S(t.name,{lookupAttribute:R(n.data)}),onSubmit:()=>{Xe(s,n,t),r({kind:"assistant",block:t,initialUserContent:o})}})):w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:()=>{Xe(s,n,t),r({kind:"assistant",block:t,initialUserContent:""})}},w.createElement(Be,{...e}),w.createElement(He,{...e}))}},[e.CHECKLIST]:{View:({checklistSession:e})=>w.createElement("div",{"data-testid":"resource-center-checklist",className:"userflowjs-resource-center-checklist"},w.createElement(U,{session:e}),w.createElement(X,{draftMode:!!e.draftMode&&"CHECKLIST PREVIEW"}))},[e.CONTACT]:{View:e=>{const{block:t,session:n,navigate:r,onChatShow:s}=e,o=h(),c=[];return t.emailEnabled&&c.push({icon:Z,label:"Email",isRoute:!0,onClick:e=>{Xe(o,n,t,"Email"),r({kind:"email",block:t},e)}}),t.phoneEnabled&&c.push({icon:Y,label:"Phone",isRoute:!0,onClick:e=>{Xe(o,n,t,"Phone"),r({kind:"phone",block:t},e)}}),t.chatEnabled&&c.push({icon:J,label:"Live-chat",isRoute:!1,onClick:()=>{if(Xe(o,n,t,"Chat"),t.chatProvider){const n=se[t.chatProvider];try{n.show({block:t})}catch(e){console.error(`Userflow.js: Error when showing ${t.chatProvider}:`,e)}s()}else n.draftMode&&window.alert("You have not selected a chat provider. Go to the resource center builder in Userflow. Click the Contact block. Pick a chat provider in the side panel.")}}),w.createElement("div",{className:O({"userflowjs-resource-center-block":!0,"userflowjs-resource-center-block--clickable":1===c.length}),onClick:1===c.length?c[0].onClick:void 0},1===c.length&&w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(M,{icon:c[0].icon})),w.createElement(He,{...e}),c.length>1&&c.map((({icon:e,label:t,onClick:n},r)=>w.createElement("button",{key:r,className:"userflowjs-resource-center-icon-button",onClick:n,"aria-label":t},w.createElement(M,{icon:e})))),1===c.length&&c[0].isRoute&&w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(M,{icon:G})))}},[e.DIVIDER]:{View:()=>w.createElement("div",{className:"userflowjs-resource-center-divider"})},[e.FLOWS]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h();return w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:e=>{Xe(s,n,t),r({kind:"flows",block:t},e)}},w.createElement(Be,{...e}),w.createElement(He,{...e}),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(M,{icon:G})))},routeTo:({block:e,initialQ:t})=>({kind:"flows",block:e,initialQ:t}),isSearchable:e=>!!e.searchEnabled,search:async({client:e,session:t,block:n,q:r})=>{const{flows:s}=await e.send({kind:"ListResourceCenterBlockFlows",sessionId:t.id,blockCvid:n.cvid},{handlesRejection:!0}),o=Ue(s,r),c=o.slice(0,5);return{block:n,truncated:c.length===o.length,results:c.map((e=>({kind:"flow",flow:e})))}}},[e.KNOWLEDGE_BASE]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h();return w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:e=>{Xe(s,n,t),r({kind:"knowledgeBase",block:t},e)}},w.createElement(Be,{...e}),w.createElement(He,{...e}),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(M,{icon:G})))},routeTo:({block:e,initialQ:t})=>({kind:"knowledgeBase",block:e,initialQ:t}),search:async({client:e,session:t,block:n,q:r})=>{const{truncated:s,articles:o}=await e.send({kind:"SearchKnowledgeBase",sessionId:t.id,blockCvid:n.cvid,q:r,offset:0,limit:5},{handlesRejection:!0});return{block:n,truncated:s,results:o.map((e=>({kind:"article",article:e})))}}},[e.MESSAGE]:{View:({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-block"},w.createElement("div",{className:"userflowjs-resource-center-block-text userflowjs-bubble-content"},w.createElement(j,{doc:e.content,lookupAttribute:R(t.data)})))},[e.SUBPAGE]:{View:e=>{const{block:t,session:n,navigate:r}=e,s=h();return w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:e=>{Xe(s,n,t),r({kind:"subpage",block:t},e)}},w.createElement(Be,{...e}),w.createElement(He,{...e}),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(M,{icon:G})))}}},Be=({block:e})=>e.icon?w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(M,{icon:e.icon,size:16})):null,He=({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-block-text"},w.createElement(y,{doc:e.name,lookupAttribute:R(t.data)}));const Fe=({session:e,navigate:t})=>{const n=h(),r=e.version.resourceCenter.blocks,s=Ae(r),{t:o}=te(),c=w.useRef(null),[a,l]=w.useState(""),[i,u]=Se(a,l),[d,m]=w.useState(null);return w.useEffect((()=>{if(""===a.trim())return void m(null);let t=!1;return(async()=>{m(null);const s=await Promise.all(r.map((async t=>{const{search:r}=Le[t.type];if(!r)return null;try{return await r({client:n,session:e,block:t,q:a})}catch(s){return console.error(`Userflow.js: Global search failed for ${t.type} block=`,t,"error=",s),null}})));t||m(s.filter((e=>null!=e&&e.results.length>0)))})(),()=>{t=!0}}),[n,e,r,a]),w.useEffect((()=>{c.current?.focus({preventScroll:!0})}),[]),w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-resource-center-list-route-search"},w.createElement("input",{ref:c,className:"userflowjs-text-input",type:"text",value:i,onChange:e=>u(e.target.value),placeholder:o("resource_center.search_placeholder")})),""===a.trim()?w.createElement("div",{"data-testid":"resource-center-empty-query",className:"userflowjs-resource-center-list-route-error"},o("resource_center.search_in")," ",s.map(((t,n)=>w.createElement(w.Fragment,{key:t.cvid},n>0&&(n===s.length-1?` ${o("and")} `:", "),w.createElement("b",null,w.createElement(y,{doc:t.name,lookupAttribute:R(e.data)}))))),"."):d?0===d.length?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},o("resource_center.no_results_found")):d.map((({block:r,truncated:s,results:c},l)=>{const i=Le[r.type],u=i.routeTo&&i.routeTo({block:r,initialQ:a});return w.createElement(w.Fragment,{key:r.cvid},l>0&&w.createElement("div",{className:"userflowjs-resource-center-divider"}),w.createElement("div",{className:"userflowjs-resource-center-label"},w.createElement(y,{doc:r.name,lookupAttribute:R(e.data)})),c.map(((n,s)=>"flow"===n.kind?w.createElement(We,{key:n.flow.id,block:r,session:e,flow:n.flow,navigate:t}):"article"===n.kind?w.createElement(ze,{key:s,block:r,session:e,article:n.article}):null)),!s&&u&&w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:s=>{Xe(n,e,r),t(u,s)}},w.createElement("div",{className:"userflowjs-resource-center-block-text"},o("more"),":"," ",w.createElement(y,{doc:r.name,lookupAttribute:R(e.data)})),w.createElement("div",{className:"userflowjs-resource-center-block-nav-icon"},w.createElement(M,{icon:G}))))})):w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null)))},Oe=({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-content-route userflowjs-bubble-content"},w.createElement(j,{doc:e.emailContent,lookupAttribute:R(t.data)})),Pe=({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-content-route userflowjs-bubble-content"},w.createElement(j,{doc:e.phoneContent,lookupAttribute:R(t.data)})),De=({block:e,initialQ:t,session:n,navigate:r})=>{const{t:s}=te(),o=w.useRef(null),[c,a]=w.useState(t||""),[l,i]=Se(c,a),{data:u,error:d}=Ne({message:{kind:"ListResourceCenterBlockFlows",sessionId:n.id,blockCvid:e.cvid}}),m=u?.flows,f=w.useMemo((()=>m?Ue(m,c):null),[m,c]);return w.useEffect((()=>{o.current?.focus({preventScroll:!0})}),[]),w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-resource-center-list-route-header"},w.createElement("div",{className:"userflowjs-resource-center-list-route-title"},w.createElement(y,{doc:e.name,lookupAttribute:R(n.data)}))),e.searchEnabled&&w.createElement("div",{className:"userflowjs-resource-center-list-route-search"},w.createElement("input",{ref:o,className:"userflowjs-text-input",type:"text",value:l,onChange:e=>i(e.target.value),placeholder:s("resource_center.search_placeholder")})),d?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},s("resource_center.generic_error")):f?0===f.length?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},s("resource_center.no_results_found")):f.map((t=>w.createElement(We,{key:t.id,block:e,session:n,flow:t,navigate:r}))):w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,{fadeIn:!0})))};function Ue(e,t){const n=t.toLowerCase().trim();return""===n?e:e.filter((e=>e.name.toLowerCase().includes(n)))}const We=({block:e,session:t,flow:n,navigate:r})=>{const s=h(),[o,c]=w.useState(!1);return w.useEffect((()=>{if(!o||n.type!==u.CHECKLIST)return;const e=()=>{s.checklistSession?.flow.id===n.id&&(t(),r(null))},t=()=>{s.off("checklistChanged",e)};return s.on("checklistChanged",e),t}),[s,o,n.type,n.id,r]),w.createElement("button",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:()=>{if(Xe(s,t,e,n.name),s.checklistSession?.flow.id===n.id)return void r(null);s.startFlow({flowId:n.id,startReason:d.RESOURCE_CENTER,replaceCurrent:!0}),c(!0);const o=S(n.url,{lookupAttribute:R(t.data)});o&&I(o)},disabled:o},w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(M,{icon:n.type===u.CHECKLIST?"regular/tasks":"regular/shoe-prints",size:16})),w.createElement("div",{className:"userflowjs-resource-center-block-text"},n.name),o&&w.createElement(je,null))},$e=({block:e,initialQ:t,session:n,bodyRef:r})=>{const{t:s}=te(),o=w.useRef(null),[c,a]=w.useState(t||""),[l,i]=Se(c,a),{loading:u,loadingMore:d,data:m,messageForData:f,error:h,loadMore:E}=Ne({message:{kind:"SearchKnowledgeBase",sessionId:n.id,blockCvid:e.cvid,q:c,offset:0}});et({bodyRef:r,loading:u,loadingMore:d,truncated:m?.truncated,loadMoreHelper:w.useCallback((()=>{E(((e,t)=>({...t,offset:e.articles.length})),((e,t)=>({...t,articles:[...e.articles,...t.articles]})))}),[E])}),w.useEffect((()=>{o.current?.focus({preventScroll:!0})}),[]);let b=e.knowledgeBaseUrl||"";return b.match(/^https?:\/\//)||(b=`http://${b}`),w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-resource-center-list-route-header"},w.createElement("div",{className:"userflowjs-resource-center-list-route-title"},w.createElement(y,{doc:e.name,lookupAttribute:R(n.data)})),w.createElement("a",{className:"userflowjs-resource-center-icon-button",href:b,target:"_blank",rel:"noopener noreferrer"},w.createElement(M,{icon:Q}))),w.createElement("div",{className:"userflowjs-resource-center-list-route-search"},w.createElement("input",{ref:o,className:"userflowjs-text-input",type:"text",value:l,onChange:e=>i(e.target.value),placeholder:s("resource_center.search_placeholder")})),h?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},"quota_exceeded"===h.code?"Sorry, this company has reached its max number of searches. Consider asking Userflow to be moved to a dedicated search engine for a higher quota.":h.humanMessage||s("resource_center.generic_error")):u||!m?w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null)):0===m.articles.length?""===f?.q?null:w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},s("resource_center.no_results_found")):w.createElement(w.Fragment,null,""===f?.q&&w.createElement("div",{className:"userflowjs-resource-center-label"},s("resource_center.suggested_articles")),m.articles.map(((t,r)=>w.createElement(ze,{key:r,block:e,session:n,article:t}))),d&&w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null))))},ze=({block:e,article:t,session:n})=>{const r=h();return w.createElement("a",{className:"userflowjs-resource-center-block userflowjs-resource-center-block--clickable",onClick:()=>{Xe(r,n,e,t.title)},href:t.url,target:"_blank",rel:"noopener noreferrer"},w.createElement("div",{className:"userflowjs-resource-center-block-icon"},w.createElement(M,{icon:"regular/file-alt",size:16})),w.createElement("div",{className:"userflowjs-resource-center-block-text"},w.createElement("span",{dangerouslySetInnerHTML:{__html:t.htmlTitle}}),w.createElement("div",{className:"userflowjs-resource-center-block-subtext",dangerouslySetInnerHTML:{__html:t.htmlSnippet}})))},qe=({block:e,session:t})=>w.createElement("div",{className:"userflowjs-resource-center-content-route userflowjs-bubble-content"},w.createElement(j,{doc:e.content,lookupAttribute:R(t.data)})),Ve=({bodyRef:e,session:t,route:n,navigate:r})=>{const s=h(),o=Ne({message:{kind:"ListAnnouncements",beforeAnnouncementId:null},skip:"announcementList"!==n?.kind}),{loading:c,loadingMore:a,data:l,loadMore:i}=o,u=l?.truncated,d=w.useCallback((()=>{i(((e,t)=>e.announcements.length>0?{...t,beforeAnnouncementId:e.announcements[e.announcements.length-1].id}:t),((e,t)=>({...t,announcements:[...e.announcements,...t.announcements]})))}),[i]);et({bodyRef:e,loading:c,loadingMore:a,truncated:u,loadMoreHelper:d});const[m,f]=w.useState(void 0);return w.useLayoutEffect((()=>{e.current&&null!=m&&"announcementList"===n?.kind&&(e.current.scrollTop=m)}),[e,m,n?.kind]),"announcementList"===n?.kind?w.createElement(Ke,{bodyRef:e,session:t,block:n.block,onMoreClick:o=>{f(e.current?.scrollTop),Xe(s,t,n.block,o.title),r({kind:"announcementShow",block:n.block,announcementId:o.id})},...o}):"announcementShow"===n?.kind?w.createElement(Ye,{block:n.block,announcementId:n.announcementId}):null},Ke=({bodyRef:e,block:t,session:n,onMoreClick:r,error:s,loading:o,loadingMore:c,data:a})=>{const{t:l}=te(),[i,u]=w.useMemo((()=>{const e=[],t=[];if(a){let n=-1;for(const r of a.announcements)n++,n<a.pageSize&&!r.seen&&r.level!==m.SILENT?e.push(r):t.push(r)}return[e,t]}),[a]),d=i.length;return w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-resource-center-list-route-header"},w.createElement("div",{className:"userflowjs-resource-center-list-route-title"},w.createElement(y,{doc:t.name,lookupAttribute:R(n.data)}))),s?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},s.humanMessage||l("resource_center.generic_error")):o||!a?w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null)):0===a.announcements.length?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},l("resource_center.no_results_found")):w.createElement(w.Fragment,null,d>0&&w.createElement("div",{className:"userflowjs-announcement-unread-header"},l("resource_center.unread",{count:d})),i.map(((t,n)=>w.createElement(Ze,{key:n,bodyRef:e,onMoreClick:()=>r(t),announcement:t}))),i.length>0&&u.length>0&&w.createElement("div",{className:"userflowjs-announcement-seen-divider"}),u.map(((t,n)=>w.createElement(Ze,{key:n,bodyRef:e,onMoreClick:()=>r(t),announcement:t}))),c&&w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null))))},Ge=new Set;function Qe(t,n){Ge.has(n.id)||(Ge.add(n.id),t.setResourceCenterSession((t=>t?{...t,version:{...t.version,resourceCenter:{...t.version.resourceCenter,blocks:t.version.resourceCenter.blocks.map((t=>t.type===e.ANNOUNCEMENTS?{...t,unreadAnnouncementCount:t.unreadAnnouncementCount-1,popoutAnnouncement:t.popoutAnnouncement?.id===n.id?null:t.popoutAnnouncement}:t))}}}:null)),t.toggleUI(),t.send({kind:"MarkAnnouncementSeen",announcementId:n.id,versionId:n.versionId}))}const Ze=({bodyRef:e,onMoreClick:t,announcement:n})=>{const r=h(),s=w.useRef(null),o=w.useRef(!1);return w.useEffect((()=>{if(o.current||n.seen)return;const t=new IntersectionObserver((e=>{const t=e[0];t&&t.isIntersecting&&(Qe(r,n),o.current=!0,c())}),{root:e.current,threshold:1}),c=()=>{t.disconnect()};return t.observe(s.current),c}),[e,r,n]),w.createElement("div",{className:"userflowjs-announcement-list-item"},w.createElement("div",{className:"userflowjs-announcement-time-divider"},w.createElement("div",{className:"userflowjs-announcement-time-divider-line"}),w.createElement("div",{className:"userflowjs-announcement-time-text"},tt(n.time)),w.createElement("div",{className:"userflowjs-announcement-time-divider-line"})),w.createElement("h2",{ref:s,className:"userflowjs-announcement-title"},!n.seen&&n.level!==m.SILENT&&w.createElement("span",{className:"userflowjs-unread-dot"}),w.createElement("span",null,n.title)),w.createElement("div",{className:"userflowjs-announcement-content userflowjs-bubble-content"},w.createElement(j,{doc:n.content,buttons:n.buttons})),w.createElement("div",{className:"userflowjs-announcement-more"},n.moreEnabled&&w.createElement("button",{className:"userflowjs-announcement-more-button",onClick:t},w.createElement("div",null,n.moreButtonText||"Read more"),w.createElement("span",{className:"userflowjs-rtl-mirrored"},w.createElement(M,{icon:K})))))},Ye=({announcementId:e})=>{const t=h(),{t:n}=te(),{loading:r,data:s,error:o}=Ne({message:{kind:"GetAnnouncement",announcementId:e}}),c=s?.announcement;return w.useEffect((()=>{c&&!c.seen&&Qe(t,c)}),[t,c]),w.createElement(w.Fragment,null,o?w.createElement("div",{className:"userflowjs-resource-center-list-route-error"},o.humanMessage||n("resource_center.generic_error")):r||!c?w.createElement("div",{className:"userflowjs-resource-center-list-route-spinner"},w.createElement(je,null)):w.createElement(w.Fragment,null,w.createElement("div",{className:"userflowjs-announcement-show"},w.createElement("h2",{className:"userflowjs-announcement-title"},c?.title),w.createElement("div",{className:"userflowjs-announcement-time"},w.createElement("div",{className:"userflowjs-announcement-time-text"},tt(c.time))),w.createElement("div",{className:"userflowjs-bubble-content"},w.createElement(j,{doc:c.content,buttons:c.buttons}),c.moreEnabled&&w.createElement(j,{doc:c.moreContent,buttons:c.moreButtons})))))},Je=({block:e,initialUserContent:t,session:r,navigate:s})=>{const o=e.assistantFlowId,c=h(),[a,l]=w.useState(null),[i,u]=w.useState(null),[d,m]=w.useState(null),[f]=w.useState(t);return w.useEffect((()=>{t&&s({kind:"assistant",block:e,initialUserContent:""})}),[t,e,s]),w.useEffect((()=>{let e=!1;return(async()=>{try{const t=n.getItem("assistantConversationId:"+o),[r,s]=await Promise.all([_e(),c.send({kind:"GetAssistant",assistantFlowId:o,conversationId:t},{handlesRejection:!0,endBatch:!0})]);if(e)return;l((()=>r)),u(s)}catch(t){console.error("Resource center assistant route failed to load:",t),m(t.humanMessage||"Sorry, something went wrong. Please try again or contact my human friends.")}})(),()=>{e=!0}}),[c,o]),d?w.createElement("div",{className:"userflowjs-assistant-chat"},w.createElement("div",{className:"userflowjs-assistant-chat__content"},w.createElement("div",{className:"userflowjs-assistant-chat__error"},d))):a&&i?w.createElement(a,{block:e,session:r,assistantReply:i,initialUserContent:f}):w.createElement(je,{center:!0,fadeIn:!0})};function Xe(e,t,n,r){e.send({kind:"ClickResourceCenter",sessionId:t.id,description:n?S(n.name,{lookupAttribute:R(t.data)})+(r?` - ${r}`:""):r},{batch:!0})}function et({bodyRef:e,loading:t,loadingMore:n,truncated:r,loadMoreHelper:s}){w.useEffect((()=>{const o=e.current;if(!o||t||n||r)return;const c=()=>{o.scrollHeight-o.clientHeight-o.scrollTop>400||s()};return o.addEventListener("scroll",c),()=>{o.removeEventListener("scroll",c)}}),[e,t,n,r,s])}function tt(e){const t=e?new Date(e):new Date;let n=new Intl.DateTimeFormat(E.language,{weekday:"long",day:"numeric",month:"short",year:t.getFullYear()===(new Date).getFullYear()?void 0:"numeric"}).format(t);return n.substring(0,1).toUpperCase()+n.substring(1)}var nt=Object.freeze({__proto__:null,[Symbol.toStringTag]:"Module",ResourceCenterApp:xe,default:xe});export{Ie as A,ye as G,nt as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./vendor.react.js";import{Z as t,$ as s,i as a}from"./userflow.js";import{u as n}from"./client-context.js";import{D as r,E as o,F as i,G as l,H as c,I as u,J as m,K as d}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{p as g}from"./vendor.dompurify.js";import{m as f}from"./vendor.marked.js";import{o as p}from"./vendor.obj-str.js";import{A as b,G as h}from"./ResourceCenterApp.js";import{r as E,R as k}from"./bubble-frame.styl.js";import{D as _}from"./stylesheets.js";import{U as j,b as v}from"./flow-condition-types.js";import{r as w}from"./vendor.react-dom.js";import"./vendor.object-assign.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.i18next.js";import"./vendor.react-i18next.js";import"./vendor.babel.runtime.js";import"./flow-host.styl.js";import"./use-window-resize.js";import"./logomark.js";import"./ChecklistUI.js";import"./vendor.fortawesome.pro-solid-svg-icons.js";import"./BubbleToolbar.js";import"./use-element-rect.js";import"./vendor.date-fns.js";import"./vendor.scheduler.js";function I(e){const t=Intl.Segmenter;if(t){return/(\p{Emoji_Presentation}|\p{Extended_Pictographic})(\p{Emoji_Modifier_Base}?\p{Emoji_Modifier}?|\uFE0F\u200D(\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?\uFE0F\u200D)*\p{Emoji_Presentation}|\uFE0F\u200D\p{Extended_Pictographic})/u.test(e)&&1===[...(new t).segment(e)].length}return!1}const C=[];const S=({assistant:t,lookupAttribute:s,history:a,setInput:n,contentElRef:r,scrolledToTop:o,userContent:i,setUserContent:l,onSubmitMessage:c,supportsFeedback:u,onSubmitRating:m,onSubmitFeedback:d,InsideMessage:g,reset:f,onContentScroll:h,onContentWheel:_,conversationId:j})=>e.createElement("div",{className:"userflowjs-assistant-chat"},e.createElement("div",{className:p({"userflowjs-assistant-chat__header":!0,"userflowjs-assistant-chat__header--content-scrolled":!o})},e.createElement("h2",{className:"userflowjs-assistant-chat__title"},t.title),e.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--default",onClick:f},t.resetText)),e.createElement("div",{ref:r,className:"userflowjs-assistant-chat__content",onScroll:h,onWheel:_},!E(t.intro)&&e.createElement("div",{className:"userflowjs-assistant-chat__intro"},e.createElement(k,{doc:t.intro,lookupAttribute:s})),a.map(((s,n)=>e.createElement(M,{key:n,assistant:t,message:s,supportsFeedback:u,onSubmitRating:m,onSubmitFeedback:d,InsideMessage:g,conversationId:j,isLast:n===a.length-1})))),e.createElement("div",{className:"userflowjs-assistant-chat__prompt"},e.createElement(b,{textareaRef:n,placeholder:(0===a.length?t.promptEmptyPlaceholder:t.promptNonemptyPlaceholder)||"",value:i,onChange:l,onSubmit:()=>c(i)}))),M=({assistant:s,message:a,supportsFeedback:n,onSubmitRating:r,onSubmitFeedback:o,InsideMessage:i,conversationId:l,isLast:c})=>e.createElement("div",{className:"userflowjs-assistant-chat__message"},i&&e.createElement(i,{message:a}),e.createElement("div",{className:p({"userflowjs-assistant-chat__user-content":!0,"userflowjs-assistant-chat__user-content--enter":!!a.enterAnimation}),"data-assistant-conversation-id":l,"data-assistant-message-id":a.id},e.createElement("div",{style:{whiteSpace:"pre-wrap"}},a.userContent)),a.warning&&e.createElement("div",{className:"userflowjs-assistant-chat__error"},"Warning: ",a.warning),e.createElement("div",{className:"userflowjs-assistant-chat__assistant-content"},e.createElement("div",null,e.createElement(x,{html:a.assistantHtml})),a.error&&e.createElement("div",{className:"userflowjs-assistant-chat__error"},a.error)),a.sources&&a.sources.length>0&&e.createElement("div",{className:"userflowjs-assistant-chat__sources"},e.createElement("div",{className:"userflowjs-assistant-chat__sources-title"},s.sourcesText),a.sources.map(((t,s)=>e.createElement("a",{key:s,className:"userflowjs-assistant-chat__source",href:t.url,target:"_blank",rel:"noreferrer noopener"},t.title)))),n&&a.completed&&a.id&&(s.ratingMode===t.LIKE||s.ratingMode===t.SCALE&&c)&&e.createElement(R,{assistant:s,message:a,onSubmitRating:r,onSubmitFeedback:o})),R=({assistant:a,message:n,onSubmitRating:l,onSubmitFeedback:c})=>{const u=e.useRef(null),[m,d]=e.useState(""),g=()=>{n.id&&(c({messageId:n.id,feedback:m.trim()}),d(""))},f=a.ratingMode===t.LIKE?e.createElement("button",{className:"userflowjs-assistant-chat__rating-option",disabled:!0},e.createElement(_,{icon:n.rating==s.DISLIKE?r:o})):n.scaleRating&&n.scaleMax&&e.createElement("button",{className:p({"userflowjs-assistant-chat__rating-option":!0,"userflowjs-assistant-chat__rating-option--scale":!0}),disabled:!0},L(a,n.scaleRating,n.scaleMax));return e.createElement("div",{className:`userflowjs-assistant-chat__rating userflowjs-assistant-chat__rating--${a.ratingMode}`},a.ratingMode===t.SCALE&&e.createElement("div",{className:"userflowjs-assistant-chat__rating-question"},a.scaleQuestion),n.feedbackSubmitted?e.createElement("div",{className:"userflowjs-assistant-chat__rating-thanks"},f,e.createElement("div",{className:"userflowjs-assistant-chat__rating-thanks-message"},a.feedbackThanksText)):(a.ratingMode===t.LIKE?n.rating:n.scaleRating)?e.createElement(h,{textareaRef:u,className:"userflowjs-growing-textarea userflowjs-assistant-chat__feedback-textarea",mirrorClassName:"userflowjs-growing-textarea__mirror",textareaClassName:"userflowjs-textarea",placeholder:(a.ratingMode===t.LIKE?n.rating===s.LIKE?a.feedbackLikePlaceholder:a.feedbackDislikePlaceholder:a.scaleFeedbackPlaceholder)||"",value:m,onChange:d,onKeyDown:e=>{e.shiftKey||"Enter"!==e.key||(e.preventDefault(),g())}},f,e.createElement("button",{className:"userflowjs-assistant-chat__feedback-submit",onClick:()=>g()},e.createElement(_,{icon:i}))):e.createElement("div",{className:"userflowjs-assistant-chat__rating-options"},a.ratingMode===t.LIKE?[s.LIKE,s.DISLIKE].map((a=>(!n.rating||n.rating===a)&&e.createElement("button",{key:a,className:"userflowjs-assistant-chat__rating-option",onClick:n.rating?void 0:()=>(e=>{const s=n.id;s&&(w.flushSync((()=>{l({ratingMode:t.LIKE,messageId:s,rating:e})})),u.current?.focus({preventScroll:!0}))})(a),disabled:!!n.rating,"data-testid":`assistant-chat-rating-${a}`},e.createElement(_,{icon:a==s.DISLIKE?r:o})))):function(e){let t=[];const s=e.scaleMax||5;for(let a=1;a<=s;a++)t.push({value:a,label:L(e,a,s)});return t}(a).map((({value:s,label:r})=>e.createElement("button",{key:s,className:p({"userflowjs-assistant-chat__rating-option":!0,"userflowjs-assistant-chat__rating-option--large-scale":I(r||"")}),onClick:n.scaleRating?void 0:()=>(e=>{const s=n.id;s&&(w.flushSync((()=>{l({ratingMode:t.SCALE,messageId:s,scaleRating:e,scaleMax:a.scaleMax})})),u.current?.focus({preventScroll:!0}))})(s),disabled:!!n.scaleRating,"data-testid":`assistant-chat-rating-${s}`},r)))))};function y(e){let t=e;const s=e=>e=(e=e.replace(/\s*[*_`]*$/,"")).replace(/(^|\n)\s*(\d+\.?|-|=)$/,"");t=s(t),t=t.replace(/\[([^\]\n]*)(\](\([^)\n]*)?)?$/,"$1"),t=s(t);const a=Array.from(t.matchAll(/\n( *)```/g));if(a.length%2==1){t+="\n"+a[a.length-1][1]+"```"}else{let e=0;for(let r=t.length-1;r>=0;r--)if("\n"===t[r]&&"\n"===t[r-1]){e=r;break}const s=[];let a=!1;const n=e=>null==e||e.match(/\W/);for(let r=e;r<t.length;r++){const o=t[r],i=o+t[r+1],l=i+t[r+2];let c=null;if((a||"***"!==l)&&(a||"___"!==l||!n(t[r-1])&&!n(t[r+3]))?(a||"**"!==i)&&(a||"__"!==i||!n(t[r-1])&&!n(t[r+2]))?(a||"*"!==o)&&(a||"_"!==o||!n(t[r-1])&&!n(t[r+1]))?"`"===o&&(c=o):c=o:c=i:c=l,null!=c){!!t.slice(e,r+c.length).match(/\[[^\]\n]*\]\([^)\n]*$/)||(s[s.length-1]===c?("`"===c&&(a=!1),s.pop()):("`"===c&&(a=!0),s.push(c))),r+=c.length-1}}t+=s.reverse().join("")}return t}function N(e,t){e=e.trim(),!1!==t&&(e=e.replace(/(\n *```)?$/," {{USERFLOWCHATBRAIN}}$1"));let s=g.sanitize(f.parse(e));if(!1!==t){let e="userflowjs-assistant-brain";t&&(e+=` userflowjs-assistant-brain--${t}`),s=s.replace("{{USERFLOWCHATBRAIN}}",`<span class="${e}"><span></span><span></span><span></span><span></span></span>`)}return s=s.replace(/<a href=/g,'<a target="_blank" rel="noopener noreferrer" href='),s}const x=({html:t})=>e.useMemo((()=>{if(!t)return null;return A((new DOMParser).parseFromString(t,"text/html").body)}),[t]);function A(t,s){if(t instanceof Element){if("BODY"===t.tagName)return e.createElement(e.Fragment,{key:s},F(t));{if(["script","style"].includes(t.tagName))return null;const a={key:s};for(const e of t.attributes){let t=e.name;t.startsWith("on")||("class"===t&&(t="className"),a[t]=e.value)}return e.createElement(t.tagName.toLowerCase(),a,F(t))}}return t instanceof Text?t.textContent:null}function F(e){const t=[];let s=0;for(const a of e.childNodes)t.push(A(a,s)),s++;return t}function L(t,s,a){if(t.scaleLabels)return t.scaleLabels[s-1]||s;{const t=H[a]&&H[a][s];return t?e.createElement(_,{icon:t,size:24}):s}}const H={2:{1:l,2:c},3:{1:l,2:u,3:c},4:{1:m,2:l,3:c,4:d},5:{1:m,2:l,3:u,4:c,5:d}},T=({block:s,session:r,assistantReply:o,initialUserContent:i})=>{const l=s.assistantFlowId,c=n(),u=function({assistant:s,lookupAttribute:a,initialConversationId:n,initialHistory:r,initialUserContent:o,onConversationIdChange:i,submitMessage:l,submitRating:c,submitFeedback:u,InsideMessage:m}){const[d,g]=e.useState(null),[f,p]=e.useState((()=>r?r.map((e=>({...e,assistantHtml:N(y(e.assistantContent),!1)}))):C)),[b,h]=e.useState(""),E=e.useRef(null),k=e.useRef(null),_=e.useRef(!0),v=e.useRef(n||null),[w,I]=e.useState(v.current),S=e.useCallback((e=>{v.current=e,I(e),i&&i(e)}),[i]),M=e.useCallback((()=>{d?.focus({preventScroll:!0})}),[d]);e.useEffect((()=>{M()}),[M]),e.useLayoutEffect((()=>{const e=k.current;e&&(e.scrollTop=Math.ceil(e.scrollHeight-e.clientHeight))}),[]);const R=e.useCallback((()=>{const e=k.current;e&&(_.current=!0,"function"==typeof e.scrollTo&&e.scrollTo({top:Math.ceil(e.scrollHeight-e.clientHeight),behavior:"smooth"}))}),[]),x=e.useRef(0);e.useLayoutEffect((()=>{const e=k.current;e&&e.scrollHeight!==x.current&&(x.current=e.scrollHeight,_.current&&R())}),[f,R]);const A=e.useCallback((()=>{E.current&&E.current()}),[]);e.useEffect((()=>()=>{A()}),[A]);const F=(e,t)=>{p((s=>s.map((s=>{if(e===s.id){const e=t(s);return{...s,...e}}return s}))))},L=e=>{p((t=>t.map(((s,a)=>{if(a===t.length-1){const t=e(s);return{...s,...t}}return s}))))},H=e.useCallback((async e=>{if(""===(e=e.trim()))return;A(),p((t=>[...t,{id:null,userContent:e,assistantContent:"",assistantHtml:N("","enter"),enterAnimation:!0,sources:[],completed:!1,rating:null,scaleRating:null,scaleMax:null,feedbackSubmitted:!1}])),h(""),R();let t=!1;const s=()=>{t=!0,E.current=null},a=l({conversationId:v.current,userContent:e,callback:e=>{if(t)console.log("Userflow.js AssistantChat got message after being done",e);else switch(e.kind){case"conversation_created":S(e.conversationId);break;case"message_created":L((()=>({id:e.messageId,warning:e.warning})));break;case"assistant_content_delta":L((t=>{const s=e.delta,a=t.assistantContent+s;return{assistantContent:a,assistantHtml:N(y(a))}}));break;case"done":s(),L((t=>({assistantHtml:N(t.assistantContent,"exit"),completed:!0,sources:e.sources})));break;case"error":s(),L((t=>({failed:!0,error:e.message,assistantHtml:N(y(t.assistantContent),!1)})));break;default:console.log("Userflow.js AssistantChat got unknown message",e)}}});E.current=()=>{s(),a.abort(),L((e=>({assistantHtml:N(y(e.assistantContent),!1)})))}}),[A,R,l,S]),T=e.useRef(!1);e.useEffect((()=>{T.current||(T.current=!0,o&&H(o))}),[H,o]);const K=e.useCallback((()=>{A(),S(null),p(C),M()}),[A,M,S]),[P,D]=e.useState(!0),$=e.useCallback((()=>{const e=k.current;e&&D(0===e.scrollTop)}),[]),U=e.useCallback((()=>{const e=k.current;e&&(_.current=Math.ceil(e.scrollHeight-e.clientHeight)==Math.ceil(e.scrollTop))}),[]);return{assistant:s,lookupAttribute:a,history:f,setInput:g,contentElRef:k,scrolledToTop:P,userContent:b,setUserContent:h,onSubmitMessage:H,supportsFeedback:!!c&&!!u,onSubmitRating:e=>{if(c){switch(e.ratingMode){case t.LIKE:F(e.messageId,(()=>({rating:e.rating})));break;case t.SCALE:F(e.messageId,(()=>({scaleRating:e.scaleRating,scaleMax:e.scaleMax})));break;default:throw new j(e)}c(e)}},onSubmitFeedback:e=>{u&&(F(e.messageId,(()=>({feedbackSubmitted:!0}))),u(e))},InsideMessage:m,reset:K,onContentScroll:$,onContentWheel:U,conversationId:w}}(e.useMemo((()=>({assistant:o.assistant,lookupAttribute:v(r.data),initialConversationId:o.conversationId,initialHistory:o.history,initialUserContent:i,onConversationIdChange:e=>{const t="assistantConversationId:"+l;e?a.setItem(t,e):a.removeItem(t)},submitMessage:({conversationId:e,userContent:t,callback:s})=>{c.assistantMessageInProgress=!0;const a=c.nextRef();c.send({kind:"SubmitAssistantMessage",ref:a,assistantFlowId:l,conversationId:e,userContent:t}).catch((e=>{s({kind:"error",message:e.humanMessage||"I'm sorry, but something went wrong. Please try again."})}));const n=()=>{c.assistantMessageInProgress=void 0,c.off("private:assistantMessageEvent",r),c.off("private:disconnect",o)},r=e=>{if(e.ref!==a)return;const{event:t}=e;s(t),"done"!=t.kind&&"error"!=t.kind||n()},o=()=>{s({kind:"error",message:"Sorry, my connection got disconnected. Please try again or contact my human friends."}),n()};return c.on("private:assistantMessageEvent",r),c.on("private:disconnect",o),{abort:()=>{c.send({kind:"AbortAssistantMessage"}),n()}}},submitRating:e=>{switch(e.ratingMode){case t.LIKE:c.send({kind:"SubmitAssistantRating",messageId:e.messageId,rating:e.rating});break;case t.SCALE:c.send({kind:"SubmitAssistantScaleRating",messageId:e.messageId,scaleRating:e.scaleRating,scaleMax:e.scaleMax});break;default:throw new j(e)}},submitFeedback:e=>{c.send({kind:"SubmitAssistantFeedback",messageId:e.messageId,feedback:e.feedback})}})),[o,l,c,i,r.data]));return e.createElement(e.Fragment,null,e.createElement(S,{...u}))};export{T as ResourceCenterAssistantChat};
|
|
1
|
+
import{r as e}from"./vendor.react.js";import{Z as t,$ as s,i as a}from"./userflow.js";import{u as n}from"./client-context.js";import{D as r,E as o,F as i,G as l,H as c,I as u,J as m,K as d}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{p as g}from"./vendor.dompurify.js";import{m as f}from"./vendor.marked.js";import{o as p}from"./vendor.obj-str.js";import{A as b,G as h}from"./ResourceCenterApp.js";import{r as E,R as _}from"./bubble-frame.styl.js";import{D as k}from"./stylesheets.js";import{U as j,b as v}from"./flow-condition-types.js";import{r as w}from"./vendor.react-dom.js";import{u as I}from"./vendor.react-i18next.js";import"./vendor.object-assign.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.i18next.js";import"./flow-host.styl.js";import"./use-window-resize.js";import"./logomark.js";import"./ChecklistUI.js";import"./vendor.fortawesome.pro-solid-svg-icons.js";import"./BubbleToolbar.js";import"./use-element-rect.js";import"./vendor.date-fns.js";import"./vendor.scheduler.js";import"./vendor.babel.runtime.js";function C(e){const t=Intl.Segmenter;if(t){return/(\p{Emoji_Presentation}|\p{Extended_Pictographic})(\p{Emoji_Modifier_Base}?\p{Emoji_Modifier}?|\uFE0F\u200D(\p{Emoji_Modifier_Base}\p{Emoji_Modifier}?\uFE0F\u200D)*\p{Emoji_Presentation}|\uFE0F\u200D\p{Extended_Pictographic})/u.test(e)&&1===[...(new t).segment(e)].length}return!1}const S=[];const M=({assistant:t,lookupAttribute:s,history:a,setInput:n,contentElRef:r,scrolledToTop:o,userContent:i,setUserContent:l,onSubmitMessage:c,supportsFeedback:u,onSubmitRating:m,onSubmitFeedback:d,InsideMessage:g,reset:f,onContentScroll:h,onContentWheel:k,conversationId:j})=>e.createElement("div",{className:"userflowjs-assistant-chat"},e.createElement("div",{className:p({"userflowjs-assistant-chat__header":!0,"userflowjs-assistant-chat__header--content-scrolled":!o})},e.createElement("h2",{className:"userflowjs-assistant-chat__title"},t.title),e.createElement("button",{className:"userflowjs-bubble-button userflowjs-bubble-button--default",onClick:f},t.resetText)),e.createElement("div",{ref:r,className:"userflowjs-assistant-chat__content",onScroll:h,onWheel:k},!E(t.intro)&&e.createElement("div",{className:"userflowjs-assistant-chat__intro"},e.createElement(_,{doc:t.intro,lookupAttribute:s})),a.map(((s,n)=>e.createElement(R,{key:n,assistant:t,message:s,supportsFeedback:u,onSubmitRating:m,onSubmitFeedback:d,InsideMessage:g,conversationId:j,isLast:n===a.length-1})))),e.createElement("div",{className:"userflowjs-assistant-chat__prompt"},e.createElement(b,{textareaRef:n,placeholder:(0===a.length?t.promptEmptyPlaceholder:t.promptNonemptyPlaceholder)||"",value:i,onChange:l,onSubmit:()=>c(i)}))),R=({assistant:s,message:a,supportsFeedback:n,onSubmitRating:r,onSubmitFeedback:o,InsideMessage:i,conversationId:l,isLast:c})=>e.createElement("div",{className:"userflowjs-assistant-chat__message"},i&&e.createElement(i,{message:a}),e.createElement("div",{className:p({"userflowjs-assistant-chat__user-content":!0,"userflowjs-assistant-chat__user-content--enter":!!a.enterAnimation}),"data-assistant-conversation-id":l,"data-assistant-message-id":a.id},e.createElement("div",{style:{whiteSpace:"pre-wrap"}},a.userContent)),a.warning&&e.createElement("div",{className:"userflowjs-assistant-chat__error"},"Warning: ",a.warning),e.createElement("div",{className:"userflowjs-assistant-chat__assistant-content"},e.createElement("div",null,e.createElement(A,{html:a.assistantHtml})),a.error&&e.createElement("div",{className:"userflowjs-assistant-chat__error"},a.error)),a.sources&&a.sources.length>0&&e.createElement("div",{className:"userflowjs-assistant-chat__sources"},e.createElement("div",{className:"userflowjs-assistant-chat__sources-title"},s.sourcesText),a.sources.map(((t,s)=>e.createElement("a",{key:s,className:"userflowjs-assistant-chat__source",href:t.url,target:"_blank",rel:"noreferrer noopener"},t.title)))),n&&a.completed&&a.id&&(s.ratingMode===t.LIKE||s.ratingMode===t.SCALE&&c)&&e.createElement(N,{assistant:s,message:a,onSubmitRating:r,onSubmitFeedback:o})),N=({assistant:a,message:n,onSubmitRating:l,onSubmitFeedback:c})=>{const u=e.useRef(null),[m,d]=e.useState(""),g=()=>{n.id&&(c({messageId:n.id,feedback:m.trim()}),d(""))},f=a.ratingMode===t.LIKE?e.createElement("button",{className:"userflowjs-assistant-chat__rating-option",disabled:!0},e.createElement(k,{icon:n.rating==s.DISLIKE?r:o})):n.scaleRating&&n.scaleMax&&e.createElement("button",{className:p({"userflowjs-assistant-chat__rating-option":!0,"userflowjs-assistant-chat__rating-option--scale":!0}),disabled:!0},H(a,n.scaleRating,n.scaleMax));return e.createElement("div",{className:`userflowjs-assistant-chat__rating userflowjs-assistant-chat__rating--${a.ratingMode}`},a.ratingMode===t.SCALE&&e.createElement("div",{className:"userflowjs-assistant-chat__rating-question"},a.scaleQuestion),n.feedbackSubmitted?e.createElement("div",{className:"userflowjs-assistant-chat__rating-thanks"},f,e.createElement("div",{className:"userflowjs-assistant-chat__rating-thanks-message"},a.feedbackThanksText)):(a.ratingMode===t.LIKE?n.rating:n.scaleRating)?e.createElement(h,{textareaRef:u,className:"userflowjs-growing-textarea userflowjs-assistant-chat__feedback-textarea",mirrorClassName:"userflowjs-growing-textarea__mirror",textareaClassName:"userflowjs-textarea",placeholder:(a.ratingMode===t.LIKE?n.rating===s.LIKE?a.feedbackLikePlaceholder:a.feedbackDislikePlaceholder:a.scaleFeedbackPlaceholder)||"",value:m,onChange:d,onKeyDown:e=>{e.shiftKey||"Enter"!==e.key||(e.preventDefault(),g())}},f,e.createElement("button",{className:"userflowjs-assistant-chat__feedback-submit",onClick:()=>g()},e.createElement(k,{icon:i}))):e.createElement("div",{className:"userflowjs-assistant-chat__rating-options"},a.ratingMode===t.LIKE?[s.LIKE,s.DISLIKE].map((a=>(!n.rating||n.rating===a)&&e.createElement("button",{key:a,className:"userflowjs-assistant-chat__rating-option",onClick:n.rating?void 0:()=>(e=>{const s=n.id;s&&(w.flushSync((()=>{l({ratingMode:t.LIKE,messageId:s,rating:e})})),u.current?.focus({preventScroll:!0}))})(a),disabled:!!n.rating,"data-testid":`assistant-chat-rating-${a}`},e.createElement(k,{icon:a==s.DISLIKE?r:o})))):function(e){let t=[];const s=e.scaleMax||5;for(let a=1;a<=s;a++)t.push({value:a,label:H(e,a,s)});return t}(a).map((({value:s,label:r})=>e.createElement("button",{key:s,className:p({"userflowjs-assistant-chat__rating-option":!0,"userflowjs-assistant-chat__rating-option--large-scale":C(r||"")}),onClick:n.scaleRating?void 0:()=>(e=>{const s=n.id;s&&(w.flushSync((()=>{l({ratingMode:t.SCALE,messageId:s,scaleRating:e,scaleMax:a.scaleMax})})),u.current?.focus({preventScroll:!0}))})(s),disabled:!!n.scaleRating,"data-testid":`assistant-chat-rating-${s}`},r)))))};function x(e){let t=e;const s=e=>e=(e=e.replace(/\s*[*_`]*$/,"")).replace(/(^|\n)\s*(\d+\.?|-|=)$/,"");t=s(t),t=t.replace(/\[([^\]\n]*)(\](\([^)\n]*)?)?$/,"$1"),t=s(t);const a=Array.from(t.matchAll(/\n( *)```/g));if(a.length%2==1){t+="\n"+a[a.length-1][1]+"```"}else{let e=0;for(let r=t.length-1;r>=0;r--)if("\n"===t[r]&&"\n"===t[r-1]){e=r;break}const s=[];let a=!1;const n=e=>null==e||e.match(/\W/);for(let r=e;r<t.length;r++){const o=t[r],i=o+t[r+1],l=i+t[r+2];let c=null;if((a||"***"!==l)&&(a||"___"!==l||!n(t[r-1])&&!n(t[r+3]))?(a||"**"!==i)&&(a||"__"!==i||!n(t[r-1])&&!n(t[r+2]))?(a||"*"!==o)&&(a||"_"!==o||!n(t[r-1])&&!n(t[r+1]))?"`"===o&&(c=o):c=o:c=i:c=l,null!=c){!!t.slice(e,r+c.length).match(/\[[^\]\n]*\]\([^)\n]*$/)||(s[s.length-1]===c?("`"===c&&(a=!1),s.pop()):("`"===c&&(a=!0),s.push(c))),r+=c.length-1}}t+=s.reverse().join("")}return t}function y(e,t){e=e.trim(),!1!==t&&(e=e.replace(/(\n *```)?$/," {{USERFLOWCHATBRAIN}}$1"));let s=g.sanitize(f.parse(e));if(!1!==t){let e="userflowjs-assistant-brain";t&&(e+=` userflowjs-assistant-brain--${t}`),s=s.replace("{{USERFLOWCHATBRAIN}}",`<span class="${e}"><span></span><span></span><span></span><span></span></span>`)}return s=s.replace(/<a href=/g,'<a target="_blank" rel="noopener noreferrer" href='),s}const A=({html:t})=>e.useMemo((()=>{if(!t)return null;return F((new DOMParser).parseFromString(t,"text/html").body)}),[t]);function F(t,s){if(t instanceof Element){if("BODY"===t.tagName)return e.createElement(e.Fragment,{key:s},L(t));{if(["script","style"].includes(t.tagName))return null;const a={key:s};for(const e of t.attributes){let t=e.name;t.startsWith("on")||("class"===t&&(t="className"),a[t]=e.value)}return e.createElement(t.tagName.toLowerCase(),a,L(t))}}return t instanceof Text?t.textContent:null}function L(e){const t=[];let s=0;for(const a of e.childNodes)t.push(F(a,s)),s++;return t}function H(t,s,a){if(t.scaleLabels)return t.scaleLabels[s-1]||s;{const t=T[a]&&T[a][s];return t?e.createElement(k,{icon:t,size:24}):s}}const T={2:{1:l,2:c},3:{1:l,2:u,3:c},4:{1:m,2:l,3:c,4:d},5:{1:m,2:l,3:u,4:c,5:d}},K=({block:s,session:r,assistantReply:o,initialUserContent:i})=>{const l=s.assistantFlowId,c=n(),{t:u}=I(),m=u("assistant.generic_error"),d=u("assistant.disconnected_error"),g=function({assistant:s,lookupAttribute:a,initialConversationId:n,initialHistory:r,initialUserContent:o,onConversationIdChange:i,submitMessage:l,submitRating:c,submitFeedback:u,InsideMessage:m}){const[d,g]=e.useState(null),[f,p]=e.useState((()=>r?r.map((e=>({...e,assistantHtml:y(x(e.assistantContent),!1)}))):S)),[b,h]=e.useState(""),E=e.useRef(null),_=e.useRef(null),k=e.useRef(!0),v=e.useRef(n||null),[w,I]=e.useState(v.current),C=e.useCallback((e=>{v.current=e,I(e),i&&i(e)}),[i]),M=e.useCallback((()=>{d?.focus({preventScroll:!0})}),[d]);e.useEffect((()=>{M()}),[M]),e.useLayoutEffect((()=>{const e=_.current;e&&(e.scrollTop=Math.ceil(e.scrollHeight-e.clientHeight))}),[]);const R=e.useCallback((()=>{const e=_.current;e&&(k.current=!0,"function"==typeof e.scrollTo&&e.scrollTo({top:Math.ceil(e.scrollHeight-e.clientHeight),behavior:"smooth"}))}),[]),N=e.useRef(0);e.useLayoutEffect((()=>{const e=_.current;e&&e.scrollHeight!==N.current&&(N.current=e.scrollHeight,k.current&&R())}),[f,R]);const A=e.useCallback((()=>{E.current&&E.current()}),[]);e.useEffect((()=>()=>{A()}),[A]);const F=(e,t)=>{p((s=>s.map((s=>{if(e===s.id){const e=t(s);return{...s,...e}}return s}))))},L=e=>{p((t=>t.map(((s,a)=>{if(a===t.length-1){const t=e(s);return{...s,...t}}return s}))))},H=e.useCallback((async e=>{if(""===(e=e.trim()))return;A(),p((t=>[...t,{id:null,userContent:e,assistantContent:"",assistantHtml:y("","enter"),enterAnimation:!0,sources:[],completed:!1,rating:null,scaleRating:null,scaleMax:null,feedbackSubmitted:!1}])),h(""),R();let t=!1;const s=()=>{t=!0,E.current=null},a=l({conversationId:v.current,userContent:e,callback:e=>{if(t)console.log("Userflow.js AssistantChat got message after being done",e);else switch(e.kind){case"conversation_created":C(e.conversationId);break;case"message_created":L((()=>({id:e.messageId,warning:e.warning})));break;case"assistant_content_delta":L((t=>{const s=e.delta,a=t.assistantContent+s;return{assistantContent:a,assistantHtml:y(x(a))}}));break;case"done":s(),L((t=>({assistantHtml:y(t.assistantContent,"exit"),completed:!0,sources:e.sources})));break;case"error":s(),L((t=>({failed:!0,error:e.message,assistantHtml:y(x(t.assistantContent),!1)})));break;default:console.log("Userflow.js AssistantChat got unknown message",e)}}});E.current=()=>{s(),a.abort(),L((e=>({assistantHtml:y(x(e.assistantContent),!1)})))}}),[A,R,l,C]),T=e.useRef(!1);e.useEffect((()=>{T.current||(T.current=!0,o&&H(o))}),[H,o]);const K=e.useCallback((()=>{A(),C(null),p(S),M()}),[A,M,C]),[D,$]=e.useState(!0),P=e.useCallback((()=>{const e=_.current;e&&$(0===e.scrollTop)}),[]),U=e.useCallback((()=>{const e=_.current;e&&(k.current=Math.ceil(e.scrollHeight-e.clientHeight)==Math.ceil(e.scrollTop))}),[]);return{assistant:s,lookupAttribute:a,history:f,setInput:g,contentElRef:_,scrolledToTop:D,userContent:b,setUserContent:h,onSubmitMessage:H,supportsFeedback:!!c&&!!u,onSubmitRating:e=>{if(c){switch(e.ratingMode){case t.LIKE:F(e.messageId,(()=>({rating:e.rating})));break;case t.SCALE:F(e.messageId,(()=>({scaleRating:e.scaleRating,scaleMax:e.scaleMax})));break;default:throw new j(e)}c(e)}},onSubmitFeedback:e=>{u&&(F(e.messageId,(()=>({feedbackSubmitted:!0}))),u(e))},InsideMessage:m,reset:K,onContentScroll:P,onContentWheel:U,conversationId:w}}(e.useMemo((()=>({assistant:o.assistant,lookupAttribute:v(r.data),initialConversationId:o.conversationId,initialHistory:o.history,initialUserContent:i,onConversationIdChange:e=>{const t="assistantConversationId:"+l;e?a.setItem(t,e):a.removeItem(t)},submitMessage:({conversationId:e,userContent:t,callback:s})=>{c.assistantMessageInProgress=!0;const a=c.nextRef();c.send({kind:"SubmitAssistantMessage",ref:a,assistantFlowId:l,conversationId:e,userContent:t}).catch((e=>{s({kind:"error",message:e.humanMessage||m})}));const n=()=>{c.assistantMessageInProgress=void 0,c.off("private:assistantMessageEvent",r),c.off("private:disconnect",o)},r=e=>{if(e.ref!==a)return;const{event:t}=e;s(t),"done"!=t.kind&&"error"!=t.kind||n()},o=()=>{s({kind:"error",message:d}),n()};return c.on("private:assistantMessageEvent",r),c.on("private:disconnect",o),{abort:()=>{c.send({kind:"AbortAssistantMessage"}),n()}}},submitRating:e=>{switch(e.ratingMode){case t.LIKE:c.send({kind:"SubmitAssistantRating",messageId:e.messageId,rating:e.rating});break;case t.SCALE:c.send({kind:"SubmitAssistantScaleRating",messageId:e.messageId,scaleRating:e.scaleRating,scaleMax:e.scaleMax});break;default:throw new j(e)}},submitFeedback:e=>{c.send({kind:"SubmitAssistantFeedback",messageId:e.messageId,feedback:e.feedback})}})),[o,l,c,i,r.data,m,d]));return e.createElement(e.Fragment,null,e.createElement(M,{...g}))};export{K as ResourceCenterAssistantChat};
|
package/client-context.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as e}from"./vendor.i18next.js";import{i as t}from"./vendor.react-i18next.js";import{r as n}from"./vendor.react.js";var i={and:"و",more:"المزيد",checklist:{nextSection:"التالي",previousSection:"السابق"},checklistDismiss:{button:"رفض قائمة التحقق",title:"هل تريد رفض قائمة التحقق؟",yes:"نعم ، رفض",cancel:"إلغاء"},menu:{title:"قائمة",restart:"بدء من جديد",close:"أغلق الدليل",back:"ارجع إلى الدليل"},question:{npsLabelLeft:"غير محتمل على الإطلاق",npsLabelRight:"من المرجح للغاية",other:"آخر",placeholder:"اكتب إجابتك هنا ...",requiredError:"من فضلك املأ هذه الحقل.",submit:"إرسال"},resource_center:{back:"العودة",generic_error:"عذرا، لا يمكن تحميل هذا المحتوى في هذا الوقت.",no_results_found:"لا توجد نتائج.",search_in:"بحث في",search_placeholder:"بحث",suggested_articles:"المقالات المقترحة",unread:"غير مقروءة {{count}}",unread_plural:"غير مقروءة {{count}}"},tooltipTargetMissing:{line1:"يبدو أنك انتقلت بعيدًا عن الصفحة التي ينتمي إليها الدليل الحالي.",line2:"للمتابعة مع بقية الدليل، ارجع إلى الصفحة التي كنت فيها آخر مرة، أو بدلاً من ذلك، يمكنك إعادة تشغيل الدليل أو إغلاقه."}};var l={and:"a",more:"Více",checklist:{nextSection:"Další",previousSection:"Předchozí’"},checklistDismiss:{button:"Zavřít checklist",title:"Zavřít checklist?",yes:"Ano, zavřít",cancel:"Zavřít"},menu:{title:"Menu",restart:"Začít znovu",close:"Zavřít průvodce",back:"Vrátit se k průvodci"},question:{multiple_selection_hint:"{{selected}} ze {{range}} vybraných",multiple_selection_too_few:"Vyberte prosím alespoň {{count}} možnost.",multiple_selection_too_few_plural:"Vyberte prosím alespoň {{count}} možnosti.",multiple_selection_too_many:"Vyberte prosím ne více než {{count}} možnost.",multiple_selection_too_many_plural:"Vyberte prosím maximálně {{count}} možnosti.",multiple_selection_wrong:"Vyberte prosím přesně {{count}} možnost.",multiple_selection_wrong_plural:"Vyberte prosím přesně {{count}} možnosti.",npsLabelLeft:"Spíše ne",npsLabelRight:"Určitě ano",other:"Jiné",placeholder:"Zde napište svou odpověď...",requiredError:"Vyplňte prosím toto pole.",submit:"Uložit"},resource_center:{back:"Zpět",generic_error:"Litujeme, tento obsah v tuto chvíli nelze načíst.",no_results_found:"Nebylo nic nalezeno.",search_in:"Hledat v",search_placeholder:"Hledej",suggested_articles:"Doporučené články",unread:"{{count}} nepřečtená",unread_plural:"{{count}} nepřečtené"},tooltipTargetMissing:{line1:"Zdá se, že jste opustili stránku s průvodcem.",line2:"Pro pokračování s průvodcem jděte zpět na předchozí stránku. Případně můžete začít úplně znovu nebo průvodce zavřít."}};var o={and:"og",more:"Mere",checklistDismiss:{button:"Fjern tjekliste",title:"Fjern tjekliste?",yes:"Ja, fjern",cancel:"Annuller"},menu:{title:"Menu",restart:"Start forfra",close:"Luk guide",back:"Tilbage til guiden"},question:{multiple_selection_hint:"{{selected}} ud af {{range}} valgt",multiple_selection_too_few:"Vælg venligst {{count}} mulighed.",multiple_selection_too_few_plural:"Vælg venligst {{count}} muligheder.",multiple_selection_too_many:"Vælg ikke mere end {{count}} mulighed.",multiple_selection_too_many_plural:"Vælg ikke mere end {{count}} muligheder.",multiple_selection_wrong:"Vælg venligst præcis {{count}} mulighed.",multiple_selection_wrong_plural:"Vælg venligst præcis {{count}} muligheder.",npsLabelLeft:"Ikke sandsynligt",npsLabelRight:"Ekstremt sandsynligt",other:"Andet",placeholder:"Skriv dit svar her...",requiredError:"Udfyld venligst dette felt.",submit:"Send"},resource_center:{back:"Tilbage",generic_error:"Beklager, vi kan desværre ikke hente dette indhold i øjeblikket.",no_results_found:"Ingen resultater fundet.",search_in:"Søg i",search_placeholder:"Søg",suggested_articles:"Foreslåede artikler",unread:"{{count}} ulæst",unread_plural:"{{count}} ulæste"},tooltipTargetMissing:{line1:"Det lader til at du er navigeret væk fra siden som denne guide hører til.",line2:"Prøv at gå tilbage til den forrige side for at fortsætte med resten af guiden. Alternativt kan du genstarte guiden eller lukke den."}};var a={and:"und",more:"Mehr",checklist:{nextSection:"Nächste",previousSection:"Vorherige"},checklistDismiss:{button:"Checkliste schließen",title:"Checkliste schließen?",yes:"Ja, schließen",cancel:"Abbrechen"},menu:{title:"Menü",restart:"Von vorne beginnen",close:"Tour beenden",back:"Zurück"},question:{multiple_selection_hint:"{{selected}} von {{range}} ausgewählt",multiple_selection_too_few:"Bitte wähle Sie mindestens {{count}} Option aus.",multiple_selection_too_few_plural:"Bitte wählen Sie mindestens {{count}} Optionen aus.",multiple_selection_too_many:"Bitte wählen Sie nicht mehr als {{count}} Option aus.",multiple_selection_too_many_plural:"Bitte wählen Sie nicht mehr als {{count}} Optionen aus.",multiple_selection_wrong:"Bitte wählen Sie genau {{count}} Option aus.",multiple_selection_wrong_plural:"Bitte wählen Sie genau {{count}} Optionen aus.",npsLabelLeft:"Unwahrscheinlich",npsLabelRight:"Sehr wahrscheinlich",other:"Weitere",placeholder:"Geben Sie Ihre Antwort hier ein...",requiredError:"Bitte füllen Sie dieses Feld aus.",submit:"Absenden"},resource_center:{back:"Zurück",generic_error:"Entschuldigung, dieser Inhalt konnte zu diesem Zeitpunkt nicht geladen werden.",no_results_found:"keine Ergebnisse gefunden.",search_in:"Suche in",search_placeholder:"Suchen",suggested_articles:"Vorgeschlagene Artikel",unread:"{{count}} ungelesen"},tooltipTargetMissing:{line1:"Es sieht so aus, dass Du auf einer falschen Seite gelandet bist, die nicht zum aktuellen Leitfaden gehört.",line2:"Um mit dem Leitfaden fortzufahren, gehe zur letzten Seite zurück auf der du den Leitfaden gesehen hast. Alternativ dazu kannst du den Leitfaden jederzeit neustarten oder schließen."}};var r={and:"και",more:"Περισσότερο",checklist:{nextSection:"Επόμενο",previousSection:"Προηγούμενος"},checklistDismiss:{button:"Παράβλεψη λίστας εκκρεμοτήτων",title:"Κλείσιμο λίστας εκκρεμοτήτων;",yes:"Ναί, παράβλεψη",cancel:"Ακύρωση"},menu:{title:"Μενού",restart:"Ξεκίνημα απ'την αρχή",close:"Κλείσιμο οδηγού",back:"Επιστροφή"},question:{multiple_selection_hint:"Επιλέχτηκε {{selected}} στους {{range}}",multiple_selection_too_few:"Επιλέξτε τουλάχιστον {{count}} επιλογή.",multiple_selection_too_few_plural:"Επιλέξτε τουλάχιστον {{count}} επιλογές.",multiple_selection_too_many:"Επιλέξτε όχι περισσότερες από {{count}} επιλογές.",multiple_selection_too_many_plural:"Επιλέξτε όχι περισσότερες από {{count}} επιλογές.",multiple_selection_wrong:"Επιλέξτε ακριβώς {{count}} επιλογή.",multiple_selection_wrong_plural:"Επιλέξτε ακριβώς {{count}} επιλογές.",npsLabelLeft:"Καθόλου πιθανό",npsLabelRight:"Εξαιρετικά πιθανό",other:"Αλλος",placeholder:"Πληκτρολογήστε την απάντησή σας εδώ...",requiredError:"Παρακαλώ συμπληρώστε αυτό το πεδίο.",submit:"υποβάλετε"},resource_center:{back:"Επιστροφή",generic_error:"Λυπούμαστε, δεν ήταν δυνατή η φόρτωση αυτού του περιεχομένου αυτήν τη στιγμή.",no_results_found:"Δεν βρέθηκαν αποτελέσματα.",search_in:"Αναζήτηση στη",search_placeholder:"Αναζήτηση",suggested_articles:"Προτεινόμενα άρθρα",unread:"{{count}} μη αναγνωσμένο",unread_plural:"{{count}} αδιάβαστοι"},tooltipTargetMissing:{line1:"Φαίνεται ότι έχετε απομακρυνθεί από τη σελίδα του μάγου.",line2:"Για να συνεχίσετε με τον υπόλοιπο οδηγό, επιστρέψτε στη σελίδα στην οποία ήσασταν τελευταία ή, εναλλακτικά, μπορείτε να επανεκκινήσετε τον οδηγό ή να τον κλείσετε."}};var s={and:"and",more:"More",checklist:{nextSection:"Next",previousSection:"Previous"},checklistDismiss:{button:"Dismiss checklist",title:"Dismiss checklist?",yes:"Yes, dismiss",cancel:"Cancel"},menu:{title:"Menu",restart:"Start over",close:"Close guide",back:"Return to guide"},question:{multiple_selection_hint:"{{selected}} out of {{range}} selected",multiple_selection_too_few:"Please select at least {{count}} option.",multiple_selection_too_few_plural:"Please select at least {{count}} options.",multiple_selection_too_many:"Please select no more than {{count}} option.",multiple_selection_too_many_plural:"Please select no more than {{count}} options.",multiple_selection_wrong:"Please select exactly {{count}} option.",multiple_selection_wrong_plural:"Please select exactly {{count}} options.",npsLabelLeft:"Not at all likely",npsLabelRight:"Extremely likely",other:"Other",placeholder:"Type your answer here...",requiredError:"Please fill in this field.",submit:"Submit"},resource_center:{back:"Back",generic_error:"Sorry, this content could not be loaded at this time.",no_results_found:"No results found.",search_in:"Search in",search_placeholder:"Search",suggested_articles:"Suggested articles",unread:"{{count}} unread"},tooltipTargetMissing:{line1:"It seems you've navigated away from the page the current guide belongs to.",line2:"To continue with the rest of the guide, go back to the page you were last on, or alternatively, you can restart the guide or close it."}};var c={and:"y",more:"Más",checklist:{nextSection:"Siguiente",previousSection:"Anterior"},checklistDismiss:{button:"Descartar checklist",title:"¿Descartar checklist?",yes:"Si, descartar",cancel:"Mantener checklist"},menu:{title:"Menu",restart:"Reiniciar",close:"Cerrar guía",back:"Continuar guía"},question:{multiple_selection_hint:"{{selected}} de {{range}} seleccionados",multiple_selection_too_few:"Por favor, seleccione al menos {{count}} opción.",multiple_selection_too_few_plural:"Por favor, seleccione al menos {{count}} opciones.",multiple_selection_too_many:"Por favor, seleccione no más de {{count}} opción.",multiple_selection_too_many_plural:"Por favor, seleccione no más de {{count}} opciones.",multiple_selection_wrong:"Por favor, seleccione exactamente {{count}} opción.",multiple_selection_wrong_plural:"Por favor, seleccione exactamente {{count}} opciones.",npsLabelLeft:"No es muy probable",npsLabelRight:"Extremadamente probable",other:"Otro/Otra",placeholder:"Escriba aquí su respuesta...",requiredError:"Por favor, rellene este campo.",submit:"Enviar"},resource_center:{back:"Atrás",generic_error:"Lo sentimos, este contenido no se pudo cargar en este momento.",no_results_found:"No se han encontrado resultados.",search_in:"Buscar en",search_placeholder:"Buscar",suggested_articles:"Artículos sugeridos",unread:"{{count}} no leído",unread_plural:"{{count}} no leídos"},tooltipTargetMissing:{line1:"Parece que has navegado fuera de la guía.",line2:"Para continuar con el resto de la guía, regresa a la página donde estabas, o también, puedes reiniciarla o cerrarla."}};var u={and:"ja",more:"Lisää",checklist:{nextSection:"Seuraava",previousSection:"Edellinen"},checklistDismiss:{button:"Hylkää tarkistuslista",title:"Hylkää tarkistuslista?",yes:"Kyllä, hylkää",cancel:"Peruuta"},menu:{title:"Valikko",restart:"Aloita uudestaan",close:"Sulje ohje",back:"Takaisin ohjeeseen"},question:{multiple_selection_hint:"{{selected}}/{{range}} valittu",multiple_selection_too_few:"Valitse vähintään {{count}} vaihtoehto.",multiple_selection_too_few_plural:"Ole hyvä ja valitse vähintään {{count}} vaihtoehtoa.",multiple_selection_too_many:"Ole hyvä ja valitse enintään {{count}} vaihtoehto.",multiple_selection_too_many_plural:"Ole hyvä ja valitse enintään {{count}} vaihtoehtoa.",multiple_selection_wrong:"Ole hyvä ja valitse täsmälleen {{count}} vaihtoehto.",multiple_selection_wrong_plural:"Ole hyvä ja valitse tarkalleen {{count}} vaihtoehtoa.",npsLabelLeft:"Ei yhtään sopiva",npsLabelRight:"Todella sopiva",other:"Muu",placeholder:"Kirjoita vastauksesi tähän...",requiredError:"Täytä tämä kohta.",submit:"Lähetä"},resource_center:{back:"Takaisin",generic_error:"Valitettavasti tätä sisältöä ei voitu ladata tällä hetkellä.",no_results_found:"Ei tuloksia.",search_in:"Etsi",search_placeholder:"Etsi",suggested_articles:"Ehdotetut artikkelit",unread:"{{count}} lukematon",unread_plural:"{{count}} lukematonta"},tooltipTargetMissing:{line1:"Näyttää siltä, että olet siirtynyt pois sivulta, jolle nykyinen opas kuuluu.",line2:"Jatka oppaan loppuun palaamalla sivulle, jolla olit viimeksi, tai vaihtoehtoisesti voit käynnistää oppaan uudelleen tai sulkea sen."}};var _={and:"et",more:"Plus",checklist:{nextSection:"Suivant",previousSection:"Précédent"},checklistDismiss:{button:"Fermer la check-list",title:"Fermer la check-list?",yes:"Oui, fermer",cancel:"Annuler"},menu:{title:"Menu",restart:"Recommencer",close:"Fermer la visite",back:"Étape précédente"},question:{multiple_selection_hint:"{{selected}} sur {{range}} sélectionnés",multiple_selection_too_few:"Veuillez sélectionner au moins {{count}} option.",multiple_selection_too_few_plural:"Veuillez sélectionner au moins {{count}} options.",multiple_selection_too_many:"Veuillez ne pas sélectionner plus {{count}} option.",multiple_selection_too_many_plural:"Veuillez ne pas sélectionner plus de {{count}} options.",multiple_selection_wrong:"Veuillez sélectionner exactement {{count}} option.",multiple_selection_wrong_plural:"Veuillez sélectionner exactement {{count}} options.",npsLabelLeft:"Pas du tout probable",npsLabelRight:"Hautement probable",other:"Autre",placeholder:"Tapez votre réponse ici...",requiredError:"Veuillez remplir ce champ.",submit:"Soumettre"},resource_center:{back:"Retour",generic_error:"Désolé, ce contenu n'a pas pu être chargé pour le moment.",no_results_found:"Aucun résultat trouvé.",search_in:"Rechercher dans",search_placeholder:"Rechercher",suggested_articles:"Articles suggérés",unread:"{{count}} non lu",unread_plural:"{{count}} non lus"},tooltipTargetMissing:{line1:"Il semble que vous vous soyez éloigné de la page à laquelle appartient le guide actuel.",line2:"Pour continuer avec le reste du guide, revenez à la dernière page sur laquelle vous étiez, ou vous pouvez également redémarrer le guide ou le fermer."}};var p={and:"גם",more:"עוד",checklist:{nextSection:"הבא",previousSection:"קודם"},checklistDismiss:{button:"יציאה מרשימת המשימות",title:"לצאת מרשימת המשימות?",yes:"כן, סגור",cancel:"ביטול"},menu:{title:"תפריט",restart:"התחל מחדש",close:"סגור מדריך",back:"חזרה למדריך"},question:{npsLabelLeft:"בסבירות נמוכה",npsLabelRight:"בסבירות גבוהה",other:"אחר",placeholder:"הקלדת התשובה כאן",requiredError:"יש למלא את השדות כאן",submit:"הגשה"},resource_center:{back:"חזרה",generic_error:"תוכן זה אינו זמין כעת",no_results_found:"לא נמצאו תוצאות",search_in:"חיפוש ב",search_placeholder:"חיפוש",suggested_articles:"מאמרים מוצעים",unread:"לא נקרא {{count}}",unread_plural:"שלא נקראו {{count}}"},tooltipTargetMissing:{line1:"נראה כי ניווטת אל מחוץ למדריך",line2:"לחזרה למדריך, יש לנווט חזרה אל הדף הקודם,או לחילופין, להתחיל את המדריך מהתחלה"}};var d={and:"और",more:"अधिक",checklist:{nextSection:"अगला",previousSection:"पहले का"},checklistDismiss:{button:"चेकलिस्ट खारिज करें",title:"चेकलिस्ट खारिज करें?",yes:"हाँ, ख़ारिज करें",cancel:"रद्द करें"},menu:{title:"मेन्यू",restart:"प्रारंभ करें",close:"गाइड बंद करें",back:"गाइड पर लौटें"},question:{multiple_selection_hint:"{{range}} में से {{selected}} चयनित",multiple_selection_too_few:"कृपया कम से कम {{count}} विकल्प चुनें.",multiple_selection_too_few_plural:"कृपया कम से कम {{count}} विकल्प चुनें.",multiple_selection_too_many:"कृपया {{count}} से अधिक विकल्प न चुनें.",multiple_selection_too_many_plural:"कृपया {{count}} से अधिक विकल्प न चुनें.",multiple_selection_wrong:"कृपया ठीक {{count}} विकल्प चुनें.",multiple_selection_wrong_plural:"कृपया ठीक {{count}} विकल्प चुनें.",npsLabelLeft:"बिल्कुल असंभावित",npsLabelRight:"बहुत ज्यादा संभावना",other:"अन्य",placeholder:"अपना उत्तर यहां टाइप करें...",requiredError:"कृपया इस फ़ील्ड को भरें.",submit:"सब्मिट"},resource_center:{back:"पीछे",generic_error:"क्षमा करें, यह सामग्री इस समय लोड नहीं की जा सकी.",no_results_found:"कोई परिणाम नहीं मिला.",search_in:"यहाँ खोजें",search_placeholder:"खोज",suggested_articles:"सुझाए गए लेख",unread:"{{count}} अपठित",unread_plural:"{{count}} अपठित"},tooltipTargetMissing:{line1:"ऐसा लगता है कि आप उस पृष्ठ से दूर चले गए हैं जिससे वर्तमान गाइड संबंधित है.",line2:"शेष गाइड को जारी रखने के लिए, उस पृष्ठ पर वापस जाएं जिस पर आप पिछली बार थे, या वैकल्पिक रूप से, आप गाइड को पुनः आरंभ कर सकते हैं या इसे बंद कर सकते हैं."}};var m={and:"i",more:"Više",checklist:{nextSection:"Iduća",previousSection:"Prethodna"},checklistDismiss:{button:"Odbaci popis",title:"Odbaci popis?",yes:"Da, zatvori ",cancel:"Otkaži"},menu:{title:"Menu",restart:"Započni ispočetka",close:"Zatvori vodič",back:"Natrag na vodič"},question:{multiple_selection_hint:"{{selected}} od {{range}} opcije odabrane",multiple_selection_too_few:"Molimo odaberite najmanje {{count}} opciju.",multiple_selection_too_few_plural:"Molimo odaberite najmanje {{count}} opcije.",multiple_selection_too_many:"Molimo odaberite najviše {{count}} opciju.",multiple_selection_too_many_plural:"Molimo odaberite najviše {{count}} opcije.",multiple_selection_wrong:"Molimo izaberite točno {{count}} opciju.",multiple_selection_wrong_plural:"Molimo odaberite točno {{count}} opcije.",npsLabelLeft:"Uopće nije vjerojatno",npsLabelRight:"Vrlo vjerojatno",other:"Drugo",placeholder:"Upiši svoj odgovor ovdje...",requiredError:"Molimo popunite ovo polje.",submit:"Pošalji"},resource_center:{back:"Vrati se",generic_error:"Nažalost, ovaj se sadržaj trenutačno ne može učitati.",no_results_found:"Nema rezultata.",search_in:"Pretražiti u",search_placeholder:"Pretraga",suggested_articles:"Predloženi članci",unread:"{{count}} nepročitano",unread_plural:"{{count}} nepročitana"},tooltipTargetMissing:{line1:"Izgleda da ste otišli sa stranice vodiča.",line2:"Za nastavak vodiča, vratite se na prethodnu stranicu, ili vodič ponovno započnite, ili ga ugasite."}};var g={and:"és",more:"Több",checklist:{nextSection:"Következő",previousSection:"Előző"},checklistDismiss:{button:"zárja be az ellenőrzőlistát",title:"bezárja az ellenőrző listát??",yes:"Igen, közel",cancel:"Megse"},menu:{title:"Menü",restart:"Kezdje elölről",close:"Útmutató bezárása",back:"Vissza az útmutatóhoz"},question:{multiple_selection_hint:"{{selected}} a {{range}}-ból kiválasztva",multiple_selection_too_few:"Kérjük, válasszon legalább {{count}} opciót.",multiple_selection_too_few_plural:"Kérjük, válasszon legalább {{count}} opciót.",multiple_selection_too_many:"Kérjük, válasszon legfeljebb {{count}} lehetőséget.",multiple_selection_too_many_plural:"Kérjük, legfeljebb {{count}} lehetőséget válasszon.",multiple_selection_wrong:"Kérjük, pontosan {{count}} opciót válasszon.",multiple_selection_wrong_plural:"kérjük, válasszon ki pontosan {{count}} lehetőséget.",npsLabelLeft:"Nem valószínű",npsLabelRight:"Nagyon valószínű",other:"Egyéb",placeholder:"Írja be ide a választ...",requiredError:"Kérjük, töltse ki ezt a mezőt.",submit:"Beküldés"},resource_center:{back:"Vissza",generic_error:"Sajnálom, ezt a tartalmat jelenleg nem lehetett betölteni.",no_results_found:"Nincs találat.",search_in:"Keresés a",search_placeholder:"Keresés",suggested_articles:"Javasolt cikkek",unread:"{{count}} olvasatlan"},tooltipTargetMissing:{line1:"Úgy tűnik, elnavigáltál arról az oldalról, amelyhez az aktuális útmutató tartozik.",line2:"Az útmutató többi részének folytatásához lépjen vissza arra az oldalra, amelyen utoljára járt, vagy újraindíthatja vagy bezárhatja az útmutatót."}};var h={and:"dan",more:"Lebih",checklist:{nextSection:"Berikutnya",previousSection:"Sebelumnya"},checklistDismiss:{button:"Tutup daftar periksa",title:"Tutup daftar periksa?",yes:"Ya, tutup",cancel:"Batalkan"},menu:{title:"Menu",restart:"Mulai lagi",close:"Tutup panduan",back:"Kembali ke panduan"},question:{multiple_selection_hint:"{{selected} dari {{range}} dipilih",multiple_selection_too_few:"Harap pilih setidaknya {{count}} opsi.",multiple_selection_too_few_plural:"Pilih minimal {{count}} opsi.",multiple_selection_too_many:"Harap pilih tidak lebih dari {{count}} opsi.",multiple_selection_too_many_plural:"Harap pilih tidak lebih dari {{count}} opsi.",multiple_selection_wrong:"Pilih tepat {{count}} opsi.",multiple_selection_wrong_plural:"Silakan pilih tepat {{count}} opsi.",npsLabelLeft:"Tidak mungkin sama sekali",npsLabelRight:"Sangat mungkin",other:"Lain",placeholder:"Ketik jawabanmu di sini...",requiredError:"Silakan isi bidang ini.",submit:"Kirim"},resource_center:{back:"Kembali",generic_error:"Maaf, konten ini tidak dapat dimuat saat ini.",no_results_found:"Tidak ada hasil yang ditemukan.",search_in:"Cari di",search_placeholder:"Cari",suggested_articles:"Artikel yang disarankan",unread:"{{count}} belum dibaca"},tooltipTargetMissing:{line1:"Sepertinya Anda telah keluar dari halaman tempat panduan saat ini berada.",line2:"Untuk melanjutkan panduan lainnya, kembali ke halaman terakhir Anda berada, atau sebagai alternatif, Anda dapat memulai ulang panduan atau menutupnya."}};var k={and:"e",more:"Più",checklist:{nextSection:"Prossima",previousSection:"Precedente"},checklistDismiss:{button:"Chiudi la lista di controllo",title:"Vuoi chiudere la lista di controllo?",yes:"Sì, chiudi",cancel:"Annulla"},menu:{title:"Menu",restart:"Ricomincia da capo",close:"Chiudi la guida",back:"Indietro"},question:{multiple_selection_hint:"{{selected}} di {{range}} selezionati",multiple_selection_too_few:"Si prega di selezionare almeno {{count}} opzione.",multiple_selection_too_few_plural:"Si prega di selezionare almeno {{count}} opzioni.",multiple_selection_too_many:"Si prega di selezionare non più di {{count}} opzione.",multiple_selection_too_many_plural:"Si prega di selezionare non più di {{count}} opzioni.",multiple_selection_wrong:"Si prega di selezionare esattamente {{count}} opzione.",multiple_selection_wrong_plural:"Si prega di selezionare esattamente {{count}} opzioni.",npsLabelLeft:"Per niente probabile",npsLabelRight:"Estremamente probabile",other:"Altro",placeholder:"Scrivi qui la tua risposta...",requiredError:"Si prega di compilare questo campo.",submit:"Invia"},resource_center:{back:"Indietro",generic_error:"Spiacenti, questo contenuto non può essere caricato in questo momento.",no_results_found:"Nessun risultato trovato.",search_in:"Cerca nella",search_placeholder:"Cerca",suggested_articles:"Articoli suggeriti",unread:"{{count}} non letto"},tooltipTargetMissing:{line1:"Sembra che tu ti sia allontanato dalla pagina a cui appartiene il tour attuale.",line2:"Per continuare con il resto del tour, torna alla pagina dove ti trovavi. In alternativa puoi ricominciare da capo o chiudere il tour."}};var b={and:"と",more:"もっと",checklist:{nextSection:"次へ",previousSection:"戻る"},checklistDismiss:{button:"チェックリストを終了",title:"チェックリストを終了しますか?",yes:"終了",cancel:"キャンセル"},menu:{title:"メニュー",restart:"ガイドの始めに戻る",close:"ガイドを終了",back:"ガイドに戻る"},question:{multiple_selection_hint:"{{range}}のうち{{selected}}が選択されました",multiple_selection_too_few:"最低{{count}}つご選択ください。",multiple_selection_too_few_plural:"最低{{count}}つご選択ください。",multiple_selection_too_many:"{{count}}つ以内でご選択ください。",multiple_selection_too_many_plural:"{{count}}つ以内でご選択ください。",multiple_selection_wrong:"{{count}}つご選択ください。",multiple_selection_wrong_plural:"{{count}}つご選択ください。",npsLabelLeft:"非常に可能性が低い",npsLabelRight:"非常に可能性が高い",other:"その他",placeholder:"こちらにご入力ください...",requiredError:"こちらは必須入力項目です。",submit:"回答する"},resource_center:{back:"戻る",generic_error:"現在、このコンテンツを読み込めませんでした.",no_results_found:"結果が見つかりません。",search_in:"内検索",search_placeholder:"探す",suggested_articles:"おすすめの記事",unread:"{{count}} 未読"},tooltipTargetMissing:{line1:"現在のガイドが属するページから移動したようです。",line2:"ガイドの残りの部分を続行するには、最後に表示していたページに戻るか、ガイドを再起動するか閉じます。"}};var v={and:"그리고",more:"더 알아보기",checklist:{nextSection:"다음으로",previousSection:"이전으로"},checklistDismiss:{button:"체크리스트 무시하기",title:"체크리스트를 무시할까요?",yes:"네, 무시할게요.",cancel:"취소l"},menu:{title:"메뉴",restart:"다시 시작하기",close:"가이드를 닫을게요.",back:"가이드로 돌아갈게요."},question:{multiple_selection_hint:"{{range}} 개 중 {{selected}} 개 선택",multiple_selection_too_few:"옵션을 {{count}} 개 이상 선택하세요.",multiple_selection_too_few_plural:"옵션을 {{count}} 개 이상 선택하세요.",multiple_selection_too_many:"{{count}} 개 이하의 옵션을 선택하세요.",multiple_selection_too_many_plural:"{{count}} 개 이하의 옵션을 선택하세요.",multiple_selection_wrong:"옵션을 정확히 {{count}} 개 선택하세요.",multiple_selection_wrong_plural:"정확히 {{count}} 가지 옵션을 선택해주세요.",npsLabelLeft:"전혀 가능성이 없어요.",npsLabelRight:"가능성이 매우 높아요.",other:"그 외",placeholder:"여기에 답변을 적어주세요.",requiredError:"이 입력란을 채워주세요.",submit:"제출하기"},resource_center:{back:"뒤로가기",generic_error:"죄송해요. 내용을 표시할 수 없어요.",no_results_found:"검색 결과가 없어요.",search_in:"여기서 검색하세요.",search_placeholder:"검색하기",suggested_articles:"추천 기사",unread:"읽지 않은 항목 {{count}} 개",unread_plural:"읽지 않은 {{count}} 개"},tooltipTargetMissing:{line1:"가이드를 확인할 수 있는 페이지를 벗어났어요.",line2:" 가이드를 계속 확인하고 싶다면 이전 페이지로 돌아가세요. 아니면 처음부터 다시 시작할 수 있어요."}};var y={and:"og",more:"Mer",checklist:{nextSection:"Neste",previousSection:"Forrige"},checklistDismiss:{button:"Avslutt sjekkliste",title:"Avslutt sjekkliste?",yes:"Ja, avslutt",cancel:"Avbryt"},menu:{title:"Meny",restart:"Start på nytt",close:"Steng guiden",back:"Tilbake til guiden"},question:{multiple_selection_hint:"{{selected}} av {{range}} er valgt",multiple_selection_too_few:"Vennligst velg minst {{count}} alternativ.",multiple_selection_too_few_plural:"Vennligst velg minst {{count}} alternativer.",multiple_selection_too_many:"Vennligst velg ikke mer enn {{count}} alternativ.",multiple_selection_too_many_plural:"Vennligst velg ikke mer enn {{count}} alternativer.",multiple_selection_wrong:"Vennligst velg nøyaktig {{count}} alternativ.",multiple_selection_wrong_plural:"Vennligst velg nøyaktig {{count}} alternativer.",npsLabelLeft:"Ikke sannsynlig",npsLabelRight:"Svært sannsynlig",other:"Annet",placeholder:"Skriv inn svaret ditt her...",requiredError:"Dette feltet må fylles ut.",submit:"Send"},resource_center:{back:"Tilbake",generic_error:"Beklager, dette innholdet kunne ikke lastes nå.",no_results_found:"Ingen resultater.",search_in:"Søk i",search_placeholder:"Søk'",suggested_articles:"Foreslåtte artikler",unread:"{{count}} ulest",unread_plural:"{{count}} uleste"},tooltipTargetMissing:{line1:"Det ser ut til at du har forlatt siden denne guiden hører til.",line2:"For å fortsette med resten av guiden, gå tilbake til siden du besøkte sist. Alternativt kan du starte guiden på nytt eller stenge den."}};var f={and:"en",more:"Meer",checklistDismiss:{button:"Sluit checklist",title:"Checklist sluiten?",yes:"Ja, sluiten",cancel:"Annuleren"},menu:{title:"Menu",restart:"Opnieuw starten",close:"Rondleiding stoppen",back:"Terug"},question:{multiple_selection_hint:"{{selected}} van de {{range}} geselecteerd",multiple_selection_too_few:"Selecteer minste {{count}} optie.",multiple_selection_too_few_plural:"Selecteer minste {{count}} opties.",multiple_selection_too_many:"Selecteer niet meer dan {{count}} optie.",multiple_selection_too_many_plural:"Selecteer niet meer dan {{count}} opties.",multiple_selection_wrong:"Selecteer precies 1 optie {{count}} optie.",multiple_selection_wrong_plural:"Selecteer precies {{count}} opties.",npsLabelLeft:"Onwaarschijnlijk",npsLabelRight:"Zeer waarschijnlijk",other:"Ander",placeholder:"Typ hier je antwoord...",requiredError:"Gelieve dit veld in te vullen.",submit:"Indienen"},resource_center:{back:"Terug",generic_error:"Sorry, deze inhoud kan op dit moment niet worden geladen.",no_results_found:"Geen resultaten gevonden.",search_in:"Zoeken in",search_placeholder:"Zoek",suggested_articles:"Voorgestelde artikelen",unread:"{{count}} ongelezen"},tooltipTargetMissing:{line1:"Het lijkt erop dat u weg bent genavigeerd van de pagina waartoe de huidige rondleiding behoort.",line2:"Om verder te gaan met de rest van de rondleiding, gaat u terug naar de pagina waarop u zich het laatst bevond, of u kunt de rondleiding opnieuw starten of deze sluiten."}};var z={and:"i",more:"Więcej",checklist:{nextSection:"Dalej",previousSection:"Wróć"},checklistDismiss:{button:"Wyłącz listę zadań",title:"Wyłączyć listę zadań?",yes:"Tak, odrzuć",cancel:"Anulujl"},menu:{title:"Menu",restart:"Zacznij od nowa",close:"Zamknij przewodnik",back:"Powrót do przewodnika"},question:{multiple_selection_hint:"{{selected}} z {{range}} wybranych",multiple_selection_too_few:"Wybierz co najmniej {{count}} opcję.",multiple_selection_too_few_plural:"Wybierz co najmniej {{count}} opcje.",multiple_selection_too_many:"Wybierz nie więcej niż {{count}} opcję.",multiple_selection_too_many_plural:"Wybierz nie więcej niż {{count}} opcje.",multiple_selection_wrong:"Wybierz dokładnie {{count}} opcję.",multiple_selection_wrong_plural:"Wybierz dokładnie {{count}} opcje.",npsLabelLeft:"Wcale nie prawdopodobne",npsLabelRight:"Bardzo prawdopodobne",other:"Inny",placeholder:"Wpisz swoją odpowiedź tutaj...",requiredError:"Proszę wypełnić to pole.",submit:"Prześlij"},resource_center:{back:"Powrotu",generic_error:"Przepraszamy, w tej chwili nie można załadować tej treści.",no_results_found:"Nie znaleziono wyników.",search_in:"Szukaj w",search_placeholder:"Szukaj",suggested_articles:"Sugerowane artykuły",unread:"{{count}} nieprzeczytane"},tooltipTargetMissing:{line1:"Wygląda na to, że opuściłeś stronę, do której należy bieżąca lista zadań.",line2:"Aby kontynuować z pozostałą częścią przewodnika, wróć do ostatnio odwiedzanej strony, możesz ponownie uruchomić przewodnik lub go zamknąć."}};var w={and:"e",more:"Mais",checklist:{nextSection:"Próximo",previousSection:"Anterior"},checklistDismiss:{button:"Ignorar tarefas",title:"Ignorar tarefas?",yes:"Sim, fechar",cancel:"Cancelar"},menu:{title:"Menu",restart:"Começar novamente",close:"Fechar guia",back:"Voltar"},question:{multiple_selection_hint:"{{selected}} de {{range}} selecionados",multiple_selection_too_few:"Por favor, selecione pelo menos {{count}} opção.",multiple_selection_too_few_plural:"Por favor, selecione pelo menos {{count}} opções.",multiple_selection_too_many:"Por favor, selecione não mais de {{count}} opção.",multiple_selection_too_many_plural:"Por favor, selecione no máximo {{count}} opções.",multiple_selection_wrong:"Por favor, selecione exatamente {{count}} opção.",multiple_selection_wrong_plural:"Por favor, selecione exatamente {{count}} opções.",npsLabelLeft:"Pouco provável",npsLabelRight:"Extremamente provável",other:"Outros",placeholder:"Escreva sua resposta aqui...",requiredError:"Por favor, preencha esse campo.",submit:"Enviar"},resource_center:{back:"Voltar",generic_error:"Desculpe, este conteúdo não pode ser carregado neste momento.",no_results_found:"Nenhum resultado encontrado.",search_in:"Pesquisar na",search_placeholder:"Pesquisar",suggested_articles:"Artigos sugeridos",unread:"{{count}} não lido",unread_plural:"{{count}} não lidos"},tooltipTargetMissing:{line1:"Parece que você navegou para uma página que não pertence ao guia.",line2:"Para continuar com o restante do guia volte para a página anterior, ou como alternativa, você pode reiniciar o guia ou fechá-lo."}};var j={and:"si",more:"Mai mult",checklist:{nextSection:"Următorul",previousSection:"Anterior"},checklistDismiss:{button:"Închide lista de verificare",title:"Închide lista de verificare?",yes:"da, inchide",cancel:"Anula"},menu:{title:"Meniu",restart:"Ia de la capăt",close:"Închideți ghidul",back:"Reveniți la ghid"},question:{multiple_selection_hint:"{{selected}} din {{range}} selectat",multiple_selection_too_few:"vă rugăm să selectați cel puțin o opțiune",multiple_selection_too_few_plural:"Optionvă rugăm să selectați cel puțin {{count}} opțiuni.",multiple_selection_too_many:"Vă rugăm să nu selectați mai mult de {{count}} opțiune.",multiple_selection_too_many_plural:"Vă rugăm să selectați nu mai mult de {{count}} opțiuni.",multiple_selection_wrong:"Vă rugăm să selectați exact {{count}} opțiune.",multiple_selection_wrong_plural:"Vă rugăm să selectați exact {{count}} opțiuni.",npsLabelLeft:"Deloc probabil",npsLabelRight:"Extrem de probabil",other:"Alte",placeholder:"Introduceți răspunsul dvs. aici...",requiredError:"Vă rugăm să completați acest câmp.",submit:"Trimite"},resource_center:{back:"Înapoi",generic_error:"Ne pare rău, acest conținut nu a putut fi încărcat în acest moment.",no_results_found:"Nici un rezultat gasit.",search_in:"Caută în",search_placeholder:"Căutare",suggested_articles:"Articole sugerate",unread:"{{count}} necitit",unread_plural:"{{count}} necitite"},tooltipTargetMissing:{line1:"Se pare că ați navigat departe de pagina căreia îi aparține ghidul actual.",line2:"Pentru a continua cu restul ghidului, reveniți la pagina pe care ați fost ultima dată sau, alternativ, puteți reporni ghidul sau îl puteți închide."}};var S={and:"и",more:"Больше",checklist:{nextSection:"Дальше",previousSection:"Назад"},checklistDismiss:{button:"Скрыть список задач",title:"Вы уверены, что хотите скрыть список?",yes:"Скрыть список",cancel:"Отмена"},menu:{title:"Меню",restart:"Начать заново",close:"Закрыть обучение",back:"Назад"},question:{multiple_selection_hint:"{{selected}} из {{range}} выбранных",multiple_selection_too_few:"Пожалуйста, выберите хотя бы {{count}} вариант.",multiple_selection_too_few_plural:"Пожалуйста, выберите как минимум {{count}} варианта.",multiple_selection_too_many:"Пожалуйста, выберите не более {{count}} варианта.",multiple_selection_too_many_plural:"Пожалуйста, выберите не более {{count}} вариантов.",multiple_selection_wrong:"Пожалуйста, выберите ровно {{count}} вариант.",multiple_selection_wrong_plural:"Пожалуйста, выберите ровно {{count}} варианта.",npsLabelLeft:"Маловероятно",npsLabelRight:"Очень вероятно",other:"Другой",placeholder:"Напишите здесь ваш ответ…",requiredError:"Пожалуйста, заполните это поле.",submit:"Отправить"},resource_center:{back:"Назад",generic_error:"Извините, этот контент не может быть загружен в данный момент.",no_results_found:"Результаты не найдены.",search_in:"Поиск в",search_placeholder:"Поиск",suggested_articles:"Предлагаемые статьи",unread:"{{count}} непрочитанный",unread_plural:"{{count}} непрочитанных"},tooltipTargetMissing:{line1:"Похоже, вы ушли со страницы, на которой должно проходить обучение.",line2:"Чтобы продолжить обучение, вернитесь на страницу, на которой вы были в последний раз, или перезапустите / закройте обучение."}};var L={and:"a",more:"Viac",checklist:{nextSection:"Ďalej",previousSection:"Späť"},checklistDismiss:{button:"Skryť zoznam",title:"Skryť zoznam?",yes:"Áno, zrušiť",cancel:"Zrušiť"},menu:{title:"Menu",restart:"Začať od znova",close:"Zavrieť sprievodcu",back:"Späť na sprievodcu"},question:{multiple_selection_hint:"{{selected}} z {{range}} vybratých",multiple_selection_too_few:"Prosím, vyberte aspoň {{count}} možnosť.",multiple_selection_too_few_plural:"Prosím, vyberte aspoň {{count}} možnosti.",multiple_selection_too_many:"Prosím, nevyberajte viac ako {{count}} možnosť.",multiple_selection_too_many_plural:"Prosím, nevyberajte viac ako {{count}} možnosti.",multiple_selection_wrong:"Prosím, vyberte presne {{count}} možnosť.",multiple_selection_wrong_plural:"Prosím, vyberte presne {{count}} možnosti.",npsLabelLeft:"Určite nie",npsLabelRight:"Určite áno",other:"Iné",placeholder:"Sem napíšte svoju odpoveď...",requiredError:"Toto pole je povnné.",submit:"Potvrdiť"},resource_center:{back:"Spätný",generic_error:"Ľutujeme, tento obsah sa momentálne nepodarilo načítať.",no_results_found:"Neboli nájdené žiadne výsledky.",search_in:"Hľadať v",search_placeholder:"Hľadať",suggested_articles:"Odporúčané články",unread:"{{count}} neprečítané"},tooltipTargetMissing:{line1:"Zdá sa, že ste opustili stránku ku ktorej prislúcha aktuálny sprievodca.",line2:"Na dokončenie sprievodcu, vrátte sa o jednu stránku späť, poprípade sprievodcu môžete aj reštartovať alebo zavrieť."}};var q={and:"in",more:"Več",checklist:{nextSection:"Naprej",previousSection:"Nazaj"},checklistDismiss:{button:"Zapri seznam",title:"Želite skriti seznam?",yes:"Ja, skrij",cancel:"Prekliči"},menu:{title:"Meni",restart:"Začni znova",close:"Zapri vodič",back:"Nazaj k vodiču"},question:{multiple_selection_hint:"{{selected}} od {{range}} izbranih",multiple_selection_too_few:"Prosimo, izberite vsaj {{count}} možnost.",multiple_selection_too_few_plural:"Prosimo, izberite vsaj {{count}} možnosti",multiple_selection_too_many:"Prosimo, izberite največ {{count}} možnost.",multiple_selection_too_many_plural:"Prosimo, da izberete največ {{count}} možnosti.",multiple_selection_wrong:"Prosimo izberite točno {{count}} možnost.",multiple_selection_wrong_plural:"Prosimo izberite točno {{count}} možnosti.",npsLabelLeft:"Sploh ni verjetno",npsLabelRight:"Zelo verjetno",other:"Drugo",placeholder:"Vpišite svoj odgovor spodaj...",requiredError:"Prosimo, da izpolnite to polje.",submit:"Pošlji"},resource_center:{back:"Nazaj",generic_error:"Te vsebine trenutno ni bilo mogoče naložiti.",no_results_found:"Ni zadetkov.",search_in:"Išči v",search_placeholder:"Iskanje",suggested_articles:"Predlagani članki",unread:"{{count}} neprebrano",unread_plural:"{{count}} neprebrana"},tooltipTargetMissing:{line1:"Zdi se, da ste odšli s strani, ki ji pripada trenutni vodič.",line2:"Da bi nadaljevali z preostankom vodenja, se lahko vrnete na stran, na kateri ste nazadnje bili, ponovno pričnete z vodičem ali ga zaprete."}};var P={and:"och",more:"Mer",checklist:{nextSection:"Nästa",previousSection:"Föregående"},checklistDismiss:{button:"Ta bort checklistan",title:"Vill du ta bort checklistan?",yes:"Ja, ta bort den",cancel:"Avbryt"},menu:{title:"Meny",restart:"Börja om",close:"Stäng guiden",back:"Gå tillbaka till guiden"},question:{multiple_selection_hint:"{{selected}} av {{range}} valda",multiple_selection_too_few:"Vänligen välj minst {{count}} alternativ.",multiple_selection_too_few_plural:"Vänligen välj minst {{count}} alternativ.",multiple_selection_too_many:"Vänligen välj högst {{count}} alternativ.",multiple_selection_too_many_plural:"Vänligen välj högst {{count}} alternativ.",multiple_selection_wrong:"Vänligen välj exakt {{count}} alternativ.",multiple_selection_wrong_plural:"Vänligen välj exakt {{count}} alternativ.",npsLabelLeft:"Inte alls troligt",npsLabelRight:"Extremt troligt",other:"Övrig",placeholder:"Skriv ditt svar här...",requiredError:"Vänligen fyll i detta fält.",submit:"Skicka"},resource_center:{back:"Tillbaka",generic_error:"Tyvärr, det här innehållet kunde inte laddas för närvarande.",no_results_found:"Inga resultat funna.",search_in:"Sök i",search_placeholder:"Sök",suggested_articles:"Föreslagna artiklar",unread:"{{count}} oläst",unread_plural:"{{count}} olästa"},tooltipTargetMissing:{line1:"Det verkar som om du navigerat bort från den sida som den här guiden hör till.",line2:"För att fortsätta med resten av guiden, gå tillbaka till sidan du var på sist, alternativt starta om den här guiden, eller stäng den."}};var M={checklist:{nextSection:"ถัดไป",previousSection:"ก่อนหน้า"},checklistDismiss:{button:"ยกเลิกรายการตรวจสอบ",title:"ต้องการยกเลิกรายการตรวจสอบใช่หรือไม่",yes:"ใช่โปรดยกเลิก",cancel:"ยกเลิก"},menu:{title:"รายการ",restart:"เริ่มต้นใหม่",close:"ปิดคำแนะนำ",back:"กลับไปที่คำแนะนำ"},question:{multiple_selection_hint:"ที่เลือกไว้ {{selected}} ใน {{range}} รายการ",multiple_selection_too_few:"โปรดเลือกอย่างน้อย {{count}} ตัวเลือก",multiple_selection_too_few_plural:"โปรดเลือกอย่างน้อย {{count}} ตัวเลือก",multiple_selection_too_many:"โปรดเลือกไม่เกิน {{count}} ตัวเลือก",multiple_selection_too_many_plural:"โปรดเลือกไม่เกิน {{count}} ตัวเลือก",multiple_selection_wrong:"โปรดเลือก {{count}} ตัวเลือกเท่านั้น",multiple_selection_wrong_plural:"กรุณาเลือกให้ตรง {{count}} ตัวเลือก",npsLabelLeft:"ไม่ทั้งหมด",npsLabelRight:"มีความเป็นไปได้",other:"อื่นๆ",placeholder:"ใส่คำตอบของคุณที่นี่",requiredError:"กรุณากรอกข้อมูลในช่องนี้",submit:"ส่ง"},resource_center:{back:"กลับ",generic_error:"ขออภัย ไม่สามารถโหลดเนื้อหานี้ได้ในขณะนี้",no_results_found:"ไม่พบผลลัพธ์.",search_in:"ค้นหาใน",search_placeholder:"ค้นหา",suggested_articles:"บทความแนะนำ",unread:"{{count}} ยังไม่ได้อ่าน"},tooltipTargetMissing:{line1:"ดูเหมือนว่าคุณได้ออกจากหน้าเว็บที่เป็นของคู่มือปัจจุบันแล้ว",line2:"หากต้องการดำเนินการต่อกับคำแนะนำที่เหลือให้กลับไปที่หน้าที่คุณใช้ล่าสุดหรืออีกวิธีหนึ่งคุณสามารถเริ่มคำแนะนำใหม่ได้เลย"}};var V={and:"ve",more:"Daha Fazla",checklist:{nextSection:"Sonraki",previousSection:"Önceki"},checklistDismiss:{button:"Listeyi sonlandır",title:"Listeyi sonlandır?",yes:"Evet, sonlandır.",cancel:"İptal"},menu:{title:"Menü",restart:"Baştan Başlat",close:"Klavuzu kapat",back:"Klavuza geri dön"},question:{multiple_selection_hint:" {{selected}} / {{range}} seçildi",multiple_selection_too_few:"Lütfen en az {{count}} seçenek seçin.",multiple_selection_too_few_plural:"Lütfen en az {{count}} seçenek seçin.",multiple_selection_too_many:"Lütfen en fazla {{count}} seçenek seçin.",multiple_selection_too_many_plural:"Lütfen en fazla {{count}} seçenek belirleyin.",multiple_selection_wrong:"Lütfen tam olarak {{count}} seçeneği seçin.",multiple_selection_wrong_plural:"Lütfen tam olarak {{count}} seçeneği seçin.",npsLabelLeft:"Düşük ihtimalle",npsLabelRight:"Yüksek ihtimalle",other:"Diğer",placeholder:"Cevabınızı buraya yazınız...",requiredError:"Lütfen bu alanı doldurun.",submit:"Gönder"},resource_center:{back:"Geri",generic_error:"Üzgünüz, bu içerik şu anda bu içerik yüklenememektedir.",no_results_found:"Sonuç bulunamadı.",search_in:"Burada ara",search_placeholder:"Arama",suggested_articles:"Tavsiye edilen makaleler.",unread:"{{count}} okunmamış"},tooltipTargetMissing:{line1:"Mevcut klavuza ait olan sayfa dışına çıkmışsınız gibi görünüyor.",line2:"Klavuzla devam etmek için, en son bulunduğunuz sayfaya geri gidin, ayrıca klavuzu baştan başlatabilir veya kapatabilirsiniz."}};var T={and:"і",more:"Більше",checklist:{nextSection:"Наступний",previousSection:"Попередній"},checklistDismiss:{button:"Закрити перелік",title:"Закрити перелік?",yes:"Так, закрити",cancel:"Скасувати"},menu:{title:"Меню",restart:"Почати знову",close:"Закрити гайд",back:"Повернутися до гайду"},question:{multiple_selection_hint:"{{selected}} з {{range}} вибрано",multiple_selection_too_few:"Будь ласка, виберіть щонайменше {{count}} варіант.",multiple_selection_too_few_plural:"Будь ласка, виберіть щонайменше {{count}} варіанти.",multiple_selection_too_many:"Будь ласка, оберіть не більше {{count}} варіанти.",multiple_selection_too_many_plural:"Будь ласка, оберіть не більше {{count}} варіанти.",multiple_selection_wrong:"Будь ласка, оберіть рівно {{count}} варіант.",multiple_selection_wrong_plural:"Будь ласка, оберіть рівно {{count}} варіанти.",npsLabelLeft:"Зовсім не ймовірно",npsLabelRight:"Дуже ймовірно",other:"Інше",placeholder:"Введіть свою відповідь тут...",requiredError:"Будь ласка, заповніть це поле.",submit:"Надіслати"},resource_center:{back:"Назад",generic_error:"Вибачте, цей контент не може бути завантажений наразі.",no_results_found:"Результати не знайдено.",search_in:"Шукати у",search_placeholder:"Пошук",suggested_articles:"Рекомендовані статті",unread:"{{count}} непрочитаний",unread_plural:"{{count}} непрочитані"},tooltipTargetMissing:{line1:"Схоже, ви перейшли зі сторінки, на якій знаходиться поточний гайд.",line2:"Щоб продовжити з іншими частинами гайду, поверніться на сторінку, на якій ви були останнім часом, або, як варіант, ви можете розпочати гайд знову або закрити його."}};var x={checklist:{nextSection:"Kế tiếp",previousSection:"Trước"},checklistDismiss:{button:"Loại bỏ danh sách kiểm tra",title:"Loại bỏ danh sách kiểm tra",yes:"Đúng, loại bỏ",cancel:"Hủy"},menu:{title:"Công cụ",restart:"Bắt đầu lại",close:"Đóng hướng dẫn",back:"Quay trở lại hướng dẫn"},question:{multiple_selection_hint:"{{selected}} trong {{range}} được chọn",multiple_selection_too_few:"Vui lòng chọn ít nhất {{count}} tùy chọn.",multiple_selection_too_few_plural:"Vui lòng chọn ít nhất {{count}} tùy chọn.",multiple_selection_too_many:"Vui lòng chọn không quá {{count}} tùy chọn.",multiple_selection_too_many_plural:"Vui lòng chọn không quá {{count}} tùy chọn.",multiple_selection_wrong:"Vui lòng chọn chính xác {{count}} tùy chọn.",multiple_selection_wrong_plural:"Vui lòng chọn chính xác {{count}} tùy chọn.",npsLabelLeft:"Không thể xảy ra",npsLabelRight:"Rất có thể xảy ra",other:"Khác",placeholder:"Nhập câu hỏi bạn ở đây",requiredError:"Vui lòng điển vào trường này",submit:"Gửi đi"},resource_center:{back:"Trở lại",generic_error:"Rất tiếc, nội dung này không thể tải vào lúc này.",no_results_found:"Không có kết quả nào được tìm thấy.",search_in:"Tìm kiếm ở",search_placeholder:"Tìm kiếm",suggested_articles:"Bài viết được đề xuất",unread:"{{count}} chưa đọc"},tooltipTargetMissing:{line1:"Có vẻ bạn dời khỏi trang hướng dẫn hiện tại",line2:"Để tiếp tục với phần còn lại của hướng dẫn, quay trở lại trang mà bạn đã truy cập lần cuối, hoặc cách khác, bạn có thể khởi động lại hướng dẫn hay đóng lại"}};var E={and:"和",more:"更多",checklist:{nextSection:"下一步",previousSection:"上一步"},checklistDismiss:{button:"关闭检查表",title:"关闭检查表?",yes:"是的,关闭",cancel:"取消"},menu:{title:"菜单",restart:"重新开始",close:"关闭指南",back:"返回指南"},question:{multiple_selection_hint:"{{range}} 选 {{selected}} 选 ",multiple_selection_too_few:"请至少选择 {{count}} 个选项。",multiple_selection_too_few_plural:"请至少选择 {{count}} 个选项。",multiple_selection_too_many:"请选择不超过 {{count}} 个选项。",multiple_selection_too_many_plural:"请选择不超过 {{count}} 个选项。",multiple_selection_wrong:"请准确选择 {{count}} 个选项。",multiple_selection_wrong_plural:"请准确选择 {{count}} 个选项。",npsLabelLeft:"绝无可能",npsLabelRight:"极有可能",other:"其他",placeholder:"在此处输入您的答案…",requiredError:"请填写此字段.",submit:"提交"},resource_center:{back:"后退",generic_error:"抱歉,此内容目前无法加载.",no_results_found:"未找到结果",search_in:"搜索范围",search_placeholder:"搜索",suggested_articles:"推荐文章",unread:"{{count}} 条未读",unread_plural:"{{count}} н未读"},tooltipTargetMissing:{line1:"您似乎已离开当前指南所属的页面。",line2:"若要继续阅读本指南的其余部分,请返回您最后浏览的页面,您也可以重启或关闭指南。"}};var D={checklist:{nextSection:"下一步",previousSection:"上一步"},checklistDismiss:{button:"永久關閉選單",title:"永久關閉選單?",yes:"是的,永久關閉",cancel:"保留選單"},menu:{title:"選項",restart:"重新導覽",close:"關閉導覽",back:"繼續導覽"},question:{multiple_selection_hint:"{{range}} 選 {{selected}} 選",multiple_selection_too_few:"請至少選擇 {{count}} 個選項。",multiple_selection_too_few_plural:"請至少選擇 {{count}} 個選項。",multiple_selection_too_many:"請選擇不超過 {{count}} 個選項。",multiple_selection_too_many_plural:"請選擇不超過 {{count}} 個選項。",multiple_selection_wrong:"請準確選擇 {{count}} 個選項。",multiple_selection_wrong_plural:"請準確選擇 {{count}} 個選項。",npsLabelLeft:"根本不可能",npsLabelRight:"極有可能",other:"其他",placeholder:"在此處輸入您的答案",requiredError:"請填寫此字段。",submit:"提交"},resource_center:{back:"回",generic_error:"抱歉,此時無法加載此內容。",no_results_found:"未找到結果。",search_in:"在里面搜索",search_placeholder:"搜索",suggested_articles:"推薦文章",unread:"{{count}} 条未读",unread_plural:"{{count}} н未读"},tooltipTargetMissing:{line1:"看起來你已經離開導覽了唷!",line2:"如果想要繼續導覽,請回到上一頁。你也可以選擇重新導覽,或是關閉導覽。"}};const R=function(){const n=e.createInstance();return n.use(t).init({resources:{ar:{translation:i},cs:{translation:l},da:{translation:o},de:{translation:a},el:{translation:r},en:{translation:s},es:{translation:c},fi:{translation:u},fr:{translation:_},he:{translation:p},hi:{translation:d},hr:{translation:m},hu:{translation:g},id:{translation:h},it:{translation:k},ja:{translation:b},ko:{translation:v},nb:{translation:y},nl:{translation:f},pl:{translation:z},pt:{translation:w},ro:{translation:j},ru:{translation:S},sk:{translation:L},sl:{translation:q},sv:{translation:P},th:{translation:M},tr:{translation:V},uk:{translation:T},vi:{translation:x},"zh-CN":{translation:E},"zh-TW":{translation:D}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}}),n}(),A=n.createContext(null);function N(){return n.useContext(A)}function Z(){return n.useContext(A)}export{A as U,N as a,R as i,Z as u};
|
|
1
|
+
import{i as e}from"./vendor.i18next.js";import{i as t}from"./vendor.react-i18next.js";import{r as n}from"./vendor.react.js";var i={and:"و",more:"المزيد",checklist:{nextSection:"التالي",previousSection:"السابق"},checklistDismiss:{button:"رفض قائمة التحقق",title:"هل تريد رفض قائمة التحقق؟",yes:"نعم ، رفض",cancel:"إلغاء"},menu:{title:"قائمة",restart:"بدء من جديد",close:"أغلق الدليل",back:"ارجع إلى الدليل"},question:{npsLabelLeft:"غير محتمل على الإطلاق",npsLabelRight:"من المرجح للغاية",other:"آخر",placeholder:"اكتب إجابتك هنا ...",requiredError:"من فضلك املأ هذه الحقل.",submit:"إرسال"},resource_center:{back:"العودة",generic_error:"عذرا، لا يمكن تحميل هذا المحتوى في هذا الوقت.",no_results_found:"لا توجد نتائج.",search_in:"بحث في",search_placeholder:"بحث",suggested_articles:"المقالات المقترحة",unread:"غير مقروءة {{count}}",unread_plural:"غير مقروءة {{count}}"},tooltipTargetMissing:{line1:"يبدو أنك انتقلت بعيدًا عن الصفحة التي ينتمي إليها الدليل الحالي.",line2:"للمتابعة مع بقية الدليل، ارجع إلى الصفحة التي كنت فيها آخر مرة، أو بدلاً من ذلك، يمكنك إعادة تشغيل الدليل أو إغلاقه."}};var l={and:"a",more:"Více",checklist:{nextSection:"Další",previousSection:"Předchozí’"},checklistDismiss:{button:"Zavřít checklist",title:"Zavřít checklist?",yes:"Ano, zavřít",cancel:"Zavřít"},menu:{title:"Menu",restart:"Začít znovu",close:"Zavřít průvodce",back:"Vrátit se k průvodci"},question:{multiple_selection_hint:"{{selected}} ze {{range}} vybraných",multiple_selection_too_few:"Vyberte prosím alespoň {{count}} možnost.",multiple_selection_too_few_plural:"Vyberte prosím alespoň {{count}} možnosti.",multiple_selection_too_many:"Vyberte prosím ne více než {{count}} možnost.",multiple_selection_too_many_plural:"Vyberte prosím maximálně {{count}} možnosti.",multiple_selection_wrong:"Vyberte prosím přesně {{count}} možnost.",multiple_selection_wrong_plural:"Vyberte prosím přesně {{count}} možnosti.",npsLabelLeft:"Spíše ne",npsLabelRight:"Určitě ano",other:"Jiné",placeholder:"Zde napište svou odpověď...",requiredError:"Vyplňte prosím toto pole.",submit:"Uložit"},resource_center:{back:"Zpět",generic_error:"Litujeme, tento obsah v tuto chvíli nelze načíst.",no_results_found:"Nebylo nic nalezeno.",search_in:"Hledat v",search_placeholder:"Hledej",suggested_articles:"Doporučené články",unread:"{{count}} nepřečtená",unread_plural:"{{count}} nepřečtené"},tooltipTargetMissing:{line1:"Zdá se, že jste opustili stránku s průvodcem.",line2:"Pro pokračování s průvodcem jděte zpět na předchozí stránku. Případně můžete začít úplně znovu nebo průvodce zavřít."}};var o={and:"og",more:"Mere",checklistDismiss:{button:"Fjern tjekliste",title:"Fjern tjekliste?",yes:"Ja, fjern",cancel:"Annuller"},menu:{title:"Menu",restart:"Start forfra",close:"Luk guide",back:"Tilbage til guiden"},question:{multiple_selection_hint:"{{selected}} ud af {{range}} valgt",multiple_selection_too_few:"Vælg venligst {{count}} mulighed.",multiple_selection_too_few_plural:"Vælg venligst {{count}} muligheder.",multiple_selection_too_many:"Vælg ikke mere end {{count}} mulighed.",multiple_selection_too_many_plural:"Vælg ikke mere end {{count}} muligheder.",multiple_selection_wrong:"Vælg venligst præcis {{count}} mulighed.",multiple_selection_wrong_plural:"Vælg venligst præcis {{count}} muligheder.",npsLabelLeft:"Ikke sandsynligt",npsLabelRight:"Ekstremt sandsynligt",other:"Andet",placeholder:"Skriv dit svar her...",requiredError:"Udfyld venligst dette felt.",submit:"Send"},resource_center:{back:"Tilbage",generic_error:"Beklager, vi kan desværre ikke hente dette indhold i øjeblikket.",no_results_found:"Ingen resultater fundet.",search_in:"Søg i",search_placeholder:"Søg",suggested_articles:"Foreslåede artikler",unread:"{{count}} ulæst",unread_plural:"{{count}} ulæste"},tooltipTargetMissing:{line1:"Det lader til at du er navigeret væk fra siden som denne guide hører til.",line2:"Prøv at gå tilbage til den forrige side for at fortsætte med resten af guiden. Alternativt kan du genstarte guiden eller lukke den."}};var a={and:"und",assistant:{disconnected_error:"Entschuldigung, meine Verbindung wurde unterbrochen. Bitte versuchen Sie es erneut oder kontaktieren Sie meine menschlichen Freunde.",generic_error:"Es tut mir leid, aber etwas ist schief gelaufen. Bitte versuche es erneut."},more:"Mehr",checklist:{nextSection:"Nächste",previousSection:"Vorherige"},checklistDismiss:{button:"Checkliste schließen",title:"Checkliste schließen?",yes:"Ja, schließen",cancel:"Abbrechen"},menu:{title:"Menü",restart:"Von vorne beginnen",close:"Tour beenden",back:"Zurück"},question:{multiple_selection_hint:"{{selected}} von {{range}} ausgewählt",multiple_selection_too_few:"Bitte wähle Sie mindestens {{count}} Option aus.",multiple_selection_too_few_plural:"Bitte wählen Sie mindestens {{count}} Optionen aus.",multiple_selection_too_many:"Bitte wählen Sie nicht mehr als {{count}} Option aus.",multiple_selection_too_many_plural:"Bitte wählen Sie nicht mehr als {{count}} Optionen aus.",multiple_selection_wrong:"Bitte wählen Sie genau {{count}} Option aus.",multiple_selection_wrong_plural:"Bitte wählen Sie genau {{count}} Optionen aus.",npsLabelLeft:"Unwahrscheinlich",npsLabelRight:"Sehr wahrscheinlich",other:"Weitere",placeholder:"Geben Sie Ihre Antwort hier ein...",requiredError:"Bitte füllen Sie dieses Feld aus.",submit:"Absenden"},resource_center:{back:"Zurück",generic_error:"Entschuldigung, dieser Inhalt konnte zu diesem Zeitpunkt nicht geladen werden.",no_results_found:"keine Ergebnisse gefunden.",search_in:"Suche in",search_placeholder:"Suchen",suggested_articles:"Vorgeschlagene Artikel",unread:"{{count}} ungelesen"},tooltipTargetMissing:{line1:"Es sieht so aus, dass Du auf einer falschen Seite gelandet bist, die nicht zum aktuellen Leitfaden gehört.",line2:"Um mit dem Leitfaden fortzufahren, gehe zur letzten Seite zurück auf der du den Leitfaden gesehen hast. Alternativ dazu kannst du den Leitfaden jederzeit neustarten oder schließen."}};var r={and:"και",more:"Περισσότερο",checklist:{nextSection:"Επόμενο",previousSection:"Προηγούμενος"},checklistDismiss:{button:"Παράβλεψη λίστας εκκρεμοτήτων",title:"Κλείσιμο λίστας εκκρεμοτήτων;",yes:"Ναί, παράβλεψη",cancel:"Ακύρωση"},menu:{title:"Μενού",restart:"Ξεκίνημα απ'την αρχή",close:"Κλείσιμο οδηγού",back:"Επιστροφή"},question:{multiple_selection_hint:"Επιλέχτηκε {{selected}} στους {{range}}",multiple_selection_too_few:"Επιλέξτε τουλάχιστον {{count}} επιλογή.",multiple_selection_too_few_plural:"Επιλέξτε τουλάχιστον {{count}} επιλογές.",multiple_selection_too_many:"Επιλέξτε όχι περισσότερες από {{count}} επιλογές.",multiple_selection_too_many_plural:"Επιλέξτε όχι περισσότερες από {{count}} επιλογές.",multiple_selection_wrong:"Επιλέξτε ακριβώς {{count}} επιλογή.",multiple_selection_wrong_plural:"Επιλέξτε ακριβώς {{count}} επιλογές.",npsLabelLeft:"Καθόλου πιθανό",npsLabelRight:"Εξαιρετικά πιθανό",other:"Αλλος",placeholder:"Πληκτρολογήστε την απάντησή σας εδώ...",requiredError:"Παρακαλώ συμπληρώστε αυτό το πεδίο.",submit:"υποβάλετε"},resource_center:{back:"Επιστροφή",generic_error:"Λυπούμαστε, δεν ήταν δυνατή η φόρτωση αυτού του περιεχομένου αυτήν τη στιγμή.",no_results_found:"Δεν βρέθηκαν αποτελέσματα.",search_in:"Αναζήτηση στη",search_placeholder:"Αναζήτηση",suggested_articles:"Προτεινόμενα άρθρα",unread:"{{count}} μη αναγνωσμένο",unread_plural:"{{count}} αδιάβαστοι"},tooltipTargetMissing:{line1:"Φαίνεται ότι έχετε απομακρυνθεί από τη σελίδα του μάγου.",line2:"Για να συνεχίσετε με τον υπόλοιπο οδηγό, επιστρέψτε στη σελίδα στην οποία ήσασταν τελευταία ή, εναλλακτικά, μπορείτε να επανεκκινήσετε τον οδηγό ή να τον κλείσετε."}};var s={and:"and",assistant:{disconnected_error:"Sorry, my connection got disconnected. Please try again or contact my human friends.",generic_error:"I'm sorry, but something went wrong. Please try again."},more:"More",checklist:{nextSection:"Next",previousSection:"Previous"},checklistDismiss:{button:"Dismiss checklist",title:"Dismiss checklist?",yes:"Yes, dismiss",cancel:"Cancel"},menu:{title:"Menu",restart:"Start over",close:"Close guide",back:"Return to guide"},question:{multiple_selection_hint:"{{selected}} out of {{range}} selected",multiple_selection_too_few:"Please select at least {{count}} option.",multiple_selection_too_few_plural:"Please select at least {{count}} options.",multiple_selection_too_many:"Please select no more than {{count}} option.",multiple_selection_too_many_plural:"Please select no more than {{count}} options.",multiple_selection_wrong:"Please select exactly {{count}} option.",multiple_selection_wrong_plural:"Please select exactly {{count}} options.",npsLabelLeft:"Not at all likely",npsLabelRight:"Extremely likely",other:"Other",placeholder:"Type your answer here...",requiredError:"Please fill in this field.",submit:"Submit"},resource_center:{back:"Back",generic_error:"Sorry, this content could not be loaded at this time.",no_results_found:"No results found.",search_in:"Search in",search_placeholder:"Search",suggested_articles:"Suggested articles",unread:"{{count}} unread"},tooltipTargetMissing:{line1:"It seems you've navigated away from the page the current guide belongs to.",line2:"To continue with the rest of the guide, go back to the page you were last on, or alternatively, you can restart the guide or close it."}};var c={and:"y",more:"Más",checklist:{nextSection:"Siguiente",previousSection:"Anterior"},checklistDismiss:{button:"Descartar checklist",title:"¿Descartar checklist?",yes:"Si, descartar",cancel:"Mantener checklist"},menu:{title:"Menu",restart:"Reiniciar",close:"Cerrar guía",back:"Continuar guía"},question:{multiple_selection_hint:"{{selected}} de {{range}} seleccionados",multiple_selection_too_few:"Por favor, seleccione al menos {{count}} opción.",multiple_selection_too_few_plural:"Por favor, seleccione al menos {{count}} opciones.",multiple_selection_too_many:"Por favor, seleccione no más de {{count}} opción.",multiple_selection_too_many_plural:"Por favor, seleccione no más de {{count}} opciones.",multiple_selection_wrong:"Por favor, seleccione exactamente {{count}} opción.",multiple_selection_wrong_plural:"Por favor, seleccione exactamente {{count}} opciones.",npsLabelLeft:"No es muy probable",npsLabelRight:"Extremadamente probable",other:"Otro/Otra",placeholder:"Escriba aquí su respuesta...",requiredError:"Por favor, rellene este campo.",submit:"Enviar"},resource_center:{back:"Atrás",generic_error:"Lo sentimos, este contenido no se pudo cargar en este momento.",no_results_found:"No se han encontrado resultados.",search_in:"Buscar en",search_placeholder:"Buscar",suggested_articles:"Artículos sugeridos",unread:"{{count}} no leído",unread_plural:"{{count}} no leídos"},tooltipTargetMissing:{line1:"Parece que has navegado fuera de la guía.",line2:"Para continuar con el resto de la guía, regresa a la página donde estabas, o también, puedes reiniciarla o cerrarla."}};var u={and:"ja",more:"Lisää",checklist:{nextSection:"Seuraava",previousSection:"Edellinen"},checklistDismiss:{button:"Hylkää tarkistuslista",title:"Hylkää tarkistuslista?",yes:"Kyllä, hylkää",cancel:"Peruuta"},menu:{title:"Valikko",restart:"Aloita uudestaan",close:"Sulje ohje",back:"Takaisin ohjeeseen"},question:{multiple_selection_hint:"{{selected}}/{{range}} valittu",multiple_selection_too_few:"Valitse vähintään {{count}} vaihtoehto.",multiple_selection_too_few_plural:"Ole hyvä ja valitse vähintään {{count}} vaihtoehtoa.",multiple_selection_too_many:"Ole hyvä ja valitse enintään {{count}} vaihtoehto.",multiple_selection_too_many_plural:"Ole hyvä ja valitse enintään {{count}} vaihtoehtoa.",multiple_selection_wrong:"Ole hyvä ja valitse täsmälleen {{count}} vaihtoehto.",multiple_selection_wrong_plural:"Ole hyvä ja valitse tarkalleen {{count}} vaihtoehtoa.",npsLabelLeft:"Ei yhtään sopiva",npsLabelRight:"Todella sopiva",other:"Muu",placeholder:"Kirjoita vastauksesi tähän...",requiredError:"Täytä tämä kohta.",submit:"Lähetä"},resource_center:{back:"Takaisin",generic_error:"Valitettavasti tätä sisältöä ei voitu ladata tällä hetkellä.",no_results_found:"Ei tuloksia.",search_in:"Etsi",search_placeholder:"Etsi",suggested_articles:"Ehdotetut artikkelit",unread:"{{count}} lukematon",unread_plural:"{{count}} lukematonta"},tooltipTargetMissing:{line1:"Näyttää siltä, että olet siirtynyt pois sivulta, jolle nykyinen opas kuuluu.",line2:"Jatka oppaan loppuun palaamalla sivulle, jolla olit viimeksi, tai vaihtoehtoisesti voit käynnistää oppaan uudelleen tai sulkea sen."}};var _={and:"et",more:"Plus",checklist:{nextSection:"Suivant",previousSection:"Précédent"},checklistDismiss:{button:"Fermer la check-list",title:"Fermer la check-list?",yes:"Oui, fermer",cancel:"Annuler"},menu:{title:"Menu",restart:"Recommencer",close:"Fermer la visite",back:"Étape précédente"},question:{multiple_selection_hint:"{{selected}} sur {{range}} sélectionnés",multiple_selection_too_few:"Veuillez sélectionner au moins {{count}} option.",multiple_selection_too_few_plural:"Veuillez sélectionner au moins {{count}} options.",multiple_selection_too_many:"Veuillez ne pas sélectionner plus {{count}} option.",multiple_selection_too_many_plural:"Veuillez ne pas sélectionner plus de {{count}} options.",multiple_selection_wrong:"Veuillez sélectionner exactement {{count}} option.",multiple_selection_wrong_plural:"Veuillez sélectionner exactement {{count}} options.",npsLabelLeft:"Pas du tout probable",npsLabelRight:"Hautement probable",other:"Autre",placeholder:"Tapez votre réponse ici...",requiredError:"Veuillez remplir ce champ.",submit:"Soumettre"},resource_center:{back:"Retour",generic_error:"Désolé, ce contenu n'a pas pu être chargé pour le moment.",no_results_found:"Aucun résultat trouvé.",search_in:"Rechercher dans",search_placeholder:"Rechercher",suggested_articles:"Articles suggérés",unread:"{{count}} non lu",unread_plural:"{{count}} non lus"},tooltipTargetMissing:{line1:"Il semble que vous vous soyez éloigné de la page à laquelle appartient le guide actuel.",line2:"Pour continuer avec le reste du guide, revenez à la dernière page sur laquelle vous étiez, ou vous pouvez également redémarrer le guide ou le fermer."}};var p={and:"גם",more:"עוד",checklist:{nextSection:"הבא",previousSection:"קודם"},checklistDismiss:{button:"יציאה מרשימת המשימות",title:"לצאת מרשימת המשימות?",yes:"כן, סגור",cancel:"ביטול"},menu:{title:"תפריט",restart:"התחל מחדש",close:"סגור מדריך",back:"חזרה למדריך"},question:{npsLabelLeft:"בסבירות נמוכה",npsLabelRight:"בסבירות גבוהה",other:"אחר",placeholder:"הקלדת התשובה כאן",requiredError:"יש למלא את השדות כאן",submit:"הגשה"},resource_center:{back:"חזרה",generic_error:"תוכן זה אינו זמין כעת",no_results_found:"לא נמצאו תוצאות",search_in:"חיפוש ב",search_placeholder:"חיפוש",suggested_articles:"מאמרים מוצעים",unread:"לא נקרא {{count}}",unread_plural:"שלא נקראו {{count}}"},tooltipTargetMissing:{line1:"נראה כי ניווטת אל מחוץ למדריך",line2:"לחזרה למדריך, יש לנווט חזרה אל הדף הקודם,או לחילופין, להתחיל את המדריך מהתחלה"}};var d={and:"और",more:"अधिक",checklist:{nextSection:"अगला",previousSection:"पहले का"},checklistDismiss:{button:"चेकलिस्ट खारिज करें",title:"चेकलिस्ट खारिज करें?",yes:"हाँ, ख़ारिज करें",cancel:"रद्द करें"},menu:{title:"मेन्यू",restart:"प्रारंभ करें",close:"गाइड बंद करें",back:"गाइड पर लौटें"},question:{multiple_selection_hint:"{{range}} में से {{selected}} चयनित",multiple_selection_too_few:"कृपया कम से कम {{count}} विकल्प चुनें.",multiple_selection_too_few_plural:"कृपया कम से कम {{count}} विकल्प चुनें.",multiple_selection_too_many:"कृपया {{count}} से अधिक विकल्प न चुनें.",multiple_selection_too_many_plural:"कृपया {{count}} से अधिक विकल्प न चुनें.",multiple_selection_wrong:"कृपया ठीक {{count}} विकल्प चुनें.",multiple_selection_wrong_plural:"कृपया ठीक {{count}} विकल्प चुनें.",npsLabelLeft:"बिल्कुल असंभावित",npsLabelRight:"बहुत ज्यादा संभावना",other:"अन्य",placeholder:"अपना उत्तर यहां टाइप करें...",requiredError:"कृपया इस फ़ील्ड को भरें.",submit:"सब्मिट"},resource_center:{back:"पीछे",generic_error:"क्षमा करें, यह सामग्री इस समय लोड नहीं की जा सकी.",no_results_found:"कोई परिणाम नहीं मिला.",search_in:"यहाँ खोजें",search_placeholder:"खोज",suggested_articles:"सुझाए गए लेख",unread:"{{count}} अपठित",unread_plural:"{{count}} अपठित"},tooltipTargetMissing:{line1:"ऐसा लगता है कि आप उस पृष्ठ से दूर चले गए हैं जिससे वर्तमान गाइड संबंधित है.",line2:"शेष गाइड को जारी रखने के लिए, उस पृष्ठ पर वापस जाएं जिस पर आप पिछली बार थे, या वैकल्पिक रूप से, आप गाइड को पुनः आरंभ कर सकते हैं या इसे बंद कर सकते हैं."}};var m={and:"i",more:"Više",checklist:{nextSection:"Iduća",previousSection:"Prethodna"},checklistDismiss:{button:"Odbaci popis",title:"Odbaci popis?",yes:"Da, zatvori ",cancel:"Otkaži"},menu:{title:"Menu",restart:"Započni ispočetka",close:"Zatvori vodič",back:"Natrag na vodič"},question:{multiple_selection_hint:"{{selected}} od {{range}} opcije odabrane",multiple_selection_too_few:"Molimo odaberite najmanje {{count}} opciju.",multiple_selection_too_few_plural:"Molimo odaberite najmanje {{count}} opcije.",multiple_selection_too_many:"Molimo odaberite najviše {{count}} opciju.",multiple_selection_too_many_plural:"Molimo odaberite najviše {{count}} opcije.",multiple_selection_wrong:"Molimo izaberite točno {{count}} opciju.",multiple_selection_wrong_plural:"Molimo odaberite točno {{count}} opcije.",npsLabelLeft:"Uopće nije vjerojatno",npsLabelRight:"Vrlo vjerojatno",other:"Drugo",placeholder:"Upiši svoj odgovor ovdje...",requiredError:"Molimo popunite ovo polje.",submit:"Pošalji"},resource_center:{back:"Vrati se",generic_error:"Nažalost, ovaj se sadržaj trenutačno ne može učitati.",no_results_found:"Nema rezultata.",search_in:"Pretražiti u",search_placeholder:"Pretraga",suggested_articles:"Predloženi članci",unread:"{{count}} nepročitano",unread_plural:"{{count}} nepročitana"},tooltipTargetMissing:{line1:"Izgleda da ste otišli sa stranice vodiča.",line2:"Za nastavak vodiča, vratite se na prethodnu stranicu, ili vodič ponovno započnite, ili ga ugasite."}};var g={and:"és",more:"Több",checklist:{nextSection:"Következő",previousSection:"Előző"},checklistDismiss:{button:"zárja be az ellenőrzőlistát",title:"bezárja az ellenőrző listát??",yes:"Igen, közel",cancel:"Megse"},menu:{title:"Menü",restart:"Kezdje elölről",close:"Útmutató bezárása",back:"Vissza az útmutatóhoz"},question:{multiple_selection_hint:"{{selected}} a {{range}}-ból kiválasztva",multiple_selection_too_few:"Kérjük, válasszon legalább {{count}} opciót.",multiple_selection_too_few_plural:"Kérjük, válasszon legalább {{count}} opciót.",multiple_selection_too_many:"Kérjük, válasszon legfeljebb {{count}} lehetőséget.",multiple_selection_too_many_plural:"Kérjük, legfeljebb {{count}} lehetőséget válasszon.",multiple_selection_wrong:"Kérjük, pontosan {{count}} opciót válasszon.",multiple_selection_wrong_plural:"kérjük, válasszon ki pontosan {{count}} lehetőséget.",npsLabelLeft:"Nem valószínű",npsLabelRight:"Nagyon valószínű",other:"Egyéb",placeholder:"Írja be ide a választ...",requiredError:"Kérjük, töltse ki ezt a mezőt.",submit:"Beküldés"},resource_center:{back:"Vissza",generic_error:"Sajnálom, ezt a tartalmat jelenleg nem lehetett betölteni.",no_results_found:"Nincs találat.",search_in:"Keresés a",search_placeholder:"Keresés",suggested_articles:"Javasolt cikkek",unread:"{{count}} olvasatlan"},tooltipTargetMissing:{line1:"Úgy tűnik, elnavigáltál arról az oldalról, amelyhez az aktuális útmutató tartozik.",line2:"Az útmutató többi részének folytatásához lépjen vissza arra az oldalra, amelyen utoljára járt, vagy újraindíthatja vagy bezárhatja az útmutatót."}};var h={and:"dan",more:"Lebih",checklist:{nextSection:"Berikutnya",previousSection:"Sebelumnya"},checklistDismiss:{button:"Tutup daftar periksa",title:"Tutup daftar periksa?",yes:"Ya, tutup",cancel:"Batalkan"},menu:{title:"Menu",restart:"Mulai lagi",close:"Tutup panduan",back:"Kembali ke panduan"},question:{multiple_selection_hint:"{{selected} dari {{range}} dipilih",multiple_selection_too_few:"Harap pilih setidaknya {{count}} opsi.",multiple_selection_too_few_plural:"Pilih minimal {{count}} opsi.",multiple_selection_too_many:"Harap pilih tidak lebih dari {{count}} opsi.",multiple_selection_too_many_plural:"Harap pilih tidak lebih dari {{count}} opsi.",multiple_selection_wrong:"Pilih tepat {{count}} opsi.",multiple_selection_wrong_plural:"Silakan pilih tepat {{count}} opsi.",npsLabelLeft:"Tidak mungkin sama sekali",npsLabelRight:"Sangat mungkin",other:"Lain",placeholder:"Ketik jawabanmu di sini...",requiredError:"Silakan isi bidang ini.",submit:"Kirim"},resource_center:{back:"Kembali",generic_error:"Maaf, konten ini tidak dapat dimuat saat ini.",no_results_found:"Tidak ada hasil yang ditemukan.",search_in:"Cari di",search_placeholder:"Cari",suggested_articles:"Artikel yang disarankan",unread:"{{count}} belum dibaca"},tooltipTargetMissing:{line1:"Sepertinya Anda telah keluar dari halaman tempat panduan saat ini berada.",line2:"Untuk melanjutkan panduan lainnya, kembali ke halaman terakhir Anda berada, atau sebagai alternatif, Anda dapat memulai ulang panduan atau menutupnya."}};var k={and:"e",more:"Più",checklist:{nextSection:"Prossima",previousSection:"Precedente"},checklistDismiss:{button:"Chiudi la lista di controllo",title:"Vuoi chiudere la lista di controllo?",yes:"Sì, chiudi",cancel:"Annulla"},menu:{title:"Menu",restart:"Ricomincia da capo",close:"Chiudi la guida",back:"Indietro"},question:{multiple_selection_hint:"{{selected}} di {{range}} selezionati",multiple_selection_too_few:"Si prega di selezionare almeno {{count}} opzione.",multiple_selection_too_few_plural:"Si prega di selezionare almeno {{count}} opzioni.",multiple_selection_too_many:"Si prega di selezionare non più di {{count}} opzione.",multiple_selection_too_many_plural:"Si prega di selezionare non più di {{count}} opzioni.",multiple_selection_wrong:"Si prega di selezionare esattamente {{count}} opzione.",multiple_selection_wrong_plural:"Si prega di selezionare esattamente {{count}} opzioni.",npsLabelLeft:"Per niente probabile",npsLabelRight:"Estremamente probabile",other:"Altro",placeholder:"Scrivi qui la tua risposta...",requiredError:"Si prega di compilare questo campo.",submit:"Invia"},resource_center:{back:"Indietro",generic_error:"Spiacenti, questo contenuto non può essere caricato in questo momento.",no_results_found:"Nessun risultato trovato.",search_in:"Cerca nella",search_placeholder:"Cerca",suggested_articles:"Articoli suggeriti",unread:"{{count}} non letto"},tooltipTargetMissing:{line1:"Sembra che tu ti sia allontanato dalla pagina a cui appartiene il tour attuale.",line2:"Per continuare con il resto del tour, torna alla pagina dove ti trovavi. In alternativa puoi ricominciare da capo o chiudere il tour."}};var b={and:"と",more:"もっと",checklist:{nextSection:"次へ",previousSection:"戻る"},checklistDismiss:{button:"チェックリストを終了",title:"チェックリストを終了しますか?",yes:"終了",cancel:"キャンセル"},menu:{title:"メニュー",restart:"ガイドの始めに戻る",close:"ガイドを終了",back:"ガイドに戻る"},question:{multiple_selection_hint:"{{range}}のうち{{selected}}が選択されました",multiple_selection_too_few:"最低{{count}}つご選択ください。",multiple_selection_too_few_plural:"最低{{count}}つご選択ください。",multiple_selection_too_many:"{{count}}つ以内でご選択ください。",multiple_selection_too_many_plural:"{{count}}つ以内でご選択ください。",multiple_selection_wrong:"{{count}}つご選択ください。",multiple_selection_wrong_plural:"{{count}}つご選択ください。",npsLabelLeft:"非常に可能性が低い",npsLabelRight:"非常に可能性が高い",other:"その他",placeholder:"こちらにご入力ください...",requiredError:"こちらは必須入力項目です。",submit:"回答する"},resource_center:{back:"戻る",generic_error:"現在、このコンテンツを読み込めませんでした.",no_results_found:"結果が見つかりません。",search_in:"内検索",search_placeholder:"探す",suggested_articles:"おすすめの記事",unread:"{{count}} 未読"},tooltipTargetMissing:{line1:"現在のガイドが属するページから移動したようです。",line2:"ガイドの残りの部分を続行するには、最後に表示していたページに戻るか、ガイドを再起動するか閉じます。"}};var v={and:"그리고",more:"더 알아보기",checklist:{nextSection:"다음으로",previousSection:"이전으로"},checklistDismiss:{button:"체크리스트 무시하기",title:"체크리스트를 무시할까요?",yes:"네, 무시할게요.",cancel:"취소l"},menu:{title:"메뉴",restart:"다시 시작하기",close:"가이드를 닫을게요.",back:"가이드로 돌아갈게요."},question:{multiple_selection_hint:"{{range}} 개 중 {{selected}} 개 선택",multiple_selection_too_few:"옵션을 {{count}} 개 이상 선택하세요.",multiple_selection_too_few_plural:"옵션을 {{count}} 개 이상 선택하세요.",multiple_selection_too_many:"{{count}} 개 이하의 옵션을 선택하세요.",multiple_selection_too_many_plural:"{{count}} 개 이하의 옵션을 선택하세요.",multiple_selection_wrong:"옵션을 정확히 {{count}} 개 선택하세요.",multiple_selection_wrong_plural:"정확히 {{count}} 가지 옵션을 선택해주세요.",npsLabelLeft:"전혀 가능성이 없어요.",npsLabelRight:"가능성이 매우 높아요.",other:"그 외",placeholder:"여기에 답변을 적어주세요.",requiredError:"이 입력란을 채워주세요.",submit:"제출하기"},resource_center:{back:"뒤로가기",generic_error:"죄송해요. 내용을 표시할 수 없어요.",no_results_found:"검색 결과가 없어요.",search_in:"여기서 검색하세요.",search_placeholder:"검색하기",suggested_articles:"추천 기사",unread:"읽지 않은 항목 {{count}} 개",unread_plural:"읽지 않은 {{count}} 개"},tooltipTargetMissing:{line1:"가이드를 확인할 수 있는 페이지를 벗어났어요.",line2:" 가이드를 계속 확인하고 싶다면 이전 페이지로 돌아가세요. 아니면 처음부터 다시 시작할 수 있어요."}};var y={and:"og",more:"Mer",checklist:{nextSection:"Neste",previousSection:"Forrige"},checklistDismiss:{button:"Avslutt sjekkliste",title:"Avslutt sjekkliste?",yes:"Ja, avslutt",cancel:"Avbryt"},menu:{title:"Meny",restart:"Start på nytt",close:"Steng guiden",back:"Tilbake til guiden"},question:{multiple_selection_hint:"{{selected}} av {{range}} er valgt",multiple_selection_too_few:"Vennligst velg minst {{count}} alternativ.",multiple_selection_too_few_plural:"Vennligst velg minst {{count}} alternativer.",multiple_selection_too_many:"Vennligst velg ikke mer enn {{count}} alternativ.",multiple_selection_too_many_plural:"Vennligst velg ikke mer enn {{count}} alternativer.",multiple_selection_wrong:"Vennligst velg nøyaktig {{count}} alternativ.",multiple_selection_wrong_plural:"Vennligst velg nøyaktig {{count}} alternativer.",npsLabelLeft:"Ikke sannsynlig",npsLabelRight:"Svært sannsynlig",other:"Annet",placeholder:"Skriv inn svaret ditt her...",requiredError:"Dette feltet må fylles ut.",submit:"Send"},resource_center:{back:"Tilbake",generic_error:"Beklager, dette innholdet kunne ikke lastes nå.",no_results_found:"Ingen resultater.",search_in:"Søk i",search_placeholder:"Søk'",suggested_articles:"Foreslåtte artikler",unread:"{{count}} ulest",unread_plural:"{{count}} uleste"},tooltipTargetMissing:{line1:"Det ser ut til at du har forlatt siden denne guiden hører til.",line2:"For å fortsette med resten av guiden, gå tilbake til siden du besøkte sist. Alternativt kan du starte guiden på nytt eller stenge den."}};var f={and:"en",more:"Meer",checklistDismiss:{button:"Sluit checklist",title:"Checklist sluiten?",yes:"Ja, sluiten",cancel:"Annuleren"},menu:{title:"Menu",restart:"Opnieuw starten",close:"Rondleiding stoppen",back:"Terug"},question:{multiple_selection_hint:"{{selected}} van de {{range}} geselecteerd",multiple_selection_too_few:"Selecteer minste {{count}} optie.",multiple_selection_too_few_plural:"Selecteer minste {{count}} opties.",multiple_selection_too_many:"Selecteer niet meer dan {{count}} optie.",multiple_selection_too_many_plural:"Selecteer niet meer dan {{count}} opties.",multiple_selection_wrong:"Selecteer precies 1 optie {{count}} optie.",multiple_selection_wrong_plural:"Selecteer precies {{count}} opties.",npsLabelLeft:"Onwaarschijnlijk",npsLabelRight:"Zeer waarschijnlijk",other:"Ander",placeholder:"Typ hier je antwoord...",requiredError:"Gelieve dit veld in te vullen.",submit:"Indienen"},resource_center:{back:"Terug",generic_error:"Sorry, deze inhoud kan op dit moment niet worden geladen.",no_results_found:"Geen resultaten gevonden.",search_in:"Zoeken in",search_placeholder:"Zoek",suggested_articles:"Voorgestelde artikelen",unread:"{{count}} ongelezen"},tooltipTargetMissing:{line1:"Het lijkt erop dat u weg bent genavigeerd van de pagina waartoe de huidige rondleiding behoort.",line2:"Om verder te gaan met de rest van de rondleiding, gaat u terug naar de pagina waarop u zich het laatst bevond, of u kunt de rondleiding opnieuw starten of deze sluiten."}};var z={and:"i",more:"Więcej",checklist:{nextSection:"Dalej",previousSection:"Wróć"},checklistDismiss:{button:"Wyłącz listę zadań",title:"Wyłączyć listę zadań?",yes:"Tak, odrzuć",cancel:"Anulujl"},menu:{title:"Menu",restart:"Zacznij od nowa",close:"Zamknij przewodnik",back:"Powrót do przewodnika"},question:{multiple_selection_hint:"{{selected}} z {{range}} wybranych",multiple_selection_too_few:"Wybierz co najmniej {{count}} opcję.",multiple_selection_too_few_plural:"Wybierz co najmniej {{count}} opcje.",multiple_selection_too_many:"Wybierz nie więcej niż {{count}} opcję.",multiple_selection_too_many_plural:"Wybierz nie więcej niż {{count}} opcje.",multiple_selection_wrong:"Wybierz dokładnie {{count}} opcję.",multiple_selection_wrong_plural:"Wybierz dokładnie {{count}} opcje.",npsLabelLeft:"Wcale nie prawdopodobne",npsLabelRight:"Bardzo prawdopodobne",other:"Inny",placeholder:"Wpisz swoją odpowiedź tutaj...",requiredError:"Proszę wypełnić to pole.",submit:"Prześlij"},resource_center:{back:"Powrotu",generic_error:"Przepraszamy, w tej chwili nie można załadować tej treści.",no_results_found:"Nie znaleziono wyników.",search_in:"Szukaj w",search_placeholder:"Szukaj",suggested_articles:"Sugerowane artykuły",unread:"{{count}} nieprzeczytane"},tooltipTargetMissing:{line1:"Wygląda na to, że opuściłeś stronę, do której należy bieżąca lista zadań.",line2:"Aby kontynuować z pozostałą częścią przewodnika, wróć do ostatnio odwiedzanej strony, możesz ponownie uruchomić przewodnik lub go zamknąć."}};var w={and:"e",more:"Mais",checklist:{nextSection:"Próximo",previousSection:"Anterior"},checklistDismiss:{button:"Ignorar tarefas",title:"Ignorar tarefas?",yes:"Sim, fechar",cancel:"Cancelar"},menu:{title:"Menu",restart:"Começar novamente",close:"Fechar guia",back:"Voltar"},question:{multiple_selection_hint:"{{selected}} de {{range}} selecionados",multiple_selection_too_few:"Por favor, selecione pelo menos {{count}} opção.",multiple_selection_too_few_plural:"Por favor, selecione pelo menos {{count}} opções.",multiple_selection_too_many:"Por favor, selecione não mais de {{count}} opção.",multiple_selection_too_many_plural:"Por favor, selecione no máximo {{count}} opções.",multiple_selection_wrong:"Por favor, selecione exatamente {{count}} opção.",multiple_selection_wrong_plural:"Por favor, selecione exatamente {{count}} opções.",npsLabelLeft:"Pouco provável",npsLabelRight:"Extremamente provável",other:"Outros",placeholder:"Escreva sua resposta aqui...",requiredError:"Por favor, preencha esse campo.",submit:"Enviar"},resource_center:{back:"Voltar",generic_error:"Desculpe, este conteúdo não pode ser carregado neste momento.",no_results_found:"Nenhum resultado encontrado.",search_in:"Pesquisar na",search_placeholder:"Pesquisar",suggested_articles:"Artigos sugeridos",unread:"{{count}} não lido",unread_plural:"{{count}} não lidos"},tooltipTargetMissing:{line1:"Parece que você navegou para uma página que não pertence ao guia.",line2:"Para continuar com o restante do guia volte para a página anterior, ou como alternativa, você pode reiniciar o guia ou fechá-lo."}};var j={and:"si",more:"Mai mult",checklist:{nextSection:"Următorul",previousSection:"Anterior"},checklistDismiss:{button:"Închide lista de verificare",title:"Închide lista de verificare?",yes:"da, inchide",cancel:"Anula"},menu:{title:"Meniu",restart:"Ia de la capăt",close:"Închideți ghidul",back:"Reveniți la ghid"},question:{multiple_selection_hint:"{{selected}} din {{range}} selectat",multiple_selection_too_few:"vă rugăm să selectați cel puțin o opțiune",multiple_selection_too_few_plural:"Optionvă rugăm să selectați cel puțin {{count}} opțiuni.",multiple_selection_too_many:"Vă rugăm să nu selectați mai mult de {{count}} opțiune.",multiple_selection_too_many_plural:"Vă rugăm să selectați nu mai mult de {{count}} opțiuni.",multiple_selection_wrong:"Vă rugăm să selectați exact {{count}} opțiune.",multiple_selection_wrong_plural:"Vă rugăm să selectați exact {{count}} opțiuni.",npsLabelLeft:"Deloc probabil",npsLabelRight:"Extrem de probabil",other:"Alte",placeholder:"Introduceți răspunsul dvs. aici...",requiredError:"Vă rugăm să completați acest câmp.",submit:"Trimite"},resource_center:{back:"Înapoi",generic_error:"Ne pare rău, acest conținut nu a putut fi încărcat în acest moment.",no_results_found:"Nici un rezultat gasit.",search_in:"Caută în",search_placeholder:"Căutare",suggested_articles:"Articole sugerate",unread:"{{count}} necitit",unread_plural:"{{count}} necitite"},tooltipTargetMissing:{line1:"Se pare că ați navigat departe de pagina căreia îi aparține ghidul actual.",line2:"Pentru a continua cu restul ghidului, reveniți la pagina pe care ați fost ultima dată sau, alternativ, puteți reporni ghidul sau îl puteți închide."}};var S={and:"и",more:"Больше",checklist:{nextSection:"Дальше",previousSection:"Назад"},checklistDismiss:{button:"Скрыть список задач",title:"Вы уверены, что хотите скрыть список?",yes:"Скрыть список",cancel:"Отмена"},menu:{title:"Меню",restart:"Начать заново",close:"Закрыть обучение",back:"Назад"},question:{multiple_selection_hint:"{{selected}} из {{range}} выбранных",multiple_selection_too_few:"Пожалуйста, выберите хотя бы {{count}} вариант.",multiple_selection_too_few_plural:"Пожалуйста, выберите как минимум {{count}} варианта.",multiple_selection_too_many:"Пожалуйста, выберите не более {{count}} варианта.",multiple_selection_too_many_plural:"Пожалуйста, выберите не более {{count}} вариантов.",multiple_selection_wrong:"Пожалуйста, выберите ровно {{count}} вариант.",multiple_selection_wrong_plural:"Пожалуйста, выберите ровно {{count}} варианта.",npsLabelLeft:"Маловероятно",npsLabelRight:"Очень вероятно",other:"Другой",placeholder:"Напишите здесь ваш ответ…",requiredError:"Пожалуйста, заполните это поле.",submit:"Отправить"},resource_center:{back:"Назад",generic_error:"Извините, этот контент не может быть загружен в данный момент.",no_results_found:"Результаты не найдены.",search_in:"Поиск в",search_placeholder:"Поиск",suggested_articles:"Предлагаемые статьи",unread:"{{count}} непрочитанный",unread_plural:"{{count}} непрочитанных"},tooltipTargetMissing:{line1:"Похоже, вы ушли со страницы, на которой должно проходить обучение.",line2:"Чтобы продолжить обучение, вернитесь на страницу, на которой вы были в последний раз, или перезапустите / закройте обучение."}};var L={and:"a",more:"Viac",checklist:{nextSection:"Ďalej",previousSection:"Späť"},checklistDismiss:{button:"Skryť zoznam",title:"Skryť zoznam?",yes:"Áno, zrušiť",cancel:"Zrušiť"},menu:{title:"Menu",restart:"Začať od znova",close:"Zavrieť sprievodcu",back:"Späť na sprievodcu"},question:{multiple_selection_hint:"{{selected}} z {{range}} vybratých",multiple_selection_too_few:"Prosím, vyberte aspoň {{count}} možnosť.",multiple_selection_too_few_plural:"Prosím, vyberte aspoň {{count}} možnosti.",multiple_selection_too_many:"Prosím, nevyberajte viac ako {{count}} možnosť.",multiple_selection_too_many_plural:"Prosím, nevyberajte viac ako {{count}} možnosti.",multiple_selection_wrong:"Prosím, vyberte presne {{count}} možnosť.",multiple_selection_wrong_plural:"Prosím, vyberte presne {{count}} možnosti.",npsLabelLeft:"Určite nie",npsLabelRight:"Určite áno",other:"Iné",placeholder:"Sem napíšte svoju odpoveď...",requiredError:"Toto pole je povnné.",submit:"Potvrdiť"},resource_center:{back:"Spätný",generic_error:"Ľutujeme, tento obsah sa momentálne nepodarilo načítať.",no_results_found:"Neboli nájdené žiadne výsledky.",search_in:"Hľadať v",search_placeholder:"Hľadať",suggested_articles:"Odporúčané články",unread:"{{count}} neprečítané"},tooltipTargetMissing:{line1:"Zdá sa, že ste opustili stránku ku ktorej prislúcha aktuálny sprievodca.",line2:"Na dokončenie sprievodcu, vrátte sa o jednu stránku späť, poprípade sprievodcu môžete aj reštartovať alebo zavrieť."}};var q={and:"in",more:"Več",checklist:{nextSection:"Naprej",previousSection:"Nazaj"},checklistDismiss:{button:"Zapri seznam",title:"Želite skriti seznam?",yes:"Ja, skrij",cancel:"Prekliči"},menu:{title:"Meni",restart:"Začni znova",close:"Zapri vodič",back:"Nazaj k vodiču"},question:{multiple_selection_hint:"{{selected}} od {{range}} izbranih",multiple_selection_too_few:"Prosimo, izberite vsaj {{count}} možnost.",multiple_selection_too_few_plural:"Prosimo, izberite vsaj {{count}} možnosti",multiple_selection_too_many:"Prosimo, izberite največ {{count}} možnost.",multiple_selection_too_many_plural:"Prosimo, da izberete največ {{count}} možnosti.",multiple_selection_wrong:"Prosimo izberite točno {{count}} možnost.",multiple_selection_wrong_plural:"Prosimo izberite točno {{count}} možnosti.",npsLabelLeft:"Sploh ni verjetno",npsLabelRight:"Zelo verjetno",other:"Drugo",placeholder:"Vpišite svoj odgovor spodaj...",requiredError:"Prosimo, da izpolnite to polje.",submit:"Pošlji"},resource_center:{back:"Nazaj",generic_error:"Te vsebine trenutno ni bilo mogoče naložiti.",no_results_found:"Ni zadetkov.",search_in:"Išči v",search_placeholder:"Iskanje",suggested_articles:"Predlagani članki",unread:"{{count}} neprebrano",unread_plural:"{{count}} neprebrana"},tooltipTargetMissing:{line1:"Zdi se, da ste odšli s strani, ki ji pripada trenutni vodič.",line2:"Da bi nadaljevali z preostankom vodenja, se lahko vrnete na stran, na kateri ste nazadnje bili, ponovno pričnete z vodičem ali ga zaprete."}};var P={and:"och",more:"Mer",checklist:{nextSection:"Nästa",previousSection:"Föregående"},checklistDismiss:{button:"Ta bort checklistan",title:"Vill du ta bort checklistan?",yes:"Ja, ta bort den",cancel:"Avbryt"},menu:{title:"Meny",restart:"Börja om",close:"Stäng guiden",back:"Gå tillbaka till guiden"},question:{multiple_selection_hint:"{{selected}} av {{range}} valda",multiple_selection_too_few:"Vänligen välj minst {{count}} alternativ.",multiple_selection_too_few_plural:"Vänligen välj minst {{count}} alternativ.",multiple_selection_too_many:"Vänligen välj högst {{count}} alternativ.",multiple_selection_too_many_plural:"Vänligen välj högst {{count}} alternativ.",multiple_selection_wrong:"Vänligen välj exakt {{count}} alternativ.",multiple_selection_wrong_plural:"Vänligen välj exakt {{count}} alternativ.",npsLabelLeft:"Inte alls troligt",npsLabelRight:"Extremt troligt",other:"Övrig",placeholder:"Skriv ditt svar här...",requiredError:"Vänligen fyll i detta fält.",submit:"Skicka"},resource_center:{back:"Tillbaka",generic_error:"Tyvärr, det här innehållet kunde inte laddas för närvarande.",no_results_found:"Inga resultat funna.",search_in:"Sök i",search_placeholder:"Sök",suggested_articles:"Föreslagna artiklar",unread:"{{count}} oläst",unread_plural:"{{count}} olästa"},tooltipTargetMissing:{line1:"Det verkar som om du navigerat bort från den sida som den här guiden hör till.",line2:"För att fortsätta med resten av guiden, gå tillbaka till sidan du var på sist, alternativt starta om den här guiden, eller stäng den."}};var M={checklist:{nextSection:"ถัดไป",previousSection:"ก่อนหน้า"},checklistDismiss:{button:"ยกเลิกรายการตรวจสอบ",title:"ต้องการยกเลิกรายการตรวจสอบใช่หรือไม่",yes:"ใช่โปรดยกเลิก",cancel:"ยกเลิก"},menu:{title:"รายการ",restart:"เริ่มต้นใหม่",close:"ปิดคำแนะนำ",back:"กลับไปที่คำแนะนำ"},question:{multiple_selection_hint:"ที่เลือกไว้ {{selected}} ใน {{range}} รายการ",multiple_selection_too_few:"โปรดเลือกอย่างน้อย {{count}} ตัวเลือก",multiple_selection_too_few_plural:"โปรดเลือกอย่างน้อย {{count}} ตัวเลือก",multiple_selection_too_many:"โปรดเลือกไม่เกิน {{count}} ตัวเลือก",multiple_selection_too_many_plural:"โปรดเลือกไม่เกิน {{count}} ตัวเลือก",multiple_selection_wrong:"โปรดเลือก {{count}} ตัวเลือกเท่านั้น",multiple_selection_wrong_plural:"กรุณาเลือกให้ตรง {{count}} ตัวเลือก",npsLabelLeft:"ไม่ทั้งหมด",npsLabelRight:"มีความเป็นไปได้",other:"อื่นๆ",placeholder:"ใส่คำตอบของคุณที่นี่",requiredError:"กรุณากรอกข้อมูลในช่องนี้",submit:"ส่ง"},resource_center:{back:"กลับ",generic_error:"ขออภัย ไม่สามารถโหลดเนื้อหานี้ได้ในขณะนี้",no_results_found:"ไม่พบผลลัพธ์.",search_in:"ค้นหาใน",search_placeholder:"ค้นหา",suggested_articles:"บทความแนะนำ",unread:"{{count}} ยังไม่ได้อ่าน"},tooltipTargetMissing:{line1:"ดูเหมือนว่าคุณได้ออกจากหน้าเว็บที่เป็นของคู่มือปัจจุบันแล้ว",line2:"หากต้องการดำเนินการต่อกับคำแนะนำที่เหลือให้กลับไปที่หน้าที่คุณใช้ล่าสุดหรืออีกวิธีหนึ่งคุณสามารถเริ่มคำแนะนำใหม่ได้เลย"}};var V={and:"ve",more:"Daha Fazla",checklist:{nextSection:"Sonraki",previousSection:"Önceki"},checklistDismiss:{button:"Listeyi sonlandır",title:"Listeyi sonlandır?",yes:"Evet, sonlandır.",cancel:"İptal"},menu:{title:"Menü",restart:"Baştan Başlat",close:"Klavuzu kapat",back:"Klavuza geri dön"},question:{multiple_selection_hint:" {{selected}} / {{range}} seçildi",multiple_selection_too_few:"Lütfen en az {{count}} seçenek seçin.",multiple_selection_too_few_plural:"Lütfen en az {{count}} seçenek seçin.",multiple_selection_too_many:"Lütfen en fazla {{count}} seçenek seçin.",multiple_selection_too_many_plural:"Lütfen en fazla {{count}} seçenek belirleyin.",multiple_selection_wrong:"Lütfen tam olarak {{count}} seçeneği seçin.",multiple_selection_wrong_plural:"Lütfen tam olarak {{count}} seçeneği seçin.",npsLabelLeft:"Düşük ihtimalle",npsLabelRight:"Yüksek ihtimalle",other:"Diğer",placeholder:"Cevabınızı buraya yazınız...",requiredError:"Lütfen bu alanı doldurun.",submit:"Gönder"},resource_center:{back:"Geri",generic_error:"Üzgünüz, bu içerik şu anda bu içerik yüklenememektedir.",no_results_found:"Sonuç bulunamadı.",search_in:"Burada ara",search_placeholder:"Arama",suggested_articles:"Tavsiye edilen makaleler.",unread:"{{count}} okunmamış"},tooltipTargetMissing:{line1:"Mevcut klavuza ait olan sayfa dışına çıkmışsınız gibi görünüyor.",line2:"Klavuzla devam etmek için, en son bulunduğunuz sayfaya geri gidin, ayrıca klavuzu baştan başlatabilir veya kapatabilirsiniz."}};var T={and:"і",more:"Більше",checklist:{nextSection:"Наступний",previousSection:"Попередній"},checklistDismiss:{button:"Закрити перелік",title:"Закрити перелік?",yes:"Так, закрити",cancel:"Скасувати"},menu:{title:"Меню",restart:"Почати знову",close:"Закрити гайд",back:"Повернутися до гайду"},question:{multiple_selection_hint:"{{selected}} з {{range}} вибрано",multiple_selection_too_few:"Будь ласка, виберіть щонайменше {{count}} варіант.",multiple_selection_too_few_plural:"Будь ласка, виберіть щонайменше {{count}} варіанти.",multiple_selection_too_many:"Будь ласка, оберіть не більше {{count}} варіанти.",multiple_selection_too_many_plural:"Будь ласка, оберіть не більше {{count}} варіанти.",multiple_selection_wrong:"Будь ласка, оберіть рівно {{count}} варіант.",multiple_selection_wrong_plural:"Будь ласка, оберіть рівно {{count}} варіанти.",npsLabelLeft:"Зовсім не ймовірно",npsLabelRight:"Дуже ймовірно",other:"Інше",placeholder:"Введіть свою відповідь тут...",requiredError:"Будь ласка, заповніть це поле.",submit:"Надіслати"},resource_center:{back:"Назад",generic_error:"Вибачте, цей контент не може бути завантажений наразі.",no_results_found:"Результати не знайдено.",search_in:"Шукати у",search_placeholder:"Пошук",suggested_articles:"Рекомендовані статті",unread:"{{count}} непрочитаний",unread_plural:"{{count}} непрочитані"},tooltipTargetMissing:{line1:"Схоже, ви перейшли зі сторінки, на якій знаходиться поточний гайд.",line2:"Щоб продовжити з іншими частинами гайду, поверніться на сторінку, на якій ви були останнім часом, або, як варіант, ви можете розпочати гайд знову або закрити його."}};var x={checklist:{nextSection:"Kế tiếp",previousSection:"Trước"},checklistDismiss:{button:"Loại bỏ danh sách kiểm tra",title:"Loại bỏ danh sách kiểm tra",yes:"Đúng, loại bỏ",cancel:"Hủy"},menu:{title:"Công cụ",restart:"Bắt đầu lại",close:"Đóng hướng dẫn",back:"Quay trở lại hướng dẫn"},question:{multiple_selection_hint:"{{selected}} trong {{range}} được chọn",multiple_selection_too_few:"Vui lòng chọn ít nhất {{count}} tùy chọn.",multiple_selection_too_few_plural:"Vui lòng chọn ít nhất {{count}} tùy chọn.",multiple_selection_too_many:"Vui lòng chọn không quá {{count}} tùy chọn.",multiple_selection_too_many_plural:"Vui lòng chọn không quá {{count}} tùy chọn.",multiple_selection_wrong:"Vui lòng chọn chính xác {{count}} tùy chọn.",multiple_selection_wrong_plural:"Vui lòng chọn chính xác {{count}} tùy chọn.",npsLabelLeft:"Không thể xảy ra",npsLabelRight:"Rất có thể xảy ra",other:"Khác",placeholder:"Nhập câu hỏi bạn ở đây",requiredError:"Vui lòng điển vào trường này",submit:"Gửi đi"},resource_center:{back:"Trở lại",generic_error:"Rất tiếc, nội dung này không thể tải vào lúc này.",no_results_found:"Không có kết quả nào được tìm thấy.",search_in:"Tìm kiếm ở",search_placeholder:"Tìm kiếm",suggested_articles:"Bài viết được đề xuất",unread:"{{count}} chưa đọc"},tooltipTargetMissing:{line1:"Có vẻ bạn dời khỏi trang hướng dẫn hiện tại",line2:"Để tiếp tục với phần còn lại của hướng dẫn, quay trở lại trang mà bạn đã truy cập lần cuối, hoặc cách khác, bạn có thể khởi động lại hướng dẫn hay đóng lại"}};var E={and:"和",more:"更多",checklist:{nextSection:"下一步",previousSection:"上一步"},checklistDismiss:{button:"关闭检查表",title:"关闭检查表?",yes:"是的,关闭",cancel:"取消"},menu:{title:"菜单",restart:"重新开始",close:"关闭指南",back:"返回指南"},question:{multiple_selection_hint:"{{range}} 选 {{selected}} 选 ",multiple_selection_too_few:"请至少选择 {{count}} 个选项。",multiple_selection_too_few_plural:"请至少选择 {{count}} 个选项。",multiple_selection_too_many:"请选择不超过 {{count}} 个选项。",multiple_selection_too_many_plural:"请选择不超过 {{count}} 个选项。",multiple_selection_wrong:"请准确选择 {{count}} 个选项。",multiple_selection_wrong_plural:"请准确选择 {{count}} 个选项。",npsLabelLeft:"绝无可能",npsLabelRight:"极有可能",other:"其他",placeholder:"在此处输入您的答案…",requiredError:"请填写此字段.",submit:"提交"},resource_center:{back:"后退",generic_error:"抱歉,此内容目前无法加载.",no_results_found:"未找到结果",search_in:"搜索范围",search_placeholder:"搜索",suggested_articles:"推荐文章",unread:"{{count}} 条未读",unread_plural:"{{count}} н未读"},tooltipTargetMissing:{line1:"您似乎已离开当前指南所属的页面。",line2:"若要继续阅读本指南的其余部分,请返回您最后浏览的页面,您也可以重启或关闭指南。"}};var D={checklist:{nextSection:"下一步",previousSection:"上一步"},checklistDismiss:{button:"永久關閉選單",title:"永久關閉選單?",yes:"是的,永久關閉",cancel:"保留選單"},menu:{title:"選項",restart:"重新導覽",close:"關閉導覽",back:"繼續導覽"},question:{multiple_selection_hint:"{{range}} 選 {{selected}} 選",multiple_selection_too_few:"請至少選擇 {{count}} 個選項。",multiple_selection_too_few_plural:"請至少選擇 {{count}} 個選項。",multiple_selection_too_many:"請選擇不超過 {{count}} 個選項。",multiple_selection_too_many_plural:"請選擇不超過 {{count}} 個選項。",multiple_selection_wrong:"請準確選擇 {{count}} 個選項。",multiple_selection_wrong_plural:"請準確選擇 {{count}} 個選項。",npsLabelLeft:"根本不可能",npsLabelRight:"極有可能",other:"其他",placeholder:"在此處輸入您的答案",requiredError:"請填寫此字段。",submit:"提交"},resource_center:{back:"回",generic_error:"抱歉,此時無法加載此內容。",no_results_found:"未找到結果。",search_in:"在里面搜索",search_placeholder:"搜索",suggested_articles:"推薦文章",unread:"{{count}} 条未读",unread_plural:"{{count}} н未读"},tooltipTargetMissing:{line1:"看起來你已經離開導覽了唷!",line2:"如果想要繼續導覽,請回到上一頁。你也可以選擇重新導覽,或是關閉導覽。"}};const R=function(){const n=e.createInstance();return n.use(t).init({resources:{ar:{translation:i},cs:{translation:l},da:{translation:o},de:{translation:a},el:{translation:r},en:{translation:s},es:{translation:c},fi:{translation:u},fr:{translation:_},he:{translation:p},hi:{translation:d},hr:{translation:m},hu:{translation:g},id:{translation:h},it:{translation:k},ja:{translation:b},ko:{translation:v},nb:{translation:y},nl:{translation:f},pl:{translation:z},pt:{translation:w},ro:{translation:j},ru:{translation:S},sk:{translation:L},sl:{translation:q},sv:{translation:P},th:{translation:M},tr:{translation:V},uk:{translation:T},vi:{translation:x},"zh-CN":{translation:E},"zh-TW":{translation:D}},lng:"en",fallbackLng:"en",interpolation:{escapeValue:!1}}),n}(),A=n.createContext(null);function N(){return n.useContext(A)}function I(){return n.useContext(A)}export{A as U,N as a,R as i,I as u};
|
package/hash.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
73af196317e28bea45e55645017054f7110df996
|
package/package.json
CHANGED
package/userflow.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{S as e}from"./vendor.phoenix.js";import{v as t}from"./vendor.uuid.js";let s;const i={},n=function(e,t){if(!t)return e();if(void 0===s){const e=document.createElement("link").relList;s=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(t.map((e=>{if(e in i)return;i[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":s,t||(o.as="script",o.crossOrigin=""),o.href=e,document.head.appendChild(o),t?new Promise(((e,t)=>{o.addEventListener("load",e),o.addEventListener("error",t)})):void 0}))).then((()=>e()))};class o extends Error{constructor(e,t,s){super(e),Object.setPrototypeOf(this,o.prototype),this.name="UserflowError",this.code=t,this.humanMessage=s}}class r{constructor(e){this.type=e,this.testState={}}formatKey(e){return`userflow:${e}`}isSupported(){if("undefined"==typeof window)return!1;try{return null!=window[this.type]}catch{return!1}}getItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].getItem(e):null}setItem(e,t){e=this.formatKey(e),this.isSupported()&&window[this.type].setItem(e,t)}removeItem(e){if(e=this.formatKey(e),this.isSupported())return window[this.type].removeItem(e)}clear(){if(this.isSupported())return window[this.type].clear()}}const a=new r("localStorage"),c=new r("sessionStorage");function l(e){window.location.href=e}function d(){return window.location.href}var h,u,E;function T(e){window.postMessage(e,window.origin)}function S(e){const t=t=>{if(t.source!==window||t.origin!==window.origin)return;const i=t.data;i&&"object"==typeof i&&"string"==typeof i.kind&&i.kind.startsWith("userflow:")&&!0===e(i)&&s()};window.addEventListener("message",t);const s=()=>window.removeEventListener("message",t);return s}(h||(h={})).INPUT="INPUT",(E=u||(u={})).AUTO="AUTO",E.MANUAL="MANUAL";const f=new Set;let w=!1;function p(e){return function(){if(w)return;w=!0;const{history:e}=window,t=t=>{const s=e[t];e[t]=(...t)=>{s.apply(e,t),I()}};t("pushState"),t("replaceState"),window.addEventListener("popstate",(()=>{I()}))}(),f.add(e),()=>{g(e)}}function g(e){f.delete(e)}function I(){f.forEach((e=>e()))}class C{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(e){T({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})}onBuilderMessage(e){return this.unregisterOnMessage=S(e),!1}async captureScreenshot(e,t,s,i){T({kind:"userflow:crxScreenshot",x:e,y:t,width:s,height:i,devicePixelRatio:window.devicePixelRatio});var n;return(await(n=e=>"userflow:crxScreenshotResult"===e.kind?e:null,new Promise((e=>{S((t=>{const s=n(t);return!!s&&(e(s),!0)}))})))).imageDataUrl}}var m,k,A,U,L,R,N,v,O,y,_,b,D,M,F,B,P,x,H,G,W,$,V,K,j,z,Y,J,X,Z,Q,q,ee,te,se,ie,ne,oe,re,ae,ce,le,de,he,ue,Ee,Te,Se,fe,we,pe,ge,Ie,Ce,me,ke,Ae,Ue,Le,Re,Ne,ve,Oe,ye,_e,be,De,Me,Fe,Be,Pe,xe,He,Ge,We,$e,Ve,Ke,je,ze,Ye,Je,Xe,Ze;(k=m||(m={})).ACTION="ACTION",k.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",k.REPLACED="REPLACED",k.SNOOZED="SNOOZED",k.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",k.USERFLOWJS="USERFLOWJS",k.USER_CLOSED="USER_CLOSED",(U=A||(A={})).SECOND="SECOND",U.MINUTE="MINUTE",U.HOUR="HOUR",U.DAY="DAY",(R=L||(L={})).ACTION="ACTION",R.DRAFT="DRAFT",R.LINK="LINK",R.LAUNCHER_SEEN="LAUNCHER_SEEN",R.RESOURCE_CENTER="RESOURCE_CENTER",R.USERFLOWJS="USERFLOWJS",(v=N||(N={})).LIKE="LIKE",v.DISLIKE="DISLIKE",(y=O||(O={})).STRING="STRING",y.BOOLEAN="BOOLEAN",y.NUMBER="NUMBER",y.DATETIME="DATETIME",y.LIST="LIST",y.RANDOM_AB="RANDOM_AB",y.RANDOM_NUMBER="RANDOM_NUMBER",(b=_||(_={})).FLOW="FLOW",b.BANNER="BANNER",b.CHECKLIST="CHECKLIST",b.LAUNCHER="LAUNCHER",b.RESOURCE_CENTER="RESOURCE_CENTER",(M=D||(D={})).ALWAYS_TRUE="ALWAYS_TRUE",M.ATTRIBUTE="ATTRIBUTE",M.CLAUSE="CLAUSE",M.ELEMENT="ELEMENT",M.FILLED_IN_INPUT="FILLED_IN_INPUT",M.FLOW="FLOW",M.INPUT_VALUE="INPUT_VALUE",M.PAGE="PAGE",M.SEGMENT="SEGMENT",M.TIME="TIME",function(e){e.AUTO="AUTO",e.MANUAL="MANUAL"}(F||(F={})),(B||(B={})).INPUT="INPUT",(x=P||(P={})).ABSOLUTE_EQ="ABSOLUTE_EQ",x.ABSOLUTE_GT="ABSOLUTE_GT",x.ABSOLUTE_LT="ABSOLUTE_LT",x.AND="AND",x.BETWEEN="BETWEEN",x.CONTAINS="CONTAINS",x.EMPTY="EMPTY",x.ENDS_WITH="ENDS_WITH",x.EQ="EQ",x.EXCLUDES_ALL="EXCLUDES_ALL",x.EXCLUDES_ANY="EXCLUDES_ANY",x.FALSE="FALSE",x.GT="GT",x.GTE="GTE",x.INCLUDES_ALL="INCLUDES_ALL",x.INCLUDES_ANY="INCLUDES_ANY",x.LT="LT",x.LTE="LTE",x.NE="NE",x.NOT_CONTAINS="NOT_CONTAINS",x.NOT_EMPTY="NOT_EMPTY",x.NOT_REGEX="NOT_REGEX",x.OR="OR",x.REGEX="REGEX",x.RELATIVE_EQ="RELATIVE_EQ",x.RELATIVE_GT="RELATIVE_GT",x.RELATIVE_LT="RELATIVE_LT",x.STARTS_WITH="STARTS_WITH",x.TRUE="TRUE",x.URL="URL",(G=H||(H={})).CLICK="CLICK",G.DISABLED="DISABLED",G.MOUSEDOWN="MOUSEDOWN",G.NOT_CLICK="NOT_CLICK",G.NOT_DISABLED="NOT_DISABLED",G.NOT_PRESENT="NOT_PRESENT",G.PRESENT="PRESENT",($=W||(W={})).ASSET="ASSET",$.CARTOON="CARTOON",$.NONE="NONE",$.URL="URL",(K=V||(V={})).INSIDE="INSIDE",K.OUTSIDE="OUTSIDE",(z=j||(j={})).TOP_LEFT="TOP_LEFT",z.TOP_CENTER="TOP_CENTER",z.TOP_RIGHT="TOP_RIGHT",z.BOTTOM_RIGHT="BOTTOM_RIGHT",z.BOTTOM_CENTER="BOTTOM_CENTER",z.BOTTOM_LEFT="BOTTOM_LEFT",z.CENTER="CENTER",(J=Y||(Y={})).GOOGLE="GOOGLE",J.STANDARD="STANDARD",(Z=X||(X={})).DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",Z.DISMISS="DISMISS",(q=Q||(Q={})).DISMISS="DISMISS",q.NONE="NONE",(te=ee||(ee={})).DEFAULT="DEFAULT",te.PLAINTEXT="PLAINTEXT",(ie=se||(se={})).CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",ie.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",ie.NONE="NONE",(oe=ne||(ne={})).BUBBLE="BUBBLE",oe.END="END",oe.ERROR="ERROR",oe.FLAG="FLAG",(ae=re||(re={})).MANUAL="MANUAL",ae.NONE="NONE",ae.SYNTHETIC="SYNTHETIC",(le=ce||(ce={})).BUBBLE="BUBBLE",le.HIDDEN="HIDDEN",le.MODAL="MODAL",le.TOOLTIP="TOOLTIP",(he=de||(de={})).ABOVE="ABOVE",he.BELOW="BELOW",he.LEFT="LEFT",he.RIGHT="RIGHT",(Ee=ue||(ue={})).CLOSE_FLOW="CLOSE_FLOW",Ee.EVAL_JS="EVAL_JS",Ee.GO_TO_STEP="GO_TO_STEP",Ee.NAVIGATE="NAVIGATE",Ee.SET_ATTRIBUTE="SET_ATTRIBUTE",Ee.SNOOZE="SNOOZE",Ee.START_FLOW="START_FLOW",(Se=Te||(Te={})).NEW_TAB="NEW_TAB",Se.SAME_TAB="SAME_TAB",(we=fe||(fe={})).SET="SET",we.SET_DATETIME="SET_DATETIME",we.SET_DATETIME_ONCE="SET_DATETIME_ONCE",we.SET_ONCE="SET_ONCE",we.ADD="ADD",we.SUBTRACT="SUBTRACT",we.APPEND="APPEND",we.PREPEND="PREPEND",we.REMOVE="REMOVE",we.UNSET="UNSET",(ge=pe||(pe={})).MULTILINE_TEXT="MULTILINE_TEXT",ge.MULTIPLE_CHOICE="MULTIPLE_CHOICE",ge.NPS="NPS",ge.SCALE="SCALE",ge.STARS="STARS",ge.TEXT="TEXT",(Ce=Ie||(Ie={})).ACTION="ACTION",Ce.ANNOUNCEMENTS="ANNOUNCEMENTS",Ce.ASSISTANT="ASSISTANT",Ce.CHECKLIST="CHECKLIST",Ce.CONTACT="CONTACT",Ce.DIVIDER="DIVIDER",Ce.FLOWS="FLOWS",Ce.KNOWLEDGE_BASE="KNOWLEDGE_BASE",Ce.MESSAGE="MESSAGE",Ce.SUBPAGE="SUBPAGE",(ke=me||(me={})).CRISP="CRISP",ke.CUSTOM="CUSTOM",ke.FRESHCHAT="FRESHCHAT",ke.HELPSCOUT="HELPSCOUT",ke.HUBSPOT="HUBSPOT",ke.INTERCOM="INTERCOM",ke.ZENDESK="ZENDESK",ke.ZENDESK_MESSENGER="ZENDESK_MESSENGER",(Ue=Ae||(Ae={})).BUTTON="BUTTON",Ue.INPUT="INPUT",(Re=Le||(Le={})).SILENT="SILENT",Re.BADGE="BADGE",Re.POPOUT="POPOUT",(ve=Ne||(Ne={})).LAUNCHER_CLICK="LAUNCHER_CLICK",ve.LAUNCHER_HOVER="LAUNCHER_HOVER",ve.TARGET_CLICK="TARGET_CLICK",ve.TARGET_HOVER="TARGET_HOVER",ve.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",ve.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",(ye=Oe||(Oe={})).ACTIVATE="ACTIVATE",ye.DEACTIVATE="DEACTIVATE",ye.NEVER="NEVER",(be=_e||(_e={})).AUTO="AUTO",be.TOP="TOP",be.RIGHT="RIGHT",be.BOTTOM="BOTTOM",be.LEFT="LEFT",(Me=De||(De={})).START="START",Me.CENTER="CENTER",Me.END="END",(Be=Fe||(Fe={})).PERCENT="PERCENT",Be.PX="PX",(xe=Pe||(Pe={})).BEACON="BEACON",xe.BUTTON="BUTTON",xe.HIDDEN="HIDDEN",xe.ICON="ICON",(Ge=He||(He={})).LAUNCHER="LAUNCHER",Ge.TARGET="TARGET",($e=We||(We={})).BODY_FIRST="BODY_FIRST",$e.BODY_LAST="BODY_LAST",$e.ELEMENT_FIRST="ELEMENT_FIRST",$e.ELEMENT_LAST="ELEMENT_LAST",$e.ELEMENT_BEFORE="ELEMENT_BEFORE",$e.ELEMENT_AFTER="ELEMENT_AFTER",(Ke=Ve||(Ve={})).START="START",Ke.CENTER="CENTER",Ke.SPACE_BETWEEN="SPACE_BETWEEN",(ze=je||(je={})).NONE="NONE",ze.LIKE="LIKE",ze.SCALE="SCALE",(Je=Ye||(Ye={})).ACTIVE="ACTIVE",Je.COMPLETED="COMPLETED",Je.ENDED="ENDED",Je.NOT_SEEN="NOT_SEEN",(Ze=Xe||(Xe={})).HIGHLIGHT="HIGHLIGHT",Ze.MODAL="MODAL",Ze.HIGHLIGHT_MODAL="HIGHLIGHT_MODAL";const Qe={customInputs:[],customNavigate:null,urlFilter:null,customScrollIntoView:null,scrollPadding:null,inferenceAttributeNames:["data-for","data-id","data-testid","data-test-id","for","id","name","placeholder","role"],inferenceAttributeFilters:{id:[e=>!e.match(/\d$/)],"data-id":[e=>!e.match(/\d$/)]},inferenceClassNameFilters:[e=>!e.startsWith("css-")],baseZIndex:1234500,evalJsDisabled:!1};function qe(e){return Array.isArray(e)||(e=e?[e]:[]),e=e.map((e=>"string"==typeof e?new RegExp(e):e))}function et(e,t){return e.every((e=>"function"==typeof e?e(t):!(e instanceof RegExp)||e.test(t)))}function tt(){let e=d();if(Qe.urlFilter){if(e=Qe.urlFilter(e),"string"!=typeof e)throw new o("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(e)}catch(t){throw new o("Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.\nReturned URL: "+e+"\nError message: "+t.message)}}return e}let st="";try{st=localStorage.getItem("debug")||""}catch(Tt){}const it=st.split(",").some((e=>"*"===e||e.startsWith("userflow:*"))),nt=rt("log");let ot;function rt(e){return function(t,...s){if(it){const i=performance.now(),n=ot?Math.round(i-ot):0;ot=i,console[e](`%cuserflow %c${t} %c+${n}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}nt.group=rt("group"),nt.groupCollapsed=rt("groupCollapsed"),nt.groupEnd=function(){it&&console.groupEnd()};const at=()=>n((()=>import("./ResourceCenterApp.js").then((function(e){return e.R}))),[new URL("ResourceCenterApp.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("flow-host.styl.js",import.meta.url).toString(),new URL("bubble-frame.styl.js",import.meta.url).toString(),new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString(),new URL("stylesheets.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-regular-svg-icons.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-solid-svg-icons.js",import.meta.url).toString(),new URL("vendor.obj-str.js",import.meta.url).toString(),new URL("use-window-resize.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("logomark.js",import.meta.url).toString(),new URL("ChecklistUI.js",import.meta.url).toString(),new URL("BubbleToolbar.js",import.meta.url).toString(),new URL("use-element-rect.js",import.meta.url).toString()]);function ct(e){const t=e.version.checklist.tasks.length;return Math.max(0,t-e.taskCompletions.length)}class lt{constructor(e){this.observers=new Set,this._value=e}get value(){return this._value}update(e){if(e!==this._value){this._value=e;for(const e of this.observers)e()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const dt=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit"],ht=()=>n((()=>import("./BannerApp.js")),[new URL("BannerApp.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("vendor.obj-str.js",import.meta.url).toString(),new URL("stylesheets.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-regular-svg-icons.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-solid-svg-icons.js",import.meta.url).toString(),new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString(),new URL("bubble-frame.styl.js",import.meta.url).toString(),new URL("flow-host.styl.js",import.meta.url).toString(),new URL("use-selector-element-monitoring.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("use-window-resize.js",import.meta.url).toString(),new URL("use-element-rect.js",import.meta.url).toString(),new URL("vendor.phoenix.js",import.meta.url).toString(),new URL("vendor.uuid.js",import.meta.url).toString()]),ut=import.meta.url;class Et{constructor(){this.clientToken=null,this.externalId=null,this.signature=null,this.groupId=null,this.groupSignature=null,this._socketStatus="disconnected",this.socket=null,this.channel=null,this.featureFlags=new Set,this.logrocketAppId=null,this.debounceInactiveDisconnectTimeout=void 0,this.inBatch=!1,this.endBatchTimeout=void 0,this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=0,this.clientClock=1,this.serverClock=1,this.flowSession=null,this.flowSessionClock=0,this.checklistSession=null,this.checklistExpanded=!1,this.checklistExpandPending=!1,this.checklistSessionClock=0,this.bannerSession=null,this.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=!1,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.notificationIdCounter=0,this.sessionStorageState=null,this.clientContext=null,this.flushUrlChangeTimeout=void 0,this.onFirstIdentifyRun=!1,this.onFirstIdentifyTimeout=void 0,this.firstIdentifyCallback=null,this.ui=null,this.unackedTasks=new Set,this.clientConditions=new Map,this.trackers=new Map,this.conditionWaitTimers=new Map,this.listeners=new Map,this.targetEnv=null,this.idempotencyKeysSeen=new Set,this.testUserIdentified=!1,this.cspIssueReported=!1,this.uiDisabled=!1,this.audio=null,this.audioReady=!1,this.pageTrackingDisabled=!1,this.refCounter=1,this.onBuilderMessage=e=>(this.handleBuilderMessage(e),!1),this.handleBuilderMessage=async e=>{nt(`builder ${e.kind} message received`,e);const t="idempotencyKey"in e&&"string"==typeof e.idempotencyKey?e.idempotencyKey:null;if(t&&this.idempotencyKeysSeen.has(t))return;const s=()=>{t&&this.idempotencyKeysSeen.add(t)};switch(e.kind){case"userflow:selectElement":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),void this.setSessionStorageState((t=>({...t,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}})));case"userflow:selectElementCancel":return void this.setSessionStorageState((e=>({...e,activeApp:null,elementSelection:null})));case"userflow:startFlowWithToken":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState((e=>({...e,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0}))),c.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),void(e.testStartCondition?this.setSessionStorageState((t=>({...t,activeApp:"startConditionTesting",testStartConditionToken:e.token}))):this.onceIdentified((()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const t=()=>{const s=this.resourceCenterSession;s&&s.draftMode&&s.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",t))};this.on("resourceCenterChanged",t),t()}})));case"userflow:testTracker":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState((e=>({...e,isTargetTab:!0}))),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),void this.setSessionStorageState((t=>({...t,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}})));case"userflow:testTrackerCancel":return void this.setSessionStorageState((e=>({...e,activeApp:null,trackerTesting:null})))}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout((()=>this.flushUrlChange()),50))},this.onUserActivity=()=>this.ensureConnected(),this.remountIfNecessary=()=>{this.ui?.container&&!document.contains(this.ui.container)&&(nt("remounting UI because container was missing"),this.remount())},nt("constructor, build=1004182"),p(this.onUrlChange),this.setTargetEnv(new C),this.checkTestUserAtBoot(),this.toggleUI();for(const e of dt)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){nt("destroy"),this.reset(),g(this.onUrlChange),this.destroyTargetEnv();for(const e of dt)document.removeEventListener(e,this.remountIfNecessary)}setTargetEnv(e){this.destroyTargetEnv(),this.targetEnv=e,e.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new o("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const t=e(this.getSessionStorageState());c.setItem("userflowClientState",JSON.stringify(t)),this.sessionStorageState=t,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const t=c.getItem("userflowClientState");if(t)try{e=JSON.parse(t)}catch(Tt){console.error("Userflow.js: Parse ElementSelectionState error:",Tt)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=e}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(nt("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState((t=>({...t,testUser:e}))),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const t=[this.identify(e.id,{name:e.name,email:e.email,signed_up_at:{set_once:(new Date).toISOString(),data_type:"datetime"}},{signature:e.signature})],{group:s}=e;s&&(this.groupId=s.id,t.push(this.group(s.id,{name:s.name},{signature:s.signature}))),await Promise.all(t)}resetTestUser(){this.setSessionStorageState((e=>({...e,testUser:null})))}init(e){if(nt("init",e),!e)throw new o("userflow.init() was called but missing Userflow.js Token");this.clientToken!==e&&(this.testUserIdentified?nt("init() ignoring new token since a test user has been identified"):(this.clientToken&&(nt("init() resetting due to new client token"),this.reset()),this.clientToken=e))}ensureInit(){if(!this.clientToken)throw new o("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new o("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new o("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId)return;if(this.debounceInactiveDisconnect(),this.socket)return;this._socketStatus="connecting",nt("connecting to socket");let t=Qe.serverEndpoint||"e.userflow.com";"js.getuserflow.com"===new URL(ut).hostname&&"e.userflow.com"===t&&(t="e.getuserflow.com");const s="wss://"+t+"/end-users/"+this.clientToken+"/socket";this.socket=new e(s,{reconnectAfterMs:e=>[100,500,1e3,5e3][e-1]||1e4,timeout:2e4}),this.socket.connect(),this.socket.onOpen((()=>{nt("socket opened")})),this.socket.onClose((()=>{this.emit("private:disconnect")})),this.socket.onError((e=>{console.log("Userflow.js socket error",e),this.reportCspIssue()})),this.channel=this.socket.channel(`end_users:${this.externalId}`,(()=>this.makeChannelJoinPayload())),this.channel.join().receive("ok",(e=>{this.logrocketAppId=e.logrocketAppId,this.featureFlags=new Set(e.featureFlags),nt("channel joined"),"connected"!==this._socketStatus&&(this._socketStatus="connected")})).receive("error",(e=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(e.code)?(console.error(`Userflow.js resetting due to: [${e.code}] ${e.message}`),this.reset(),this.clientToken=null):"invalid_protocol_version"===e.code?(console.error(`Userflow.js destroying due to: [${e.code}] ${e.message}`),this.destroy()):console.log("Userflow.js channel join error",e)})),this.channel.on("server_message",(e=>this.handleServerMessage(e))),this.channel.on("server_error",(e=>{console.log(`Userflow.js server error (${e.code}): ${e.message}`+(e.details&&e.details.length>0?"\nDetails:\n"+e.details.map((e=>(e.path?`${e.path}: `:"")+e.message)):""))}))}makeChannelJoinPayload(){const e=this.buildClientContext();this.clientContext=e;const t={protocolVersion:2,userflowClientBuild:"1004182",signature:this.signature,groupExternalId:this.groupId,groupSignature:this.groupSignature,flowSessionId:this.flowSession?.id||null,checklistSessionId:this.checklistSession?.id||null,bannerSessionId:this.bannerSession?.id||null,resourceCenterSessionId:this.resourceCenterSession?.id||null,launchers:this.launcherSessions.map((e=>({flowId:e.flow.id}))),trackers:Array.from(this.trackers.values()).map((e=>({flowId:e.tracker.flowId}))),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map((e=>({conditionId:e.condition.id,isTrue:e.isTrue}))),previewFlowId:c.getItem("previewFlowId"),clientContext:e};return nt("channel join payload",t),t}disconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.socket&&this.socket.disconnect(),this._socketStatus="disconnected",this.socket=null,this.channel=null}debounceInactiveDisconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.debounceInactiveDisconnectTimeout=window.setTimeout((()=>{this.hasDraftSession()||this.assistantMessageInProgress?this.debounceInactiveDisconnect():(nt("disconnecting from socket due to inactivity"),this.disconnect())}),3e5)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.bannerSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some((e=>e.draftMode))}async send(e,{batch:t,endBatch:s,handlesRejection:i}={}){return this.inBatch&&["ToggleClientCondition","UpdateClientContext"].includes(e.kind)||this.checkPushRateLimit(),this.ensureConnected(),t&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),s?this.endBatch():this.endBatchTimeout=window.setTimeout((()=>{this.endBatch()}),50)),this.sendRaw(e,{handlesRejection:i})}async sendRaw(e,{handlesRejection:t}={}){return new Promise(((s,i)=>{if(!this.channel){const s=`Userflow.js: send() should not be called if channel is not set. Message kind=${e.kind}`;if(t)throw Error(s);return void console.log(s,"\nClient message:",e)}nt(`push ${e.kind} message`,e);const n=this.clientClock,r=()=>{this.serverClock=n,this.channel?.off("phx_error",a)},a=this.channel.on("phx_error",(s=>{r();const n=`Userflow.js send ${e.kind} got phx_error`;"connected"===this._socketStatus&&console.log(n,"\nClient message:",e,"\nError:",s),t&&i(new o(n))}));this.channel.push("client_message",e).receive("ok",(e=>{r(),s(e)})).receive("error",(s=>{r();const n=`Userflow.js error reply (${s.code}): ${s.message}`;console.log(n,"\nClient message:",e,"\nError:",s),t&&i(new o(n,s.code,s.message))}))}))}endBatch(){this.inBatch=!1,this.sendRaw({kind:"EndBatch"})}checkPushRateLimit(){const e=Date.now();if(this.pushRateLimitMinuteExpires<e&&(this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=e+6e4),this.pushRateLimitMinute>=100)throw new o("This Userflow.js client has reached a maximum of 100 operations in the last 1 minute. This is usually due to one of the following:\n\n - Excessive calls to Userflow.js. Check if any of userflow.track(), userflow.identify(), userflow.updateUser() or similar are called repeatedly.\n - The URL changing too frequently. Look into https://userflow.com/docs/userflow-js#seturlfilter and filter out the changing part of the URL.\n - The user legitimately being very active, in which case you can just ignore this error.\n \n If in doubt, reach out to us at support@userflow.com.");this.pushRateLimitMinute++}handleServerMessage(e){nt(`received ${e.kind} message`,e);const{serverClock:t,flowSession:s,flowSessionClock:i,checklistSession:n,checklistSessionClock:o,bannerSession:r,resourceCenterSession:a}=this;switch(e.kind){case"CheckSessionsAck":case"ServerDebug":return;case"AddLauncher":{const{session:t}=e,s=this.launcherSessions.findIndex((e=>e.flow.id===t.flow.id));return this.launcherSessions=-1===s?[...this.launcherSessions,t]:[...this.launcherSessions.slice(0,s),t,...this.launcherSessions.slice(s+1)],void this.toggleUI()}case"AddTracker":return void this.addTracker(e.tracker);case"AssistantMessageEventWrapper":return void this.emit("private:assistantMessageEvent",e);case"CancelConditionWaitTimer":return window.clearTimeout(this.conditionWaitTimers.get(e.conditionId)),void this.conditionWaitTimers.delete(e.conditionId);case"ChecklistTaskCompleted":return void this.unackedTasks.add(e.taskCvid);case"ForceGoToStep":return i>t?void nt(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`):void(s?.id===e.sessionId&&this.emit("gotostep",{session:s,step:{id:e.stepId}}));case"RemoveLauncher":return void(this.removeLauncher(e.flowId)&&this.toggleUI());case"RemoveTracker":return void this.removeTracker(e.flowId);case"SetBannerSession":return this.setBannerSession(e.session),void this.toggleUI();case"SetChecklistSession":return void(o<=t||n?.id===e.session.id?(this.setChecklistSession(e.session,t),this.toggleUI()):nt(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${o} > serverClock=${t}`));case"SetFlowSession":return void(i<=t||s?.id===e.session.id?(this.setFlowSession(e.session,t),this.toggleUI()):nt(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`));case"SetResourceCenterSession":return this.setResourceCenterSession(e.session),void this.toggleUI();case"StartConditionWaitTimer":if(!this.conditionWaitTimers.has(e.conditionId)){const t=window.setTimeout((()=>{this.conditionWaitTimers.delete(e.conditionId),this.send({kind:"FireConditionWaitTimer",conditionId:e.conditionId},{batch:!0})}),1e3*parseFloat(e.waitTime));this.conditionWaitTimers.set(e.conditionId,t)}return;case"TestStartConditionSuccess":return void this.emit("private:testStartConditionSuccess");case"TrackClientCondition":return void this.trackClientCondition(e.condition);case"UnsetBannerSession":return void(r?.id===e.sessionId&&(this.setBannerSession(null),this.toggleUI()));case"UnsetChecklistSession":return o>t?void nt(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${o} > serverClock=${t}`):void(n?.id===e.sessionId&&(this.setChecklistSession(null,t),this.toggleUI()));case"UnsetFlowSession":return i>t?void nt(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`):void(s?.id===e.sessionId&&(this.setFlowSession(null,t),this.toggleUI()));case"UnsetResourceCenterSession":return void(a?.id===e.sessionId&&(this.setResourceCenterSession(null),this.toggleUI()));case"UntrackClientCondition":return void this.untrackClientCondition(e.conditionId);default:return void console.warn("Userflow.js: Received unknown message",e)}}async identify(e,t={},{signature:s}={}){if(nt("identify",e),this.ensureInit(),this.testUserIdentified&&e!==this.externalId)nt("identify() ignored since a test user has been identified");else{if("number"==typeof e)e=String(e);else if(!e||"string"!=typeof e)throw new o(`userflow.identify: First argument must be a non-empty string representing the user's ID in your database. Value received: ${JSON.stringify(e)}`);this.externalId&&e!==this.externalId&&(nt("identify resetting due to new externalId"),this.reset()),this.externalId=e,this.signature=s||null,this.observeUserActivity(),await Promise.all([this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(t)},{batch:!0}),this.onFirstIdentify()]),this.emit("private:identified")}}async identifyAnonymous(e={},s={}){if(!a.isSupported())throw new o("userflow.identifyAnonymous() is not supported when localStorage access is denied.");const i="anonymousId";let n=a.getItem(i);n||(n="anon-"+t(),a.setItem(i,n)),await this.identify(n,e,s)}async updateUser(e={},t={}){nt("updateUser"),this.ensureIdentified(),await this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(e)},{batch:!0})}async group(e,t={},{signature:s,membership:i}={}){if(nt("group",e),this.ensureIdentified(),this.testUserIdentified&&e!==this.groupId)nt("group() ignored since a test user has been identified");else{if("number"==typeof e)e=String(e);else if(!e||"string"!=typeof e)throw new o(`userflow.group: First argument must be a non-empty string representing the group's ID in your database. Value received: ${JSON.stringify(e)}`);this.groupId=e,this.groupSignature=s||null,await this.send({kind:"UpsertGroup",groupExternalId:e,groupSignature:this.groupSignature,groupAttributes:this.normalizeAttributes(t),membershipAttributes:this.normalizeAttributes(i)},{batch:!0})}}async updateGroup(e={},t={}){nt("updateGroup");const s=this.ensureGroup();await this.send({kind:"UpsertGroup",groupExternalId:s,groupSignature:this.groupSignature,membershipAttributes:this.normalizeAttributes(t.membership),groupAttributes:this.normalizeAttributes(e)},{batch:!0})}normalizeAttributes(e){if(null==e)return{};if("object"!=typeof e)throw new o("Userflow: 'attributes' must be an object.");const t={};for(const s in e){if(!e.hasOwnProperty(s))continue;if("traits"===s){const i=e[s];Object.assign(t,this.extractLegacyTraits(i));continue}let i=e[s];if("string"==typeof i||"number"==typeof i||"boolean"==typeof i||null==i||Array.isArray(i))t[s]=this.normalizeAttributeLiteralOrList(s,i);else{if("object"!=typeof i||null==i)throw new o(`Userflow: Invalid value for '${s}' attribute.`);if("set"in i)t[s]={set:this.normalizeAttributeLiteralOrList(s,i.set),dataType:this.normalizeDataType(s,i.data_type||i.dataType)};else if("set_once"in i||"setOnce"in i)t[s]={setOnce:this.normalizeAttributeLiteralOrList(s,i.set_once??i.setOnce),dataType:this.normalizeDataType(s,i.data_type||i.dataType)};else if("add"in i){const e=i.add;if("string"!=typeof e&&"number"!=typeof e)throw new o(`Userflow: Invalid 'add' value for '${s}' attribute. Must be a number or string.`);t[s]={add:e}}else if("subtract"in i){const e=i.subtract;if("string"!=typeof e&&"number"!=typeof e)throw new o(`Userflow: Invalid 'subtract' value for '${s}' attribute. Must be a number or string.`);t[s]={subtract:e}}else if("append"in i)t[s]={append:this.normalizeAttributeLiteralOrList(s,i.append)};else if("prepend"in i)t[s]={prepend:this.normalizeAttributeLiteralOrList(s,i.prepend)};else{if(!("remove"in i))throw new o(`Userflow: Invalid value for '${s}' attribute.`);t[s]={remove:this.normalizeAttributeLiteralOrList(s,i.remove)}}}}return t}normalizeAttributeLiteralOrList(e,t){return Array.isArray(t)?t.map((t=>this.normalizeAttributeLiteral(e,t))):this.normalizeAttributeLiteral(e,t)}normalizeAttributeLiteral(e,t){if(null==t)return null;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return t;throw new o(`Userflow: Invalid value for '${e}' attribute.`)}normalizeDataType(e,t){if(!t)return null;switch(t){case"string":return O.STRING;case"number":return O.NUMBER;case"boolean":return O.BOOLEAN;case"datetime":return O.DATETIME}throw new o(`Userflow: Invalid data_type for '${e}' attribute.`)}extractLegacyTraits(e){if(!e)return{};if(!Array.isArray(e)){const t=[];for(const s in e)e.hasOwnProperty(s)&&t.push({name:s,value:e[s]});e=t}return e.reduce(((e,{name:t,value:s,dataType:i})=>{if("string"!=typeof t||t.length>100||!t.match(/^[a-z0-9_]+$/))return this.warn("Userflow.identify: Invalid trait name (must be string, no more than 100 characters, and only consist of a-z, 0-9 and underscores). The trait will be ignored. Name was:",t),e;if("string"==typeof s);else if("boolean"==typeof s)i||(i="boolean"),s=s?"true":"false";else{if("number"!=typeof s)return this.warn(`userflow.identify: The value of trait '${t}' is invalid (must be a string, a boolean or a number). The trait will be ignored. Value was:`,s),e;i||(i=Number.isInteger(s)?"integer":"decimal"),s=String(s)}let n=null;if(i)switch(i){case"string":n=O.STRING;break;case"boolean":n=O.BOOLEAN;break;case"integer":case"decimal":n=O.NUMBER;break;case"datetime":n=O.DATETIME;break;default:return this.warn(`userflow.identify: The data type of trait '${t}' is invalid (must be a 'string', 'boolean', 'integer', 'decimal' or 'datetime'). The trait will be ignored. Data type was:`,i),e}return e[t]={set:s,dataType:n},e}),{})}async track(e,t={},{userOnly:s}={}){nt(`track '${e}'`,t),this.ensureIdentified(),await this.send({kind:"TrackEvent",userOnly:!!s,name:e,attributes:this.normalizeEventAttributes(t)},{batch:!0})}normalizeEventAttributes(e){const t=this.normalizeAttributes(e);for(const s in t){if(!t.hasOwnProperty(s))continue;const e=t[s];if(null!=e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Array.isArray(e)&&!("set"in e))throw new o(`Userflow: Invalid value for '${s}' attribute. Event attributes only support literal values, list values and 'set' changes.`)}return t}onFirstIdentify(){this.onFirstIdentifyRun||(this.onFirstIdentifyRun=!0,this.onFirstIdentifyTimeout=window.setTimeout((()=>{this.trackPageViewed(),this.firstIdentifyCallback?(this.firstIdentifyCallback(),this.firstIdentifyCallback=null):this.checkUrlForStartFlow()}),0))}onceIdentified(e){this.isIdentified()?e():this.firstIdentifyCallback=e}checkUrlForStartFlow(){const e=new URL(d()),t=e.searchParams.get("userflow")||e.searchParams.get("studio1_flow")||e.searchParams.get("studio1_walkthrough");t&&(nt(`url contained flow ${t}`),this.startFlow({flowId:t,startReason:L.LINK,batch:!0}),e.searchParams.delete("userflow"),e.searchParams.delete("studio1_flow"),e.searchParams.delete("studio1_walkthrough"),window.history.replaceState({},"",e.toString()),this.clientContext=this.buildClientContext(),this.pushUpdateClientContext())}flushUrlChange(){const e=this.buildClientContext();this.clientContext&&e.pageUrl===this.clientContext.pageUrl||(this.clientContext=e,this.pushUpdateClientContext(),this.trackPageViewed(),this.checkUrlForStartFlow())}async trackPageViewed(){this.pageTrackingDisabled||this.track("page_viewed",{})}buildClientContext(){return{pageUrl:tt(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}pushUpdateClientContext(){this.send({kind:"UpdateClientContext",clientContext:this.clientContext},{batch:!0})}ackCompletedTask(e){this.unackedTasks.delete(e)}taskIsUnacked(e){return this.unackedTasks.has(e)}isIdentified(){return null!=this.externalId}on(e,t){let s=this.listeners.get(e);s||(s=new Set,this.listeners.set(e,s)),s.add(t)}off(e,t){const s=this.listeners.get(e);s&&s.delete(t)}emit(e,...t){const s=this.listeners.get(e);if(s){Array.from(s).forEach((e=>e(...t)))}}observeUserActivity(){document.addEventListener("mouseover",this.onUserActivity),document.addEventListener("pointerdown",this.onUserActivity),document.addEventListener("keydown",this.onUserActivity)}unobserveUserActivity(){document.removeEventListener("mouseover",this.onUserActivity),document.removeEventListener("pointerdown",this.onUserActivity),document.removeEventListener("keydown",this.onUserActivity)}reset(){nt("reset"),this.externalId=null,this.groupId=null,this.sessionStorageState=null,this.setFlowSession(null,0),this.setChecklistSession(null,0),this.setBannerSession(null),this.setResourceCenterSession(null),this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.unackedTasks=new Set,this.onFirstIdentifyRun=!1,window.clearTimeout(this.onFirstIdentifyTimeout),this.onFirstIdentifyTimeout=void 0,this.clientContext=null,this.unobserveUserActivity(),window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=void 0,this.clientConditions.forEach(((e,t)=>{this.untrackClientCondition(t)})),this.firstIdentifyCallback=null,this.testUserIdentified=!1,a.removeItem("anonymousId"),this.unmountUI(),this.disconnect(),this.inBatch=!1,window.clearTimeout(this.endBatchTimeout),this.endBatchTimeout=void 0,this.clientClock=1,this.serverClock=1,this.titleMonitored=void 0,this.titleObserver&&(this.titleObserver.disconnect(),this.titleObserver=void 0)}async startFlow({flowId:e,stepCvid:t,startReason:s,once:i,batch:n,replaceCurrent:o}){if(this.ensureIdentified(),o&&this.flowSession&&this.endFlow(this.flowSession,{endReason:m.REPLACED,batch:!0}),nt(`startFlow ${e}`,{startReason:s}),this.checklistSession?.flow.id===e)return nt("startFlow matches current checklist, so showing it instead"),void this.showChecklist();const r={kind:"StartFlow",flowId:e,stepCvid:t,startReason:s,once:!!i};await this.send(r,{batch:n})}async startFlowWithToken(e){this.ensureIdentified(),nt("startFlowWithToken",{token:e}),await this.send({kind:"StartFlowWithToken",token:e},{batch:!0})}optimisticClockUIUpdate(e){this.clientClock++,e(),this.toggleUI()}async showChecklist(){this.resourceCenterEmbedsChecklist()?this.openResourceCenter():(this.unmarkExpandPending(),this.checklistSession&&!this.checklistExpanded&&(this.ensureIdentified(),this.checklistExpanded=!0,this.toggleUI(),c.setItem(`checklistExpanded:${this.checklistSession.id}`,"1"),await this.send({kind:"ShowChecklist",sessionId:this.checklistSession.id},{batch:!0})))}async hideChecklist(){this.resourceCenterEmbedsChecklist()?this.closeResourceCenter():this.checklistSession&&this.checklistExpanded&&(this.ensureIdentified(),this.checklistExpanded=!1,this.toggleUI(),c.removeItem(`checklistExpanded:${this.checklistSession.id}`),await this.send({kind:"HideChecklist",sessionId:this.checklistSession.id},{batch:!0}))}async unmarkExpandPending(){this.checklistSession&&this.checklistExpandPending&&(this.checklistExpandPending=!1,await this.send({kind:"UnmarkExpandPending",sessionId:this.checklistSession.id},{batch:!0}))}async openResourceCenter(){this.resourceCenterEmbedsChecklist()&&this.unmarkExpandPending(),this.resourceCenterSession&&!this.resourceCenterOpen&&(this.ensureIdentified(),this.resourceCenterOpen=!0,this.toggleUI(),this.emit("resourceCenterChanged"),c.setItem(`resourceCenterOpen:${this.resourceCenterSession.id}`,"1"),await this.send({kind:"OpenResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}async closeResourceCenter(){this.resourceCenterSession&&this.resourceCenterOpen&&(this.ensureIdentified(),this.resourceCenterOpen=!1,this.toggleUI(),this.emit("resourceCenterChanged"),c.removeItem(`resourceCenterOpen:${this.resourceCenterSession.id}`),await this.send({kind:"CloseResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}toggleResourceCenter(){this.resourceCenterOpen?this.closeResourceCenter():this.openResourceCenter()}setResourceCenterLauncherHidden(e){this.resourceCenterLauncherHidden=e,this.toggleUI()}getResourceCenterState(){if(!this.resourceCenterSession)return null;const e=this.resourceCenterEmbedsChecklist(),{checklistSession:t}=this,s=this.resourceCenterSession.version.resourceCenter?.blocks.find((e=>e.type===Ie.ANNOUNCEMENTS));return{isOpen:this.resourceCenterOpen,hasChecklist:e,uncompletedChecklistTaskCount:e&&t?ct(t):0,unreadAnnouncementCount:s?.unreadAnnouncementCount||0}}resourceCenterEmbedsChecklist(){const e=this.resourceCenterSession;return!!e&&!!e.version.resourceCenter?.blocks.some((e=>e.type===Ie.CHECKLIST))}async endFlow(e,{endReason:t,batch:s}){this.ensureIdentified(),this.optimisticClockUIUpdate((()=>{const{clientClock:t}=this;this.flowSession?.id===e.id&&this.setFlowSession(null,t),this.checklistSession?.id===e.id&&this.setChecklistSession(null,t),this.bannerSession?.id===e.id&&this.setBannerSession(null),this.resourceCenterSession?.id===e.id&&this.setResourceCenterSession(null)}));const{flow:i}=e,n={id:i.id,type:i.type.toLowerCase()};i.type===_.CHECKLIST?this.emit("checklistEnded",{checklist:n,endReason:t}):i.type===_.FLOW&&this.emit("flowEnded",{flow:n,endReason:t});const o={kind:"EndFlow",sessionId:e.id,endReason:t};await this.send(o,{batch:s})}async goToStep(e,t){nt("goToStep",e.id,t.name||t.id),this.ensureIdentified();const s=this.send({kind:"GoToStep",sessionId:e.id,stepId:t.id});e.currentStep=t,this.emit("gotostep",{session:e,step:t}),await s}async endAllFlows(){nt("endAllFlows"),this.optimisticClockUIUpdate((()=>{const{clientClock:e}=this;this.setFlowSession(null,e),this.setChecklistSession(null,e)})),await this.send({kind:"EndAllFlows"})}async endChecklist(){nt("endChecklist");const e=this.checklistSession||this.flowSession;e?.flow.type===_.CHECKLIST&&this.endFlow(e,{endReason:m.USERFLOWJS})}setFlowSession(e,t=this.clientClock){const s=this.flowSession;this.flowSession=e,this.flowSessionClock=t,e&&!s&&(this.hideChecklist(),this.closeResourceCenter()),null==e&&this.originalActiveElement&&("function"==typeof this.originalActiveElement.focus&&this.originalActiveElement.focus(),this.originalActiveElement=void 0)}setChecklistSession(e,t=this.clientClock){const s=this.checklistSession;this.checklistSession=e,this.checklistSessionClock=t,null===e&&(this.checklistExpanded=!1,this.checklistExpandPending=!1),e&&e.id!==s?.id&&(this.checklistExpanded=!!c.getItem(`checklistExpanded:${e.id}`),e.expandPending&&(this.checklistExpandPending=!0)),this.emit("checklistChanged"),this.emit("resourceCenterChanged")}setBannerSession(e){this.bannerSession=e}setResourceCenterSession(e){const t=this.resourceCenterSession;e="function"==typeof e?e(this.resourceCenterSession):e,this.resourceCenterSession=e,null===e&&(this.resourceCenterOpen=!1),t&&t.id!==e?.id&&c.removeItem(`resourceCenterOpen:${t.id}`),e&&e.id!==t?.id&&(this.resourceCenterOpen=!!c.getItem(`resourceCenterOpen:${e.id}`)),this.emit("resourceCenterChanged")}launcherSeen(e){this.send({kind:"StartFlow",flowId:e,startReason:L.LAUNCHER_SEEN,once:!1})}activateLauncher(e){const t=this.activeLauncherFlowId&&this.launcherSessions.find((e=>e.flow.id===this.activeLauncherFlowId));t&&this.deactivateLauncher(t),this.activeLauncherFlowId=e.flow.id,this.toggleUI(),this.send({kind:"ActivateLauncher",flowId:e.flow.id})}deactivateLauncher(e){const{launcher:t}=e.version;e.flow.id===this.activeLauncherFlowId&&(t?.dismissOn===Oe.DEACTIVATE?this.dismissLauncher(e,{endReason:m.LAUNCHER_DEACTIVATED}):(this.activeLauncherFlowId=null,this.toggleUI()))}dismissLauncher(e,{endReason:t}){const s=e.flow.id;this.removeLauncher(s),this.toggleUI(),this.send({kind:"DismissLauncher",flowId:s,endReason:t})}removeLauncher(e){const t=this.launcherSessions.findIndex((t=>t.flow.id===e));return-1!==t&&(this.launcherSessions=[...this.launcherSessions.slice(0,t),...this.launcherSessions.slice(t+1)],e===this.activeLauncherFlowId&&(this.activeLauncherFlowId=null),!0)}async toggleUI(){const e=this.getSessionStorageState();this.flowSession||!this.checklistExpandPending&&!this.checklistSession?.version.checklist?.tasks.some((e=>this.taskIsUnacked(e.cvid)))||this.showChecklist(),e.isTargetTab&&this.monitorTitle(),this.emit("uistatechange"),this.shouldBeMounted()?await this.mountUI():this.unmountUI()}shouldBeMounted(){if(this.uiDisabled)return!1;return!!this.getSessionStorageState().activeApp||!!this.flowSession||!!this.checklistSession&&(this.checklistExpanded||!!this.checklistSession?.version.checklist?.launcherEnabled)||!!this.bannerSession||!!this.resourceCenterSession&&(this.resourceCenterOpen||!this.resourceCenterLauncherHidden)||this.launcherSessions.length>0||this.notifications.length>0}async mountUI(){if(!this.ui){const e=await this.createUI();this.shouldBeMounted()&&!this.ui&&(nt("mount UI"),this.ui=e,this.ui.mount())}}unmountUI(){this.ui&&(nt("unmount UI"),this.ui.unmount(),this.ui=null)}remount(){this.unmountUI(),this.toggleUI()}async createUI(){try{const e=n((()=>import("./ui.js")),[new URL("ui.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("vendor.phoenix.js",import.meta.url).toString(),new URL("vendor.uuid.js",import.meta.url).toString()]);this.bannerSession&&ht(),this.resourceCenterSession&&at();const{RealUI:t}=await e;return new t(this)}catch(Tt){throw this.reportCspIssue(),Tt}}async trackClientCondition(e){if(this.clientConditions.has(e.id))return;nt("track client condition",e),this.clientConditions.set(e.id,{condition:e,isTrue:null});const{conditionTypes:t}=await n((()=>import("./flow-condition-types.js").then((function(e){return e.v}))),[new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString()]),s=t[e.type],i=this.clientConditions.get(e.id);i&&(i.untrack=s.track({sessionData:new lt([]),condition:e,callback:t=>{i.isTrue!==t&&(nt("client condition truthiness changed",t,i.condition),i.isTrue=t,this.send({kind:"ToggleClientCondition",conditionId:e.id,isTrue:t},{batch:!0}))}}))}untrackClientCondition(e){const t=this.clientConditions.get(e);t&&(nt("untrack client condition",t.condition),t.untrack&&t.untrack(),this.clientConditions.delete(e))}async addTracker(e){let t=this.trackers.get(e.flowId);t?t.tracker=e:this.trackers.set(e.flowId,{tracker:e,isTrue:!1});const{conditionTypes:s}=await n((()=>import("./flow-condition-types.js").then((function(e){return e.v}))),[new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString()]),i=this.trackers.get(e.flowId);if(!i)return;const{tracker:o}=i,{condition:r}=o,a=s[r.type];i.untrack&&i.untrack(),i.untrack=a.track({sessionData:new lt(o.data),condition:r,flipBackEvents:!0,callback:e=>{const t=i.isTrue;i.isTrue=e,!t&&e&&this.send({kind:"TrackTrackerEvent",token:o.token},{batch:!0})},description:`event tracker ${o.flowId}`}),this.emit("private:trackerStarted")}removeTracker(e){const t=this.trackers.get(e);t&&(t.untrack&&t.untrack(),this.trackers.delete(e),this.emit("private:trackerStopped"))}monitorTitle(){if(this.titleMonitored)return;this.titleMonitored=!0,this.fixTitle();const e=document.querySelector("title");if(e){const t=new MutationObserver((()=>{this.fixTitle()}));t.observe(e,{childList:!0}),this.titleObserver=t}}fixTitle(){const e=document.title,t="[Userflow Preview] "+e.replace(/\[Userflow Preview\] /,"");e!==t&&(document.title=t)}reportCspIssue(){const e=this.getSessionStorageState();!this.testUserIdentified&&!e.activeApp||this.cspIssueReported||(this.cspIssueReported=!0,nt("csp issue detected"),T({kind:"userflow:crxCspIssueDetected"}))}getAudio(){return this.audio||(this.audio=new Audio),this.audio}playAudio(e){if(document.hidden)return;const t=this.getAudio();e&&(t.src=e);const s=t.play();this.audioReady=!0,s&&s.catch((e=>{e.name}))}pauseAudio(){const e=this.audio;e&&!e.paused&&e.pause()}async getStepSpeech(e,t){return(await this.send({kind:"GetStepSpeechV2",syntheticVoice:e,text:t})).url}featureFlagEnabled(e){return this.featureFlags.has(e)}showNotification(e,t,s){const i={id:++this.notificationIdCounter,label:e,message:t,type:s};this.notifications=[...this.notifications,i],this.toggleUI()}dismissNotification(e){this.notifications=this.notifications.filter((t=>t.id!==e)),this.toggleUI()}warn(...e){console.warn(...e)}nextRef(){return this.refCounter++}}if(void 0===window.userflow||window.userflow._stubbed){const e=Object.assign(window.userflow||{},function(){const e=new Et;return{_stubbed:!1,init(t){e.init(t)},identify:(t,s={},i={})=>e.identify(t,s,i),identifyAnonymous:(t={},s={})=>e.identifyAnonymous(t,s),isIdentified:()=>e.isIdentified(),updateUser:(t,s={})=>e.updateUser(t,s),group:(t,s={},i={})=>e.group(t,s,i),updateGroup:(t,s={})=>e.updateGroup(t,s),track:(t,s={},i={})=>e.track(t,s,i),start:(t,{once:s}={})=>e.startFlow({flowId:t,startReason:L.USERFLOWJS,once:s}),startFlow:e=>(console.warn("Userflow.js: userflow.startFlow() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)),startWalk:e=>(console.warn("Userflow.js: userflow.startWalk() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)),endAll:()=>e.endAllFlows(),endChecklist:()=>e.endChecklist(),endAllFlows:()=>window.userflow.endAll(),async endFlow(){console.warn("Userflow.js: userflow.endFlow() has been deprecated and no longer has any effect.")},async endWalk(){console.warn("Userflow.js: userflow.endWalk() has been deprecated and no longer has any effect.")},openResourceCenter(){e.openResourceCenter()},closeResourceCenter(){e.closeResourceCenter()},toggleResourceCenter(){e.toggleResourceCenter()},setResourceCenterLauncherHidden(t){e.setResourceCenterLauncherHidden(t)},getResourceCenterState:()=>e.getResourceCenterState(),setWalkPosition(){console.warn("Userflow.js: userflow.setWalkPosition() has been deprecated and no longer has any effect.")},reset(){e.reset()},remount(){e.remount()},on(t,s){e.on(t,s)},off(t,s){e.off(t,s)},setCustomInputSelector(e){console.warn("Userflow.js: userflow.setCustomInputSelector() has been deprecated. Use userflow.registerCustomInput() instead. See docs: https://userflow.com/docs/userflow-js"),e&&Qe.customInputs.push({cssSelector:e})},registerCustomInput(e,t){Qe.customInputs.push({cssSelector:e,getValue:t})},setCustomNavigate(e){Qe.customNavigate=e},setUrlFilter(e){Qe.urlFilter=e},setInferenceAttributeNames(e){Qe.inferenceAttributeNames=e},setInferenceAttributeFilter(e,t){Qe.inferenceAttributeFilters[e]=qe(t)},setInferenceClassNameFilter(e){Qe.inferenceClassNameFilters=qe(e)},setScrollPadding(e){Qe.scrollPadding=e},setCustomScrollIntoView(e){Qe.customScrollIntoView=e},prepareAudio(){e.playAudio(null)},setShadowDomEnabled(e){console.warn("Userflow.js: userflow.setShadowDomEnabled() has been deprecated. Please remove this call from your Userflow.js snippet. Shadow DOM is supported by default now.")},setPageTrackingDisabled(t){e.pageTrackingDisabled=t},setBaseZIndex(e){Qe.baseZIndex=e},setServerEndpoint(e){Qe.serverEndpoint=e},disableEvalJs(){Qe.evalJsDisabled=!0},_setTargetEnv(t){e.setTargetEnv(t)}}}());window.userflow=e,window.studio1=e,function(){const e=window.userflow,t=window.USERFLOWJS_QUEUE;if(delete window.USERFLOWJS_QUEUE,!t||0===t.length)return;nt(`processing ${t.length} items in the queue`);for(const[s,i,n]of t){if("function"!=typeof e[s]){console.error(`Userflow.js: Invalid method '${s}' in queue`);continue}const t=e[s](...n);i&&t&&"function"==typeof t.then&&t.then(i.resolve,i.reject)}nt("queue processed")}()}export{N as $,Le as A,ht as B,me as C,Y as D,m as E,P as F,a as G,We as H,X as I,ne as J,ce as K,j as L,Q as M,de as N,Pe as O,Ne as P,_e as Q,at as R,L as S,dt as T,o as U,re as V,He as W,De as X,Fe as Y,je as Z,n as _,B as a,F as b,Qe as c,nt as d,D as e,H as f,tt as g,Ie as h,c as i,ct as j,se as k,ee as l,ue as m,Ae as n,p as o,_ as p,d as q,Te as r,l as s,et as t,g as u,fe as v,pe as w,lt as x,V as y,W as z};export default window.userflow;
|
|
1
|
+
import{S as e}from"./vendor.phoenix.js";import{v as t}from"./vendor.uuid.js";let s;const i={},n=function(e,t){if(!t)return e();if(void 0===s){const e=document.createElement("link").relList;s=e&&e.supports&&e.supports("modulepreload")?"modulepreload":"preload"}return Promise.all(t.map((e=>{if(e in i)return;i[e]=!0;const t=e.endsWith(".css"),n=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${n}`))return;const o=document.createElement("link");return o.rel=t?"stylesheet":s,t||(o.as="script",o.crossOrigin=""),o.href=e,document.head.appendChild(o),t?new Promise(((e,t)=>{o.addEventListener("load",e),o.addEventListener("error",t)})):void 0}))).then((()=>e()))};class o extends Error{constructor(e,t,s){super(e),Object.setPrototypeOf(this,o.prototype),this.name="UserflowError",this.code=t,this.humanMessage=s}}class r{constructor(e){this.type=e,this.testState={}}formatKey(e){return`userflow:${e}`}isSupported(){if("undefined"==typeof window)return!1;try{return null!=window[this.type]}catch{return!1}}getItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].getItem(e):null}setItem(e,t){e=this.formatKey(e),this.isSupported()&&window[this.type].setItem(e,t)}removeItem(e){if(e=this.formatKey(e),this.isSupported())return window[this.type].removeItem(e)}clear(){if(this.isSupported())return window[this.type].clear()}}const a=new r("localStorage"),c=new r("sessionStorage");function l(e){window.location.href=e}function d(){return window.location.href}var h,u,E;function T(e){window.postMessage(e,window.origin)}function S(e){const t=t=>{if(t.source!==window||t.origin!==window.origin)return;const i=t.data;i&&"object"==typeof i&&"string"==typeof i.kind&&i.kind.startsWith("userflow:")&&!0===e(i)&&s()};window.addEventListener("message",t);const s=()=>window.removeEventListener("message",t);return s}(h||(h={})).INPUT="INPUT",(E=u||(u={})).AUTO="AUTO",E.MANUAL="MANUAL";const f=new Set;let w=!1;function p(e){return function(){if(w)return;w=!0;const{history:e}=window,t=t=>{const s=e[t];e[t]=(...t)=>{s.apply(e,t),I()}};t("pushState"),t("replaceState"),window.addEventListener("popstate",(()=>{I()}))}(),f.add(e),()=>{g(e)}}function g(e){f.delete(e)}function I(){f.forEach((e=>e()))}class C{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(e){T({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})}onBuilderMessage(e){return this.unregisterOnMessage=S(e),!1}async captureScreenshot(e,t,s,i){T({kind:"userflow:crxScreenshot",x:e,y:t,width:s,height:i,devicePixelRatio:window.devicePixelRatio});var n;return(await(n=e=>"userflow:crxScreenshotResult"===e.kind?e:null,new Promise((e=>{S((t=>{const s=n(t);return!!s&&(e(s),!0)}))})))).imageDataUrl}}var m,k,A,U,L,R,N,v,O,y,_,b,D,M,F,B,P,x,H,G,W,$,V,K,j,z,Y,J,X,Z,Q,q,ee,te,se,ie,ne,oe,re,ae,ce,le,de,he,ue,Ee,Te,Se,fe,we,pe,ge,Ie,Ce,me,ke,Ae,Ue,Le,Re,Ne,ve,Oe,ye,_e,be,De,Me,Fe,Be,Pe,xe,He,Ge,We,$e,Ve,Ke,je,ze,Ye,Je,Xe,Ze;(k=m||(m={})).ACTION="ACTION",k.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",k.REPLACED="REPLACED",k.SNOOZED="SNOOZED",k.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",k.USERFLOWJS="USERFLOWJS",k.USER_CLOSED="USER_CLOSED",(U=A||(A={})).SECOND="SECOND",U.MINUTE="MINUTE",U.HOUR="HOUR",U.DAY="DAY",(R=L||(L={})).ACTION="ACTION",R.DRAFT="DRAFT",R.LINK="LINK",R.LAUNCHER_SEEN="LAUNCHER_SEEN",R.RESOURCE_CENTER="RESOURCE_CENTER",R.USERFLOWJS="USERFLOWJS",(v=N||(N={})).LIKE="LIKE",v.DISLIKE="DISLIKE",(y=O||(O={})).STRING="STRING",y.BOOLEAN="BOOLEAN",y.NUMBER="NUMBER",y.DATETIME="DATETIME",y.LIST="LIST",y.RANDOM_AB="RANDOM_AB",y.RANDOM_NUMBER="RANDOM_NUMBER",(b=_||(_={})).FLOW="FLOW",b.BANNER="BANNER",b.CHECKLIST="CHECKLIST",b.LAUNCHER="LAUNCHER",b.RESOURCE_CENTER="RESOURCE_CENTER",(M=D||(D={})).ALWAYS_TRUE="ALWAYS_TRUE",M.ATTRIBUTE="ATTRIBUTE",M.CLAUSE="CLAUSE",M.ELEMENT="ELEMENT",M.FILLED_IN_INPUT="FILLED_IN_INPUT",M.FLOW="FLOW",M.INPUT_VALUE="INPUT_VALUE",M.PAGE="PAGE",M.SEGMENT="SEGMENT",M.TIME="TIME",function(e){e.AUTO="AUTO",e.MANUAL="MANUAL"}(F||(F={})),(B||(B={})).INPUT="INPUT",(x=P||(P={})).ABSOLUTE_EQ="ABSOLUTE_EQ",x.ABSOLUTE_GT="ABSOLUTE_GT",x.ABSOLUTE_LT="ABSOLUTE_LT",x.AND="AND",x.BETWEEN="BETWEEN",x.CONTAINS="CONTAINS",x.EMPTY="EMPTY",x.ENDS_WITH="ENDS_WITH",x.EQ="EQ",x.EXCLUDES_ALL="EXCLUDES_ALL",x.EXCLUDES_ANY="EXCLUDES_ANY",x.FALSE="FALSE",x.GT="GT",x.GTE="GTE",x.INCLUDES_ALL="INCLUDES_ALL",x.INCLUDES_ANY="INCLUDES_ANY",x.LT="LT",x.LTE="LTE",x.NE="NE",x.NOT_CONTAINS="NOT_CONTAINS",x.NOT_EMPTY="NOT_EMPTY",x.NOT_REGEX="NOT_REGEX",x.OR="OR",x.REGEX="REGEX",x.RELATIVE_EQ="RELATIVE_EQ",x.RELATIVE_GT="RELATIVE_GT",x.RELATIVE_LT="RELATIVE_LT",x.STARTS_WITH="STARTS_WITH",x.TRUE="TRUE",x.URL="URL",(G=H||(H={})).CLICK="CLICK",G.DISABLED="DISABLED",G.MOUSEDOWN="MOUSEDOWN",G.NOT_CLICK="NOT_CLICK",G.NOT_DISABLED="NOT_DISABLED",G.NOT_PRESENT="NOT_PRESENT",G.PRESENT="PRESENT",($=W||(W={})).ASSET="ASSET",$.CARTOON="CARTOON",$.NONE="NONE",$.URL="URL",(K=V||(V={})).INSIDE="INSIDE",K.OUTSIDE="OUTSIDE",(z=j||(j={})).TOP_LEFT="TOP_LEFT",z.TOP_CENTER="TOP_CENTER",z.TOP_RIGHT="TOP_RIGHT",z.BOTTOM_RIGHT="BOTTOM_RIGHT",z.BOTTOM_CENTER="BOTTOM_CENTER",z.BOTTOM_LEFT="BOTTOM_LEFT",z.CENTER="CENTER",(J=Y||(Y={})).GOOGLE="GOOGLE",J.STANDARD="STANDARD",(Z=X||(X={})).DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",Z.DISMISS="DISMISS",(q=Q||(Q={})).DISMISS="DISMISS",q.NONE="NONE",(te=ee||(ee={})).DEFAULT="DEFAULT",te.PLAINTEXT="PLAINTEXT",(ie=se||(se={})).CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",ie.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",ie.NONE="NONE",(oe=ne||(ne={})).BUBBLE="BUBBLE",oe.END="END",oe.ERROR="ERROR",oe.FLAG="FLAG",(ae=re||(re={})).MANUAL="MANUAL",ae.NONE="NONE",ae.SYNTHETIC="SYNTHETIC",(le=ce||(ce={})).BUBBLE="BUBBLE",le.HIDDEN="HIDDEN",le.MODAL="MODAL",le.TOOLTIP="TOOLTIP",(he=de||(de={})).ABOVE="ABOVE",he.BELOW="BELOW",he.LEFT="LEFT",he.RIGHT="RIGHT",(Ee=ue||(ue={})).CLOSE_FLOW="CLOSE_FLOW",Ee.EVAL_JS="EVAL_JS",Ee.GO_TO_STEP="GO_TO_STEP",Ee.NAVIGATE="NAVIGATE",Ee.SET_ATTRIBUTE="SET_ATTRIBUTE",Ee.SNOOZE="SNOOZE",Ee.START_FLOW="START_FLOW",(Se=Te||(Te={})).NEW_TAB="NEW_TAB",Se.SAME_TAB="SAME_TAB",(we=fe||(fe={})).SET="SET",we.SET_DATETIME="SET_DATETIME",we.SET_DATETIME_ONCE="SET_DATETIME_ONCE",we.SET_ONCE="SET_ONCE",we.ADD="ADD",we.SUBTRACT="SUBTRACT",we.APPEND="APPEND",we.PREPEND="PREPEND",we.REMOVE="REMOVE",we.UNSET="UNSET",(ge=pe||(pe={})).MULTILINE_TEXT="MULTILINE_TEXT",ge.MULTIPLE_CHOICE="MULTIPLE_CHOICE",ge.NPS="NPS",ge.SCALE="SCALE",ge.STARS="STARS",ge.TEXT="TEXT",(Ce=Ie||(Ie={})).ACTION="ACTION",Ce.ANNOUNCEMENTS="ANNOUNCEMENTS",Ce.ASSISTANT="ASSISTANT",Ce.CHECKLIST="CHECKLIST",Ce.CONTACT="CONTACT",Ce.DIVIDER="DIVIDER",Ce.FLOWS="FLOWS",Ce.KNOWLEDGE_BASE="KNOWLEDGE_BASE",Ce.MESSAGE="MESSAGE",Ce.SUBPAGE="SUBPAGE",(ke=me||(me={})).CRISP="CRISP",ke.CUSTOM="CUSTOM",ke.FRESHCHAT="FRESHCHAT",ke.HELPSCOUT="HELPSCOUT",ke.HUBSPOT="HUBSPOT",ke.INTERCOM="INTERCOM",ke.ZENDESK="ZENDESK",ke.ZENDESK_MESSENGER="ZENDESK_MESSENGER",(Ue=Ae||(Ae={})).BUTTON="BUTTON",Ue.INPUT="INPUT",(Re=Le||(Le={})).SILENT="SILENT",Re.BADGE="BADGE",Re.POPOUT="POPOUT",(ve=Ne||(Ne={})).LAUNCHER_CLICK="LAUNCHER_CLICK",ve.LAUNCHER_HOVER="LAUNCHER_HOVER",ve.TARGET_CLICK="TARGET_CLICK",ve.TARGET_HOVER="TARGET_HOVER",ve.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",ve.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",(ye=Oe||(Oe={})).ACTIVATE="ACTIVATE",ye.DEACTIVATE="DEACTIVATE",ye.NEVER="NEVER",(be=_e||(_e={})).AUTO="AUTO",be.TOP="TOP",be.RIGHT="RIGHT",be.BOTTOM="BOTTOM",be.LEFT="LEFT",(Me=De||(De={})).START="START",Me.CENTER="CENTER",Me.END="END",(Be=Fe||(Fe={})).PERCENT="PERCENT",Be.PX="PX",(xe=Pe||(Pe={})).BEACON="BEACON",xe.BUTTON="BUTTON",xe.HIDDEN="HIDDEN",xe.ICON="ICON",(Ge=He||(He={})).LAUNCHER="LAUNCHER",Ge.TARGET="TARGET",($e=We||(We={})).BODY_FIRST="BODY_FIRST",$e.BODY_LAST="BODY_LAST",$e.ELEMENT_FIRST="ELEMENT_FIRST",$e.ELEMENT_LAST="ELEMENT_LAST",$e.ELEMENT_BEFORE="ELEMENT_BEFORE",$e.ELEMENT_AFTER="ELEMENT_AFTER",(Ke=Ve||(Ve={})).START="START",Ke.CENTER="CENTER",Ke.SPACE_BETWEEN="SPACE_BETWEEN",(ze=je||(je={})).NONE="NONE",ze.LIKE="LIKE",ze.SCALE="SCALE",(Je=Ye||(Ye={})).ACTIVE="ACTIVE",Je.COMPLETED="COMPLETED",Je.ENDED="ENDED",Je.NOT_SEEN="NOT_SEEN",(Ze=Xe||(Xe={})).HIGHLIGHT="HIGHLIGHT",Ze.MODAL="MODAL",Ze.HIGHLIGHT_MODAL="HIGHLIGHT_MODAL";const Qe={customInputs:[],customNavigate:null,urlFilter:null,customScrollIntoView:null,scrollPadding:null,inferenceAttributeNames:["data-for","data-id","data-testid","data-test-id","for","id","name","placeholder","role"],inferenceAttributeFilters:{id:[e=>!e.match(/\d$/)],"data-id":[e=>!e.match(/\d$/)]},inferenceClassNameFilters:[e=>!e.startsWith("css-")],baseZIndex:1234500,evalJsDisabled:!1};function qe(e){return Array.isArray(e)||(e=e?[e]:[]),e=e.map((e=>"string"==typeof e?new RegExp(e):e))}function et(e,t){return e.every((e=>"function"==typeof e?e(t):!(e instanceof RegExp)||e.test(t)))}function tt(){let e=d();if(Qe.urlFilter){if(e=Qe.urlFilter(e),"string"!=typeof e)throw new o("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(e)}catch(t){throw new o("Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.\nReturned URL: "+e+"\nError message: "+t.message)}}return e}let st="";try{st=localStorage.getItem("debug")||""}catch(Tt){}const it=st.split(",").some((e=>"*"===e||e.startsWith("userflow:*"))),nt=rt("log");let ot;function rt(e){return function(t,...s){if(it){const i=performance.now(),n=ot?Math.round(i-ot):0;ot=i,console[e](`%cuserflow %c${t} %c+${n}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}nt.group=rt("group"),nt.groupCollapsed=rt("groupCollapsed"),nt.groupEnd=function(){it&&console.groupEnd()};const at=()=>n((()=>import("./ResourceCenterApp.js").then((function(e){return e.R}))),[new URL("ResourceCenterApp.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("flow-host.styl.js",import.meta.url).toString(),new URL("bubble-frame.styl.js",import.meta.url).toString(),new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString(),new URL("stylesheets.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-regular-svg-icons.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-solid-svg-icons.js",import.meta.url).toString(),new URL("vendor.obj-str.js",import.meta.url).toString(),new URL("use-window-resize.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("logomark.js",import.meta.url).toString(),new URL("ChecklistUI.js",import.meta.url).toString(),new URL("BubbleToolbar.js",import.meta.url).toString(),new URL("use-element-rect.js",import.meta.url).toString()]);function ct(e){const t=e.version.checklist.tasks.length;return Math.max(0,t-e.taskCompletions.length)}class lt{constructor(e){this.observers=new Set,this._value=e}get value(){return this._value}update(e){if(e!==this._value){this._value=e;for(const e of this.observers)e()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const dt=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit"],ht=()=>n((()=>import("./BannerApp.js")),[new URL("BannerApp.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("vendor.obj-str.js",import.meta.url).toString(),new URL("stylesheets.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-regular-svg-icons.js",import.meta.url).toString(),new URL("vendor.fortawesome.pro-solid-svg-icons.js",import.meta.url).toString(),new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString(),new URL("bubble-frame.styl.js",import.meta.url).toString(),new URL("flow-host.styl.js",import.meta.url).toString(),new URL("use-selector-element-monitoring.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("use-window-resize.js",import.meta.url).toString(),new URL("use-element-rect.js",import.meta.url).toString(),new URL("vendor.phoenix.js",import.meta.url).toString(),new URL("vendor.uuid.js",import.meta.url).toString()]),ut=import.meta.url;class Et{constructor(){this.clientToken=null,this.externalId=null,this.signature=null,this.groupId=null,this.groupSignature=null,this._socketStatus="disconnected",this.socket=null,this.channel=null,this.featureFlags=new Set,this.logrocketAppId=null,this.debounceInactiveDisconnectTimeout=void 0,this.inBatch=!1,this.endBatchTimeout=void 0,this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=0,this.clientClock=1,this.serverClock=1,this.flowSession=null,this.flowSessionClock=0,this.checklistSession=null,this.checklistExpanded=!1,this.checklistExpandPending=!1,this.checklistSessionClock=0,this.bannerSession=null,this.resourceCenterSession=null,this.resourceCenterOpen=!1,this.resourceCenterLauncherHidden=!1,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.notificationIdCounter=0,this.sessionStorageState=null,this.clientContext=null,this.flushUrlChangeTimeout=void 0,this.onFirstIdentifyRun=!1,this.onFirstIdentifyTimeout=void 0,this.firstIdentifyCallback=null,this.ui=null,this.unackedTasks=new Set,this.clientConditions=new Map,this.trackers=new Map,this.conditionWaitTimers=new Map,this.listeners=new Map,this.targetEnv=null,this.idempotencyKeysSeen=new Set,this.testUserIdentified=!1,this.cspIssueReported=!1,this.uiDisabled=!1,this.audio=null,this.audioReady=!1,this.pageTrackingDisabled=!1,this.refCounter=1,this.onBuilderMessage=e=>(this.handleBuilderMessage(e),!1),this.handleBuilderMessage=async e=>{nt(`builder ${e.kind} message received`,e);const t="idempotencyKey"in e&&"string"==typeof e.idempotencyKey?e.idempotencyKey:null;if(t&&this.idempotencyKeysSeen.has(t))return;const s=()=>{t&&this.idempotencyKeysSeen.add(t)};switch(e.kind){case"userflow:selectElement":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),void this.setSessionStorageState((t=>({...t,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}})));case"userflow:selectElementCancel":return void this.setSessionStorageState((e=>({...e,activeApp:null,elementSelection:null})));case"userflow:startFlowWithToken":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState((e=>({...e,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0}))),c.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),void(e.testStartCondition?this.setSessionStorageState((t=>({...t,activeApp:"startConditionTesting",testStartConditionToken:e.token}))):this.onceIdentified((()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const t=()=>{const s=this.resourceCenterSession;s&&s.draftMode&&s.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",t))};this.on("resourceCenterChanged",t),t()}})));case"userflow:testTracker":return s(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState((e=>({...e,isTargetTab:!0}))),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),void this.setSessionStorageState((t=>({...t,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}})));case"userflow:testTrackerCancel":return void this.setSessionStorageState((e=>({...e,activeApp:null,trackerTesting:null})))}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout((()=>this.flushUrlChange()),50))},this.onUserActivity=()=>this.ensureConnected(),this.remountIfNecessary=()=>{this.ui?.container&&!document.contains(this.ui.container)&&(nt("remounting UI because container was missing"),this.remount())},nt("constructor, build=1004191"),p(this.onUrlChange),this.setTargetEnv(new C),this.checkTestUserAtBoot(),this.toggleUI();for(const e of dt)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){nt("destroy"),this.reset(),g(this.onUrlChange),this.destroyTargetEnv();for(const e of dt)document.removeEventListener(e,this.remountIfNecessary)}setTargetEnv(e){this.destroyTargetEnv(),this.targetEnv=e,e.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new o("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const t=e(this.getSessionStorageState());c.setItem("userflowClientState",JSON.stringify(t)),this.sessionStorageState=t,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const t=c.getItem("userflowClientState");if(t)try{e=JSON.parse(t)}catch(Tt){console.error("Userflow.js: Parse ElementSelectionState error:",Tt)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=e}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(nt("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState((t=>({...t,testUser:e}))),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const t=[this.identify(e.id,{name:e.name,email:e.email,signed_up_at:{set_once:(new Date).toISOString(),data_type:"datetime"}},{signature:e.signature})],{group:s}=e;s&&(this.groupId=s.id,t.push(this.group(s.id,{name:s.name},{signature:s.signature}))),await Promise.all(t)}resetTestUser(){this.setSessionStorageState((e=>({...e,testUser:null})))}init(e){if(nt("init",e),!e)throw new o("userflow.init() was called but missing Userflow.js Token");this.clientToken!==e&&(this.testUserIdentified?nt("init() ignoring new token since a test user has been identified"):(this.clientToken&&(nt("init() resetting due to new client token"),this.reset()),this.clientToken=e))}ensureInit(){if(!this.clientToken)throw new o("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new o("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new o("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId)return;if(this.debounceInactiveDisconnect(),this.socket)return;this._socketStatus="connecting",nt("connecting to socket");let t=Qe.serverEndpoint||"e.userflow.com";"js.getuserflow.com"===new URL(ut).hostname&&"e.userflow.com"===t&&(t="e.getuserflow.com");const s="wss://"+t+"/end-users/"+this.clientToken+"/socket";this.socket=new e(s,{reconnectAfterMs:e=>[100,500,1e3,5e3][e-1]||1e4,timeout:2e4}),this.socket.connect(),this.socket.onOpen((()=>{nt("socket opened")})),this.socket.onClose((()=>{this.emit("private:disconnect")})),this.socket.onError((e=>{console.log("Userflow.js socket error",e),this.reportCspIssue()})),this.channel=this.socket.channel(`end_users:${this.externalId}`,(()=>this.makeChannelJoinPayload())),this.channel.join().receive("ok",(e=>{this.logrocketAppId=e.logrocketAppId,this.featureFlags=new Set(e.featureFlags),nt("channel joined"),"connected"!==this._socketStatus&&(this._socketStatus="connected")})).receive("error",(e=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(e.code)?(console.error(`Userflow.js resetting due to: [${e.code}] ${e.message}`),this.reset(),this.clientToken=null):"invalid_protocol_version"===e.code?(console.error(`Userflow.js destroying due to: [${e.code}] ${e.message}`),this.destroy()):console.log("Userflow.js channel join error",e)})),this.channel.on("server_message",(e=>this.handleServerMessage(e))),this.channel.on("server_error",(e=>{console.log(`Userflow.js server error (${e.code}): ${e.message}`+(e.details&&e.details.length>0?"\nDetails:\n"+e.details.map((e=>(e.path?`${e.path}: `:"")+e.message)):""))}))}makeChannelJoinPayload(){const e=this.buildClientContext();this.clientContext=e;const t={protocolVersion:2,userflowClientBuild:"1004191",signature:this.signature,groupExternalId:this.groupId,groupSignature:this.groupSignature,flowSessionId:this.flowSession?.id||null,checklistSessionId:this.checklistSession?.id||null,bannerSessionId:this.bannerSession?.id||null,resourceCenterSessionId:this.resourceCenterSession?.id||null,launchers:this.launcherSessions.map((e=>({flowId:e.flow.id}))),trackers:Array.from(this.trackers.values()).map((e=>({flowId:e.tracker.flowId}))),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map((e=>({conditionId:e.condition.id,isTrue:e.isTrue}))),previewFlowId:c.getItem("previewFlowId"),clientContext:e};return nt("channel join payload",t),t}disconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.socket&&this.socket.disconnect(),this._socketStatus="disconnected",this.socket=null,this.channel=null}debounceInactiveDisconnect(){window.clearTimeout(this.debounceInactiveDisconnectTimeout),this.debounceInactiveDisconnectTimeout=window.setTimeout((()=>{this.hasDraftSession()||this.assistantMessageInProgress?this.debounceInactiveDisconnect():(nt("disconnecting from socket due to inactivity"),this.disconnect())}),3e5)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.bannerSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some((e=>e.draftMode))}async send(e,{batch:t,endBatch:s,handlesRejection:i}={}){return this.inBatch&&["ToggleClientCondition","UpdateClientContext"].includes(e.kind)||this.checkPushRateLimit(),this.ensureConnected(),t&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),s?this.endBatch():this.endBatchTimeout=window.setTimeout((()=>{this.endBatch()}),50)),this.sendRaw(e,{handlesRejection:i})}async sendRaw(e,{handlesRejection:t}={}){return new Promise(((s,i)=>{if(!this.channel){const s=`Userflow.js: send() should not be called if channel is not set. Message kind=${e.kind}`;if(t)throw Error(s);return void console.log(s,"\nClient message:",e)}nt(`push ${e.kind} message`,e);const n=this.clientClock,r=()=>{this.serverClock=n,this.channel?.off("phx_error",a)},a=this.channel.on("phx_error",(s=>{r();const n=`Userflow.js send ${e.kind} got phx_error`;"connected"===this._socketStatus&&console.log(n,"\nClient message:",e,"\nError:",s),t&&i(new o(n))}));this.channel.push("client_message",e).receive("ok",(e=>{r(),s(e)})).receive("error",(s=>{r();const n=`Userflow.js error reply (${s.code}): ${s.message}`;console.log(n,"\nClient message:",e,"\nError:",s),t&&i(new o(n,s.code,s.message))}))}))}endBatch(){this.inBatch=!1,this.sendRaw({kind:"EndBatch"})}checkPushRateLimit(){const e=Date.now();if(this.pushRateLimitMinuteExpires<e&&(this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=e+6e4),this.pushRateLimitMinute>=100)throw new o("This Userflow.js client has reached a maximum of 100 operations in the last 1 minute. This is usually due to one of the following:\n\n - Excessive calls to Userflow.js. Check if any of userflow.track(), userflow.identify(), userflow.updateUser() or similar are called repeatedly.\n - The URL changing too frequently. Look into https://userflow.com/docs/userflow-js#seturlfilter and filter out the changing part of the URL.\n - The user legitimately being very active, in which case you can just ignore this error.\n \n If in doubt, reach out to us at support@userflow.com.");this.pushRateLimitMinute++}handleServerMessage(e){nt(`received ${e.kind} message`,e);const{serverClock:t,flowSession:s,flowSessionClock:i,checklistSession:n,checklistSessionClock:o,bannerSession:r,resourceCenterSession:a}=this;switch(e.kind){case"CheckSessionsAck":case"ServerDebug":return;case"AddLauncher":{const{session:t}=e,s=this.launcherSessions.findIndex((e=>e.flow.id===t.flow.id));return this.launcherSessions=-1===s?[...this.launcherSessions,t]:[...this.launcherSessions.slice(0,s),t,...this.launcherSessions.slice(s+1)],void this.toggleUI()}case"AddTracker":return void this.addTracker(e.tracker);case"AssistantMessageEventWrapper":return void this.emit("private:assistantMessageEvent",e);case"CancelConditionWaitTimer":return window.clearTimeout(this.conditionWaitTimers.get(e.conditionId)),void this.conditionWaitTimers.delete(e.conditionId);case"ChecklistTaskCompleted":return void this.unackedTasks.add(e.taskCvid);case"ForceGoToStep":return i>t?void nt(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`):void(s?.id===e.sessionId&&this.emit("gotostep",{session:s,step:{id:e.stepId}}));case"RemoveLauncher":return void(this.removeLauncher(e.flowId)&&this.toggleUI());case"RemoveTracker":return void this.removeTracker(e.flowId);case"SetBannerSession":return this.setBannerSession(e.session),void this.toggleUI();case"SetChecklistSession":return void(o<=t||n?.id===e.session.id?(this.setChecklistSession(e.session,t),this.toggleUI()):nt(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${o} > serverClock=${t}`));case"SetFlowSession":return void(i<=t||s?.id===e.session.id?(this.setFlowSession(e.session,t),this.toggleUI()):nt(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`));case"SetResourceCenterSession":return this.setResourceCenterSession(e.session),void this.toggleUI();case"StartConditionWaitTimer":if(!this.conditionWaitTimers.has(e.conditionId)){const t=window.setTimeout((()=>{this.conditionWaitTimers.delete(e.conditionId),this.send({kind:"FireConditionWaitTimer",conditionId:e.conditionId},{batch:!0})}),1e3*parseFloat(e.waitTime));this.conditionWaitTimers.set(e.conditionId,t)}return;case"TestStartConditionSuccess":return void this.emit("private:testStartConditionSuccess");case"TrackClientCondition":return void this.trackClientCondition(e.condition);case"UnsetBannerSession":return void(r?.id===e.sessionId&&(this.setBannerSession(null),this.toggleUI()));case"UnsetChecklistSession":return o>t?void nt(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${o} > serverClock=${t}`):void(n?.id===e.sessionId&&(this.setChecklistSession(null,t),this.toggleUI()));case"UnsetFlowSession":return i>t?void nt(`ignoring ${e.kind} message due to stale clock flowSessionClock=${i} > serverClock=${t}`):void(s?.id===e.sessionId&&(this.setFlowSession(null,t),this.toggleUI()));case"UnsetResourceCenterSession":return void(a?.id===e.sessionId&&(this.setResourceCenterSession(null),this.toggleUI()));case"UntrackClientCondition":return void this.untrackClientCondition(e.conditionId);default:return void console.warn("Userflow.js: Received unknown message",e)}}async identify(e,t={},{signature:s}={}){if(nt("identify",e),this.ensureInit(),this.testUserIdentified&&e!==this.externalId)nt("identify() ignored since a test user has been identified");else{if("number"==typeof e)e=String(e);else if(!e||"string"!=typeof e)throw new o(`userflow.identify: First argument must be a non-empty string representing the user's ID in your database. Value received: ${JSON.stringify(e)}`);this.externalId&&e!==this.externalId&&(nt("identify resetting due to new externalId"),this.reset()),this.externalId=e,this.signature=s||null,this.observeUserActivity(),await Promise.all([this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(t)},{batch:!0}),this.onFirstIdentify()]),this.emit("private:identified")}}async identifyAnonymous(e={},s={}){if(!a.isSupported())throw new o("userflow.identifyAnonymous() is not supported when localStorage access is denied.");const i="anonymousId";let n=a.getItem(i);n||(n="anon-"+t(),a.setItem(i,n)),await this.identify(n,e,s)}async updateUser(e={},t={}){nt("updateUser"),this.ensureIdentified(),await this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(e)},{batch:!0})}async group(e,t={},{signature:s,membership:i}={}){if(nt("group",e),this.ensureIdentified(),this.testUserIdentified&&e!==this.groupId)nt("group() ignored since a test user has been identified");else{if("number"==typeof e)e=String(e);else if(!e||"string"!=typeof e)throw new o(`userflow.group: First argument must be a non-empty string representing the group's ID in your database. Value received: ${JSON.stringify(e)}`);this.groupId=e,this.groupSignature=s||null,await this.send({kind:"UpsertGroup",groupExternalId:e,groupSignature:this.groupSignature,groupAttributes:this.normalizeAttributes(t),membershipAttributes:this.normalizeAttributes(i)},{batch:!0})}}async updateGroup(e={},t={}){nt("updateGroup");const s=this.ensureGroup();await this.send({kind:"UpsertGroup",groupExternalId:s,groupSignature:this.groupSignature,membershipAttributes:this.normalizeAttributes(t.membership),groupAttributes:this.normalizeAttributes(e)},{batch:!0})}normalizeAttributes(e){if(null==e)return{};if("object"!=typeof e)throw new o("Userflow: 'attributes' must be an object.");const t={};for(const s in e){if(!e.hasOwnProperty(s))continue;if("traits"===s){const i=e[s];Object.assign(t,this.extractLegacyTraits(i));continue}let i=e[s];if("string"==typeof i||"number"==typeof i||"boolean"==typeof i||null==i||Array.isArray(i))t[s]=this.normalizeAttributeLiteralOrList(s,i);else{if("object"!=typeof i||null==i)throw new o(`Userflow: Invalid value for '${s}' attribute.`);if("set"in i)t[s]={set:this.normalizeAttributeLiteralOrList(s,i.set),dataType:this.normalizeDataType(s,i.data_type||i.dataType)};else if("set_once"in i||"setOnce"in i)t[s]={setOnce:this.normalizeAttributeLiteralOrList(s,i.set_once??i.setOnce),dataType:this.normalizeDataType(s,i.data_type||i.dataType)};else if("add"in i){const e=i.add;if("string"!=typeof e&&"number"!=typeof e)throw new o(`Userflow: Invalid 'add' value for '${s}' attribute. Must be a number or string.`);t[s]={add:e}}else if("subtract"in i){const e=i.subtract;if("string"!=typeof e&&"number"!=typeof e)throw new o(`Userflow: Invalid 'subtract' value for '${s}' attribute. Must be a number or string.`);t[s]={subtract:e}}else if("append"in i)t[s]={append:this.normalizeAttributeLiteralOrList(s,i.append)};else if("prepend"in i)t[s]={prepend:this.normalizeAttributeLiteralOrList(s,i.prepend)};else{if(!("remove"in i))throw new o(`Userflow: Invalid value for '${s}' attribute.`);t[s]={remove:this.normalizeAttributeLiteralOrList(s,i.remove)}}}}return t}normalizeAttributeLiteralOrList(e,t){return Array.isArray(t)?t.map((t=>this.normalizeAttributeLiteral(e,t))):this.normalizeAttributeLiteral(e,t)}normalizeAttributeLiteral(e,t){if(null==t)return null;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return t;throw new o(`Userflow: Invalid value for '${e}' attribute.`)}normalizeDataType(e,t){if(!t)return null;switch(t){case"string":return O.STRING;case"number":return O.NUMBER;case"boolean":return O.BOOLEAN;case"datetime":return O.DATETIME}throw new o(`Userflow: Invalid data_type for '${e}' attribute.`)}extractLegacyTraits(e){if(!e)return{};if(!Array.isArray(e)){const t=[];for(const s in e)e.hasOwnProperty(s)&&t.push({name:s,value:e[s]});e=t}return e.reduce(((e,{name:t,value:s,dataType:i})=>{if("string"!=typeof t||t.length>100||!t.match(/^[a-z0-9_]+$/))return this.warn("Userflow.identify: Invalid trait name (must be string, no more than 100 characters, and only consist of a-z, 0-9 and underscores). The trait will be ignored. Name was:",t),e;if("string"==typeof s);else if("boolean"==typeof s)i||(i="boolean"),s=s?"true":"false";else{if("number"!=typeof s)return this.warn(`userflow.identify: The value of trait '${t}' is invalid (must be a string, a boolean or a number). The trait will be ignored. Value was:`,s),e;i||(i=Number.isInteger(s)?"integer":"decimal"),s=String(s)}let n=null;if(i)switch(i){case"string":n=O.STRING;break;case"boolean":n=O.BOOLEAN;break;case"integer":case"decimal":n=O.NUMBER;break;case"datetime":n=O.DATETIME;break;default:return this.warn(`userflow.identify: The data type of trait '${t}' is invalid (must be a 'string', 'boolean', 'integer', 'decimal' or 'datetime'). The trait will be ignored. Data type was:`,i),e}return e[t]={set:s,dataType:n},e}),{})}async track(e,t={},{userOnly:s}={}){nt(`track '${e}'`,t),this.ensureIdentified(),await this.send({kind:"TrackEvent",userOnly:!!s,name:e,attributes:this.normalizeEventAttributes(t)},{batch:!0})}normalizeEventAttributes(e){const t=this.normalizeAttributes(e);for(const s in t){if(!t.hasOwnProperty(s))continue;const e=t[s];if(null!=e&&"string"!=typeof e&&"boolean"!=typeof e&&"number"!=typeof e&&!Array.isArray(e)&&!("set"in e))throw new o(`Userflow: Invalid value for '${s}' attribute. Event attributes only support literal values, list values and 'set' changes.`)}return t}onFirstIdentify(){this.onFirstIdentifyRun||(this.onFirstIdentifyRun=!0,this.onFirstIdentifyTimeout=window.setTimeout((()=>{this.trackPageViewed(),this.firstIdentifyCallback?(this.firstIdentifyCallback(),this.firstIdentifyCallback=null):this.checkUrlForStartFlow()}),0))}onceIdentified(e){this.isIdentified()?e():this.firstIdentifyCallback=e}checkUrlForStartFlow(){const e=new URL(d()),t=e.searchParams.get("userflow")||e.searchParams.get("studio1_flow")||e.searchParams.get("studio1_walkthrough");t&&(nt(`url contained flow ${t}`),this.startFlow({flowId:t,startReason:L.LINK,batch:!0}),e.searchParams.delete("userflow"),e.searchParams.delete("studio1_flow"),e.searchParams.delete("studio1_walkthrough"),window.history.replaceState({},"",e.toString()),this.clientContext=this.buildClientContext(),this.pushUpdateClientContext())}flushUrlChange(){const e=this.buildClientContext();this.clientContext&&e.pageUrl===this.clientContext.pageUrl||(this.clientContext=e,this.pushUpdateClientContext(),this.trackPageViewed(),this.checkUrlForStartFlow())}async trackPageViewed(){this.pageTrackingDisabled||this.track("page_viewed",{})}buildClientContext(){return{pageUrl:tt(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight}}pushUpdateClientContext(){this.send({kind:"UpdateClientContext",clientContext:this.clientContext},{batch:!0})}ackCompletedTask(e){this.unackedTasks.delete(e)}taskIsUnacked(e){return this.unackedTasks.has(e)}isIdentified(){return null!=this.externalId}on(e,t){let s=this.listeners.get(e);s||(s=new Set,this.listeners.set(e,s)),s.add(t)}off(e,t){const s=this.listeners.get(e);s&&s.delete(t)}emit(e,...t){const s=this.listeners.get(e);if(s){Array.from(s).forEach((e=>e(...t)))}}observeUserActivity(){document.addEventListener("mouseover",this.onUserActivity),document.addEventListener("pointerdown",this.onUserActivity),document.addEventListener("keydown",this.onUserActivity)}unobserveUserActivity(){document.removeEventListener("mouseover",this.onUserActivity),document.removeEventListener("pointerdown",this.onUserActivity),document.removeEventListener("keydown",this.onUserActivity)}reset(){nt("reset"),this.externalId=null,this.groupId=null,this.sessionStorageState=null,this.setFlowSession(null,0),this.setChecklistSession(null,0),this.setBannerSession(null),this.setResourceCenterSession(null),this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.unackedTasks=new Set,this.onFirstIdentifyRun=!1,window.clearTimeout(this.onFirstIdentifyTimeout),this.onFirstIdentifyTimeout=void 0,this.clientContext=null,this.unobserveUserActivity(),window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=void 0,this.clientConditions.forEach(((e,t)=>{this.untrackClientCondition(t)})),this.firstIdentifyCallback=null,this.testUserIdentified=!1,a.removeItem("anonymousId"),this.unmountUI(),this.disconnect(),this.inBatch=!1,window.clearTimeout(this.endBatchTimeout),this.endBatchTimeout=void 0,this.clientClock=1,this.serverClock=1,this.titleMonitored=void 0,this.titleObserver&&(this.titleObserver.disconnect(),this.titleObserver=void 0)}async startFlow({flowId:e,stepCvid:t,startReason:s,once:i,batch:n,replaceCurrent:o}){if(this.ensureIdentified(),o&&this.flowSession&&this.endFlow(this.flowSession,{endReason:m.REPLACED,batch:!0}),nt(`startFlow ${e}`,{startReason:s}),this.checklistSession?.flow.id===e)return nt("startFlow matches current checklist, so showing it instead"),void this.showChecklist();const r={kind:"StartFlow",flowId:e,stepCvid:t,startReason:s,once:!!i};await this.send(r,{batch:n})}async startFlowWithToken(e){this.ensureIdentified(),nt("startFlowWithToken",{token:e}),await this.send({kind:"StartFlowWithToken",token:e},{batch:!0})}optimisticClockUIUpdate(e){this.clientClock++,e(),this.toggleUI()}async showChecklist(){this.resourceCenterEmbedsChecklist()?this.openResourceCenter():(this.unmarkExpandPending(),this.checklistSession&&!this.checklistExpanded&&(this.ensureIdentified(),this.checklistExpanded=!0,this.toggleUI(),c.setItem(`checklistExpanded:${this.checklistSession.id}`,"1"),await this.send({kind:"ShowChecklist",sessionId:this.checklistSession.id},{batch:!0})))}async hideChecklist(){this.resourceCenterEmbedsChecklist()?this.closeResourceCenter():this.checklistSession&&this.checklistExpanded&&(this.ensureIdentified(),this.checklistExpanded=!1,this.toggleUI(),c.removeItem(`checklistExpanded:${this.checklistSession.id}`),await this.send({kind:"HideChecklist",sessionId:this.checklistSession.id},{batch:!0}))}async unmarkExpandPending(){this.checklistSession&&this.checklistExpandPending&&(this.checklistExpandPending=!1,await this.send({kind:"UnmarkExpandPending",sessionId:this.checklistSession.id},{batch:!0}))}async openResourceCenter(){this.resourceCenterEmbedsChecklist()&&this.unmarkExpandPending(),this.resourceCenterSession&&!this.resourceCenterOpen&&(this.ensureIdentified(),this.resourceCenterOpen=!0,this.toggleUI(),this.emit("resourceCenterChanged"),c.setItem(`resourceCenterOpen:${this.resourceCenterSession.id}`,"1"),await this.send({kind:"OpenResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}async closeResourceCenter(){this.resourceCenterSession&&this.resourceCenterOpen&&(this.ensureIdentified(),this.resourceCenterOpen=!1,this.toggleUI(),this.emit("resourceCenterChanged"),c.removeItem(`resourceCenterOpen:${this.resourceCenterSession.id}`),await this.send({kind:"CloseResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}toggleResourceCenter(){this.resourceCenterOpen?this.closeResourceCenter():this.openResourceCenter()}setResourceCenterLauncherHidden(e){this.resourceCenterLauncherHidden=e,this.toggleUI()}getResourceCenterState(){if(!this.resourceCenterSession)return null;const e=this.resourceCenterEmbedsChecklist(),{checklistSession:t}=this,s=this.resourceCenterSession.version.resourceCenter?.blocks.find((e=>e.type===Ie.ANNOUNCEMENTS));return{isOpen:this.resourceCenterOpen,hasChecklist:e,uncompletedChecklistTaskCount:e&&t?ct(t):0,unreadAnnouncementCount:s?.unreadAnnouncementCount||0}}resourceCenterEmbedsChecklist(){const e=this.resourceCenterSession;return!!e&&!!e.version.resourceCenter?.blocks.some((e=>e.type===Ie.CHECKLIST))}async endFlow(e,{endReason:t,batch:s}){this.ensureIdentified(),this.optimisticClockUIUpdate((()=>{const{clientClock:t}=this;this.flowSession?.id===e.id&&this.setFlowSession(null,t),this.checklistSession?.id===e.id&&this.setChecklistSession(null,t),this.bannerSession?.id===e.id&&this.setBannerSession(null),this.resourceCenterSession?.id===e.id&&this.setResourceCenterSession(null)}));const{flow:i}=e,n={id:i.id,type:i.type.toLowerCase()};i.type===_.CHECKLIST?this.emit("checklistEnded",{checklist:n,endReason:t}):i.type===_.FLOW&&this.emit("flowEnded",{flow:n,endReason:t});const o={kind:"EndFlow",sessionId:e.id,endReason:t};await this.send(o,{batch:s})}async goToStep(e,t){nt("goToStep",e.id,t.name||t.id),this.ensureIdentified();const s=this.send({kind:"GoToStep",sessionId:e.id,stepId:t.id});e.currentStep=t,this.emit("gotostep",{session:e,step:t}),await s}async endAllFlows(){nt("endAllFlows"),this.optimisticClockUIUpdate((()=>{const{clientClock:e}=this;this.setFlowSession(null,e),this.setChecklistSession(null,e)})),await this.send({kind:"EndAllFlows"})}async endChecklist(){nt("endChecklist");const e=this.checklistSession||this.flowSession;e?.flow.type===_.CHECKLIST&&this.endFlow(e,{endReason:m.USERFLOWJS})}setFlowSession(e,t=this.clientClock){const s=this.flowSession;this.flowSession=e,this.flowSessionClock=t,e&&!s&&(this.hideChecklist(),this.closeResourceCenter()),null==e&&this.originalActiveElement&&("function"==typeof this.originalActiveElement.focus&&this.originalActiveElement.focus(),this.originalActiveElement=void 0)}setChecklistSession(e,t=this.clientClock){const s=this.checklistSession;this.checklistSession=e,this.checklistSessionClock=t,null===e&&(this.checklistExpanded=!1,this.checklistExpandPending=!1),e&&e.id!==s?.id&&(this.checklistExpanded=!!c.getItem(`checklistExpanded:${e.id}`),e.expandPending&&(this.checklistExpandPending=!0)),this.emit("checklistChanged"),this.emit("resourceCenterChanged")}setBannerSession(e){this.bannerSession=e}setResourceCenterSession(e){const t=this.resourceCenterSession;e="function"==typeof e?e(this.resourceCenterSession):e,this.resourceCenterSession=e,null===e&&(this.resourceCenterOpen=!1),t&&t.id!==e?.id&&c.removeItem(`resourceCenterOpen:${t.id}`),e&&e.id!==t?.id&&(this.resourceCenterOpen=!!c.getItem(`resourceCenterOpen:${e.id}`)),this.emit("resourceCenterChanged")}launcherSeen(e){this.send({kind:"StartFlow",flowId:e,startReason:L.LAUNCHER_SEEN,once:!1})}activateLauncher(e){const t=this.activeLauncherFlowId&&this.launcherSessions.find((e=>e.flow.id===this.activeLauncherFlowId));t&&this.deactivateLauncher(t),this.activeLauncherFlowId=e.flow.id,this.toggleUI(),this.send({kind:"ActivateLauncher",flowId:e.flow.id})}deactivateLauncher(e){const{launcher:t}=e.version;e.flow.id===this.activeLauncherFlowId&&(t?.dismissOn===Oe.DEACTIVATE?this.dismissLauncher(e,{endReason:m.LAUNCHER_DEACTIVATED}):(this.activeLauncherFlowId=null,this.toggleUI()))}dismissLauncher(e,{endReason:t}){const s=e.flow.id;this.removeLauncher(s),this.toggleUI(),this.send({kind:"DismissLauncher",flowId:s,endReason:t})}removeLauncher(e){const t=this.launcherSessions.findIndex((t=>t.flow.id===e));return-1!==t&&(this.launcherSessions=[...this.launcherSessions.slice(0,t),...this.launcherSessions.slice(t+1)],e===this.activeLauncherFlowId&&(this.activeLauncherFlowId=null),!0)}async toggleUI(){const e=this.getSessionStorageState();this.flowSession||!this.checklistExpandPending&&!this.checklistSession?.version.checklist?.tasks.some((e=>this.taskIsUnacked(e.cvid)))||this.showChecklist(),e.isTargetTab&&this.monitorTitle(),this.emit("uistatechange"),this.shouldBeMounted()?await this.mountUI():this.unmountUI()}shouldBeMounted(){if(this.uiDisabled)return!1;return!!this.getSessionStorageState().activeApp||!!this.flowSession||!!this.checklistSession&&(this.checklistExpanded||!!this.checklistSession?.version.checklist?.launcherEnabled)||!!this.bannerSession||!!this.resourceCenterSession&&(this.resourceCenterOpen||!this.resourceCenterLauncherHidden)||this.launcherSessions.length>0||this.notifications.length>0}async mountUI(){if(!this.ui){const e=await this.createUI();this.shouldBeMounted()&&!this.ui&&(nt("mount UI"),this.ui=e,this.ui.mount())}}unmountUI(){this.ui&&(nt("unmount UI"),this.ui.unmount(),this.ui=null)}remount(){this.unmountUI(),this.toggleUI()}async createUI(){try{const e=n((()=>import("./ui.js")),[new URL("ui.js",import.meta.url).toString(),new URL("vendor.react.js",import.meta.url).toString(),new URL("vendor.object-assign.js",import.meta.url).toString(),new URL("vendor.react-dom.js",import.meta.url).toString(),new URL("vendor.scheduler.js",import.meta.url).toString(),new URL("client-context.js",import.meta.url).toString(),new URL("vendor.i18next.js",import.meta.url).toString(),new URL("vendor.react-i18next.js",import.meta.url).toString(),new URL("vendor.babel.runtime.js",import.meta.url).toString(),new URL("vendor.phoenix.js",import.meta.url).toString(),new URL("vendor.uuid.js",import.meta.url).toString()]);this.bannerSession&&ht(),this.resourceCenterSession&&at();const{RealUI:t}=await e;return new t(this)}catch(Tt){throw this.reportCspIssue(),Tt}}async trackClientCondition(e){if(this.clientConditions.has(e.id))return;nt("track client condition",e),this.clientConditions.set(e.id,{condition:e,isTrue:null});const{conditionTypes:t}=await n((()=>import("./flow-condition-types.js").then((function(e){return e.v}))),[new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString()]),s=t[e.type],i=this.clientConditions.get(e.id);i&&(i.untrack=s.track({sessionData:new lt([]),condition:e,callback:t=>{i.isTrue!==t&&(nt("client condition truthiness changed",t,i.condition),i.isTrue=t,this.send({kind:"ToggleClientCondition",conditionId:e.id,isTrue:t},{batch:!0}))}}))}untrackClientCondition(e){const t=this.clientConditions.get(e);t&&(nt("untrack client condition",t.condition),t.untrack&&t.untrack(),this.clientConditions.delete(e))}async addTracker(e){let t=this.trackers.get(e.flowId);t?t.tracker=e:this.trackers.set(e.flowId,{tracker:e,isTrue:!1});const{conditionTypes:s}=await n((()=>import("./flow-condition-types.js").then((function(e){return e.v}))),[new URL("flow-condition-types.js",import.meta.url).toString(),new URL("vendor.date-fns.js",import.meta.url).toString()]),i=this.trackers.get(e.flowId);if(!i)return;const{tracker:o}=i,{condition:r}=o,a=s[r.type];i.untrack&&i.untrack(),i.untrack=a.track({sessionData:new lt(o.data),condition:r,flipBackEvents:!0,callback:e=>{const t=i.isTrue;i.isTrue=e,!t&&e&&this.send({kind:"TrackTrackerEvent",token:o.token},{batch:!0})},description:`event tracker ${o.flowId}`}),this.emit("private:trackerStarted")}removeTracker(e){const t=this.trackers.get(e);t&&(t.untrack&&t.untrack(),this.trackers.delete(e),this.emit("private:trackerStopped"))}monitorTitle(){if(this.titleMonitored)return;this.titleMonitored=!0,this.fixTitle();const e=document.querySelector("title");if(e){const t=new MutationObserver((()=>{this.fixTitle()}));t.observe(e,{childList:!0}),this.titleObserver=t}}fixTitle(){const e=document.title,t="[Userflow Preview] "+e.replace(/\[Userflow Preview\] /,"");e!==t&&(document.title=t)}reportCspIssue(){const e=this.getSessionStorageState();!this.testUserIdentified&&!e.activeApp||this.cspIssueReported||(this.cspIssueReported=!0,nt("csp issue detected"),T({kind:"userflow:crxCspIssueDetected"}))}getAudio(){return this.audio||(this.audio=new Audio),this.audio}playAudio(e){if(document.hidden)return;const t=this.getAudio();e&&(t.src=e);const s=t.play();this.audioReady=!0,s&&s.catch((e=>{e.name}))}pauseAudio(){const e=this.audio;e&&!e.paused&&e.pause()}async getStepSpeech(e,t){return(await this.send({kind:"GetStepSpeechV2",syntheticVoice:e,text:t})).url}featureFlagEnabled(e){return this.featureFlags.has(e)}showNotification(e,t,s){const i={id:++this.notificationIdCounter,label:e,message:t,type:s};this.notifications=[...this.notifications,i],this.toggleUI()}dismissNotification(e){this.notifications=this.notifications.filter((t=>t.id!==e)),this.toggleUI()}warn(...e){console.warn(...e)}nextRef(){return this.refCounter++}}if(void 0===window.userflow||window.userflow._stubbed){const e=Object.assign(window.userflow||{},function(){const e=new Et;return{_stubbed:!1,init(t){e.init(t)},identify:(t,s={},i={})=>e.identify(t,s,i),identifyAnonymous:(t={},s={})=>e.identifyAnonymous(t,s),isIdentified:()=>e.isIdentified(),updateUser:(t,s={})=>e.updateUser(t,s),group:(t,s={},i={})=>e.group(t,s,i),updateGroup:(t,s={})=>e.updateGroup(t,s),track:(t,s={},i={})=>e.track(t,s,i),start:(t,{once:s}={})=>e.startFlow({flowId:t,startReason:L.USERFLOWJS,once:s}),startFlow:e=>(console.warn("Userflow.js: userflow.startFlow() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)),startWalk:e=>(console.warn("Userflow.js: userflow.startWalk() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)),endAll:()=>e.endAllFlows(),endChecklist:()=>e.endChecklist(),endAllFlows:()=>window.userflow.endAll(),async endFlow(){console.warn("Userflow.js: userflow.endFlow() has been deprecated and no longer has any effect.")},async endWalk(){console.warn("Userflow.js: userflow.endWalk() has been deprecated and no longer has any effect.")},openResourceCenter(){e.openResourceCenter()},closeResourceCenter(){e.closeResourceCenter()},toggleResourceCenter(){e.toggleResourceCenter()},setResourceCenterLauncherHidden(t){e.setResourceCenterLauncherHidden(t)},getResourceCenterState:()=>e.getResourceCenterState(),setWalkPosition(){console.warn("Userflow.js: userflow.setWalkPosition() has been deprecated and no longer has any effect.")},reset(){e.reset()},remount(){e.remount()},on(t,s){e.on(t,s)},off(t,s){e.off(t,s)},setCustomInputSelector(e){console.warn("Userflow.js: userflow.setCustomInputSelector() has been deprecated. Use userflow.registerCustomInput() instead. See docs: https://userflow.com/docs/userflow-js"),e&&Qe.customInputs.push({cssSelector:e})},registerCustomInput(e,t){Qe.customInputs.push({cssSelector:e,getValue:t})},setCustomNavigate(e){Qe.customNavigate=e},setUrlFilter(e){Qe.urlFilter=e},setInferenceAttributeNames(e){Qe.inferenceAttributeNames=e},setInferenceAttributeFilter(e,t){Qe.inferenceAttributeFilters[e]=qe(t)},setInferenceClassNameFilter(e){Qe.inferenceClassNameFilters=qe(e)},setScrollPadding(e){Qe.scrollPadding=e},setCustomScrollIntoView(e){Qe.customScrollIntoView=e},prepareAudio(){e.playAudio(null)},setShadowDomEnabled(e){console.warn("Userflow.js: userflow.setShadowDomEnabled() has been deprecated. Please remove this call from your Userflow.js snippet. Shadow DOM is supported by default now.")},setPageTrackingDisabled(t){e.pageTrackingDisabled=t},setBaseZIndex(e){Qe.baseZIndex=e},setServerEndpoint(e){Qe.serverEndpoint=e},disableEvalJs(){Qe.evalJsDisabled=!0},_setTargetEnv(t){e.setTargetEnv(t)}}}());window.userflow=e,window.studio1=e,function(){const e=window.userflow,t=window.USERFLOWJS_QUEUE;if(delete window.USERFLOWJS_QUEUE,!t||0===t.length)return;nt(`processing ${t.length} items in the queue`);for(const[s,i,n]of t){if("function"!=typeof e[s]){console.error(`Userflow.js: Invalid method '${s}' in queue`);continue}const t=e[s](...n);i&&t&&"function"==typeof t.then&&t.then(i.resolve,i.reject)}nt("queue processed")}()}export{N as $,Le as A,ht as B,me as C,Y as D,m as E,P as F,a as G,We as H,X as I,ne as J,ce as K,j as L,Q as M,de as N,Pe as O,Ne as P,_e as Q,at as R,L as S,dt as T,o as U,re as V,He as W,De as X,Fe as Y,je as Z,n as _,B as a,F as b,Qe as c,nt as d,D as e,H as f,tt as g,Ie as h,c as i,ct as j,se as k,ee as l,ue as m,Ae as n,p as o,_ as p,d as q,Te as r,l as s,et as t,g as u,fe as v,pe as w,lt as x,V as y,W as z};export default window.userflow;
|