userflow.js-self-hosted 0.1.1008940 → 0.1.1008964
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/BannerApp.js +1 -1
- package/BubbleToolbar.js +1 -1
- package/BuilderBar.js +1 -1
- package/ChecklistApp.js +1 -1
- package/ChecklistUI.js +1 -1
- package/ElementSelectionApp.js +1 -1
- package/FlowApp.js +1 -1
- package/FlowChrome.js +1 -1
- package/LauncherApp.js +1 -1
- package/NotificationsApp.js +1 -1
- package/ResourceCenterApp.js +2 -2
- package/ResourceCenterAssistantChat.js +1 -1
- package/StartConditionTestingApp.js +1 -1
- package/TrackerTestingApp.js +1 -1
- package/Trigger.js +1 -1
- package/bubble-frame.styl.js +2 -2
- package/client-context.js +1 -1
- package/flow-condition-types.js +1 -1
- package/flow-host.styl.js +1 -1
- package/hash.txt +1 -1
- package/package.json +1 -1
- package/stylesheets.js +1 -1
- package/ui.js +2 -2
- package/use-element-rect.js +1 -1
- package/use-selector-element-monitoring.js +1 -1
- package/use-window-resize.js +1 -1
- package/userflow.js +4 -4
- package/vendor.core-js.js +2 -0
- package/vendor.html-parse-stringify2.js +1 -1
- package/vendor.is-hotkey.js +1 -1
- package/vendor.object-assign.js +2 -2
- package/vendor.react-dom.js +1 -1
- package/vendor.react-i18next.js +1 -1
- package/vendor.react.js +2 -2
- package/vendor.scheduler.js +2 -2
- package/vendor.void-elements.js +1 -1
package/stylesheets.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as p,R as y}from"./vendor.react.js";import{o as R,p as $,k as P,i as D,q as z,h as U,r as q,s as O,t as _,u as j,v as N,w as K,j as V,x as G,y as Y,z as Q,A as X,B as J,C as Z}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{c as oo,d as ro,e as no,g as to,h as eo,i as lo,j as ao,k as uo,l as co,m as io}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.html-parse-stringify2.js";import{J as so,y as fo,p as go,c as Co,K as H}from"./userflow.js";import{s as Bo}from"./flow-condition-types.js";import{a as bo}from"./client-context.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="c469a5fd-5181-404a-a507-3397f016699c",o._sentryDebugIdIdentifier="sentry-dbid-c469a5fd-5181-404a-a507-3397f016699c")}catch{}})();function po(o){const[n]=p.useState(()=>new so(o));return n.update(o),n}const Ro=({icon:o,size:n})=>{n=n||16;const t=typeof o=="string"&&A[o]?A[o]:o;if(typeof t=="string")return y.createElement("img",{"aria-hidden":"true",src:t,width:n,height:n,style:{objectFit:"contain"}});{const e=t.icon[0],l=t.icon[1],a=t.icon[4];return y.createElement("svg",{"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:`0 0 ${e} ${l}`},y.createElement("path",{fill:"currentColor",d:String(a)}))}},A={"regular/calendar-day":R,"regular/comment-alt":$,"regular/comments-alt":P,"regular/envelope":D,"regular/exclamation-triangle":z,"regular/external-link":U,"regular/file-alt":q,"regular/graduation-cap":O,"regular/info-circle":_,"regular/lightbulb":j,"regular/megaphone":N,"regular/pencil":K,"regular/phone":V,"regular/play-circle":G,"regular/question-circle":Y,"regular/shoe-prints":Q,"solid/shoe-prints":oo,"solid/file-invoice":ro,"solid/receipt":no,"solid/university":to,"solid/users":eo,"solid/stars":lo,"regular/tasks":X,"regular/user":J,"regular/users":Z,"solid/exclamation-triangle":ao,"solid/info-circle":uo,"solid/play-circle":co,"solid/question-circle":io};function ko(o,n,t){if(!o.document.fonts)return t(),()=>{};let e=!1,l;const a=()=>{const u=o.document.fonts.load(`100px ${n}`,"BESbswy");if(!u){c(),t();return}u.then(r=>{e||(r.length>=1?(c(),t()):window.setTimeout(a,25))},r=>{console.log("Userflow.js: observeFont error:"),console.log(r),t()})};a();const i=window.setTimeout(()=>{console.warn(`Userflow.js: Timed out waiting for font family ${n} to load. Will continue anyway.`),t()},2e3),c=()=>{e=!0,window.clearTimeout(l),window.clearTimeout(i)};return c}function k(o){return o?o.match(/^#[0-9a-f]{6}$/i)?[parseInt(o.substring(1,3),16),parseInt(o.substring(3,5),16),parseInt(o.substring(5,7),16)]:o.match(/^#[0-9a-f]{3}$/i)?[parseInt(o.substring(1,2).repeat(2),16),parseInt(o.substring(2,3).repeat(2),16),parseInt(o.substring(3,4).repeat(2),16)]:[0,0,0]:[0,0,0]}function v([o,n,t]){return"#"+o.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+t.toString(16).padStart(2,"0")}function b(o){const n=k(o);return n?n.join(", "):"0, 0, 0"}function x(o){return v(k(o))}function wo([o,n,t]){return[Math.round(255-o),Math.round(255-n),Math.round(255-t)]}function F(o,n,t){return[Math.max(0,Math.min(255,Math.round(o[0]+(n[0]-o[0])*t))),Math.max(0,Math.min(255,Math.round(o[1]+(n[1]-o[1])*t))),Math.max(0,Math.min(255,Math.round(o[2]+(n[2]-o[2])*t)))]}function h(o,n,t){const e=k(o),l=k(n);return!e||!l?o:v(F(e,l,t))}function S([o,n,t]){o/=255,n/=255,t/=255;const e=Math.max(o,n,t),l=Math.min(o,n,t);let a,i,c=(e+l)/2;if(e==l)a=i=0;else{const u=e-l;switch(i=c>.5?u/(2-e-l):u/(e+l),e){case o:a=(n-t)/u+(n<t?6:0);break;case n:a=(t-o)/u+2;break;default:a=(o-n)/u+4;break}a/=6}return[a,i,c]}function m([o,n,t]){let e=o/255,l=n/255,a=t/255;function i(r){let s=0;return r<=.04045?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),s}let c=.2126*i(e)+.7152*i(l)+.0722*i(a);function u(r){let s=0;return r<=216/24389?s=r*(24389/27):s=Math.pow(r,1/3)*116-16,s}return Math.round(u(c)*10)/1e3}function L(o,n){const t=m(o),e=m(n),l=.05;let c=(1-(e-t))/2*(.18-l)+l,u=1-Math.abs(e-t),r=Math.pow((1-c)*u,4),s=c+r;return Math.round(s*1e3)/1e3}function w(o,n){const t=k(o),e=S(t);let l=null,a=null;for(const f of n){const d=k(f),g=S(d);let C=!1;!l||!a?C=!0:Math.abs(g[2]-e[2])>.3?g[1]>a[1]&&(C=!0):Math.abs(e[2]-g[2])>Math.abs(e[2]-a[2])&&(C=!0),C&&(l=d,a=g)}let i=l,c=l,u=L(i,t),r=u*2;const s=.2;return e[2]>s&&e[2]<1-s&&(c=wo(c),r=L(c,t)),[v(F(t,i,u)),v(F(t,c,r))]}function ho(o,n,t,e){const[l,a]=w(o,[n]);let i,c;if(o===t)i=l,c=a;else{const B=w(t,[o,n,e]);i=B[0],c=B[1]}const u=k(o),r=k(t),s=20;let f,d,g,C;if(Math.abs(u[0]-r[0])<s&&Math.abs(u[1]-r[1])<s&&Math.abs(u[2]-r[2])<s){f=n,d=o;const B=w(f,[d]);g=B[0],C=B[1]}else f=o,d=n,g=l,C=a;return[l,a,i,c,f,d,g,C]}function vo(o){const[n,t,e,l,a,i,c,u]=ho(o.brandBackgroundColor,o.brandForegroundColor,o.mainBackgroundColor,o.mainForegroundColor),r={...o,widgetBackgroundColor:a,widgetForegroundColor:i,widgetHoverBackgroundColor:c,widgetActiveBackgroundColor:u,sameBackground:x(o.mainBackgroundColor)==x(o.brandBackgroundColor)};r.brandHoverBackgroundColor&&(r.widgetHoverBackgroundColor=r.brandHoverBackgroundColor),r.brandActiveBackgroundColor&&(r.widgetActiveBackgroundColor=r.brandActiveBackgroundColor),r.brandHoverBackgroundColor||(r.brandHoverBackgroundColor=n),r.brandActiveBackgroundColor||(r.brandActiveBackgroundColor=t),r.mainHoverBackgroundColor||(r.mainHoverBackgroundColor=e),r.mainActiveBackgroundColor||(r.mainActiveBackgroundColor=l),r.bannerBackgroundColor||(r.bannerBackgroundColor=r.brandBackgroundColor),r.bannerForegroundColor||(r.bannerForegroundColor=r.brandForegroundColor);const[s,f]=w(r.bannerBackgroundColor,[r.bannerForegroundColor]);r.bannerHoverBackgroundColor=s,r.bannerActiveBackgroundColor=f;const[d,g]=w(r.bannerForegroundColor,[r.bannerBackgroundColor]);if(r.bannerHoverForegroundColor=d,r.bannerActiveForegroundColor=g,r.bubbleBorderColor||(r.bubbleBorderColor=r.mainForegroundColor),r.checklistLauncherActiveBackgroundColor||(r.checklistLauncherActiveBackgroundColor=r.brandActiveBackgroundColor),r.checklistLauncherBackgroundColor||(r.checklistLauncherBackgroundColor=r.brandBackgroundColor),r.checklistLauncherCounterBackgroundColor||(r.checklistLauncherCounterBackgroundColor=r.brandForegroundColor),r.checklistLauncherCounterFontColor||(r.checklistLauncherCounterFontColor=r.brandBackgroundColor),r.checklistLauncherFontColor||(r.checklistLauncherFontColor=r.brandForegroundColor),r.checklistLauncherHoverBackgroundColor||(r.checklistLauncherHoverBackgroundColor=r.brandHoverBackgroundColor),r.focusColor||(r.focusColor=r.mainActiveBackgroundColor),r.launcherIconActiveColor||(r.launcherIconActiveColor=r.brandActiveBackgroundColor),r.launcherIconColor||(r.launcherIconColor=r.brandBackgroundColor),r.launcherIconHoverColor||(r.launcherIconHoverColor=r.brandHoverBackgroundColor),r.linkColor||(r.linkColor=r.widgetBackgroundColor),r.progressBarColor||(r.progressBarColor=r.widgetBackgroundColor),r.questionColor||(r.questionColor=r.widgetBackgroundColor),r.toolbarForegroundColor||(r.toolbarForegroundColor=r.mainForegroundColor),r.primaryButtonBackgroundColor||(r.primaryButtonBackgroundColor=r.widgetBackgroundColor),r.primaryButtonFontColor||(r.primaryButtonFontColor=r.widgetForegroundColor),r.primaryButtonHoverFontColor||(r.primaryButtonHoverFontColor=r.primaryButtonFontColor),r.primaryButtonActiveFontColor||(r.primaryButtonActiveFontColor=r.primaryButtonFontColor),!r.primaryButtonHoverBackgroundColor||!r.primaryButtonActiveBackgroundColor){const[C,B]=w(r.primaryButtonBackgroundColor,[r.primaryButtonFontColor]);r.primaryButtonHoverBackgroundColor||(r.primaryButtonHoverBackgroundColor=C),r.primaryButtonActiveBackgroundColor||(r.primaryButtonActiveBackgroundColor=B)}if(r.primaryButtonBorderColor||(r.primaryButtonBorderColor=r.widgetBackgroundColor),r.primaryButtonHoverBorderColor||(r.primaryButtonHoverBorderColor=r.primaryButtonHoverBackgroundColor),r.primaryButtonActiveBorderColor||(r.primaryButtonActiveBorderColor=r.primaryButtonActiveBackgroundColor),r.defaultButtonBackgroundColor||(r.defaultButtonBackgroundColor=r.mainBackgroundColor),r.defaultButtonFontColor||(r.defaultButtonFontColor=a),r.defaultButtonHoverFontColor||(r.defaultButtonHoverFontColor=r.defaultButtonFontColor),r.defaultButtonActiveFontColor||(r.defaultButtonActiveFontColor=r.defaultButtonFontColor),!r.defaultButtonHoverBackgroundColor||!r.defaultButtonActiveBackgroundColor){const[C,B]=w(r.defaultButtonBackgroundColor,[r.defaultButtonFontColor]);r.defaultButtonHoverBackgroundColor||(r.defaultButtonHoverBackgroundColor=C),r.defaultButtonActiveBackgroundColor||(r.defaultButtonActiveBackgroundColor=B)}return r.defaultButtonBorderColor||(r.defaultButtonBorderColor=r.defaultButtonFontColor),r.defaultButtonHoverBorderColor||(r.defaultButtonHoverBorderColor=r.defaultButtonBorderColor),r.defaultButtonActiveBorderColor||(r.defaultButtonActiveBorderColor=r.defaultButtonBorderColor),r.launcherButtonBackgroundColor||(r.launcherButtonBackgroundColor=r.brandBackgroundColor),r.launcherButtonBorderColor||(r.launcherButtonBorderColor=r.brandBackgroundColor),r.launcherButtonFontColor||(r.launcherButtonFontColor=r.brandForegroundColor),r.launcherButtonHoverBackgroundColor||(r.launcherButtonHoverBackgroundColor=r.brandHoverBackgroundColor),r.launcherButtonHoverBorderColor||(r.launcherButtonHoverBorderColor=r.launcherButtonHoverBackgroundColor),r.launcherButtonHoverFontColor||(r.launcherButtonHoverFontColor=r.launcherButtonFontColor),r.launcherButtonActiveBackgroundColor||(r.launcherButtonActiveBackgroundColor=r.brandActiveBackgroundColor),r.launcherButtonActiveBorderColor||(r.launcherButtonActiveBorderColor=r.launcherButtonActiveBackgroundColor),r.launcherButtonActiveFontColor||(r.launcherButtonActiveFontColor=r.launcherButtonFontColor),r}function yo(o){const{questionColor:n}=o;return{"--userflow-backdrop-highlight-color-rgb":b(o.backdropHighlightColor),"--userflow-backdrop-highlight-inset":o.backdropHighlightType===fo.INSIDE?"inset":"","--userflow-backdrop-highlight-opacity":o.backdropHighlightOpacity,"--userflow-backdrop-highlight-radius":o.backdropHighlightRadius+"px","--userflow-backdrop-highlight-spread":o.backdropHighlightSpread+"px","--userflow-backdrop-opacity":o.backdropOpacity,"--userflow-banner-background-color":o.bannerBackgroundColor,"--userflow-banner-hover-background-color":o.bannerHoverBackgroundColor,"--userflow-banner-active-background-color":o.bannerActiveBackgroundColor,"--userflow-banner-foreground-color":o.bannerForegroundColor,"--userflow-banner-hover-foreground-color":o.bannerHoverForegroundColor,"--userflow-banner-active-foreground-color":o.bannerActiveForegroundColor,"--userflow-beacon-color":o.beaconColor,"--userflow-beacon-size":o.beaconSize+"px","--userflow-brand-active-background-color":o.brandActiveBackgroundColor,"--userflow-brand-background-color":o.brandBackgroundColor,"--userflow-brand-foreground-color":o.brandForegroundColor,"--userflow-brand-foreground-color-rgb":b(o.brandForegroundColor),"--userflow-brand-hover-background-color":o.brandHoverBackgroundColor,"--userflow-bubble-border-color":o.bubbleBorderColor,"--userflow-bubble-border-radius":o.bubbleBorderRadius+"px","--userflow-bubble-border-width":o.bubbleBorderWidth+"px","--userflow-button-border-radius":o.buttonBorderRadius+"px","--userflow-button-height":o.buttonHeight+"px","--userflow-button-min-width":o.buttonMinWidth+"px","--userflow-button-text-align":o.buttonMinWidth===0?"start":"center","--userflow-buttons-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="right"?"end":"center","--userflow-buttons-bubble-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="center"?"center":"end","--userflow-checklist-launcher-active-background-color":o.checklistLauncherActiveBackgroundColor,"--userflow-checklist-launcher-background-color":o.checklistLauncherBackgroundColor,"--userflow-checklist-launcher-border-radius":o.checklistLauncherBorderRadius+"px","--userflow-checklist-launcher-counter-background-color":o.checklistLauncherCounterBackgroundColor,"--userflow-checklist-launcher-counter-font-color":o.checklistLauncherCounterFontColor,"--userflow-checklist-launcher-font-color-rgb":b(o.checklistLauncherFontColor),"--userflow-checklist-launcher-font-color":o.checklistLauncherFontColor,"--userflow-checklist-launcher-font-weight":String(o.checklistLauncherFontWeight),"--userflow-checklist-launcher-height":o.checklistLauncherHeight+"px","--userflow-checklist-launcher-hover-background-color":o.checklistLauncherHoverBackgroundColor,"--userflow-checkmark-background-color":o.checkmarkBackgroundColor,"--userflow-completed-task-text-decoration":o.completedTaskTextDecoration,"--userflow-default-button-active-background-color":o.defaultButtonActiveBackgroundColor,"--userflow-default-button-active-border-color":o.defaultButtonActiveBorderColor,"--userflow-default-button-active-font-color":o.defaultButtonActiveFontColor,"--userflow-default-button-background-color":o.defaultButtonBackgroundColor,"--userflow-default-button-border-color":o.defaultButtonBorderColor,"--userflow-default-button-border-width":o.defaultButtonBorderWidth+"px","--userflow-default-button-font-color":o.defaultButtonFontColor,"--userflow-default-button-font-weight":String(o.defaultButtonFontWeight),"--userflow-default-button-hover-background-color":o.defaultButtonHoverBackgroundColor,"--userflow-default-button-hover-border-color":o.defaultButtonHoverBorderColor,"--userflow-default-button-hover-font-color":o.defaultButtonHoverFontColor,"--userflow-focus-color":`rgba(${b(o.focusColor)}, ${o.focusOpacity})`,"--userflow-font-family":o.builtinFontFamily?o.builtinFontFamily.name+(o.builtinFontFamily.fallback?", "+o.builtinFontFamily.fallback:""):o.fontFamily?o.fontFamily:"sans-serif","--userflow-font-size":o.fontSize+"px","--userflow-font-weight-bold":String(o.fontWeightBold),"--userflow-font-weight-normal":String(o.fontWeightNormal),"--userflow-h1-font-size":o.h1FontSize+"px","--userflow-h2-font-size":o.h2FontSize+"px","--userflow-launcher-button-active-background-color":o.launcherButtonActiveBackgroundColor,"--userflow-launcher-button-active-border-color":o.launcherButtonActiveBorderColor,"--userflow-launcher-button-active-font-color":o.launcherButtonActiveFontColor,"--userflow-launcher-button-background-color":o.launcherButtonBackgroundColor,"--userflow-launcher-button-border-color":o.launcherButtonBorderColor,"--userflow-launcher-button-border-radius":o.launcherButtonBorderRadius+"px","--userflow-launcher-button-border-width":o.launcherButtonBorderWidth+"px","--userflow-launcher-button-font-color":o.launcherButtonFontColor,"--userflow-launcher-button-font-weight":String(o.launcherButtonFontWeight),"--userflow-launcher-button-height":o.launcherButtonHeight+"px","--userflow-launcher-button-horizontal-padding":o.launcherButtonHorizontalPadding+"px","--userflow-launcher-button-hover-background-color":o.launcherButtonHoverBackgroundColor,"--userflow-launcher-button-hover-border-color":o.launcherButtonHoverBorderColor,"--userflow-launcher-button-hover-font-color":o.launcherButtonHoverFontColor,"--userflow-launcher-button-width":o.launcherButtonWidth?o.launcherButtonWidth+"px":"auto","--userflow-launcher-icon-active-color":o.launcherIconActiveColor,"--userflow-launcher-icon-color":o.launcherIconColor,"--userflow-launcher-icon-hover-color":o.launcherIconHoverColor,"--userflow-launcher-icon-opacity":o.launcherIconOpacity,"--userflow-launcher-icon-size":o.launcherIconSize+"px","--userflow-line-height":o.lineHeight+"px","--userflow-link-color":o.linkColor,"--userflow-main-active-background-color":o.mainActiveBackgroundColor,"--userflow-main-background-color":o.mainBackgroundColor,"--userflow-main-background-color-rgb":b(o.mainBackgroundColor),"--userflow-main-foreground-color":o.mainForegroundColor,"--userflow-main-foreground-color-rgb":b(o.mainForegroundColor),"--userflow-main-hover-background-color":o.mainHoverBackgroundColor,"--userflow-modal-padding":o.modalPadding+"px","--userflow-modal-padding-top":(o.avatarType===go.NONE?o.modalPadding:o.modalPadding+Math.max((o.avatarSize-o.modalPadding)/2,0))+"px","--userflow-backdrop-color-rgb":b(o.backdropColor),"--userflow-notch-color":o.bubbleBorderWidth>0&&o.bubbleBorderColor||o.mainBackgroundColor,"--userflow-primary-button-active-background-color":o.primaryButtonActiveBackgroundColor,"--userflow-primary-button-active-border-color":o.primaryButtonActiveBorderColor,"--userflow-primary-button-active-font-color":o.primaryButtonActiveFontColor,"--userflow-primary-button-background-color":o.primaryButtonBackgroundColor,"--userflow-primary-button-border-color":o.primaryButtonBorderColor,"--userflow-primary-button-border-width":o.primaryButtonBorderWidth+"px","--userflow-primary-button-font-color":o.primaryButtonFontColor,"--userflow-primary-button-font-weight":String(o.primaryButtonFontWeight),"--userflow-primary-button-hover-background-color":o.primaryButtonHoverBackgroundColor,"--userflow-primary-button-hover-border-color":o.primaryButtonHoverBorderColor,"--userflow-primary-button-hover-font-color":o.primaryButtonHoverFontColor,"--userflow-progress-bar-color":o.progressBarColor,"--userflow-progress-bar-height":o.progressBarHeight+"px","--userflow-narrow-progress-bar-height":o.narrowBarHeight+"px","--userflow-squared-progress-bar-height":o.squaredBarHeight+"px","--userflow-rounded-progress-bar-height":o.roundedBarHeight+"px","--userflow-dotted-progress-bar-height":o.dottedBarHeight+"px","--userflow-numbered-progress-bar-height":o.numberedBarFontSize+"px","--userflow-resource-center-collapsed-height":o.resourceCenterCollapsedHeight+"px","--userflow-resource-center-launcher-icon-img-size":o.rcIconSize+"px","--userflow-resource-center-full-width":o.resourceCenterFullWidth+"px","--userflow-resource-center-launcher-border-radius":(o.resourceCenterLauncherBorderRadius!=null?Math.min(o.resourceCenterLauncherBorderRadius,o.resourceCenterCollapsedHeight/2):o.resourceCenterCollapsedHeight/2)+"px","--userflow-resource-center-padding-x":o.resourceCenterPaddingX+"px","--userflow-resource-center-padding-y":o.resourceCenterPaddingY+"px","--userflow-resource-center-transition-duration":o.resourceCenterTransitionDuration+"ms","--userflow-resource-center-width":o.resourceCenterWidth+"px","--userflow-question-color-light":h(n,o.mainBackgroundColor,.5),"--userflow-question-color-lighter":h(n,o.mainBackgroundColor,.75),"--userflow-question-color-lightest":h(n,o.mainBackgroundColor,.9),"--userflow-question-color-medium-light":h(n,o.mainBackgroundColor,.15),"--userflow-question-color":n,"--userflow-toolbar-foreground-color":o.toolbarForegroundColor,"--userflow-toolbar-foreground-color-rgb":b(o.toolbarForegroundColor),"--userflow-tooltip-notch-size":o.tooltipNotchSize+"px","--userflow-unread-badge-background-color":o.unreadBadgeBackgroundColor,"--userflow-unread-badge-foreground-color":o.unreadBadgeForegroundColor,"--userflow-widget-active-background-color":o.widgetActiveBackgroundColor,"--userflow-widget-background-color":o.widgetBackgroundColor,"--userflow-widget-foreground-color":o.widgetForegroundColor,"--userflow-widget-hover-background-color":o.widgetHoverBackgroundColor}}const Fo=[];function $o(o){let[n,t]=p.useState(o);const e=po(o.sessionData||Fo);return p.useLayoutEffect(()=>{const{variations:l}=o;if(!l)return;const a=[],i=[],c=()=>{let u=o,r=!1;for(const[s,f]of l.entries())if(a[s]){r||(r=!0,u={...u});for(const d of f.overriddenKeys)u[d]=f[d]}t(u)};for(const[u,r]of l.entries()){a[u]=!1;const{condition:s}=r;if(s&&r.overriddenKeys&&r.overriddenKeys.length>0){const d=Bo[s.type].track({sessionData:e,condition:s,callback:g=>{a[u]=g,c()}});i[u]=d}else i[u]=()=>{}}return c(),()=>{for(const u of i)u()}},[o,e]),p.useMemo(()=>vo(n),[n])}function Po(o){const n=Co.serverEndpoint||"cdn.userflow.com";return o?.cssVersion?`https://${n}/themes/${o.id}/stylesheets/${o.cssVersion}/custom.css`:null}const M=new Map;function E(o){let n=M.get(o);return n||(n={stylesheets:new Map},M.set(o,n)),n}function Do(o,n,t,{uninstallOnUnmount:e}={}){const l=bo(),[a,i]=p.useState(!n);return p.useLayoutEffect(()=>{if(!o||!n)return;let c=!1,u;const r=async d=>{await W(l,o,d),u&&I(o,u),u=d};(async()=>{let d=typeof n=="string"?n:n.get();if(Ho()&&t){let g=await Ao(d);if(c)return;g=xo(g,yo(t)),d="data:text/css;base64,"+btoa(g)}await r(d),!c&&i(!0)})();let f=null;return typeof n!="string"&&(f=n.onUpdate(async()=>{r(n.get())})),()=>{c=!0,f&&f(),e&&u&&I(o,u)}},[l,o,n,t,e]),{loaded:a}}function Ho(){return!!window.MSInputMethodContext&&!!document.documentMode}const T=new Map;function Ao(o){return new Promise((n,t)=>{let e=T.get(o);if(e){n(e);return}const l=new XMLHttpRequest;l.addEventListener("load",()=>{if(l.status!==200){t(new Error("Userflow.js could not fetch stylesheet: "+o));return}const a=l.responseText;T.set(o,a),n(a)}),l.addEventListener("error",()=>{t(new Error("Userflow.js could not fetch stylesheet: "+o))}),l.open("GET",o),l.send()})}function xo(o,n){for(const t in n)if(n.hasOwnProperty(t)){const e=n[t];e&&(o=o.replace(new RegExp(`var\\(${t}.*?\\)`,"g"),e))}return o=o.replace(/var\(--[a-z0-9-]+(,\s*(.*?))?\)/g,"$2"),o}function zo(o,n){const t=n&&So(n),e=t?.url,l=t?.fontFamily,[a,i]=p.useState(!e||!l);return p.useLayoutEffect(()=>{if(!o||!e||!l)return;let c=!1;return W(null,o,e),ko(o,l,()=>{c||i(!0)}),()=>{c=!0}},[o,e,l]),{loaded:a}}function W(o,n,t){const e=E(n),l=e.stylesheets.get(t);if(l)return l.loadPromise;const a=n.document.createElement("link"),i=new Promise((c,u)=>{a.dataset.userflowStylesheet="true",a.rel="stylesheet",a.href=t,a.onload=()=>{c()},a.onerror=r=>{console.log(`Userflow.js: Error installing Stylesheet ${t}:`,r),o&&o.reportCspIssue(),u()},n.document.head.appendChild(a)});return e.stylesheets.set(t,{link:a,loadPromise:i}),i}function I(o,n){const t=E(o),e=t.stylesheets.get(n);e&&(o.document.head.removeChild(e.link),t.stylesheets.delete(n))}function So(o){if(o.builtinFontFamily)switch(o.builtinFontFamily.provider){case H.GOOGLE:{const n=Array.from(new Set(["0,400","1,400",`0,${o.fontWeightBold}`,`0,${o.defaultButtonFontWeight}`,`0,${o.primaryButtonFontWeight}`,`0,${o.checklistLauncherFontWeight}`,`0,${o.launcherButtonFontWeight}`])).sort().join(";");return{url:`https://fonts.googleapis.com/css2?family=${encodeURIComponent(o.builtinFontFamily.name)}:ital,wght@${n}`,fontFamily:o.builtinFontFamily.name}}case H.STANDARD:return null}else return o.fontCssUrl?{url:o.fontCssUrl,fontFamily:o.fontFamily}:null}export{Ro as D,Do as a,zo as b,po as c,Po as d,yo as g,$o as u};
|
|
1
|
+
import{r as p,R as y}from"./vendor.react.js";import{o as R,p as $,k as P,i as D,q as z,h as U,r as q,s as O,t as _,u as j,v as N,w as K,j as V,x as G,y as Y,z as Q,A as X,B as J,C as Z}from"./vendor.fortawesome.pro-regular-svg-icons.js";import{c as oo,d as ro,e as no,g as to,h as eo,i as lo,j as ao,k as uo,l as co,m as io}from"./vendor.fortawesome.pro-solid-svg-icons.js";import"./vendor.core-js.js";import{J as so,y as fo,p as go,c as bo,K as H}from"./userflow.js";import{s as Co}from"./flow-condition-types.js";import{a as Bo}from"./client-context.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[n]="7ba269a5-11cf-4d0a-aab5-75e5f977668a",o._sentryDebugIdIdentifier="sentry-dbid-7ba269a5-11cf-4d0a-aab5-75e5f977668a")}catch{}})();function po(o){const[n]=p.useState(()=>new so(o));return n.update(o),n}const Ro=({icon:o,size:n})=>{n=n||16;const t=typeof o=="string"&&A[o]?A[o]:o;if(typeof t=="string")return y.createElement("img",{"aria-hidden":"true",src:t,width:n,height:n,style:{objectFit:"contain"}});{const e=t.icon[0],l=t.icon[1],a=t.icon[4];return y.createElement("svg",{"aria-hidden":"true",role:"img",xmlns:"http://www.w3.org/2000/svg",width:n,height:n,viewBox:`0 0 ${e} ${l}`},y.createElement("path",{fill:"currentColor",d:String(a)}))}},A={"regular/calendar-day":R,"regular/comment-alt":$,"regular/comments-alt":P,"regular/envelope":D,"regular/exclamation-triangle":z,"regular/external-link":U,"regular/file-alt":q,"regular/graduation-cap":O,"regular/info-circle":_,"regular/lightbulb":j,"regular/megaphone":N,"regular/pencil":K,"regular/phone":V,"regular/play-circle":G,"regular/question-circle":Y,"regular/shoe-prints":Q,"solid/shoe-prints":oo,"solid/file-invoice":ro,"solid/receipt":no,"solid/university":to,"solid/users":eo,"solid/stars":lo,"regular/tasks":X,"regular/user":J,"regular/users":Z,"solid/exclamation-triangle":ao,"solid/info-circle":uo,"solid/play-circle":co,"solid/question-circle":io};function ko(o,n,t){if(!o.document.fonts)return t(),()=>{};let e=!1;const l=()=>{const c=o.document.fonts.load(`100px ${n}`,"BESbswy");if(!c){i(),t();return}c.then(u=>{e||(u.length>=1?(i(),t()):window.setTimeout(l,25))},u=>{console.log("Userflow.js: observeFont error:"),console.log(u),t()})};l();const a=window.setTimeout(()=>{console.warn(`Userflow.js: Timed out waiting for font family ${n} to load. Will continue anyway.`),t()},2e3),i=()=>{e=!0,window.clearTimeout(a)};return i}function k(o){return o?o.match(/^#[0-9a-f]{6}$/i)?[parseInt(o.substring(1,3),16),parseInt(o.substring(3,5),16),parseInt(o.substring(5,7),16)]:o.match(/^#[0-9a-f]{3}$/i)?[parseInt(o.substring(1,2).repeat(2),16),parseInt(o.substring(2,3).repeat(2),16),parseInt(o.substring(3,4).repeat(2),16)]:[0,0,0]:[0,0,0]}function v([o,n,t]){return"#"+o.toString(16).padStart(2,"0")+n.toString(16).padStart(2,"0")+t.toString(16).padStart(2,"0")}function B(o){const n=k(o);return n?n.join(", "):"0, 0, 0"}function x(o){return v(k(o))}function wo([o,n,t]){return[Math.round(255-o),Math.round(255-n),Math.round(255-t)]}function F(o,n,t){return[Math.max(0,Math.min(255,Math.round(o[0]+(n[0]-o[0])*t))),Math.max(0,Math.min(255,Math.round(o[1]+(n[1]-o[1])*t))),Math.max(0,Math.min(255,Math.round(o[2]+(n[2]-o[2])*t)))]}function h(o,n,t){const e=k(o),l=k(n);return!e||!l?o:v(F(e,l,t))}function S([o,n,t]){o/=255,n/=255,t/=255;const e=Math.max(o,n,t),l=Math.min(o,n,t);let a,i,c=(e+l)/2;if(e==l)a=i=0;else{const u=e-l;switch(i=c>.5?u/(2-e-l):u/(e+l),e){case o:a=(n-t)/u+(n<t?6:0);break;case n:a=(t-o)/u+2;break;default:a=(o-n)/u+4;break}a/=6}return[a,i,c]}function m([o,n,t]){let e=o/255,l=n/255,a=t/255;function i(r){let s=0;return r<=.04045?s=r/12.92:s=Math.pow((r+.055)/1.055,2.4),s}let c=.2126*i(e)+.7152*i(l)+.0722*i(a);function u(r){let s=0;return r<=216/24389?s=r*(24389/27):s=Math.pow(r,1/3)*116-16,s}return Math.round(u(c)*10)/1e3}function L(o,n){const t=m(o),e=m(n),l=.05;let c=(1-(e-t))/2*(.18-l)+l,u=1-Math.abs(e-t),r=Math.pow((1-c)*u,4),s=c+r;return Math.round(s*1e3)/1e3}function w(o,n){const t=k(o),e=S(t);let l=null,a=null;for(const g of n){const d=k(g),f=S(d);let b=!1;!l||!a?b=!0:Math.abs(f[2]-e[2])>.3?f[1]>a[1]&&(b=!0):Math.abs(e[2]-f[2])>Math.abs(e[2]-a[2])&&(b=!0),b&&(l=d,a=f)}let i=l,c=l,u=L(i,t),r=u*2;const s=.2;return e[2]>s&&e[2]<1-s&&(c=wo(c),r=L(c,t)),[v(F(t,i,u)),v(F(t,c,r))]}function ho(o,n,t,e){const[l,a]=w(o,[n]);let i,c;if(o===t)i=l,c=a;else{const C=w(t,[o,n,e]);i=C[0],c=C[1]}const u=k(o),r=k(t),s=20;let g,d,f,b;if(Math.abs(u[0]-r[0])<s&&Math.abs(u[1]-r[1])<s&&Math.abs(u[2]-r[2])<s){g=n,d=o;const C=w(g,[d]);f=C[0],b=C[1]}else g=o,d=n,f=l,b=a;return[l,a,i,c,g,d,f,b]}function vo(o){const[n,t,e,l,a,i,c,u]=ho(o.brandBackgroundColor,o.brandForegroundColor,o.mainBackgroundColor,o.mainForegroundColor),r={...o,widgetBackgroundColor:a,widgetForegroundColor:i,widgetHoverBackgroundColor:c,widgetActiveBackgroundColor:u,sameBackground:x(o.mainBackgroundColor)==x(o.brandBackgroundColor)};r.brandHoverBackgroundColor&&(r.widgetHoverBackgroundColor=r.brandHoverBackgroundColor),r.brandActiveBackgroundColor&&(r.widgetActiveBackgroundColor=r.brandActiveBackgroundColor),r.brandHoverBackgroundColor||(r.brandHoverBackgroundColor=n),r.brandActiveBackgroundColor||(r.brandActiveBackgroundColor=t),r.mainHoverBackgroundColor||(r.mainHoverBackgroundColor=e),r.mainActiveBackgroundColor||(r.mainActiveBackgroundColor=l),r.bannerBackgroundColor||(r.bannerBackgroundColor=r.brandBackgroundColor),r.bannerForegroundColor||(r.bannerForegroundColor=r.brandForegroundColor);const[s,g]=w(r.bannerBackgroundColor,[r.bannerForegroundColor]);r.bannerHoverBackgroundColor=s,r.bannerActiveBackgroundColor=g;const[d,f]=w(r.bannerForegroundColor,[r.bannerBackgroundColor]);if(r.bannerHoverForegroundColor=d,r.bannerActiveForegroundColor=f,r.bubbleBorderColor||(r.bubbleBorderColor=r.mainForegroundColor),r.checklistLauncherActiveBackgroundColor||(r.checklistLauncherActiveBackgroundColor=r.brandActiveBackgroundColor),r.checklistLauncherBackgroundColor||(r.checklistLauncherBackgroundColor=r.brandBackgroundColor),r.checklistLauncherCounterBackgroundColor||(r.checklistLauncherCounterBackgroundColor=r.brandForegroundColor),r.checklistLauncherCounterFontColor||(r.checklistLauncherCounterFontColor=r.brandBackgroundColor),r.checklistLauncherFontColor||(r.checklistLauncherFontColor=r.brandForegroundColor),r.checklistLauncherHoverBackgroundColor||(r.checklistLauncherHoverBackgroundColor=r.brandHoverBackgroundColor),r.focusColor||(r.focusColor=r.mainActiveBackgroundColor),r.launcherIconActiveColor||(r.launcherIconActiveColor=r.brandActiveBackgroundColor),r.launcherIconColor||(r.launcherIconColor=r.brandBackgroundColor),r.launcherIconHoverColor||(r.launcherIconHoverColor=r.brandHoverBackgroundColor),r.linkColor||(r.linkColor=r.widgetBackgroundColor),r.progressBarColor||(r.progressBarColor=r.widgetBackgroundColor),r.questionColor||(r.questionColor=r.widgetBackgroundColor),r.toolbarForegroundColor||(r.toolbarForegroundColor=r.mainForegroundColor),r.primaryButtonBackgroundColor||(r.primaryButtonBackgroundColor=r.widgetBackgroundColor),r.primaryButtonFontColor||(r.primaryButtonFontColor=r.widgetForegroundColor),r.primaryButtonHoverFontColor||(r.primaryButtonHoverFontColor=r.primaryButtonFontColor),r.primaryButtonActiveFontColor||(r.primaryButtonActiveFontColor=r.primaryButtonFontColor),!r.primaryButtonHoverBackgroundColor||!r.primaryButtonActiveBackgroundColor){const[b,C]=w(r.primaryButtonBackgroundColor,[r.primaryButtonFontColor]);r.primaryButtonHoverBackgroundColor||(r.primaryButtonHoverBackgroundColor=b),r.primaryButtonActiveBackgroundColor||(r.primaryButtonActiveBackgroundColor=C)}if(r.primaryButtonBorderColor||(r.primaryButtonBorderColor=r.widgetBackgroundColor),r.primaryButtonHoverBorderColor||(r.primaryButtonHoverBorderColor=r.primaryButtonHoverBackgroundColor),r.primaryButtonActiveBorderColor||(r.primaryButtonActiveBorderColor=r.primaryButtonActiveBackgroundColor),r.defaultButtonBackgroundColor||(r.defaultButtonBackgroundColor=r.mainBackgroundColor),r.defaultButtonFontColor||(r.defaultButtonFontColor=a),r.defaultButtonHoverFontColor||(r.defaultButtonHoverFontColor=r.defaultButtonFontColor),r.defaultButtonActiveFontColor||(r.defaultButtonActiveFontColor=r.defaultButtonFontColor),!r.defaultButtonHoverBackgroundColor||!r.defaultButtonActiveBackgroundColor){const[b,C]=w(r.defaultButtonBackgroundColor,[r.defaultButtonFontColor]);r.defaultButtonHoverBackgroundColor||(r.defaultButtonHoverBackgroundColor=b),r.defaultButtonActiveBackgroundColor||(r.defaultButtonActiveBackgroundColor=C)}return r.defaultButtonBorderColor||(r.defaultButtonBorderColor=r.defaultButtonFontColor),r.defaultButtonHoverBorderColor||(r.defaultButtonHoverBorderColor=r.defaultButtonBorderColor),r.defaultButtonActiveBorderColor||(r.defaultButtonActiveBorderColor=r.defaultButtonBorderColor),r.launcherButtonBackgroundColor||(r.launcherButtonBackgroundColor=r.brandBackgroundColor),r.launcherButtonBorderColor||(r.launcherButtonBorderColor=r.brandBackgroundColor),r.launcherButtonFontColor||(r.launcherButtonFontColor=r.brandForegroundColor),r.launcherButtonHoverBackgroundColor||(r.launcherButtonHoverBackgroundColor=r.brandHoverBackgroundColor),r.launcherButtonHoverBorderColor||(r.launcherButtonHoverBorderColor=r.launcherButtonHoverBackgroundColor),r.launcherButtonHoverFontColor||(r.launcherButtonHoverFontColor=r.launcherButtonFontColor),r.launcherButtonActiveBackgroundColor||(r.launcherButtonActiveBackgroundColor=r.brandActiveBackgroundColor),r.launcherButtonActiveBorderColor||(r.launcherButtonActiveBorderColor=r.launcherButtonActiveBackgroundColor),r.launcherButtonActiveFontColor||(r.launcherButtonActiveFontColor=r.launcherButtonFontColor),r}function yo(o){const{questionColor:n}=o;return{"--userflow-backdrop-highlight-color-rgb":B(o.backdropHighlightColor),"--userflow-backdrop-highlight-inset":o.backdropHighlightType===fo.INSIDE?"inset":"","--userflow-backdrop-highlight-opacity":o.backdropHighlightOpacity,"--userflow-backdrop-highlight-radius":o.backdropHighlightRadius+"px","--userflow-backdrop-highlight-spread":o.backdropHighlightSpread+"px","--userflow-backdrop-opacity":o.backdropOpacity,"--userflow-banner-background-color":o.bannerBackgroundColor,"--userflow-banner-hover-background-color":o.bannerHoverBackgroundColor,"--userflow-banner-active-background-color":o.bannerActiveBackgroundColor,"--userflow-banner-foreground-color":o.bannerForegroundColor,"--userflow-banner-hover-foreground-color":o.bannerHoverForegroundColor,"--userflow-banner-active-foreground-color":o.bannerActiveForegroundColor,"--userflow-beacon-color":o.beaconColor,"--userflow-beacon-size":o.beaconSize+"px","--userflow-brand-active-background-color":o.brandActiveBackgroundColor,"--userflow-brand-background-color":o.brandBackgroundColor,"--userflow-brand-foreground-color":o.brandForegroundColor,"--userflow-brand-foreground-color-rgb":B(o.brandForegroundColor),"--userflow-brand-hover-background-color":o.brandHoverBackgroundColor,"--userflow-bubble-border-color":o.bubbleBorderColor,"--userflow-bubble-border-radius":o.bubbleBorderRadius+"px","--userflow-bubble-border-width":o.bubbleBorderWidth+"px","--userflow-button-border-radius":o.buttonBorderRadius+"px","--userflow-button-height":o.buttonHeight+"px","--userflow-button-min-width":o.buttonMinWidth+"px","--userflow-button-text-align":o.buttonMinWidth===0?"start":"center","--userflow-buttons-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="right"?"end":"center","--userflow-buttons-bubble-justify-content":o.buttonHorizontalAlign==="left"?"start":o.buttonHorizontalAlign==="center"?"center":"end","--userflow-checklist-launcher-active-background-color":o.checklistLauncherActiveBackgroundColor,"--userflow-checklist-launcher-background-color":o.checklistLauncherBackgroundColor,"--userflow-checklist-launcher-border-radius":o.checklistLauncherBorderRadius+"px","--userflow-checklist-launcher-counter-background-color":o.checklistLauncherCounterBackgroundColor,"--userflow-checklist-launcher-counter-font-color":o.checklistLauncherCounterFontColor,"--userflow-checklist-launcher-font-color-rgb":B(o.checklistLauncherFontColor),"--userflow-checklist-launcher-font-color":o.checklistLauncherFontColor,"--userflow-checklist-launcher-font-weight":String(o.checklistLauncherFontWeight),"--userflow-checklist-launcher-height":o.checklistLauncherHeight+"px","--userflow-checklist-launcher-hover-background-color":o.checklistLauncherHoverBackgroundColor,"--userflow-checkmark-background-color":o.checkmarkBackgroundColor,"--userflow-completed-task-text-decoration":o.completedTaskTextDecoration,"--userflow-default-button-active-background-color":o.defaultButtonActiveBackgroundColor,"--userflow-default-button-active-border-color":o.defaultButtonActiveBorderColor,"--userflow-default-button-active-font-color":o.defaultButtonActiveFontColor,"--userflow-default-button-background-color":o.defaultButtonBackgroundColor,"--userflow-default-button-border-color":o.defaultButtonBorderColor,"--userflow-default-button-border-width":o.defaultButtonBorderWidth+"px","--userflow-default-button-font-color":o.defaultButtonFontColor,"--userflow-default-button-font-weight":String(o.defaultButtonFontWeight),"--userflow-default-button-hover-background-color":o.defaultButtonHoverBackgroundColor,"--userflow-default-button-hover-border-color":o.defaultButtonHoverBorderColor,"--userflow-default-button-hover-font-color":o.defaultButtonHoverFontColor,"--userflow-focus-color":`rgba(${B(o.focusColor)}, ${o.focusOpacity})`,"--userflow-font-family":o.builtinFontFamily?o.builtinFontFamily.name+(o.builtinFontFamily.fallback?", "+o.builtinFontFamily.fallback:""):o.fontFamily?o.fontFamily:"sans-serif","--userflow-font-size":o.fontSize+"px","--userflow-font-weight-bold":String(o.fontWeightBold),"--userflow-font-weight-normal":String(o.fontWeightNormal),"--userflow-h1-font-size":o.h1FontSize+"px","--userflow-h2-font-size":o.h2FontSize+"px","--userflow-launcher-button-active-background-color":o.launcherButtonActiveBackgroundColor,"--userflow-launcher-button-active-border-color":o.launcherButtonActiveBorderColor,"--userflow-launcher-button-active-font-color":o.launcherButtonActiveFontColor,"--userflow-launcher-button-background-color":o.launcherButtonBackgroundColor,"--userflow-launcher-button-border-color":o.launcherButtonBorderColor,"--userflow-launcher-button-border-radius":o.launcherButtonBorderRadius+"px","--userflow-launcher-button-border-width":o.launcherButtonBorderWidth+"px","--userflow-launcher-button-font-color":o.launcherButtonFontColor,"--userflow-launcher-button-font-weight":String(o.launcherButtonFontWeight),"--userflow-launcher-button-height":o.launcherButtonHeight+"px","--userflow-launcher-button-horizontal-padding":o.launcherButtonHorizontalPadding+"px","--userflow-launcher-button-hover-background-color":o.launcherButtonHoverBackgroundColor,"--userflow-launcher-button-hover-border-color":o.launcherButtonHoverBorderColor,"--userflow-launcher-button-hover-font-color":o.launcherButtonHoverFontColor,"--userflow-launcher-button-width":o.launcherButtonWidth?o.launcherButtonWidth+"px":"auto","--userflow-launcher-icon-active-color":o.launcherIconActiveColor,"--userflow-launcher-icon-color":o.launcherIconColor,"--userflow-launcher-icon-hover-color":o.launcherIconHoverColor,"--userflow-launcher-icon-opacity":o.launcherIconOpacity,"--userflow-launcher-icon-size":o.launcherIconSize+"px","--userflow-line-height":o.lineHeight+"px","--userflow-link-color":o.linkColor,"--userflow-main-active-background-color":o.mainActiveBackgroundColor,"--userflow-main-background-color":o.mainBackgroundColor,"--userflow-main-background-color-rgb":B(o.mainBackgroundColor),"--userflow-main-foreground-color":o.mainForegroundColor,"--userflow-main-foreground-color-rgb":B(o.mainForegroundColor),"--userflow-main-hover-background-color":o.mainHoverBackgroundColor,"--userflow-modal-padding":o.modalPadding+"px","--userflow-modal-padding-top":(o.avatarType===go.NONE?o.modalPadding:o.modalPadding+Math.max((o.avatarSize-o.modalPadding)/2,0))+"px","--userflow-backdrop-color-rgb":B(o.backdropColor),"--userflow-notch-color":o.bubbleBorderWidth>0&&o.bubbleBorderColor||o.mainBackgroundColor,"--userflow-primary-button-active-background-color":o.primaryButtonActiveBackgroundColor,"--userflow-primary-button-active-border-color":o.primaryButtonActiveBorderColor,"--userflow-primary-button-active-font-color":o.primaryButtonActiveFontColor,"--userflow-primary-button-background-color":o.primaryButtonBackgroundColor,"--userflow-primary-button-border-color":o.primaryButtonBorderColor,"--userflow-primary-button-border-width":o.primaryButtonBorderWidth+"px","--userflow-primary-button-font-color":o.primaryButtonFontColor,"--userflow-primary-button-font-weight":String(o.primaryButtonFontWeight),"--userflow-primary-button-hover-background-color":o.primaryButtonHoverBackgroundColor,"--userflow-primary-button-hover-border-color":o.primaryButtonHoverBorderColor,"--userflow-primary-button-hover-font-color":o.primaryButtonHoverFontColor,"--userflow-progress-bar-color":o.progressBarColor,"--userflow-progress-bar-height":o.progressBarHeight+"px","--userflow-narrow-progress-bar-height":o.narrowBarHeight+"px","--userflow-squared-progress-bar-height":o.squaredBarHeight+"px","--userflow-rounded-progress-bar-height":o.roundedBarHeight+"px","--userflow-dotted-progress-bar-height":o.dottedBarHeight+"px","--userflow-numbered-progress-bar-height":o.numberedBarFontSize+"px","--userflow-resource-center-collapsed-height":o.resourceCenterCollapsedHeight+"px","--userflow-resource-center-launcher-icon-img-size":o.rcIconSize+"px","--userflow-resource-center-full-width":o.resourceCenterFullWidth+"px","--userflow-resource-center-launcher-border-radius":(o.resourceCenterLauncherBorderRadius!=null?Math.min(o.resourceCenterLauncherBorderRadius,o.resourceCenterCollapsedHeight/2):o.resourceCenterCollapsedHeight/2)+"px","--userflow-resource-center-padding-x":o.resourceCenterPaddingX+"px","--userflow-resource-center-padding-y":o.resourceCenterPaddingY+"px","--userflow-resource-center-transition-duration":o.resourceCenterTransitionDuration+"ms","--userflow-resource-center-width":o.resourceCenterWidth+"px","--userflow-question-color-light":h(n,o.mainBackgroundColor,.5),"--userflow-question-color-lighter":h(n,o.mainBackgroundColor,.75),"--userflow-question-color-lightest":h(n,o.mainBackgroundColor,.9),"--userflow-question-color-medium-light":h(n,o.mainBackgroundColor,.15),"--userflow-question-color":n,"--userflow-toolbar-foreground-color":o.toolbarForegroundColor,"--userflow-toolbar-foreground-color-rgb":B(o.toolbarForegroundColor),"--userflow-tooltip-notch-size":o.tooltipNotchSize+"px","--userflow-unread-badge-background-color":o.unreadBadgeBackgroundColor,"--userflow-unread-badge-foreground-color":o.unreadBadgeForegroundColor,"--userflow-widget-active-background-color":o.widgetActiveBackgroundColor,"--userflow-widget-background-color":o.widgetBackgroundColor,"--userflow-widget-foreground-color":o.widgetForegroundColor,"--userflow-widget-hover-background-color":o.widgetHoverBackgroundColor}}const Fo=[];function $o(o){let[n,t]=p.useState(o);const e=po(o.sessionData||Fo);return p.useLayoutEffect(()=>{const{variations:l}=o;if(!l)return;const a=[],i=[],c=()=>{let u=o,r=!1;for(const[s,g]of l.entries())if(a[s]){r||(r=!0,u={...u});for(const d of g.overriddenKeys){const f=d,b=g[f];u[f]=b}}t(u)};for(const[u,r]of l.entries()){a[u]=!1;const{condition:s}=r;if(s&&r.overriddenKeys&&r.overriddenKeys.length>0){const d=Co[s.type].track({sessionData:e,condition:s,callback:f=>{a[u]=f,c()}});i[u]=d}else i[u]=()=>{}}return c(),()=>{for(const u of i)u()}},[o,e]),p.useMemo(()=>vo(n),[n])}function Po(o){const n=bo.serverEndpoint||"cdn.userflow.com";return o?.cssVersion?`https://${n}/themes/${o.id}/stylesheets/${o.cssVersion}/custom.css`:null}const M=new Map;function E(o){let n=M.get(o);return n||(n={stylesheets:new Map},M.set(o,n)),n}function Do(o,n,t,{uninstallOnUnmount:e}={}){const l=Bo(),[a,i]=p.useState(!n);return p.useLayoutEffect(()=>{if(!o||!n)return;let c=!1,u;const r=async d=>{await W(l,o,d),u&&T(o,u),u=d};(async()=>{let d=typeof n=="string"?n:n.get();if(Ho()&&t){let f=await Ao(d);if(c)return;f=xo(f,yo(t)),d="data:text/css;base64,"+btoa(f)}await r(d),!c&&i(!0)})();let g=null;return typeof n!="string"&&(g=n.onUpdate(async()=>{r(n.get())})),()=>{c=!0,g&&g(),e&&u&&T(o,u)}},[l,o,n,t,e]),{loaded:a}}function Ho(){return!!window.MSInputMethodContext&&!!document.documentMode}const I=new Map;function Ao(o){return new Promise((n,t)=>{let e=I.get(o);if(e){n(e);return}const l=new XMLHttpRequest;l.addEventListener("load",()=>{if(l.status!==200){t(new Error("Userflow.js could not fetch stylesheet: "+o));return}const a=l.responseText;I.set(o,a),n(a)}),l.addEventListener("error",()=>{t(new Error("Userflow.js could not fetch stylesheet: "+o))}),l.open("GET",o),l.send()})}function xo(o,n){for(const t in n)if(n.hasOwnProperty(t)){const e=n[t];e&&(o=o.replace(new RegExp(`var\\(${t}.*?\\)`,"g"),e))}return o=o.replace(/var\(--[a-z0-9-]+(,\s*(.*?))?\)/g,"$2"),o}function zo(o,n){const t=n&&So(n),e=t?.url,l=t?.fontFamily,[a,i]=p.useState(!e||!l);return p.useLayoutEffect(()=>{if(!o||!e||!l)return;let c=!1;return W(null,o,e),ko(o,l,()=>{c||i(!0)}),()=>{c=!0}},[o,e,l]),{loaded:a}}function W(o,n,t){const e=E(n),l=e.stylesheets.get(t);if(l)return l.loadPromise;const a=n.document.createElement("link"),i=new Promise((c,u)=>{a.dataset.userflowStylesheet="true",a.rel="stylesheet",a.href=t,a.onload=()=>{c()},a.onerror=r=>{console.log(`Userflow.js: Error installing Stylesheet ${t}:`,r),o&&o.reportCspIssue(),u()},n.document.head.appendChild(a)});return e.stylesheets.set(t,{link:a,loadPromise:i}),i}function T(o,n){const t=E(o),e=t.stylesheets.get(n);e&&(o.document.head.removeChild(e.link),t.stylesheets.delete(n))}function So(o){if(o.builtinFontFamily)switch(o.builtinFontFamily.provider){case H.GOOGLE:{const n=Array.from(new Set(["0,400","1,400",`0,${o.fontWeightBold}`,`0,${o.defaultButtonFontWeight}`,`0,${o.primaryButtonFontWeight}`,`0,${o.checklistLauncherFontWeight}`,`0,${o.launcherButtonFontWeight}`])).sort().join(";");return{url:`https://fonts.googleapis.com/css2?family=${encodeURIComponent(o.builtinFontFamily.name)}:ital,wght@${n}`,fontFamily:o.builtinFontFamily.name}}case H.STANDARD:return null}else return o.fontCssUrl?{url:o.fontCssUrl,fontFamily:o.fontFamily}:null}export{Ro as D,Do as a,zo as b,po as c,Po as d,yo as g,$o as u};
|
|
2
2
|
//# sourceMappingURL=stylesheets.js.map
|
package/ui.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ElementSelectionApp.js","vendor.react.js","vendor.
|
|
2
|
-
import{R as e,r as s}from"./vendor.react.js";import{r as
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ElementSelectionApp.js","vendor.react.js","vendor.core-js.js","vendor.object-assign.js","vendor.is-hotkey.js","vendor.obj-str.js","flow-condition-types.js","userflow.js","vendor.phoenix.js","vendor.uuid.js","vendor.date-fns.js","client-context.js","vendor.i18next.js","vendor.react-i18next.js","vendor.babel.runtime.js","use-window-resize.js","vendor.react-dom.js","vendor.scheduler.js","stylesheets.js","vendor.fortawesome.pro-regular-svg-icons.js","vendor.fortawesome.pro-solid-svg-icons.js","BuilderBar.js","logomark.js","vendor.fortawesome.pro-light-svg-icons.js","FlowApp.js","BubbleToolbar.js","bubble-frame.styl.js","FlowChrome.js","flow-host.styl.js","use-selector-element-monitoring.js","Trigger.js","ChecklistApp.js","ChecklistUI.js","LauncherApp.js","NotificationsApp.js","TrackerTestingApp.js","StartConditionTestingApp.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{R as e,r as s}from"./vendor.react.js";import{r as b}from"./vendor.react-dom.js";import{u as x,i as z,U as V}from"./client-context.js";import{_ as i,B as U,R as F,U as H}from"./userflow.js";import"./vendor.core-js.js";import{I as B}from"./vendor.react-i18next.js";import"./vendor.object-assign.js";import"./vendor.scheduler.js";import"./vendor.i18next.js";import"./vendor.phoenix.js";import"./vendor.uuid.js";import"./vendor.babel.runtime.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="14d43ba4-c929-4c7b-8da5-b8c51e229156",t._sentryDebugIdIdentifier="sentry-dbid-14d43ba4-c929-4c7b-8da5-b8c51e229156")}catch{}})();const N=e.lazy(()=>i(()=>import("./ElementSelectionApp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23]))),j=e.lazy(()=>i(()=>import("./FlowApp.js"),__vite__mapDeps([24,1,2,3,7,8,9,13,14,25,19,18,20,6,10,11,12,26,5,27,15,16,17,28,22,29,30]))),q=e.lazy(()=>i(()=>import("./ChecklistApp.js"),__vite__mapDeps([31,1,2,3,7,8,9,27,15,16,17,18,19,20,6,10,11,12,13,14,28,26,5,22,29,32,25]))),G=e.lazy(U),J=e.lazy(F),K=e.lazy(()=>i(()=>import("./LauncherApp.js"),__vite__mapDeps([33,1,2,3,7,8,9,29,6,10,26,18,19,20,11,12,13,14,5,28,27,15,16,17,22,25,30]))),M=e.lazy(()=>i(()=>import("./NotificationsApp.js"),__vite__mapDeps([34,1,2,3,11,12,13,14,28,7,8,9,18,19,20,6,10]))),Q=e.lazy(()=>i(()=>import("./TrackerTestingApp.js"),__vite__mapDeps([35,1,2,3,11,12,13,14,21,15,16,17,18,19,20,7,8,9,6,10,22,5,23]))),W=e.lazy(()=>i(()=>import("./StartConditionTestingApp.js"),__vite__mapDeps([36,1,2,3,11,12,13,14,21,15,16,17,18,19,20,7,8,9,6,10,22,5,23]))),X=()=>{const t=x(),[n,d]=s.useState(t.getSessionStorageState()),[c,p]=s.useState(()=>u()?null:t.flowSession),[o,C]=s.useState(t.checklistSession),[m,k]=s.useState(t.checklistExpanded),[a,y]=s.useState(t.bannerSession),[l,v]=s.useState(t.resourceCenterSession),[S,g]=s.useState(t.resourceCenterOpen),[w,A]=s.useState(t.resourceCenterLauncherHidden),[f,I]=s.useState(t.resourceCenterEmbedsChecklist()),[L,R]=s.useState(t.launcherSessions),[T,D]=s.useState(t.activeLauncherFlowId),[E,O]=s.useState(t.notifications);s.useEffect(()=>{const r=()=>{d(t.getSessionStorageState()),p(P=>u()&&t.flowSession?.id!==P?.id?null:t.flowSession),C(t.checklistSession),k(t.checklistExpanded),y(t.bannerSession),v(t.resourceCenterSession),g(t.resourceCenterOpen),A(t.resourceCenterLauncherHidden),I(t.resourceCenterEmbedsChecklist()),R(t.launcherSessions),D(t.activeLauncherFlowId),O(t.notifications)};t.on("uistatechange",r);const _=()=>{u()||p(t.flowSession)};return document.addEventListener("visibilitychange",_),()=>{t.off("uistatechange",r),document.removeEventListener("visibilitychange",_)}},[t]);const h=!n.activeApp&&!!c;return s.useLayoutEffect(()=>{if(h)return t.emit("flowvisibilitychange",!0),()=>{t.emit("flowvisibilitychange",!1)}},[t,h]),n.activeApp==="elementSelection"&&n.elementSelection?e.createElement(e.Suspense,{fallback:null},e.createElement(N,{state:n.elementSelection})):n.activeApp==="trackerTesting"&&n.trackerTesting?e.createElement(e.Suspense,{fallback:null},e.createElement(Q,{state:n.trackerTesting})):e.createElement(e.Fragment,null,c&&e.createElement(e.Suspense,{fallback:null},e.createElement(j,{key:c.id,session:c,checklistSession:o,resourceCenterEmbedsChecklist:f})),o&&!f&&(m||o.version.checklist?.launcherEnabled)&&e.createElement(e.Suspense,{fallback:null},e.createElement(q,{key:o.id,session:o,checklistExpanded:m})),a&&e.createElement(e.Suspense,{fallback:null},e.createElement(G,{key:a.id,session:a})),l&&(S||!w)&&e.createElement(e.Suspense,{fallback:null},e.createElement(J,{key:l.id,session:l,isOpen:S,flowSession:c,checklistSession:o})),e.createElement(e.Suspense,{fallback:null},L.map(r=>e.createElement(K,{key:r.flow.id,session:r,active:r.flow.id===T}))),E.length>0&&e.createElement(e.Suspense,{fallback:null},e.createElement(M,{notifications:E})),n.activeApp==="startConditionTesting"&&n.testStartConditionToken&&e.createElement(e.Suspense,{fallback:null},e.createElement(W,{token:n.testStartConditionToken})))};function u(){return document.visibilityState==="hidden"}const Y=({client:t})=>e.createElement(B,{i18n:z},e.createElement(V.Provider,{value:t},e.createElement(X,null)));class ue{constructor(n){this.client=n}mount(){if(this.container)throw new H("UI has already been mounted");this.container=document.createElement("div"),this.container.id="userflow-ui",document.body.appendChild(this.container),b.render(e.createElement(Y,{client:this.client}),this.container)}unmount(){this.container&&(b.unmountComponentAtNode(this.container),document.body.contains(this.container)&&document.body.removeChild(this.container),delete this.container)}}export{ue as RealUI};
|
|
3
3
|
//# sourceMappingURL=ui.js.map
|
package/use-element-rect.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as t}from"./vendor.react.js";import{u as
|
|
1
|
+
import{r as t}from"./vendor.react.js";import{u as f}from"./use-window-resize.js";import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="b71dfb38-8001-43d8-a8de-eb28d0c2e86f",e._sentryDebugIdIdentifier="sentry-dbid-b71dfb38-8001-43d8-a8de-eb28d0c2e86f")}catch{}})();function l(){const[e,s]=t.useState(null),[n,o]=t.useState(0),[d,i]=t.useState(0),r=t.useCallback(()=>{o(e?.offsetWidth||0),i(e?.offsetHeight||0)},[e]);return t.useLayoutEffect(()=>{if(!e||typeof MutationObserver!="function")return;const u=new MutationObserver(()=>{r()});return u.observe(e,{childList:!0,attributes:!0,subtree:!0}),()=>{u.disconnect()}},[e,r]),t.useLayoutEffect(()=>{r()}),f(r),{width:n,height:d,setEl:s}}export{l as u};
|
|
2
2
|
//# sourceMappingURL=use-element-rect.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as o}from"./vendor.react.js";import{p as _,d as O,q as B,n as H,r as M,h as S,c as F,a as Z,g as G}from"./flow-condition-types.js";import"./vendor.
|
|
1
|
+
import{r as o}from"./vendor.react.js";import{p as _,d as O,q as B,n as H,r as M,h as S,c as F,a as Z,g as G}from"./flow-condition-types.js";import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},t=new Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="9fbcd9be-72c1-4681-94a1-aa81cf221628",e._sentryDebugIdIdentifier="sentry-dbid-9fbcd9be-72c1-4681-94a1-aa81cf221628")}catch{}})();let w=!1;const s=[];let l=[],D;function N(e){s.push(e),s.length===1&&(w=!0,I(),window.addEventListener("scroll",q))}function P(e){const t=s.indexOf(e);t>=0&&(s.splice(t,1),s.length===0&&(w=!1,window.cancelAnimationFrame(D),window.removeEventListener("scroll",q)))}function U(e){l.push(e)}function V(){s.forEach(e=>e()),l.length>0&&(l.forEach(e=>e()),l=[]),I()}function I(){w&&(D=window.requestAnimationFrame(V))}function q(){}function X({selector:e,targetMoved:t,targetLost:c,onTargetClick:i,onTargetMouseEnter:b,onTargetMouseLeave:R}){const L=o.useRef(t),k=o.useRef(c),d=o.useRef(i),m=o.useRef(b),g=o.useRef(R);o.useLayoutEffect(()=>{L.current=t,k.current=c,d.current=i,m.current=b,g.current=R}),o.useLayoutEffect(()=>{let n=null,a=null,f=null,y=!1;const h=()=>{n=null,a=null,f=null,k.current()};if(!e){h();return}const A=()=>{if(!f||!n)return;const r=M(n);(!a||!j(a,r))&&(a=r,r.width===0&&r.height===0?h():L.current({targetEl:n,targetRect:a,clipEl:f,viewportClipRect:z(f)}))};let u=!1;const T=()=>{u||(u=!0,N(A))},C=()=>{u&&(u=!1,P(A))},v=()=>{d.current&&d.current()},E=()=>{m.current&&m.current()},p=()=>{g.current&&g.current()},x=()=>{const r=n;n=O(e)?e:B(e),(!y||n!==r)&&(r&&(r.removeEventListener("click",v),r.removeEventListener("mouseenter",E),r.removeEventListener("mouseleave",p)),n?(T(),n.addEventListener("click",v),n.addEventListener("mouseenter",E),n.addEventListener("mouseleave",p),f=H(n)):(C(),h())),y=!0};x();const W=_(x);return()=>{W.disconnect(),C(),n&&(n.removeEventListener("click",v),n.removeEventListener("mouseenter",E),n.removeEventListener("mouseleave",p))}},[e])}function j(e,t){return e.left===t.left&&e.top===t.top&&e.width===t.width&&e.height===t.height}function z(e){S();const t=F(Z()),c=F(G());if(!e||e===document.documentElement)return{top:0,right:c,bottom:t,left:0};{const i=M(e);return{top:Math.max(0,i.top),right:Math.min(c,i.right),bottom:Math.min(t,i.bottom),left:Math.max(0,i.left)}}}export{U as r,X as u};
|
|
2
2
|
//# sourceMappingURL=use-selector-element-monitoring.js.map
|
package/use-window-resize.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{r as
|
|
1
|
+
import{r as l,R as w}from"./vendor.react.js";import{r as h}from"./vendor.react-dom.js";import{g as k,a as F,b as A,d as D}from"./stylesheets.js";import{a as S,i as I}from"./client-context.js";import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},s=new Error().stack;s&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[s]="00867e56-9ffe-40a7-a279-4c9d09ef207a",e._sentryDebugIdIdentifier="sentry-dbid-00867e56-9ffe-40a7-a279-4c9d09ef207a")}catch{}})();const W=new URL("iframe-reset.css",import.meta.url).href,j=({testId:e,className:s,style:o,elRef:d,stylesheet:c,theme:n,onStylesheetsLoad:f,noIframe:a,noScroll:m,ariaHidden:p,title:L,children:E})=>{a=a||!1;const[r,b]=l.useState(null),v=n&&"userflowjs-theme-root",g=n&&k(n),{loaded:u}=F(r,a?null:W),{loaded:t}=F(r,c,n),{loaded:i}=A(r,n),y=n&&D(n),{loaded:R}=F(r,y,n,{uninstallOnUnmount:!0});return l.useEffect(()=>{f&&u&&t&&i&&R&&f(!0)},[f,u,t,i,R]),a?w.createElement(U,{testId:e,className:s,style:o,rootClassName:v,rootStyle:g,elRef:d,onWinReady:b,noScroll:m,ariaHidden:p},E):w.createElement(x,{testId:e,className:s,style:o,rootClassName:v,rootStyle:g,elRef:d,onWinReady:b,noScroll:m,ariaHidden:p,title:L},E)},x=({testId:e,className:s,style:o,rootClassName:d,rootStyle:c,elRef:n,onWinReady:f,noScroll:a,ariaHidden:m,title:p,children:L})=>{const E=S(),[r,b]=l.useState(null);l.useLayoutEffect(()=>{if(!r)return;const{documentElement:u,body:t}=r.document;u.dir=I.dir();const i=d&&d.split(" ");if(i&&t.classList.add(...i),c)for(const y in c)t.style.setProperty(y,c[y]);return t.style.overflow=a?"hidden":"",()=>{i&&t.classList.remove(...i)}},[r,d,c,a]);const v=E?.logrocketAppId;l.useRef(!1),l.useEffect(()=>{},[r,v]);const g={bis_size:"{}"};return w.createElement("iframe",{ref:u=>{if(!u)return;n&&(n.current=u);const t=u.contentWindow;if(!t||t===r)return;const i=y=>{b(y),f(y)};t.document.readyState==="complete"?i(t):t.addEventListener("load",()=>{i(t)})},"data-testid":e,"aria-hidden":m?"true":void 0,title:p,tabIndex:m?-1:void 0,className:s,style:{...o,border:"none"},...g},r&&h.createPortal(L,r.document.body))},U=({testId:e,className:s,style:o,rootClassName:d,rootStyle:c,elRef:n,onWinReady:f,ariaHidden:a,children:m})=>(l.useEffect(()=>{f(window)},[f]),w.createElement("div",{ref:n,"data-testid":e,"aria-hidden":a?"true":void 0,tabIndex:a?-1:void 0,dir:I.dir(),className:s,style:o},w.createElement("div",{className:d,style:c},m)));function q(e){l.useLayoutEffect(()=>{let s;const o=()=>{window.cancelAnimationFrame(s),s=window.requestAnimationFrame(e)};return window.addEventListener("resize",o),()=>{window.removeEventListener("resize",o),window.cancelAnimationFrame(s)}},[e])}export{j as F,q as u};
|
|
2
2
|
//# sourceMappingURL=use-window-resize.js.map
|
package/userflow.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ResourceCenterApp.js","vendor.react.js","vendor.
|
|
2
|
-
import"./vendor.
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ResourceCenterApp.js","vendor.react.js","vendor.core-js.js","vendor.object-assign.js","client-context.js","vendor.i18next.js","vendor.react-i18next.js","vendor.babel.runtime.js","flow-host.styl.js","bubble-frame.styl.js","flow-condition-types.js","vendor.date-fns.js","stylesheets.js","vendor.fortawesome.pro-regular-svg-icons.js","vendor.fortawesome.pro-solid-svg-icons.js","vendor.obj-str.js","use-window-resize.js","vendor.react-dom.js","vendor.scheduler.js","logomark.js","ChecklistUI.js","BubbleToolbar.js","use-element-rect.js","BannerApp.js","use-selector-element-monitoring.js","vendor.phoenix.js","vendor.uuid.js","ui.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import"./vendor.core-js.js";import{S as K}from"./vendor.phoenix.js";import{v as j}from"./vendor.uuid.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="ddb51db6-62ac-458e-95f6-d1d44a079630",t._sentryDebugIdIdentifier="sentry-dbid-ddb51db6-62ac-458e-95f6-d1d44a079630")}catch{}})();const z="modulepreload",Y=function(t){return"https://js.userflow.com/es2020/"+t},v={},w=function(e,s,i){let n=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");n=Promise.allSettled(s.map(c=>{if(c=Y(c),c in v)return;v[c]=!0;const h=c.endsWith(".css"),T=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${T}`))return;const E=document.createElement("link");if(E.rel=h?"stylesheet":z,h||(E.as="script"),E.crossOrigin="",E.href=c,u&&E.setAttribute("nonce",u),document.head.appendChild(E),h)return new Promise((F,V)=>{E.addEventListener("load",F),E.addEventListener("error",()=>V(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(a){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=a,window.dispatchEvent(u),!u.defaultPrevented)throw a}return n.then(a=>{for(const u of a||[])u.status==="rejected"&&r(u.reason);return e().catch(r)})};class l extends Error{constructor(e,s,i){super(e),Object.setPrototypeOf(this,l.prototype),this.name="UserflowError",this.code=s,this.humanMessage=i}}class B{constructor(e){this.type=e,this.testState={}}formatKey(e){return`userflow:${e}`}isSupported(){if(typeof window>"u")return!1;try{return window[this.type]!=null}catch{return!1}}getItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].getItem(e):null}setItem(e,s){e=this.formatKey(e);{if(!this.isSupported())return;window[this.type].setItem(e,s)}}removeItem(e){return e=this.formatKey(e),this.isSupported()?window[this.type].removeItem(e):void 0}clear(){return this.isSupported()?window[this.type].clear():void 0}}const g=new B("localStorage"),f=new B("sessionStorage");function je(t){window.location.href=t}function P(){return window.location.href}function U(t){window.postMessage(t,window.origin)}function x(t){const e=i=>{if(i.source!==window||i.origin!==window.origin)return;const n=i.data;!n||typeof n!="object"||typeof n.kind!="string"||!n.kind.startsWith("userflow:")||t(n)===!0&&s()};window.addEventListener("message",e);const s=()=>window.removeEventListener("message",e);return s}function J(t){return new Promise(e=>{x(s=>{const i=t(s);return i?(e(i),!0):!1})})}const A=new Set;let _=!1;function X(t){return Z(),A.add(t),()=>{H(t)}}function H(t){A.delete(t)}function I(){A.forEach(t=>t())}function Z(){if(_)return;_=!0;const{history:t}=window,e=s=>{const i=t[s];t[s]=(...n)=>{const r=i.apply(t,n);return I(),r}};window.__userflowStatePatched?(window.addEventListener("userflow:pushstate",()=>{I()}),window.addEventListener("userflow:replacestate",()=>{I()})):(e("pushState"),e("replaceState")),window.addEventListener("popstate",()=>{I()})}class q{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(e){U({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:e})}onBuilderMessage(e){return this.unregisterOnMessage=x(e),!1}async captureScreenshot(e,s,i,n){return U({kind:"userflow:crxScreenshot",x:e,y:s,width:i,height:n,devicePixelRatio:window.devicePixelRatio}),(await J(a=>a.kind==="userflow:crxScreenshotResult"?a:null)).imageDataUrl}}var C=(t=>(t.ACTION="ACTION",t.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",t.REPLACED="REPLACED",t.SNOOZED="SNOOZED",t.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",t.USERFLOWJS="USERFLOWJS",t.USER_CLOSED="USER_CLOSED",t))(C||{}),m=(t=>(t.ACTION="ACTION",t.DRAFT="DRAFT",t.LINK="LINK",t.LAUNCHER_SEEN="LAUNCHER_SEEN",t.RESOURCE_CENTER="RESOURCE_CENTER",t.USERFLOWJS="USERFLOWJS",t))(m||{}),Q=(t=>(t.LIKE="LIKE",t.DISLIKE="DISLIKE",t))(Q||{}),S=(t=>(t.STRING="STRING",t.BOOLEAN="BOOLEAN",t.NUMBER="NUMBER",t.DATETIME="DATETIME",t.LIST="LIST",t.RANDOM_AB="RANDOM_AB",t.RANDOM_NUMBER="RANDOM_NUMBER",t))(S||{}),k=(t=>(t.FLOW="FLOW",t.BANNER="BANNER",t.CHECKLIST="CHECKLIST",t.LAUNCHER="LAUNCHER",t.RESOURCE_CENTER="RESOURCE_CENTER",t))(k||{}),ee=(t=>(t.ALWAYS_TRUE="ALWAYS_TRUE",t.ATTRIBUTE="ATTRIBUTE",t.CLAUSE="CLAUSE",t.ELEMENT="ELEMENT",t.FILLED_IN_INPUT="FILLED_IN_INPUT",t.FLOW="FLOW",t.INPUT_VALUE="INPUT_VALUE",t.PAGE="PAGE",t.SEGMENT="SEGMENT",t.TIME="TIME",t))(ee||{}),te=(t=>(t.AUTO="AUTO",t.MANUAL="MANUAL",t))(te||{}),se=(t=>(t.INPUT="INPUT",t))(se||{}),ie=(t=>(t.ABSOLUTE_EQ="ABSOLUTE_EQ",t.ABSOLUTE_GT="ABSOLUTE_GT",t.ABSOLUTE_LT="ABSOLUTE_LT",t.AND="AND",t.BETWEEN="BETWEEN",t.CONTAINS="CONTAINS",t.EMPTY="EMPTY",t.ENDS_WITH="ENDS_WITH",t.EQ="EQ",t.EXCLUDES_ALL="EXCLUDES_ALL",t.EXCLUDES_ANY="EXCLUDES_ANY",t.FALSE="FALSE",t.GT="GT",t.GTE="GTE",t.INCLUDES_ALL="INCLUDES_ALL",t.INCLUDES_ANY="INCLUDES_ANY",t.LT="LT",t.LTE="LTE",t.NE="NE",t.NOT_CONTAINS="NOT_CONTAINS",t.NOT_EMPTY="NOT_EMPTY",t.NOT_REGEX="NOT_REGEX",t.OR="OR",t.REGEX="REGEX",t.RELATIVE_EQ="RELATIVE_EQ",t.RELATIVE_GT="RELATIVE_GT",t.RELATIVE_LT="RELATIVE_LT",t.STARTS_WITH="STARTS_WITH",t.TRUE="TRUE",t.URL="URL",t))(ie||{}),ne=(t=>(t.CLICK="CLICK",t.DISABLED="DISABLED",t.MOUSEDOWN="MOUSEDOWN",t.NOT_CLICK="NOT_CLICK",t.NOT_DISABLED="NOT_DISABLED",t.NOT_PRESENT="NOT_PRESENT",t.PRESENT="PRESENT",t))(ne||{}),re=(t=>(t.ASSET="ASSET",t.CARTOON="CARTOON",t.NONE="NONE",t.URL="URL",t))(re||{}),oe=(t=>(t.INSIDE="INSIDE",t.OUTSIDE="OUTSIDE",t))(oe||{}),ae=(t=>(t.TOP_LEFT="TOP_LEFT",t.TOP_CENTER="TOP_CENTER",t.TOP_RIGHT="TOP_RIGHT",t.BOTTOM_RIGHT="BOTTOM_RIGHT",t.BOTTOM_CENTER="BOTTOM_CENTER",t.BOTTOM_LEFT="BOTTOM_LEFT",t.CENTER="CENTER",t))(ae||{}),ce=(t=>(t.GOOGLE="GOOGLE",t.STANDARD="STANDARD",t))(ce||{}),le=(t=>(t.DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",t.DISMISS="DISMISS",t))(le||{}),ue=(t=>(t.DISMISS="DISMISS",t.NONE="NONE",t))(ue||{}),he=(t=>(t.DEFAULT="DEFAULT",t.PLAINTEXT="PLAINTEXT",t.CUSTOM="CUSTOM",t))(he||{}),de=(t=>(t.CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",t.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",t.NONE="NONE",t))(de||{}),fe=(t=>(t.BUBBLE="BUBBLE",t.END="END",t.ERROR="ERROR",t.FLAG="FLAG",t))(fe||{}),Ee=(t=>(t.MANUAL="MANUAL",t.NONE="NONE",t.SYNTHETIC="SYNTHETIC",t))(Ee||{}),Se=(t=>(t.BUBBLE="BUBBLE",t.HIDDEN="HIDDEN",t.MODAL="MODAL",t.TOOLTIP="TOOLTIP",t))(Se||{}),Te=(t=>(t.ABOVE="ABOVE",t.BELOW="BELOW",t.LEFT="LEFT",t.RIGHT="RIGHT",t))(Te||{}),we=(t=>(t.CLOSE_FLOW="CLOSE_FLOW",t.EVAL_JS="EVAL_JS",t.GO_TO_STEP="GO_TO_STEP",t.NAVIGATE="NAVIGATE",t.SET_ATTRIBUTE="SET_ATTRIBUTE",t.SNOOZE="SNOOZE",t.START_FLOW="START_FLOW",t))(we||{}),ge=(t=>(t.NEW_TAB="NEW_TAB",t.SAME_TAB="SAME_TAB",t))(ge||{}),Ie=(t=>(t.SET="SET",t.SET_DATETIME="SET_DATETIME",t.SET_DATETIME_ONCE="SET_DATETIME_ONCE",t.SET_ONCE="SET_ONCE",t.ADD="ADD",t.SUBTRACT="SUBTRACT",t.APPEND="APPEND",t.PREPEND="PREPEND",t.REMOVE="REMOVE",t.UNSET="UNSET",t))(Ie||{}),Ce=(t=>(t.MULTILINE_TEXT="MULTILINE_TEXT",t.MULTIPLE_CHOICE="MULTIPLE_CHOICE",t.NPS="NPS",t.SCALE="SCALE",t.STARS="STARS",t.TEXT="TEXT",t))(Ce||{}),L=(t=>(t.ACTION="ACTION",t.ANNOUNCEMENTS="ANNOUNCEMENTS",t.ASSISTANT="ASSISTANT",t.CHECKLIST="CHECKLIST",t.CONTACT="CONTACT",t.DIVIDER="DIVIDER",t.FLOWS="FLOWS",t.KNOWLEDGE_BASE="KNOWLEDGE_BASE",t.MESSAGE="MESSAGE",t.SUBPAGE="SUBPAGE",t))(L||{}),ke=(t=>(t.CRISP="CRISP",t.CUSTOM="CUSTOM",t.FRESHCHAT="FRESHCHAT",t.HELPSCOUT="HELPSCOUT",t.HUBSPOT="HUBSPOT",t.INTERCOM="INTERCOM",t.ZENDESK="ZENDESK",t.ZENDESK_MESSENGER="ZENDESK_MESSENGER",t))(ke||{}),me=(t=>(t.BUTTON="BUTTON",t.INPUT="INPUT",t))(me||{}),pe=(t=>(t.EMAIL="EMAIL",t.PHONE="PHONE",t.CHAT="CHAT",t))(pe||{}),Ue=(t=>(t.SILENT="SILENT",t.BADGE="BADGE",t.POPOUT="POPOUT",t))(Ue||{}),Le=(t=>(t.LAUNCHER_CLICK="LAUNCHER_CLICK",t.LAUNCHER_HOVER="LAUNCHER_HOVER",t.TARGET_CLICK="TARGET_CLICK",t.TARGET_HOVER="TARGET_HOVER",t.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",t.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",t))(Le||{}),G=(t=>(t.ACTIVATE="ACTIVATE",t.DEACTIVATE="DEACTIVATE",t.NEVER="NEVER",t))(G||{}),Ae=(t=>(t.AUTO="AUTO",t.TOP="TOP",t.RIGHT="RIGHT",t.BOTTOM="BOTTOM",t.LEFT="LEFT",t))(Ae||{}),Ne=(t=>(t.START="START",t.CENTER="CENTER",t.END="END",t))(Ne||{}),ve=(t=>(t.PERCENT="PERCENT",t.PX="PX",t))(ve||{}),_e=(t=>(t.BEACON="BEACON",t.BUTTON="BUTTON",t.HIDDEN="HIDDEN",t.ICON="ICON",t))(_e||{}),Re=(t=>(t.LAUNCHER="LAUNCHER",t.TARGET="TARGET",t))(Re||{}),ye=(t=>(t.BODY_FIRST="BODY_FIRST",t.BODY_LAST="BODY_LAST",t.ELEMENT_FIRST="ELEMENT_FIRST",t.ELEMENT_LAST="ELEMENT_LAST",t.ELEMENT_BEFORE="ELEMENT_BEFORE",t.ELEMENT_AFTER="ELEMENT_AFTER",t))(ye||{}),Oe=(t=>(t.NONE="NONE",t.LIKE="LIKE",t.SCALE="SCALE",t))(Oe||{});function be(){return{customInputs:[],customNavigate:null,urlFilter:null,linkUrlDecorator:null,customScrollIntoView:null,scrollPadding:null,inferenceAttributeNames:["data-for","data-id","data-testid","data-test-id","for","id","name","placeholder","role"],inferenceAttributeFilters:{id:[t=>!t.match(/\d$/)],"data-id":[t=>!t.match(/\d$/)]},inferenceClassNameFilters:[t=>!t.startsWith("css-")],baseZIndex:1234500,evalJsDisabled:!1}}const d=be();function R(t){return Array.isArray(t)||(t=t?[t]:[]),t=t.map(e=>typeof e=="string"?new RegExp(e):e),t}function ze(t,e){return t.every(s=>typeof s=="function"?s(e):s instanceof RegExp?s.test(e):!0)}function De(){let t=P();if(d.urlFilter){if(t=d.urlFilter(t),typeof t!="string")throw new l("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(t)}catch(e){throw new l(`Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.
|
|
3
3
|
Returned URL: `+t+`
|
|
4
|
-
Error message: `+e.message)}}return t}let W="";try{W=localStorage.getItem("debug")||""}catch{}const $=W.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=N("log");o.group=N("group");o.groupCollapsed=N("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let p;function N(t){return function(e,...s){if($){const i=performance.now(),n=p?Math.round(i-p):0;p=i,console[t](`%cuserflow %c${e} %c+${n}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const Me=()=>w(()=>import("./ResourceCenterApp.js").then(t=>t.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));function Be(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class y{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 s of this.observers)s()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const O=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit"],Pe=()=>w(()=>import("./BannerApp.js"),__vite__mapDeps([23,1,2,3,4,5,6,7,15,12,13,14,10,11,9,8,24,17,18,16,22,25,26])),b="
|
|
4
|
+
Error message: `+e.message)}}return t}let W="";try{W=localStorage.getItem("debug")||""}catch{}const $=W.split(",").some(t=>t==="*"||t.startsWith("userflow:*")),o=N("log");o.group=N("group");o.groupCollapsed=N("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let p;function N(t){return function(e,...s){if($){const i=performance.now(),n=p?Math.round(i-p):0;p=i,console[t](`%cuserflow %c${e} %c+${n}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const Me=()=>w(()=>import("./ResourceCenterApp.js").then(t=>t.R),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22]));function Be(t){const s=t.version.checklist.tasks.length;return Math.max(0,s-t.taskCompletions.length)}class y{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 s of this.observers)s()}}observe(e){return this.observers.add(e),()=>this.observers.delete(e)}}const O=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit"],Pe=()=>w(()=>import("./BannerApp.js"),__vite__mapDeps([23,1,2,3,4,5,6,7,15,12,13,14,10,11,9,8,24,17,18,16,22,25,26])),b="1008964",xe=import.meta.url,D=50,He=5*60*1e3,M="userflowClientState";class Ge{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=>{o(`builder ${e.kind} message received`,e);const s="idempotencyKey"in e&&typeof e.idempotencyKey=="string"?e.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const i=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(e.kind){case"userflow:selectElement":{i(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(n=>({...n,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:e.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(n=>({...n,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{i(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(n=>({...n,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),f.setItem("previewFlowId",e.flowId),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),e.testStartCondition?this.setSessionStorageState(n=>({...n,activeApp:"startConditionTesting",testStartConditionToken:e.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(e.token),e.isResourceCenter){const n=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===e.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",n))};this.on("resourceCenterChanged",n),n()}});return}case"userflow:testTracker":{i(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:e.idempotencyKey}),this.setSessionStorageState(n=>({...n,isTargetTab:!0})),e.testUser?this.identifyTestUser(e.testUser):this.resetTestUser(),this.setSessionStorageState(n=>({...n,activeApp:"trackerTesting",trackerTesting:{trackerName:e.trackerName,token:e.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(n=>({...n,activeApp:null,trackerTesting:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),D))},this.onUserActivity=()=>this.ensureConnected(),this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+b),X(this.onUrlChange),this.setTargetEnv(new q),this.checkTestUserAtBoot(),this.toggleUI();for(const e of O)document.addEventListener(e,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),H(this.onUrlChange),this.destroyTargetEnv();for(const e of O)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 l("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(e){const s=e(this.getSessionStorageState());f.setItem(M,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let e=this.sessionStorageState;if(!e){const s=f.getItem(M);if(s)try{e=JSON.parse(s)}catch(i){console.error("Userflow.js: Parse ElementSelectionState error:",i)}e||(e={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=e}return e}checkTestUserAtBoot(){const e=this.getSessionStorageState().testUser;e&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(e))}async identifyTestUser(e){this.setSessionStorageState(n=>({...n,testUser:e})),this.reset(),this.init(e.clientToken),this.testUserIdentified=!0,this.externalId=e.id;const s=[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:i}=e;i&&(this.groupId=i.id,s.push(this.group(i.id,{name:i.name},{signature:i.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(e=>({...e,testUser:null}))}init(e){if(o("init",e),!e)throw new l("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==e){if(this.testUserIdentified){o("init() ignoring new token since a test user has been identified");return}this.clientToken&&(o("init() resetting due to new client token"),this.reset()),this.clientToken=e}}ensureInit(){if(!this.clientToken)throw new l("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new l("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new l("You must call userflow.group() first");return this.groupId}ensureConnected(){if(!this.clientToken||!this.externalId||(this.debounceInactiveDisconnect(),this.socket))return;this._socketStatus="connecting",o("connecting to socket");let e=d.serverEndpoint||"e.userflow.com";new URL(xe).hostname==="js.getuserflow.com"&&e==="e.userflow.com"&&(e="e.getuserflow.com");const s="wss://"+e+"/end-users/"+this.clientToken+"/socket";this.socket=new K(s,{reconnectAfterMs:i=>[100,500,1e3,5e3][i-1]||1e4,timeout:20*1e3}),this.socket.connect(),this.socket.onOpen(()=>{o("socket opened")}),this.socket.onClose(()=>{this.emit("private:disconnect")}),this.socket.onError(i=>{console.log("Userflow.js socket error",i),this.reportCspIssue()}),this.channel=this.socket.channel(`end_users:${this.externalId}`,()=>this.makeChannelJoinPayload()),this.channel.join().receive("ok",i=>{this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected")}).receive("error",i=>{["company_closed","invalid_client_token","invalid_user_external_id","incorrect_user_signature","rate_limit_exceeded","user_signature_required"].includes(i.code)?(console.error(`Userflow.js resetting due to: [${i.code}] ${i.message}`),this.reset(),this.clientToken=null):i.code==="invalid_protocol_version"?(console.error(`Userflow.js destroying due to: [${i.code}] ${i.message}`),this.destroy()):console.log("Userflow.js channel join error",i)}),this.channel.on("server_message",i=>this.handleServerMessage(i)),this.channel.on("server_error",i=>{console.log(`Userflow.js server error (${i.code}): ${i.message}`+(i.details&&i.details.length>0?`
|
|
5
5
|
Details:
|
|
6
6
|
`+i.details.map(n=>(n.path?`${n.path}: `:"")+n.message):""))})}makeChannelJoinPayload(){const e=this.buildClientContext();this.clientContext=e;const s={protocolVersion:2,userflowClientBuild:b,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(i=>({flowId:i.flow.id})),trackers:Array.from(this.trackers.values()).map(i=>({flowId:i.tracker.flowId})),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map(i=>({conditionId:i.condition.id,isTrue:i.isTrue})),previewFlowId:f.getItem("previewFlowId"),clientContext:e};return o("channel join payload",s),s}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(()=>{if(this.hasDraftSession()||this.assistantMessageInProgress){this.debounceInactiveDisconnect();return}o("disconnecting from socket due to inactivity"),this.disconnect()},He)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.bannerSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some(e=>e.draftMode)}async send(e,{batch:s,endBatch:i,handlesRejection:n}={}){return(!this.inBatch||!["ToggleClientCondition","UpdateClientContext"].includes(e.kind))&&this.checkPushRateLimit(),this.ensureConnected(),s&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),i?this.endBatch():this.endBatchTimeout=window.setTimeout(()=>{this.endBatch()},D)),this.sendRaw(e,{handlesRejection:n})}async sendRaw(e,{handlesRejection:s}={}){return new Promise((i,n)=>{if(!this.channel){const c=`Userflow.js: send() should not be called if channel is not set. Message kind=${e.kind}`;if(s)throw Error(c);console.log(c,`
|
|
7
7
|
Client message:`,e);return}o(`push ${e.kind} message`,e);const r=this.clientClock,a=()=>{this.serverClock=r,this.channel?.off("phx_error",u)},u=this.channel.on("phx_error",c=>{a();const h=`Userflow.js send ${e.kind} got phx_error`;this._socketStatus==="connected"&&console.log(h,`
|
|
@@ -13,6 +13,6 @@ Error:`,c),s&&n(new l(h,c.code,c.message))})})}endBatch(){this.inBatch=!1,this.s
|
|
|
13
13
|
- Excessive calls to Userflow.js. Check if any of userflow.track(), userflow.identify(), userflow.updateUser() or similar are called repeatedly.
|
|
14
14
|
- The URL changing too frequently. Look into https://userflow.com/docs/userflow-js#seturlfilter and filter out the changing part of the URL.
|
|
15
15
|
- The user legitimately being very active, in which case you can just ignore this error.
|
|
16
|
-
|
|
16
|
+
|
|
17
17
|
If in doubt, reach out to us at support@userflow.com.`);this.pushRateLimitMinute++}handleServerMessage(e){o(`received ${e.kind} message`,e);const{serverClock:s,flowSession:i,flowSessionClock:n,checklistSession:r,checklistSessionClock:a,bannerSession:u,resourceCenterSession:c}=this;switch(e.kind){case"CheckSessionsAck":case"ServerDebug":return;case"AddLauncher":{const{session:h}=e,T=this.launcherSessions.findIndex(E=>E.flow.id===h.flow.id);T===-1?this.launcherSessions=[...this.launcherSessions,h]:this.launcherSessions=[...this.launcherSessions.slice(0,T),h,...this.launcherSessions.slice(T+1)],this.toggleUI();return}case"AddTracker":{this.addTracker(e.tracker);return}case"AssistantMessageEventWrapper":{this.emit("private:assistantMessageEvent",e);return}case"CancelConditionWaitTimer":window.clearTimeout(this.conditionWaitTimers.get(e.conditionId)),this.conditionWaitTimers.delete(e.conditionId);return;case"ChecklistTaskCompleted":this.unackedTasks.add(e.taskCvid);return;case"ForceGoToStep":if(n>s){o(`ignoring ${e.kind} message due to stale clock flowSessionClock=${n} > serverClock=${s}`);return}i?.id===e.sessionId&&this.emit("gotostep",{session:i,step:{id:e.stepId}});return;case"RemoveLauncher":this.removeLauncher(e.flowId)&&this.toggleUI();return;case"RemoveTracker":{this.removeTracker(e.flowId);return}case"SetBannerSession":this.setBannerSession(e.session),this.toggleUI();return;case"SetChecklistSession":a<=s||r?.id===e.session.id?(this.setChecklistSession(e.session,s),this.toggleUI()):o(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${a} > serverClock=${s}`);return;case"SetFlowSession":n<=s||i?.id===e.session.id?(this.setFlowSession(e.session,s),this.toggleUI()):o(`ignoring ${e.kind} message due to stale clock flowSessionClock=${n} > serverClock=${s}`);return;case"SetResourceCenterSession":this.setResourceCenterSession(e.session),this.toggleUI();return;case"StartConditionWaitTimer":{if(!this.conditionWaitTimers.has(e.conditionId)){const h=window.setTimeout(()=>{this.conditionWaitTimers.delete(e.conditionId),this.send({kind:"FireConditionWaitTimer",conditionId:e.conditionId},{batch:!0})},parseFloat(e.waitTime)*1e3);this.conditionWaitTimers.set(e.conditionId,h)}return}case"TestStartConditionSuccess":this.emit("private:testStartConditionSuccess");return;case"TrackClientCondition":this.trackClientCondition(e.condition);return;case"UnsetBannerSession":u?.id===e.sessionId&&(this.setBannerSession(null),this.toggleUI());return;case"UnsetChecklistSession":if(a>s){o(`ignoring ${e.kind} message due to stale clock checklistSessionClock=${a} > serverClock=${s}`);return}r?.id===e.sessionId&&(this.setChecklistSession(null,s),this.toggleUI());return;case"UnsetFlowSession":if(n>s){o(`ignoring ${e.kind} message due to stale clock flowSessionClock=${n} > serverClock=${s}`);return}i?.id===e.sessionId&&(this.setFlowSession(null,s),this.toggleUI());return;case"UnsetResourceCenterSession":c?.id===e.sessionId&&(this.setResourceCenterSession(null),this.toggleUI());return;case"UntrackClientCondition":this.untrackClientCondition(e.conditionId);return;default:console.warn("Userflow.js: Received unknown message",e);return}}async identify(e,s={},{signature:i}={}){if(o("identify",e),this.ensureInit(),this.testUserIdentified&&e!==this.externalId){o("identify() ignored since a test user has been identified");return}if(typeof e=="number")e=String(e);else if(!e||typeof e!="string")throw new l(`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&&(o("identify resetting due to new externalId"),this.reset()),this.externalId=e,this.signature=i||null,this.observeUserActivity(),await Promise.all([this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(s)},{batch:!0}),this.onFirstIdentify()]),this.emit("private:identified")}async identifyAnonymous(e={},s={}){if(!g.isSupported())throw new l("userflow.identifyAnonymous() is not supported when localStorage access is denied.");const i="anonymousId";let n=g.getItem(i);n||(n="anon-"+j(),g.setItem(i,n)),await this.identify(n,e,s)}getInitToken(){return this.clientToken}getIdentifiedUser(){return{externalId:this.externalId}}async updateUser(e={},s={}){o("updateUser"),this.ensureIdentified(),await this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(e)},{batch:!0})}async group(e,s={},{signature:i,membership:n}={}){if(o("group",e),this.ensureIdentified(),this.testUserIdentified&&e!==this.groupId){o("group() ignored since a test user has been identified");return}if(typeof e=="number")e=String(e);else if(!e||typeof e!="string")throw new l(`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=i||null,await this.send({kind:"UpsertGroup",groupExternalId:e,groupSignature:this.groupSignature,groupAttributes:this.normalizeAttributes(s),membershipAttributes:this.normalizeAttributes(n)},{batch:!0})}async updateGroup(e={},s={}){o("updateGroup");const i=this.ensureGroup();await this.send({kind:"UpsertGroup",groupExternalId:i,groupSignature:this.groupSignature,membershipAttributes:this.normalizeAttributes(s.membership),groupAttributes:this.normalizeAttributes(e)},{batch:!0})}normalizeAttributes(e){if(e==null)return{};if(typeof e!="object")throw new l("Userflow: 'attributes' must be an object.");const s={};for(const i in e){if(!e.hasOwnProperty(i))continue;if(i==="traits"){const r=e[i];Object.assign(s,this.extractLegacyTraits(r));continue}let n=e[i];if(typeof n=="string"||typeof n=="number"||typeof n=="boolean"||n==null||Array.isArray(n))s[i]=this.normalizeAttributeLiteralOrList(i,n);else{if(typeof n!="object"||n==null)throw new l(`Userflow: Invalid value for '${i}' attribute.`);if("set"in n)s[i]={set:this.normalizeAttributeLiteralOrList(i,n.set),dataType:this.normalizeDataType(i,n.data_type||n.dataType)};else if("set_once"in n||"setOnce"in n)s[i]={setOnce:this.normalizeAttributeLiteralOrList(i,n.set_once??n.setOnce),dataType:this.normalizeDataType(i,n.data_type||n.dataType)};else if("add"in n){const r=n.add;if(typeof r!="string"&&typeof r!="number")throw new l(`Userflow: Invalid 'add' value for '${i}' attribute. Must be a number or string.`);s[i]={add:r}}else if("subtract"in n){const r=n.subtract;if(typeof r!="string"&&typeof r!="number")throw new l(`Userflow: Invalid 'subtract' value for '${i}' attribute. Must be a number or string.`);s[i]={subtract:r}}else if("append"in n)s[i]={append:this.normalizeAttributeLiteralOrList(i,n.append)};else if("prepend"in n)s[i]={prepend:this.normalizeAttributeLiteralOrList(i,n.prepend)};else if("remove"in n)s[i]={remove:this.normalizeAttributeLiteralOrList(i,n.remove)};else throw new l(`Userflow: Invalid value for '${i}' attribute.`)}}return s}normalizeAttributeLiteralOrList(e,s){return Array.isArray(s)?s.map(i=>this.normalizeAttributeLiteral(e,i)):this.normalizeAttributeLiteral(e,s)}normalizeAttributeLiteral(e,s){if(s==null)return null;if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")return s;throw new l(`Userflow: Invalid value for '${e}' attribute.`)}normalizeDataType(e,s){if(!s)return null;switch(s){case"string":return S.STRING;case"number":return S.NUMBER;case"boolean":return S.BOOLEAN;case"datetime":return S.DATETIME}throw new l(`Userflow: Invalid data_type for '${e}' attribute.`)}extractLegacyTraits(e){if(!e)return{};if(!Array.isArray(e)){const s=[];for(const i in e)e.hasOwnProperty(i)&&s.push({name:i,value:e[i]});e=s}return e.reduce((s,{name:i,value:n,dataType:r})=>{if(typeof i!="string"||i.length>100||!i.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:",i),s;if(typeof n!="string")if(typeof n=="boolean")r||(r="boolean"),n=n?"true":"false";else if(typeof n=="number")r||(r=Number.isInteger(n)?"integer":"decimal"),n=String(n);else return this.warn(`userflow.identify: The value of trait '${i}' is invalid (must be a string, a boolean or a number). The trait will be ignored. Value was:`,n),s;let a=null;if(r)switch(r){case"string":a=S.STRING;break;case"boolean":a=S.BOOLEAN;break;case"integer":a=S.NUMBER;break;case"decimal":a=S.NUMBER;break;case"datetime":a=S.DATETIME;break;default:return this.warn(`userflow.identify: The data type of trait '${i}' is invalid (must be a 'string', 'boolean', 'integer', 'decimal' or 'datetime'). The trait will be ignored. Data type was:`,r),s}return s[i]={set:n,dataType:a},s},{})}async track(e,s={},{userOnly:i}={}){o(`track '${e}'`,s),this.ensureIdentified(),await this.send({kind:"TrackEvent",userOnly:!!i,name:e,attributes:this.normalizeEventAttributes(s)},{batch:!0})}normalizeEventAttributes(e){const s=this.normalizeAttributes(e);for(const i in s){if(!s.hasOwnProperty(i))continue;const n=s[i];if(!(n==null||typeof n=="string"||typeof n=="boolean"||typeof n=="number"||Array.isArray(n)||"set"in n))throw new l(`Userflow: Invalid value for '${i}' attribute. Event attributes only support literal values, list values and 'set' changes.`)}return s}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(P()),s=e.searchParams.get("userflow")||e.searchParams.get("studio1_flow")||e.searchParams.get("studio1_walkthrough");s&&(o(`url contained flow ${s}`),this.startFlow({flowId:s,startReason:m.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:De(),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 this.externalId!=null}on(e,s){let i=this.listeners.get(e);i||(i=new Set,this.listeners.set(e,i)),i.add(s)}off(e,s){const i=this.listeners.get(e);i&&i.delete(s)}emit(e,...s){const i=this.listeners.get(e);i&&Array.from(i).forEach(r=>r(...s))}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(){o("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,s)=>{this.untrackClientCondition(s)}),this.firstIdentifyCallback=null,this.testUserIdentified=!1,g.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:s,startReason:i,once:n,batch:r,replaceCurrent:a}){if(this.ensureIdentified(),a&&this.flowSession&&this.endFlow(this.flowSession,{endReason:C.REPLACED,batch:!0}),o(`startFlow ${e}`,{startReason:i}),this.checklistSession?.flow.id===e){o("startFlow matches current checklist, so showing it instead"),this.showChecklist();return}const u={kind:"StartFlow",flowId:e,stepCvid:s,startReason:i,once:!!n};await this.send(u,{batch:r})}async startFlowWithToken(e){this.ensureIdentified(),o("startFlowWithToken",{token:e}),await this.send({kind:"StartFlowWithToken",token:e},{batch:!0})}optimisticClockUIUpdate(e){this.clientClock++,e(),this.toggleUI()}async showChecklist(){if(this.resourceCenterEmbedsChecklist()){this.openResourceCenter();return}this.unmarkExpandPending(),!(!this.checklistSession||this.checklistExpanded)&&(this.ensureIdentified(),this.checklistExpanded=!0,this.toggleUI(),f.setItem(`checklistExpanded:${this.checklistSession.id}`,"1"),await this.send({kind:"ShowChecklist",sessionId:this.checklistSession.id},{batch:!0}))}async hideChecklist(){if(this.resourceCenterEmbedsChecklist()){this.closeResourceCenter();return}!this.checklistSession||!this.checklistExpanded||(this.ensureIdentified(),this.checklistExpanded=!1,this.toggleUI(),f.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"),f.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"),f.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:s}=this,i=this.resourceCenterSession.version.resourceCenter?.blocks.find(n=>n.type===L.ANNOUNCEMENTS);return{isOpen:this.resourceCenterOpen,hasChecklist:e,uncompletedChecklistTaskCount:e&&s?Be(s):0,unreadAnnouncementCount:i?.unreadAnnouncementCount||0}}resourceCenterEmbedsChecklist(){const e=this.resourceCenterSession;return!!e&&!!e.version.resourceCenter?.blocks.some(s=>s.type===L.CHECKLIST)}async endFlow(e,{endReason:s,batch:i}){this.ensureIdentified(),this.optimisticClockUIUpdate(()=>{const{clientClock:u}=this;this.flowSession?.id===e.id&&this.setFlowSession(null,u),this.checklistSession?.id===e.id&&this.setChecklistSession(null,u),this.bannerSession?.id===e.id&&this.setBannerSession(null),this.resourceCenterSession?.id===e.id&&this.setResourceCenterSession(null)});const{flow:n}=e,r={id:n.id,type:n.type.toLowerCase()};n.type===k.CHECKLIST?this.emit("checklistEnded",{checklist:r,endReason:s}):n.type===k.FLOW&&this.emit("flowEnded",{flow:r,endReason:s});const a={kind:"EndFlow",sessionId:e.id,endReason:s};await this.send(a,{batch:i})}async goToStep(e,s){o("goToStep",e.id,s.name||s.id),this.ensureIdentified();const i=this.send({kind:"GoToStep",sessionId:e.id,stepId:s.id});e.currentStep=s,this.emit("gotostep",{session:e,step:s}),await i}async endAllFlows(){o("endAllFlows"),this.optimisticClockUIUpdate(()=>{const{clientClock:e}=this;this.setFlowSession(null,e),this.setChecklistSession(null,e)}),await this.send({kind:"EndAllFlows"})}async endChecklist(){o("endChecklist");const e=this.checklistSession||this.flowSession;e?.flow.type===k.CHECKLIST&&this.endFlow(e,{endReason:C.USERFLOWJS})}setFlowSession(e,s=this.clientClock){const i=this.flowSession;this.flowSession=e,this.flowSessionClock=s,e&&!i&&(this.hideChecklist(),this.closeResourceCenter()),e==null&&this.originalActiveElement&&(typeof this.originalActiveElement.focus=="function"&&this.originalActiveElement.focus(),this.originalActiveElement=void 0)}setChecklistSession(e,s=this.clientClock){const i=this.checklistSession;this.checklistSession=e,this.checklistSessionClock=s,e===null&&(this.checklistExpanded=!1,this.checklistExpandPending=!1),e&&e.id!==i?.id&&(this.checklistExpanded=!!f.getItem(`checklistExpanded:${e.id}`),e.expandPending&&(this.checklistExpandPending=!0)),this.emit("checklistChanged"),this.emit("resourceCenterChanged")}setBannerSession(e){this.bannerSession=e}setResourceCenterSession(e){const s=this.resourceCenterSession;e=typeof e=="function"?e(this.resourceCenterSession):e,this.resourceCenterSession=e,e===null&&(this.resourceCenterOpen=!1),s&&s.id!==e?.id&&f.removeItem(`resourceCenterOpen:${s.id}`),e&&e.id!==s?.id&&(this.resourceCenterOpen=!!f.getItem(`resourceCenterOpen:${e.id}`)),this.emit("resourceCenterChanged")}launcherSeen(e){this.send({kind:"StartFlow",flowId:e,startReason:m.LAUNCHER_SEEN,once:!1})}activateLauncher(e){const s=this.activeLauncherFlowId&&this.launcherSessions.find(i=>i.flow.id===this.activeLauncherFlowId);s&&this.deactivateLauncher(s),this.activeLauncherFlowId=e.flow.id,this.toggleUI(),this.send({kind:"ActivateLauncher",flowId:e.flow.id})}deactivateLauncher(e){const{launcher:s}=e.version;e.flow.id===this.activeLauncherFlowId&&(s?.dismissOn===G.DEACTIVATE?this.dismissLauncher(e,{endReason:C.LAUNCHER_DEACTIVATED}):(this.activeLauncherFlowId=null,this.toggleUI()))}dismissLauncher(e,{endReason:s}){const i=e.flow.id;this.removeLauncher(i),this.toggleUI(),this.send({kind:"DismissLauncher",flowId:i,endReason:s})}removeLauncher(e){const s=this.launcherSessions.findIndex(i=>i.flow.id===e);return s===-1?!1:(this.launcherSessions=[...this.launcherSessions.slice(0,s),...this.launcherSessions.slice(s+1)],e===this.activeLauncherFlowId&&(this.activeLauncherFlowId=null),!0)}async toggleUI(){const e=this.getSessionStorageState();!this.flowSession&&(this.checklistExpandPending||this.checklistSession?.version.checklist?.tasks.some(s=>this.taskIsUnacked(s.cvid)))&&this.showChecklist(),e.isTargetTab&&this.monitorTitle(),this.emit("uistatechange"),this.shouldBeMounted()?await this.mountUI():this.unmountUI()}shouldBeMounted(){return this.uiDisabled?!1:!!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&&(o("mount UI"),this.ui=e,this.ui.mount())}}unmountUI(){this.ui&&(o("unmount UI"),this.ui.unmount(),this.ui=null)}remount(){this.unmountUI(),this.toggleUI()}async createUI(){try{const e=w(()=>import("./ui.js"),__vite__mapDeps([27,1,2,3,17,18,4,5,6,7,25,26]));this.bannerSession&&Pe(),this.resourceCenterSession&&Me();const{RealUI:s}=await e;return new s(this)}catch(e){throw this.reportCspIssue(),e}}async trackClientCondition(e){if(this.clientConditions.has(e.id))return;o("track client condition",e),this.clientConditions.set(e.id,{condition:e,isTrue:null});const{conditionTypes:s}=await w(async()=>{const{conditionTypes:r}=await import("./flow-condition-types.js").then(a=>a.v);return{conditionTypes:r}},__vite__mapDeps([10,2,11])),i=s[e.type],n=this.clientConditions.get(e.id);n&&(n.untrack=i.track({sessionData:new y([]),condition:e,callback:r=>{n.isTrue!==r&&(o("client condition truthiness changed",r,n.condition),n.isTrue=r,this.send({kind:"ToggleClientCondition",conditionId:e.id,isTrue:r},{batch:!0}))}}))}untrackClientCondition(e){const s=this.clientConditions.get(e);s&&(o("untrack client condition",s.condition),s.untrack&&s.untrack(),this.clientConditions.delete(e))}async addTracker(e){let s=this.trackers.get(e.flowId);s?s.tracker=e:this.trackers.set(e.flowId,{tracker:e,isTrue:!1});const{conditionTypes:i}=await w(async()=>{const{conditionTypes:c}=await import("./flow-condition-types.js").then(h=>h.v);return{conditionTypes:c}},__vite__mapDeps([10,2,11])),n=this.trackers.get(e.flowId);if(!n)return;const{tracker:r}=n,{condition:a}=r,u=i[a.type];n.untrack&&n.untrack(),n.untrack=u.track({sessionData:new y(r.data),condition:a,flipBackEvents:!0,callback:c=>{const h=n.isTrue;n.isTrue=c,!h&&c&&this.send({kind:"TrackTrackerEvent",token:r.token},{batch:!0})},description:`event tracker ${r.flowId}`}),this.emit("private:trackerStarted")}removeTracker(e){const s=this.trackers.get(e);s&&(s.untrack&&s.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 s=new MutationObserver(()=>{this.fixTitle()});s.observe(e,{childList:!0}),this.titleObserver=s}}fixTitle(){const e=document.title,i="[Userflow Preview] "+e.replace(/\[Userflow Preview\] /,"");e!==i&&(document.title=i)}reportCspIssue(){const e=this.getSessionStorageState();(this.testUserIdentified||e.activeApp)&&!this.cspIssueReported&&(this.cspIssueReported=!0,o("csp issue detected"),U({kind:"userflow:crxCspIssueDetected"}))}getAudio(){return this.audio||(this.audio=new Audio),this.audio}playAudio(e){if(document.hidden)return;const s=this.getAudio();e&&(s.src=e);const i=s.play();this.audioReady=!0,i&&i.catch(n=>{n.name})}pauseAudio(){const e=this.audio;e&&!e.paused&&e.pause()}async getStepSpeech(e,s){return(await this.send({kind:"GetStepSpeechV2",syntheticVoice:e,text:s})).url}featureFlagEnabled(e){return this.featureFlags.has(e)}showNotification(e,s,i){const r={id:++this.notificationIdCounter,label:e,message:s,type:i};this.notifications=[...this.notifications,r],this.toggleUI()}dismissNotification(e){this.notifications=this.notifications.filter(s=>s.id!==e),this.toggleUI()}warn(...e){console.warn(...e)}nextRef(){return this.refCounter++}}if(typeof window.userflow>"u"||window.userflow._stubbed){const t=Object.assign(window.userflow||{},We());window.userflow=t,window.studio1=t,$e()}function We(){const t=new Ge;return{_stubbed:!1,init(e){t.init(e)},identify(e,s={},i={}){return t.identify(e,s,i)},identifyAnonymous(e={},s={}){return t.identifyAnonymous(e,s)},isIdentified(){return t.isIdentified()},updateUser(e,s={}){return t.updateUser(e,s)},group(e,s={},i={}){return t.group(e,s,i)},updateGroup(e,s={}){return t.updateGroup(e,s)},track(e,s={},i={}){return t.track(e,s,i)},start(e,{once:s}={}){return t.startFlow({flowId:e,startReason:m.USERFLOWJS,once:s})},startFlow(e){return console.warn("Userflow.js: userflow.startFlow() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)},startWalk(e){return console.warn("Userflow.js: userflow.startWalk() has been deprecated. Use userflow.start() instead."),window.userflow.start(e)},endAll(){return t.endAllFlows()},endChecklist(){return t.endChecklist()},endAllFlows(){"Userflow.js: userflow.endAllFlows() has been deprecated. Use userflow.endAll() instead.";return 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(){t.openResourceCenter()},closeResourceCenter(){t.closeResourceCenter()},toggleResourceCenter(){t.toggleResourceCenter()},setResourceCenterLauncherHidden(e){t.setResourceCenterLauncherHidden(e)},getResourceCenterState(){return t.getResourceCenterState()},setWalkPosition(){console.warn("Userflow.js: userflow.setWalkPosition() has been deprecated and no longer has any effect.")},reset(){t.reset()},remount(){t.remount()},on(e,s){t.on(e,s)},off(e,s){t.off(e,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&&d.customInputs.push({cssSelector:e})},registerCustomInput(e,s){d.customInputs.push({cssSelector:e,getValue:s})},setCustomNavigate(e){d.customNavigate=e},setUrlFilter(e){d.urlFilter=e},setLinkUrlDecorator(e){d.linkUrlDecorator=e,t.emit("uistatechange")},setInferenceAttributeNames(e){d.inferenceAttributeNames=e},setInferenceAttributeFilter(e,s){d.inferenceAttributeFilters[e]=R(s)},setInferenceClassNameFilter(e){d.inferenceClassNameFilters=R(e)},setScrollPadding(e){d.scrollPadding=e},setCustomScrollIntoView(e){d.customScrollIntoView=e},prepareAudio(){t.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(e){t.pageTrackingDisabled=e},setBaseZIndex(e){d.baseZIndex=e},setServerEndpoint(e){d.serverEndpoint=e},disableEvalJs(){d.evalJsDisabled=!0},_setTargetEnv(e){t.setTargetEnv(e)},_getInitToken(){return t.getInitToken()},_getIdentifiedUser(){return t.getIdentifiedUser()}}}function $e(){const t=window.userflow,e=window.USERFLOWJS_QUEUE;if(delete window.USERFLOWJS_QUEUE,!(!e||e.length===0)){o(`processing ${e.length} items in the queue`);for(const[s,i,n]of e){if(typeof t[s]!="function"){console.error(`Userflow.js: Invalid method '${s}' in queue`);continue}const r=t[s](...n);i&&r&&typeof r.then=="function"&&r.then(i.resolve,i.reject)}o("queue processed")}}var Ye=window.userflow;export{Oe as $,Ue as A,Pe as B,ke as C,P as D,C as E,we as F,ge as G,Ie as H,o as I,y as J,ce as K,_e as L,ue as M,ie as N,ze as O,O as P,ee as Q,Me as R,m as S,fe as T,l as U,Ee as V,De as W,X,H as Y,ne as Z,w as _,L as a,Q as a0,de as b,d as c,he as d,Ye as default,me as e,k as f,Be as g,pe as h,ye as i,se as j,Se as k,le as l,te as m,g as n,Ce as o,re as p,ae as q,Le as r,Ae as s,Re as t,f as u,Ne as v,ve as w,Te as x,oe as y,je as z};
|
|
18
18
|
//# sourceMappingURL=userflow.js.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="19b8238d-5d00-4a6f-94f4-350aad8c9a31",r._sentryDebugIdIdentifier="sentry-dbid-19b8238d-5d00-4a6f-94f4-350aad8c9a31")}catch{}})();var Ze=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};Ze.SENTRY_RELEASE={id:"e549470387c266927588943958fb489c1afd0cd8"};var F=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yi(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var P=function(r){return r&&r.Math===Math&&r},f=P(typeof globalThis=="object"&&globalThis)||P(typeof window=="object"&&window)||P(typeof self=="object"&&self)||P(typeof F=="object"&&F)||P(typeof F=="object"&&F)||function(){return this}()||Function("return this")(),gr={},h=function(r){try{return!!r()}catch{return!0}},Qe=h,g=!Qe(function(){return Object.defineProperty({},1,{get:function(){return 7}})[1]!==7}),rt=h,Or=!rt(function(){var r=function(){}.bind();return typeof r!="function"||r.hasOwnProperty("prototype")}),et=Or,B=Function.prototype.call,O=et?B.bind(B):function(){return B.apply(B,arguments)},fe={},se={}.propertyIsEnumerable,ye=Object.getOwnPropertyDescriptor,tt=ye&&!se.call({1:2},1);fe.f=tt?function(e){var t=ye(this,e);return!!t&&t.enumerable}:se;var de=function(r,e){return{enumerable:!(r&1),configurable:!(r&2),writable:!(r&4),value:e}},$e=Or,pe=Function.prototype,sr=pe.call,nt=$e&&pe.bind.bind(sr,sr),b=$e?nt:function(r){return function(){return sr.apply(r,arguments)}},be=b,at=be({}.toString),ot=be("".slice),q=function(r){return ot(at(r),8,-1)},it=b,vt=h,ut=q,H=Object,ct=it("".split),lt=vt(function(){return!H("z").propertyIsEnumerable(0)})?function(r){return ut(r)==="String"?ct(r,""):H(r)}:H,Sr=function(r){return r==null},ft=Sr,st=TypeError,he=function(r){if(ft(r))throw new st("Can't call method on "+r);return r},yt=lt,dt=he,Er=function(r){return yt(dt(r))},X=typeof document=="object"&&document.all,d=typeof X>"u"&&X!==void 0?function(r){return typeof r=="function"||r===X}:function(r){return typeof r=="function"},$t=d,_=function(r){return typeof r=="object"?r!==null:$t(r)},Z=f,pt=d,bt=function(r){return pt(r)?r:void 0},ge=function(r,e){return arguments.length<2?bt(Z[r]):Z[r]&&Z[r][e]},ht=b,Oe=ht({}.isPrototypeOf),gt=f,_r=gt.navigator,Dr=_r&&_r.userAgent,Se=Dr?String(Dr):"",Ee=f,Q=Se,Mr=Ee.process,Ar=Ee.Deno,Fr=Mr&&Mr.versions||Ar&&Ar.version,Br=Fr&&Fr.v8,$,W;Br&&($=Br.split("."),W=$[0]>0&&$[0]<4?1:+($[0]+$[1]));!W&&Q&&($=Q.match(/Edge\/(\d+)/),(!$||$[1]>=74)&&($=Q.match(/Chrome\/(\d+)/),$&&(W=+$[1])));var Te=W,Lr=Te,Ot=h,St=f,Et=St.String,we=!!Object.getOwnPropertySymbols&&!Ot(function(){var r=Symbol("symbol detection");return!Et(r)||!(Object(r)instanceof Symbol)||!Symbol.sham&&Lr&&Lr<41}),Tt=we,Ie=Tt&&!Symbol.sham&&typeof Symbol.iterator=="symbol",wt=ge,It=d,mt=Oe,Rt=Ie,Pt=Object,me=Rt?function(r){return typeof r=="symbol"}:function(r){var e=wt("Symbol");return It(e)&&mt(e.prototype,Pt(r))},Ct=String,Tr=function(r){try{return Ct(r)}catch{return"Object"}},jt=d,Nt=Tr,_t=TypeError,D=function(r){if(jt(r))return r;throw new _t(Nt(r)+" is not a function")},Dt=D,Mt=Sr,wr=function(r,e){var t=r[e];return Mt(t)?void 0:Dt(t)},rr=O,er=d,tr=_,At=TypeError,Ft=function(r,e){var t,n;if(e==="string"&&er(t=r.toString)&&!tr(n=rr(t,r))||er(t=r.valueOf)&&!tr(n=rr(t,r))||e!=="string"&&er(t=r.toString)&&!tr(n=rr(t,r)))return n;throw new At("Can't convert object to primitive value")},Re={exports:{}},Ur=f,Bt=Object.defineProperty,Ir=function(r,e){try{Bt(Ur,r,{value:e,configurable:!0,writable:!0})}catch{Ur[r]=e}return e},Lt=f,Ut=Ir,Gr="__core-js_shared__",xr=Re.exports=Lt[Gr]||Ut(Gr,{});(xr.versions||(xr.versions=[])).push({version:"3.39.0",mode:"global",copyright:"© 2014-2024 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.39.0/LICENSE",source:"https://github.com/zloirock/core-js"});var mr=Re.exports,Kr=mr,Pe=function(r,e){return Kr[r]||(Kr[r]=e||{})},Gt=he,xt=Object,Kt=function(r){return xt(Gt(r))},Vt=b,kt=Kt,Wt=Vt({}.hasOwnProperty),S=Object.hasOwn||function(e,t){return Wt(kt(e),t)},zt=b,Yt=0,qt=Math.random(),Jt=zt(1 .toString),Ce=function(r){return"Symbol("+(r===void 0?"":r)+")_"+Jt(++Yt+qt,36)},Ht=f,Xt=Pe,Vr=S,Zt=Ce,Qt=we,rn=Ie,m=Ht.Symbol,nr=Xt("wks"),en=rn?m.for||m:m&&m.withoutSetter||Zt,E=function(r){return Vr(nr,r)||(nr[r]=Qt&&Vr(m,r)?m[r]:en("Symbol."+r)),nr[r]},tn=O,kr=_,Wr=me,nn=wr,an=Ft,on=E,vn=TypeError,un=on("toPrimitive"),cn=function(r,e){if(!kr(r)||Wr(r))return r;var t=nn(r,un),n;if(t){if(e===void 0&&(e="default"),n=tn(t,r,e),!kr(n)||Wr(n))return n;throw new vn("Can't convert object to primitive value")}return e===void 0&&(e="number"),an(r,e)},ln=cn,fn=me,je=function(r){var e=ln(r,"string");return fn(e)?e:e+""},sn=f,zr=_,yr=sn.document,yn=zr(yr)&&zr(yr.createElement),dn=function(r){return yn?yr.createElement(r):{}},$n=g,pn=h,bn=dn,Ne=!$n&&!pn(function(){return Object.defineProperty(bn("div"),"a",{get:function(){return 7}}).a!==7}),hn=g,gn=O,On=fe,Sn=de,En=Er,Tn=je,wn=S,In=Ne,Yr=Object.getOwnPropertyDescriptor;gr.f=hn?Yr:function(e,t){if(e=En(e),t=Tn(t),In)try{return Yr(e,t)}catch{}if(wn(e,t))return Sn(!gn(On.f,e,t),e[t])};var J={},mn=g,Rn=h,Pn=mn&&Rn(function(){return Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype!==42}),Cn=_,jn=String,Nn=TypeError,M=function(r){if(Cn(r))return r;throw new Nn(jn(r)+" is not an object")},_n=g,Dn=Ne,Mn=Pn,L=M,qr=je,An=TypeError,ar=Object.defineProperty,Fn=Object.getOwnPropertyDescriptor,or="enumerable",ir="configurable",vr="writable";J.f=_n?Mn?function(e,t,n){if(L(e),t=qr(t),L(n),typeof e=="function"&&t==="prototype"&&"value"in n&&vr in n&&!n[vr]){var a=Fn(e,t);a&&a[vr]&&(e[t]=n.value,n={configurable:ir in n?n[ir]:a[ir],enumerable:or in n?n[or]:a[or],writable:!1})}return ar(e,t,n)}:ar:function(e,t,n){if(L(e),t=qr(t),L(n),Dn)try{return ar(e,t,n)}catch{}if("get"in n||"set"in n)throw new An("Accessors not supported");return"value"in n&&(e[t]=n.value),e};var Bn=g,Ln=J,Un=de,_e=Bn?function(r,e,t){return Ln.f(r,e,Un(1,t))}:function(r,e,t){return r[e]=t,r},De={exports:{}},dr=g,Gn=S,Me=Function.prototype,xn=dr&&Object.getOwnPropertyDescriptor,Rr=Gn(Me,"name"),Kn=Rr&&function(){}.name==="something",Vn=Rr&&(!dr||dr&&xn(Me,"name").configurable),kn={EXISTS:Rr,PROPER:Kn,CONFIGURABLE:Vn},Wn=b,zn=d,$r=mr,Yn=Wn(Function.toString);zn($r.inspectSource)||($r.inspectSource=function(r){return Yn(r)});var Ae=$r.inspectSource,qn=f,Jn=d,Jr=qn.WeakMap,Hn=Jn(Jr)&&/native code/.test(String(Jr)),Xn=Pe,Zn=Ce,Hr=Xn("keys"),Qn=function(r){return Hr[r]||(Hr[r]=Zn(r))},Fe={},ra=Hn,Be=f,ea=_,ta=_e,ur=S,cr=mr,na=Qn,aa=Fe,Xr="Object already initialized",pr=Be.TypeError,oa=Be.WeakMap,z,N,Y,ia=function(r){return Y(r)?N(r):z(r,{})},va=function(r){return function(e){var t;if(!ea(e)||(t=N(e)).type!==r)throw new pr("Incompatible receiver, "+r+" required");return t}};if(ra||cr.state){var p=cr.state||(cr.state=new oa);p.get=p.get,p.has=p.has,p.set=p.set,z=function(r,e){if(p.has(r))throw new pr(Xr);return e.facade=r,p.set(r,e),e},N=function(r){return p.get(r)||{}},Y=function(r){return p.has(r)}}else{var I=na("state");aa[I]=!0,z=function(r,e){if(ur(r,I))throw new pr(Xr);return e.facade=r,ta(r,I,e),e},N=function(r){return ur(r,I)?r[I]:{}},Y=function(r){return ur(r,I)}}var ua={set:z,get:N,has:Y,enforce:ia,getterFor:va},Pr=b,ca=h,la=d,U=S,br=g,fa=kn.CONFIGURABLE,sa=Ae,Le=ua,ya=Le.enforce,da=Le.get,Zr=String,K=Object.defineProperty,$a=Pr("".slice),pa=Pr("".replace),ba=Pr([].join),ha=br&&!ca(function(){return K(function(){},"length",{value:8}).length!==8}),ga=String(String).split("String"),Oa=De.exports=function(r,e,t){$a(Zr(e),0,7)==="Symbol("&&(e="["+pa(Zr(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),t&&t.getter&&(e="get "+e),t&&t.setter&&(e="set "+e),(!U(r,"name")||fa&&r.name!==e)&&(br?K(r,"name",{value:e,configurable:!0}):r.name=e),ha&&t&&U(t,"arity")&&r.length!==t.arity&&K(r,"length",{value:t.arity});try{t&&U(t,"constructor")&&t.constructor?br&&K(r,"prototype",{writable:!1}):r.prototype&&(r.prototype=void 0)}catch{}var n=ya(r);return U(n,"source")||(n.source=ba(ga,typeof e=="string"?e:"")),r};Function.prototype.toString=Oa(function(){return la(this)&&da(this).source||sa(this)},"toString");var Sa=De.exports,Ea=d,Ta=J,wa=Sa,Ia=Ir,ma=function(r,e,t,n){n||(n={});var a=n.enumerable,o=n.name!==void 0?n.name:e;if(Ea(t)&&wa(t,o,n),n.global)a?r[e]=t:Ia(e,t);else{try{n.unsafe?r[e]&&(a=!0):delete r[e]}catch{}a?r[e]=t:Ta.f(r,e,{value:t,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return r},Ue={},Ra=Math.ceil,Pa=Math.floor,Ca=Math.trunc||function(e){var t=+e;return(t>0?Pa:Ra)(t)},ja=Ca,Ge=function(r){var e=+r;return e!==e||e===0?0:ja(e)},Na=Ge,_a=Math.max,Da=Math.min,Ma=function(r,e){var t=Na(r);return t<0?_a(t+e,0):Da(t,e)},Aa=Ge,Fa=Math.min,Ba=function(r){var e=Aa(r);return e>0?Fa(e,9007199254740991):0},La=Ba,xe=function(r){return La(r.length)},Ua=Er,Ga=Ma,xa=xe,Qr=function(r){return function(e,t,n){var a=Ua(e),o=xa(a);if(o===0)return!r&&-1;var i=Ga(n,o),v;if(r&&t!==t){for(;o>i;)if(v=a[i++],v!==v)return!0}else for(;o>i;i++)if((r||i in a)&&a[i]===t)return r||i||0;return!r&&-1}},Ka={includes:Qr(!0),indexOf:Qr(!1)},Va=b,lr=S,ka=Er,Wa=Ka.indexOf,za=Fe,re=Va([].push),Ya=function(r,e){var t=ka(r),n=0,a=[],o;for(o in t)!lr(za,o)&&lr(t,o)&&re(a,o);for(;e.length>n;)lr(t,o=e[n++])&&(~Wa(a,o)||re(a,o));return a},qa=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Ja=Ya,Ha=qa,Xa=Ha.concat("length","prototype");Ue.f=Object.getOwnPropertyNames||function(e){return Ja(e,Xa)};var Ke={};Ke.f=Object.getOwnPropertySymbols;var Za=ge,Qa=b,ro=Ue,eo=Ke,to=M,no=Qa([].concat),ao=Za("Reflect","ownKeys")||function(e){var t=ro.f(to(e)),n=eo.f;return n?no(t,n(e)):t},ee=S,oo=ao,io=gr,vo=J,uo=function(r,e,t){for(var n=oo(e),a=vo.f,o=io.f,i=0;i<n.length;i++){var v=n[i];!ee(r,v)&&!(t&&ee(t,v))&&a(r,v,o(e,v))}},co=h,lo=d,fo=/#|\.prototype\./,A=function(r,e){var t=yo[so(r)];return t===po?!0:t===$o?!1:lo(e)?co(e):!!e},so=A.normalize=function(r){return String(r).replace(fo,".").toLowerCase()},yo=A.data={},$o=A.NATIVE="N",po=A.POLYFILL="P",Ve=A,G=f,bo=gr.f,ho=_e,go=ma,Oo=Ir,So=uo,Eo=Ve,To=function(r,e){var t=r.target,n=r.global,a=r.stat,o,i,v,u,c,s;if(n?i=G:a?i=G[t]||Oo(t,{}):i=G[t]&&G[t].prototype,i)for(v in e){if(c=e[v],r.dontCallGetSet?(s=bo(i,v),u=s&&s.value):u=i[v],o=Eo(n?v:t+(a?".":"#")+v,r.forced),!o&&u!==void 0){if(typeof c==typeof u)continue;So(c,u)}(r.sham||u&&u.sham)&&ho(c,"sham",!0),go(i,v,c,r)}},ke={},te=D,wo=TypeError,Io=function(r){var e,t;this.promise=new r(function(n,a){if(e!==void 0||t!==void 0)throw new wo("Bad Promise constructor");e=n,t=a}),this.resolve=te(e),this.reject=te(t)};ke.f=function(r){return new Io(r)};var mo=function(r){try{return{error:!1,value:r()}}catch(e){return{error:!0,value:e}}},Ro=q,Po=b,Co=function(r){if(Ro(r)==="Function")return Po(r)},ne=Co,jo=D,No=Or,_o=ne(ne.bind),Do=function(r,e){return jo(r),e===void 0?r:No?_o(r,e):function(){return r.apply(e,arguments)}},We={},Mo=E,Ao=We,Fo=Mo("iterator"),Bo=Array.prototype,Lo=function(r){return r!==void 0&&(Ao.Array===r||Bo[Fo]===r)},Uo=E,Go=Uo("toStringTag"),ze={};ze[Go]="z";var xo=String(ze)==="[object z]",Ko=xo,Vo=d,V=q,ko=E,Wo=ko("toStringTag"),zo=Object,Yo=V(function(){return arguments}())==="Arguments",qo=function(r,e){try{return r[e]}catch{}},Jo=Ko?V:function(r){var e,t,n;return r===void 0?"Undefined":r===null?"Null":typeof(t=qo(e=zo(r),Wo))=="string"?t:Yo?V(e):(n=V(e))==="Object"&&Vo(e.callee)?"Arguments":n},Ho=Jo,ae=wr,Xo=Sr,Zo=We,Qo=E,ri=Qo("iterator"),Ye=function(r){if(!Xo(r))return ae(r,ri)||ae(r,"@@iterator")||Zo[Ho(r)]},ei=O,ti=D,ni=M,ai=Tr,oi=Ye,ii=TypeError,vi=function(r,e){var t=arguments.length<2?oi(r):e;if(ti(t))return ni(ei(t,r));throw new ii(ai(r)+" is not iterable")},ui=O,oe=M,ci=wr,li=function(r,e,t){var n,a;oe(r);try{if(n=ci(r,"return"),!n){if(e==="throw")throw t;return t}n=ui(n,r)}catch(o){a=!0,n=o}if(e==="throw")throw t;if(a)throw n;return oe(n),t},fi=Do,si=O,yi=M,di=Tr,$i=Lo,pi=xe,ie=Oe,bi=vi,hi=Ye,ve=li,gi=TypeError,k=function(r,e){this.stopped=r,this.result=e},ue=k.prototype,Oi=function(r,e,t){var n=t&&t.that,a=!!(t&&t.AS_ENTRIES),o=!!(t&&t.IS_RECORD),i=!!(t&&t.IS_ITERATOR),v=!!(t&&t.INTERRUPTED),u=fi(e,n),c,s,T,R,l,w,Cr,jr=function(y){return c&&ve(c,"normal",y),new k(!0,y)},Nr=function(y){return a?(yi(y),v?u(y[0],y[1],jr):u(y[0],y[1])):v?u(y,jr):u(y)};if(o)c=r.iterator;else if(i)c=r;else{if(s=hi(r),!s)throw new gi(di(r)+" is not iterable");if($i(s)){for(T=0,R=pi(r);R>T;T++)if(l=Nr(r[T]),l&&ie(ue,l))return l;return new k(!1)}c=bi(r,s)}for(w=o?r.next:c.next;!(Cr=si(w,c)).done;){try{l=Nr(Cr.value)}catch(y){ve(c,"throw",y)}if(typeof l=="object"&&l&&ie(ue,l))return l}return new k(!1)},Si=f,qe=Si.Promise,Ei=E,Je=Ei("iterator"),He=!1;try{var Ti=0,ce={next:function(){return{done:!!Ti++}},return:function(){He=!0}};ce[Je]=function(){return this},Array.from(ce,function(){throw 2})}catch{}var wi=function(r,e){try{if(!e&&!He)return!1}catch{return!1}var t=!1;try{var n={};n[Je]=function(){return{next:function(){return{done:t=!0}}}},r(n)}catch{}return t},C=f,Ii=Se,mi=q,x=function(r){return Ii.slice(0,r.length)===r},Ri=function(){return x("Bun/")?"BUN":x("Cloudflare-Workers")?"CLOUDFLARE":x("Deno/")?"DENO":x("Node.js/")?"NODE":C.Bun&&typeof Bun.version=="string"?"BUN":C.Deno&&typeof Deno.version=="object"?"DENO":mi(C.process)==="process"?"NODE":C.window&&C.document?"BROWSER":"REST"}(),Pi=f,j=qe,Ci=d,ji=Ve,Ni=Ae,_i=E,le=Ri,fr=Te;j&&j.prototype;var Di=_i("species"),hr=!1,Xe=Ci(Pi.PromiseRejectionEvent),Mi=ji("Promise",function(){var r=Ni(j),e=r!==String(j);if(!e&&fr===66)return!0;if(!fr||fr<51||!/native code/.test(r)){var t=new j(function(o){o(1)}),n=function(o){o(function(){},function(){})},a=t.constructor={};if(a[Di]=n,hr=t.then(function(){})instanceof n,!hr)return!0}return!e&&(le==="BROWSER"||le==="DENO")&&!Xe}),Ai={CONSTRUCTOR:Mi,REJECTION_EVENT:Xe,SUBCLASSING:hr},Fi=qe,Bi=wi,Li=Ai.CONSTRUCTOR,Ui=Li||!Bi(function(r){Fi.all(r).then(void 0,function(){})}),Gi=To,xi=O,Ki=D,Vi=ke,ki=mo,Wi=Oi,zi=Ui;Gi({target:"Promise",stat:!0,forced:zi},{allSettled:function(e){var t=this,n=Vi.f(t),a=n.resolve,o=n.reject,i=ki(function(){var v=Ki(t.resolve),u=[],c=0,s=1;Wi(e,function(T){var R=c++,l=!1;s++,xi(v,t,T).then(function(w){l||(l=!0,u[R]={status:"fulfilled",value:w},--s||a(u))},function(w){l||(l=!0,u[R]={status:"rejected",reason:w},--s||a(u))})}),--s||a(u)});return i.error&&o(i.value),n.promise}});export{Yi as g};
|
|
2
|
+
//# sourceMappingURL=vendor.core-js.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="
|
|
1
|
+
import"./vendor.core-js.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},d=new Error().stack;d&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[d]="8b58af4c-047e-42a3-96b4-ed7a593227d4",e._sentryDebugIdIdentifier="sentry-dbid-8b58af4c-047e-42a3-96b4-ed7a593227d4")}catch{}})();
|
|
2
2
|
//# sourceMappingURL=vendor.html-parse-stringify2.js.map
|
package/vendor.is-hotkey.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import"./vendor.
|
|
1
|
+
import"./vendor.core-js.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[e]="288363c0-e9aa-4c2c-92fb-b66e778170d6",r._sentryDebugIdIdentifier="sentry-dbid-288363c0-e9aa-4c2c-92fb-b66e778170d6")}catch{}})();var n={};Object.defineProperty(n,"__esModule",{value:!0});var _=typeof window<"u"&&/Mac|iPod|iPhone|iPad/.test(window.navigator.platform),p={alt:"altKey",control:"ctrlKey",meta:"metaKey",shift:"shiftKey"},A={add:"+",break:"pause",cmd:"meta",command:"meta",ctl:"control",ctrl:"control",del:"delete",down:"arrowdown",esc:"escape",ins:"insert",left:"arrowleft",mod:_?"meta":"control",opt:"alt",option:"alt",return:"enter",right:"arrowright",space:" ",spacebar:" ",up:"arrowup",win:"meta",windows:"meta"},m={backspace:8,tab:9,enter:13,shift:16,control:17,alt:18,pause:19,capslock:20,escape:27," ":32,pageup:33,pagedown:34,end:35,home:36,arrowleft:37,arrowup:38,arrowright:39,arrowdown:40,insert:45,delete:46,meta:91,numlock:144,scrolllock:145,";":186,"=":187,",":188,"-":189,".":190,"/":191,"`":192,"[":219,"\\":220,"]":221,"'":222};for(var u=1;u<20;u++)m["f"+u]=111+u;function d(r,e,o){e&&!("byKey"in e)&&(o=e,e=null),Array.isArray(r)||(r=[r]);var t=r.map(function(c){return K(c,e)}),a=function(l){return t.some(function(f){return C(f,l)})},s=o==null?a:a(o);return s}function D(r,e){return d(r,e)}function E(r,e){return d(r,{byKey:!0},e)}function K(r,e){var o=e&&e.byKey,t={};r=r.replace("++","+add");var a=r.split("+"),s=a.length;for(var c in p)t[p[c]]=!1;var l=!0,f=!1,b=void 0;try{for(var y=a[Symbol.iterator](),h;!(l=(h=y.next()).done);l=!0){var i=h.value,g=i.endsWith("?")&&i.length>1;g&&(i=i.slice(0,-1));var k=v(i),w=p[k];(s===1||!w)&&(o?t.key=k:t.which=H(i)),w&&(t[w]=g?null:!0)}}catch(I){f=!0,b=I}finally{try{!l&&y.return&&y.return()}finally{if(f)throw b}}return t}function C(r,e){for(var o in r){var t=r[o],a=void 0;if(t!=null&&(o==="key"&&e.key!=null?a=e.key.toLowerCase():o==="which"?a=t===91&&e.which===93?91:e.which:a=e[o],!(a==null&&t===!1)&&a!==t))return!1}return!0}function H(r){r=v(r);var e=m[r]||r.toUpperCase().charCodeAt(0);return e}function v(r){return r=r.toLowerCase(),r=A[r]||r,r}n.default=d;var M=n.isHotkey=d;n.isCodeHotkey=D;n.isKeyHotkey=E;n.parseHotkey=K;n.compareHotkey=C;n.toKeyCode=H;n.toKeyName=v;export{M as i};
|
|
2
2
|
//# sourceMappingURL=vendor.is-hotkey.js.map
|
package/vendor.object-assign.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import"./vendor.
|
|
1
|
+
import"./vendor.core-js.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},o=new Error().stack;o&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[o]="5d13d0b2-4d30-4261-b4d9-3b2104d562eb",r._sentryDebugIdIdentifier="sentry-dbid-5d13d0b2-4d30-4261-b4d9-3b2104d562eb")}catch{}})();/*
|
|
2
2
|
object-assign
|
|
3
3
|
(c) Sindre Sorhus
|
|
4
4
|
@license MIT
|
|
5
|
-
*/var
|
|
5
|
+
*/var b=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,c=Object.prototype.propertyIsEnumerable;function i(r){if(r==null)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(r)}function u(){try{if(!Object.assign)return!1;var r=new String("abc");if(r[5]="de",Object.getOwnPropertyNames(r)[0]==="5")return!1;for(var o={},e=0;e<10;e++)o["_"+String.fromCharCode(e)]=e;var a=Object.getOwnPropertyNames(o).map(function(n){return o[n]});if(a.join("")!=="0123456789")return!1;var t={};return"abcdefghijklmnopqrst".split("").forEach(function(n){t[n]=n}),Object.keys(Object.assign({},t)).join("")==="abcdefghijklmnopqrst"}catch{return!1}}var p=u()?Object.assign:function(r,o){for(var e,a=i(r),t,n=1;n<arguments.length;n++){e=Object(arguments[n]);for(var f in e)d.call(e,f)&&(a[f]=e[f]);if(b){t=b(e);for(var s=0;s<t.length;s++)c.call(e,t[s])&&(a[t[s]]=e[t[s]])}}return a};export{p as o};
|
|
6
6
|
//# sourceMappingURL=vendor.object-assign.js.map
|
package/vendor.react-dom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import"./vendor.
|
|
1
|
+
import"./vendor.core-js.js";import{r as gs}from"./vendor.react.js";import{o as ws}from"./vendor.object-assign.js";import{s as Ss}from"./vendor.scheduler.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},n=new Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="2c5956b7-a3e4-48d0-a869-2e9c699aa465",e._sentryDebugIdIdentifier="sentry-dbid-2c5956b7-a3e4-48d0-a869-2e9c699aa465")}catch{}})();var Ao={exports:{}},ie={};/** @license React v17.0.2
|
|
2
2
|
* react-dom.production.min.js
|
|
3
3
|
*
|
|
4
4
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
package/vendor.react-i18next.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{R as F,r as
|
|
1
|
+
import{R as F,r as c}from"./vendor.react.js";import"./vendor.core-js.js";import{_ as k,a as _,b as R,c as B}from"./vendor.babel.runtime.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},e=new Error().stack;e&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[e]="c6e4a1c7-268f-47c9-93e1-27112fce6823",n._sentryDebugIdIdentifier="sentry-dbid-c6e4a1c7-268f-47c9-93e1-27112fce6823")}catch{}})();function D(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function x(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?D(Object(t),!0).forEach(function(r){R(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):D(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}var I={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0},z,U=F.createContext();function K(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};I=x(x({},I),n)}function M(){return I}var H=function(){function n(){_(this,n),this.usedNamespaces={}}return k(n,[{key:"addUsedNamespaces",value:function(t){var r=this;t.forEach(function(s){r.usedNamespaces[s]||(r.usedNamespaces[s]=!0)})}},{key:"getUsedNamespaces",value:function(){return Object.keys(this.usedNamespaces)}}]),n}();function $(n){z=n}function V(){return z}var Q={type:"3rdParty",init:function(e){K(e.options.react),$(e)}};function W(){if(console&&console.warn){for(var n,e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];typeof t[0]=="string"&&(t[0]="react-i18next:: ".concat(t[0])),(n=console).warn.apply(n,t)}}var E={};function S(){for(var n=arguments.length,e=new Array(n),t=0;t<n;t++)e[t]=arguments[t];typeof e[0]=="string"&&E[e[0]]||(typeof e[0]=="string"&&(E[e[0]]=new Date),W.apply(void 0,e))}function T(n,e,t){n.loadNamespaces(e,function(){if(n.isInitialized)t();else{var r=function s(){setTimeout(function(){n.off("initialized",s)},0),t()};n.on("initialized",r)}})}function Y(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};if(!e.languages||!e.languages.length)return S("i18n.languages were undefined or empty",e.languages),!0;var r=e.languages[0],s=e.options?e.options.fallbackLng:!1,y=e.languages[e.languages.length-1];if(r.toLowerCase()==="cimode")return!0;var a=function(d,f){var l=e.services.backendConnector.state["".concat(d,"|").concat(f)];return l===-1||l===2};return t.bindI18n&&t.bindI18n.indexOf("languageChanging")>-1&&e.services.backendConnector.backend&&e.isLanguageChangingTo&&!a(e.isLanguageChangingTo,n)?!1:!!(e.hasResourceBundle(r,n)||!e.services.backendConnector.backend||a(r,n)&&(!s||a(y,n)))}function L(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function N(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?L(Object(t),!0).forEach(function(r){R(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):L(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function X(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},t=e.i18n,r=c.useContext(U)||{},s=r.i18n,y=r.defaultNS,a=t||s||V();if(a&&!a.reportNamespaces&&(a.reportNamespaces=new H),!a){S("You will need to pass in an i18next instance by using initReactI18next");var O=function(u){return Array.isArray(u)?u[u.length-1]:u},d=[O,{},!1];return d.t=O,d.i18n={},d.ready=!1,d}a.options.react&&a.options.react.wait!==void 0&&S("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");var f=N(N(N({},M()),a.options.react),e),l=f.useSuspense,i=y||a.options&&a.options.defaultNS;i=typeof i=="string"?[i]:i||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(i);var p=(a.isInitialized||a.initializedStoreOnce)&&i.every(function(o){return Y(o,a,f)});function v(){return a.getFixedT(null,f.nsMode==="fallback"?i:i[0])}var A=c.useState(v),P=B(A,2),j=P[0],h=P[1],g=c.useRef(!0);c.useEffect(function(){var o=f.bindI18n,u=f.bindI18nStore;g.current=!0,!p&&!l&&T(a,i,function(){g.current&&h(v)});function b(){g.current&&h(v)}return o&&a&&a.on(o,b),u&&a&&a.store.on(u,b),function(){g.current=!1,o&&a&&o.split(" ").forEach(function(w){return a.off(w,b)}),u&&a&&u.split(" ").forEach(function(w){return a.store.off(w,b)})}},[a,i.join()]);var C=c.useRef(!0);c.useEffect(function(){g.current&&!C.current&&h(v),C.current=!1},[a]);var m=[j,a,p];if(m.t=j,m.i18n=a,m.ready=p,p||!p&&!l)return m;throw new Promise(function(o){T(a,i,function(){o()})})}function Z(n){var e=n.i18n,t=n.defaultNS,r=n.children,s=c.useMemo(function(){return{i18n:e,defaultNS:t}},[e,t]);return c.createElement(U.Provider,{value:s},r)}export{Z as I,Q as i,X as u};
|
|
2
2
|
//# sourceMappingURL=vendor.react-i18next.js.map
|