userflow.js-self-hosted 0.1.1024504 → 0.1.1024509

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.
Files changed (72) hide show
  1. package/AnnouncementEngagement.js +2 -2
  2. package/BannerApp.js +1 -1
  3. package/BuilderBar.js +1 -1
  4. package/ChecklistApp.js +1 -1
  5. package/ChecklistUI.js +1 -1
  6. package/DebuggerUI.js +2 -2
  7. package/ElementSelectionApp.js +1 -1
  8. package/EmbedApp.js +1 -1
  9. package/FlowApp.js +3 -3
  10. package/FlowChrome.js +2 -2
  11. package/Frame.js +1 -1
  12. package/LauncherApp.js +1 -1
  13. package/NotificationsApp.js +1 -1
  14. package/Popover.js +1 -1
  15. package/ResourceCenterApp.js +4 -4
  16. package/ResourceCenterAssistantChat.js +2 -2
  17. package/ResourceCenterLauncherHandler.js +1 -1
  18. package/SitePage.js +1 -1
  19. package/SmartFlowRecordingApp.js +1 -1
  20. package/StartConditionTestingApp.js +1 -1
  21. package/TrackerTestingApp.js +1 -1
  22. package/TreeDoc.js +3 -3
  23. package/Trigger.js +1 -1
  24. package/WorkflowApp.js +2 -2
  25. package/client-context.js +1 -1
  26. package/flow-condition-types.js +1 -1
  27. package/flow-host.styl.js +1 -1
  28. package/happy.js +1 -1
  29. package/hash.txt +1 -1
  30. package/implicit-tracking.js +2 -2
  31. package/neutral.js +1 -1
  32. package/package.json +1 -1
  33. package/react-hooks.js +1 -1
  34. package/roots.js +1 -1
  35. package/sad.js +1 -1
  36. package/steps.js +1 -1
  37. package/stylesheets.js +1 -1
  38. package/ui.js +2 -2
  39. package/use-confetti.js +1 -1
  40. package/use-element-rect.js +1 -1
  41. package/use-selector-element-monitoring.js +1 -1
  42. package/use-window-resize.js +1 -1
  43. package/userflow.js +8 -8
  44. package/vendor.babel.runtime.js +3 -3
  45. package/vendor.bignumber.js.js +1 -1
  46. package/vendor.canvas-confetti.js +2 -2
  47. package/vendor.date-fns.js +1 -1
  48. package/vendor.dompurify.js +1 -1
  49. package/vendor.fortawesome.pro-light-svg-icons.js +1 -1
  50. package/vendor.fortawesome.pro-regular-svg-icons.js +1 -1
  51. package/vendor.fortawesome.pro-solid-svg-icons.js +1 -1
  52. package/vendor.history.js +1 -1
  53. package/vendor.html-parse-stringify2.js +1 -1
  54. package/vendor.i18next.js +1 -1
  55. package/vendor.is-hotkey.js +1 -1
  56. package/vendor.lodash.js +1 -27
  57. package/vendor.mini-create-react-context.js +1 -1
  58. package/vendor.object-assign.js +1 -5
  59. package/vendor.path-to-regexp.js +1 -1
  60. package/vendor.prop-types.js +1 -1
  61. package/vendor.react-dom.js +8 -15
  62. package/vendor.react-i18next.js +1 -1
  63. package/vendor.react-is.js +1 -8
  64. package/vendor.react-router-dom.js +1 -1
  65. package/vendor.react-router.js +1 -1
  66. package/vendor.react.js +1 -8
  67. package/vendor.scheduler.js +1 -8
  68. package/vendor.void-elements.js +1 -1
  69. package/vendor.core-js.js +0 -2
  70. package/vendor.fortawesome.fontawesome-svg-core.js +0 -762
  71. package/vendor.fortawesome.react-fontawesome.js +0 -3
  72. package/vendor.react-day-picker.js +0 -2
package/userflow.js CHANGED
@@ -1,18 +1,18 @@
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.babel.runtime.js","vendor.react-i18next.js","flow-host.styl.js","TreeDoc.js","flow-condition-types.js","vendor.date-fns.js","roots.js","stylesheets.js","vendor.fortawesome.pro-regular-svg-icons.js","vendor.fortawesome.pro-solid-svg-icons.js","vendor.obj-str.js","use-selector-element-monitoring.js","Frame.js","vendor.react-dom.js","vendor.scheduler.js","iframe-reset.styl.js","use-window-resize.js","logomark.js","ChecklistUI.js","FlowChrome.js","use-confetti.js","vendor.canvas-confetti.js","AnnouncementEngagement.js","vendor.memoize-one.js","vendor.bignumber.js.js","use-element-rect.js","BannerApp.js","vendor.phoenix.js","vendor.uuid.js","SitePage.js","vendor.react-router-dom.js","vendor.react-router.js","vendor.prop-types.js","vendor.history.js","vendor.resolve-pathname.js","vendor.value-equal.js","vendor.tiny-invariant.js","vendor.mini-create-react-context.js","vendor.path-to-regexp.js","vendor.react-is.js","Popover.js","react-hooks.js","vendor.lodash.js","implicit-tracking.js","DebuggerUI.js","vendor.fortawesome.react-fontawesome.js","vendor.fortawesome.fontawesome-svg-core.js","vendor.react-day-picker.js","ui.js"])))=>i.map(i=>d[i]);
2
- import"./vendor.core-js.js";import{S as z}from"./vendor.phoenix.js";import{v as O}from"./vendor.uuid.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]="4782a4bb-911a-41db-9863-2545e2d01b22",e._sentryDebugIdIdentifier="sentry-dbid-4782a4bb-911a-41db-9863-2545e2d01b22")}catch{}})();const J="modulepreload",Q=function(e){return new URL("./",import.meta.url).toString()+e},b={},T=function(t,s,n){let i=Promise.resolve();if(s&&s.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),u=a?.nonce||a?.getAttribute("nonce");i=Promise.allSettled(s.map(c=>{if(c=Q(c),c in b)return;b[c]=!0;const l=c.endsWith(".css"),I=l?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${I}`))return;const f=document.createElement("link");if(f.rel=l?"stylesheet":J,l||(f.as="script"),f.crossOrigin="",f.href=c,u&&f.setAttribute("nonce",u),document.head.appendChild(f),l)return new Promise((j,Y)=>{f.addEventListener("load",j),f.addEventListener("error",()=>Y(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 i.then(a=>{for(const u of a||[])u.status==="rejected"&&r(u.reason);return t().catch(r)})};class h extends Error{constructor(t,s,n){super(t),Object.setPrototypeOf(this,h.prototype),this.name="UserflowError",this.code=s,this.humanMessage=n}}class W{constructor(t){this.type=t,this.testState={}}formatKey(t){return`userflow:${t}`}isSupported(){if(typeof window>"u")return!1;try{return window[this.type]!=null}catch{return!1}}getItem(t){return t=this.formatKey(t),this.isSupported()?window[this.type].getItem(t):null}setItem(t,s){t=this.formatKey(t);{if(!this.isSupported())return;window[this.type].setItem(t,s)}}removeItem(t){return t=this.formatKey(t),this.isSupported()?window[this.type].removeItem(t):void 0}clear(){return this.isSupported()?window[this.type].clear():void 0}}const w=new W("localStorage"),d=new W("sessionStorage");function dt(e){window.location.href=e}function k(){return window.location.href}function N(e){window.postMessage(e,window.origin)}function G(e){const t=n=>{if(n.source!==window||n.origin!==window.origin)return;const i=n.data;!i||typeof i!="object"||typeof i.kind!="string"||!i.kind.startsWith("userflow:")||e(i)===!0&&s()};window.addEventListener("message",t);const s=()=>window.removeEventListener("message",t);return s}function X(e){return new Promise(t=>{G(s=>{const n=e(s);return n?(t(n),!0):!1})})}const R=new Set;let D=!1;function Z(e){return q(),R.add(e),()=>{x(e)}}function x(e){R.delete(e)}function C(){R.forEach(e=>e())}function q(){if(D)return;D=!0;const{history:e}=window,t=s=>{const n=e[s];e[s]=(...i)=>{const r=n.apply(e,i);return C(),r}};window.__userflowStatePatched?(window.addEventListener("userflow:pushstate",()=>{C()}),window.addEventListener("userflow:replacestate",()=>{C()})):(t("pushState"),t("replaceState")),window.addEventListener("popstate",()=>{C()})}class ee{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(t){N({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:t})}onBuilderMessage(t){return this.unregisterOnMessage=G(t),!1}async captureScreenshot(t,s,n,i){return N({kind:"userflow:crxScreenshot",x:t,y:s,width:n,height:i,devicePixelRatio:window.devicePixelRatio}),(await X(a=>a.kind==="userflow:crxScreenshotResult"?a:null)).imageDataUrl}}var m=(e=>(e.ACTION="ACTION",e.ELEMENT_MISSING="ELEMENT_MISSING",e.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",e.WORKFLOW_TIMED_OUT="WORKFLOW_TIMED_OUT",e.REPLACED="REPLACED",e.SNOOZED="SNOOZED",e.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",e.USERFLOWJS="USERFLOWJS",e.USER_CLOSED="USER_CLOSED",e))(m||{}),te=(e=>(e.POSITIVE="POSITIVE",e.NEUTRAL="NEUTRAL",e.NEGATIVE="NEGATIVE",e))(te||{}),se=(e=>(e.USER_INPUT_TIMEOUT="USER_INPUT_TIMEOUT",e.STEP_TIMEOUT="STEP_TIMEOUT",e))(se||{}),ie=(e=>(e.SECOND="SECOND",e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e))(ie||{}),L=(e=>(e.ACTION="ACTION",e.DRAFT="DRAFT",e.LINK="LINK",e.LAUNCHER_SEEN="LAUNCHER_SEEN",e.RESOURCE_CENTER="RESOURCE_CENTER",e.USERFLOWJS="USERFLOWJS",e.ASSISTANT="ASSISTANT",e))(L||{}),ne=(e=>(e.LIKE="LIKE",e.DISLIKE="DISLIKE",e))(ne||{}),S=(e=>(e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.DATETIME="DATETIME",e.LIST="LIST",e.RANDOM_AB="RANDOM_AB",e.RANDOM_NUMBER="RANDOM_NUMBER",e.CHECKLIST_TASK="CHECKLIST_TASK",e.FLOW="FLOW",e.FLOW_SESSION="FLOW_SESSION",e.FLOW_STEP="FLOW_STEP",e.FLOW_VERSION="FLOW_VERSION",e))(S||{}),U=(e=>(e.FLOW="FLOW",e.BANNER="BANNER",e.EMBED="EMBED",e.CHECKLIST="CHECKLIST",e.LAUNCHER="LAUNCHER",e.RESOURCE_CENTER="RESOURCE_CENTER",e.SITE="SITE",e.WORKFLOW="WORKFLOW",e))(U||{}),re=(e=>(e.ALWAYS_TRUE="ALWAYS_TRUE",e.ATTRIBUTE="ATTRIBUTE",e.CHECKLIST_TASK_CLICKED="CHECKLIST_TASK_CLICKED",e.CLAUSE="CLAUSE",e.ELEMENT="ELEMENT",e.EVENT="EVENT",e.FILLED_IN_INPUT="FILLED_IN_INPUT",e.FLOW="FLOW",e.INPUT_VALUE="INPUT_VALUE",e.PAGE="PAGE",e.SEGMENT="SEGMENT",e.TIME="TIME",e))(re||{}),oe=(e=>(e.AUTO="AUTO",e.MANUAL="MANUAL",e))(oe||{}),ae=(e=>(e.INPUT="INPUT",e))(ae||{}),ce=(e=>(e.ABSOLUTE_EQ="ABSOLUTE_EQ",e.ABSOLUTE_GT="ABSOLUTE_GT",e.ABSOLUTE_LT="ABSOLUTE_LT",e.AND="AND",e.BETWEEN="BETWEEN",e.CONTAINS="CONTAINS",e.EMPTY="EMPTY",e.ENDS_WITH="ENDS_WITH",e.EQ="EQ",e.EXCLUDES_ALL="EXCLUDES_ALL",e.EXCLUDES_ANY="EXCLUDES_ANY",e.FALSE="FALSE",e.GT="GT",e.GTE="GTE",e.INCLUDES_ALL="INCLUDES_ALL",e.INCLUDES_ANY="INCLUDES_ANY",e.LT="LT",e.LTE="LTE",e.NE="NE",e.NOT_CONTAINS="NOT_CONTAINS",e.NOT_EMPTY="NOT_EMPTY",e.NOT_REGEX="NOT_REGEX",e.OR="OR",e.REGEX="REGEX",e.RELATIVE_EQ="RELATIVE_EQ",e.RELATIVE_GT="RELATIVE_GT",e.RELATIVE_LT="RELATIVE_LT",e.STARTS_WITH="STARTS_WITH",e.TRUE="TRUE",e.URL="URL",e))(ce||{}),le=(e=>(e.CLICK="CLICK",e.DISABLED="DISABLED",e.MOUSEDOWN="MOUSEDOWN",e.NOT_CLICK="NOT_CLICK",e.NOT_DISABLED="NOT_DISABLED",e.NOT_PRESENT="NOT_PRESENT",e.PRESENT="PRESENT",e))(le||{}),ue=(e=>(e.END_USER="END_USER",e.GROUP="GROUP",e))(ue||{}),he=(e=>(e.BETWEEN="BETWEEN",e.EQ="EQ",e.GTE="GTE",e.LTE="LTE",e))(he||{}),de=(e=>(e.ANY="ANY",e.RELATIVE_BETWEEN="RELATIVE_BETWEEN",e.RELATIVE_GT="RELATIVE_GT",e.RELATIVE_LT="RELATIVE_LT",e))(de||{}),Ee=(e=>(e.CURRENT_USER="CURRENT_USER",e.CURRENT_USER_CURRENT_GROUP="CURRENT_USER_CURRENT_GROUP",e.CURRENT_GROUP="CURRENT_GROUP",e))(Ee||{}),fe=(e=>(e.ASSET="ASSET",e.CARTOON="CARTOON",e.NONE="NONE",e.URL="URL",e))(fe||{}),Se=(e=>(e.INSIDE="INSIDE",e.OUTSIDE="OUTSIDE",e))(Se||{}),Te=(e=>(e.TOP_LEFT="TOP_LEFT",e.TOP_CENTER="TOP_CENTER",e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.BOTTOM_CENTER="BOTTOM_CENTER",e.BOTTOM_LEFT="BOTTOM_LEFT",e.CENTER="CENTER",e))(Te||{}),Ie=(e=>(e.GOOGLE="GOOGLE",e.STANDARD="STANDARD",e))(Ie||{}),ge=(e=>(e.DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",e.DISMISS="DISMISS",e))(ge||{}),we=(e=>(e.DISMISS="DISMISS",e.NONE="NONE",e))(we||{}),Ce=(e=>(e.DEFAULT="DEFAULT",e.NARROW="NARROW",e.CHAINED_SQUARED="CHAINED_SQUARED",e.CHAINED_ROUNDED="CHAINED_ROUNDED",e.DOTTED="DOTTED",e.NUMBERED="NUMBERED",e))(Ce||{}),ke=(e=>(e.TOP="TOP",e.BOTTOM="BOTTOM",e))(ke||{}),me=(e=>(e.DEFAULT="DEFAULT",e.PLAINTEXT="PLAINTEXT",e.CUSTOM="CUSTOM",e))(me||{}),Ue=(e=>(e.CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",e.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",e.NONE="NONE",e))(Ue||{}),Le=(e=>(e.BUBBLE="BUBBLE",e.END="END",e.ERROR="ERROR",e.FLAG="FLAG",e))(Le||{}),pe=(e=>(e.MANUAL="MANUAL",e.NONE="NONE",e.SYNTHETIC="SYNTHETIC",e))(pe||{}),_e=(e=>(e.BUBBLE="BUBBLE",e.HIDDEN="HIDDEN",e.MODAL="MODAL",e.TOOLTIP="TOOLTIP",e))(_e||{}),Ne=(e=>(e.ABOVE="ABOVE",e.BELOW="BELOW",e.LEFT="LEFT",e.RIGHT="RIGHT",e))(Ne||{}),Ae=(e=>(e.CLOSE_FLOW="CLOSE_FLOW",e.EVAL_JS="EVAL_JS",e.GO_TO_STEP="GO_TO_STEP",e.NAVIGATE="NAVIGATE",e.SET_ATTRIBUTE="SET_ATTRIBUTE",e.SNOOZE="SNOOZE",e.START_FLOW="START_FLOW",e.TRACK_BUTTON_EVENT="TRACK_BUTTON_EVENT",e))(Ae||{}),Re=(e=>(e.NEW_TAB="NEW_TAB",e.SAME_TAB="SAME_TAB",e))(Re||{}),ve=(e=>(e.SET="SET",e.SET_DATETIME="SET_DATETIME",e.SET_DATETIME_ONCE="SET_DATETIME_ONCE",e.SET_ONCE="SET_ONCE",e.ADD="ADD",e.SUBTRACT="SUBTRACT",e.APPEND="APPEND",e.PREPEND="PREPEND",e.REMOVE="REMOVE",e.UNSET="UNSET",e))(ve||{}),Oe=(e=>(e.MULTILINE_TEXT="MULTILINE_TEXT",e.MULTIPLE_CHOICE="MULTIPLE_CHOICE",e.NPS="NPS",e.SCALE="SCALE",e.STARS="STARS",e.TEXT="TEXT",e))(Oe||{}),be=(e=>(e.CLICK="CLICK",e.FILL="FILL",e.NAVIGATE="NAVIGATE",e))(be||{}),A=(e=>(e.ACTION="ACTION",e.ANNOUNCEMENTS="ANNOUNCEMENTS",e.ASSISTANT="ASSISTANT",e.CHECKLIST="CHECKLIST",e.CONTACT="CONTACT",e.DIVIDER="DIVIDER",e.FLOWS="FLOWS",e.KNOWLEDGE_BASE="KNOWLEDGE_BASE",e.MESSAGE="MESSAGE",e.SUBPAGE="SUBPAGE",e))(A||{}),De=(e=>(e.CRISP="CRISP",e.CUSTOM="CUSTOM",e.FRESHCHAT="FRESHCHAT",e.HELPSCOUT="HELPSCOUT",e.HUBSPOT="HUBSPOT",e.INTERCOM="INTERCOM",e.ZENDESK="ZENDESK",e.ZENDESK_MESSENGER="ZENDESK_MESSENGER",e))(De||{}),ye=(e=>(e.BUTTON="BUTTON",e.INPUT="INPUT",e))(ye||{}),Me=(e=>(e.EMAIL="EMAIL",e.PHONE="PHONE",e.CHAT="CHAT",e))(Me||{}),Pe=(e=>(e.SILENT="SILENT",e.BADGE="BADGE",e.POPOUT="POPOUT",e.MODAL="MODAL",e.TOAST="TOAST",e))(Pe||{}),Be=(e=>(e.DEFAULT="DEFAULT",e.CUSTOM="CUSTOM",e.NONE="NONE",e))(Be||{}),He=(e=>(e.LAUNCHER_CLICK="LAUNCHER_CLICK",e.LAUNCHER_HOVER="LAUNCHER_HOVER",e.TARGET_CLICK="TARGET_CLICK",e.TARGET_HOVER="TARGET_HOVER",e.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",e.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",e))(He||{}),F=(e=>(e.ACTIVATE="ACTIVATE",e.DEACTIVATE="DEACTIVATE",e.NEVER="NEVER",e))(F||{}),We=(e=>(e.AUTO="AUTO",e.TOP="TOP",e.RIGHT="RIGHT",e.BOTTOM="BOTTOM",e.LEFT="LEFT",e))(We||{}),Ge=(e=>(e.START="START",e.CENTER="CENTER",e.END="END",e))(Ge||{}),xe=(e=>(e.PERCENT="PERCENT",e.PX="PX",e))(xe||{}),Fe=(e=>(e.BEACON="BEACON",e.BUTTON="BUTTON",e.HIDDEN="HIDDEN",e.ICON="ICON",e))(Fe||{}),Ve=(e=>(e.LAUNCHER="LAUNCHER",e.TARGET="TARGET",e))(Ve||{}),Ke=(e=>(e.BODY_FIRST="BODY_FIRST",e.BODY_LAST="BODY_LAST",e.ELEMENT_FIRST="ELEMENT_FIRST",e.ELEMENT_LAST="ELEMENT_LAST",e.ELEMENT_BEFORE="ELEMENT_BEFORE",e.ELEMENT_AFTER="ELEMENT_AFTER",e))(Ke||{}),$e=(e=>(e.BODY_FIRST="BODY_FIRST",e.BODY_LAST="BODY_LAST",e.ELEMENT_FIRST="ELEMENT_FIRST",e.ELEMENT_LAST="ELEMENT_LAST",e.ELEMENT_BEFORE="ELEMENT_BEFORE",e.ELEMENT_AFTER="ELEMENT_AFTER",e))($e||{}),V=(e=>(e.CHECKLIST="CHECKLIST",e))(V||{}),je=(e=>(e.INITIAL="INITIAL",e.FOLLOWUP="FOLLOWUP",e))(je||{}),Ye=(e=>(e.FLOW="FLOW",e.WORKFLOW="WORKFLOW",e))(Ye||{}),ze=(e=>(e.HIDE="HIDE",e.OTHERS="OTHERS",e))(ze||{}),Je=(e=>(e.ALWAYS="ALWAYS",e.MULTIPLE="MULTIPLE",e.NEVER="NEVER",e.ONCE="ONCE",e.ONCE_PER_GROUP="ONCE_PER_GROUP",e))(Je||{}),Qe=(e=>(e.NONE="NONE",e.PENDING_SCHEDULE="PENDING_SCHEDULE",e.SCHEDULED="SCHEDULED",e.FIRED="FIRED",e))(Qe||{}),Xe=(e=>(e.NONE="NONE",e.LIKE="LIKE",e.SCALE="SCALE",e))(Xe||{}),Ze=(e=>(e.HIDE="HIDE",e.BLOCK="BLOCK",e.OTHERS="OTHERS",e))(Ze||{});function qe(){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:[e=>!e.match(/\d$/)],"data-id":[e=>!e.match(/\d$/)]},inferenceClassNameFilters:[e=>!e.startsWith("css-")],baseZIndex:1234500,evalJsDisabled:!1}}const E=qe();function y(e){return Array.isArray(e)||(e=e?[e]:[]),e=e.map(t=>typeof t=="string"?new RegExp(t):t),e}function Et(e,t){return e.every(s=>typeof s=="function"?s(t):s instanceof RegExp?s.test(t):!0)}function et(){let e=k();if(E.urlFilter){if(e=E.urlFilter(e),typeof e!="string")throw new h("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(e)}catch(t){throw new h(`Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["ResourceCenterApp.js","vendor.react.js","vendor.object-assign.js","client-context.js","vendor.i18next.js","vendor.babel.runtime.js","vendor.react-i18next.js","flow-host.styl.js","TreeDoc.js","flow-condition-types.js","vendor.date-fns.js","roots.js","stylesheets.js","vendor.fortawesome.pro-regular-svg-icons.js","vendor.fortawesome.pro-solid-svg-icons.js","vendor.obj-str.js","use-selector-element-monitoring.js","Frame.js","vendor.react-dom.js","vendor.scheduler.js","iframe-reset.styl.js","use-window-resize.js","logomark.js","ChecklistUI.js","FlowChrome.js","use-confetti.js","vendor.canvas-confetti.js","AnnouncementEngagement.js","vendor.memoize-one.js","vendor.bignumber.js.js","use-element-rect.js","BannerApp.js","vendor.phoenix.js","vendor.uuid.js","SitePage.js","vendor.react-router-dom.js","vendor.react-router.js","vendor.prop-types.js","vendor.history.js","vendor.resolve-pathname.js","vendor.value-equal.js","vendor.tiny-invariant.js","vendor.mini-create-react-context.js","vendor.path-to-regexp.js","vendor.react-is.js","Popover.js","react-hooks.js","vendor.lodash.js","implicit-tracking.js","DebuggerUI.js","ui.js"])))=>i.map(i=>d[i]);
2
+ import"./vendor.object-assign.js";import{S as J}from"./vendor.phoenix.js";import{v as b}from"./vendor.uuid.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]="f7476079-5daf-4179-972e-1757453369a6",e._sentryDebugIdIdentifier="sentry-dbid-f7476079-5daf-4179-972e-1757453369a6")}catch{}})();const Q="modulepreload",X=function(e){return new URL("./",import.meta.url).toString()+e},D={},I=function(t,s,n){let i=Promise.resolve();if(s&&s.length>0){let u=function(c){return Promise.all(c.map(E=>Promise.resolve(E).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),l=a?.nonce||a?.getAttribute("nonce");i=u(s.map(c=>{if(c=X(c),c in D)return;D[c]=!0;const E=c.endsWith(".css"),g=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${g}`))return;const T=document.createElement("link");if(T.rel=E?"stylesheet":Q,E||(T.as="script"),T.crossOrigin="",T.href=c,l&&T.setAttribute("nonce",l),document.head.appendChild(T),E)return new Promise((Y,z)=>{T.addEventListener("load",Y),T.addEventListener("error",()=>z(new Error(`Unable to preload CSS for ${c}`)))})}))}function r(a){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=a,window.dispatchEvent(l),!l.defaultPrevented)throw a}return i.then(a=>{for(const l of a||[])l.status==="rejected"&&r(l.reason);return t().catch(r)})};class h extends Error{constructor(t,s,n){super(t),Object.setPrototypeOf(this,h.prototype),this.name="UserflowError",this.code=s,this.humanMessage=n}}class G{constructor(t){this.type=t,this.testState={}}formatKey(t){return`userflow:${t}`}isSupported(){if(typeof window>"u")return!1;try{return window[this.type]!=null}catch{return!1}}getItem(t){return t=this.formatKey(t),this.isSupported()?window[this.type].getItem(t):null}setItem(t,s){t=this.formatKey(t);{if(!this.isSupported())return;window[this.type].setItem(t,s)}}removeItem(t){return t=this.formatKey(t),this.isSupported()?window[this.type].removeItem(t):void 0}clear(){return this.isSupported()?window[this.type].clear():void 0}}const C=new G("localStorage"),d=new G("sessionStorage");function ft(e){window.location.href=e}function m(){return window.location.href}function A(e){window.postMessage(e,window.origin)}function x(e){const t=n=>{if(n.source!==window||n.origin!==window.origin)return;const i=n.data;!i||typeof i!="object"||typeof i.kind!="string"||!i.kind.startsWith("userflow:")||e(i)===!0&&s()};window.addEventListener("message",t);const s=()=>window.removeEventListener("message",t);return s}function Z(e){return new Promise(t=>{x(s=>{const n=e(s);return n?(t(n),!0):!1})})}const v=new Set;let y=!1;function q(e){return ee(),v.add(e),()=>{F(e)}}function F(e){v.delete(e)}function k(){v.forEach(e=>e())}function ee(){if(y)return;y=!0;const{history:e}=window,t=s=>{const n=e[s];e[s]=(...i)=>{const r=n.apply(e,i);return k(),r}};window.__userflowStatePatched?(window.addEventListener("userflow:pushstate",()=>{k()}),window.addEventListener("userflow:replacestate",()=>{k()})):(t("pushState"),t("replaceState")),window.addEventListener("popstate",()=>{k()})}class te{destroy(){this.unregisterOnMessage&&this.unregisterOnMessage()}postBuilderMessage(t){A({kind:"userflow:crxSendProxyMessage",direction:"targetToBuilder",message:t})}onBuilderMessage(t){return this.unregisterOnMessage=x(t),!1}async captureScreenshot(t,s,n,i){return A({kind:"userflow:crxScreenshot",x:t,y:s,width:n,height:i,devicePixelRatio:window.devicePixelRatio}),(await Z(a=>a.kind==="userflow:crxScreenshotResult"?a:null)).imageDataUrl}}var U=(e=>(e.ACTION="ACTION",e.ELEMENT_MISSING="ELEMENT_MISSING",e.LAUNCHER_DEACTIVATED="LAUNCHER_DEACTIVATED",e.WORKFLOW_TIMED_OUT="WORKFLOW_TIMED_OUT",e.REPLACED="REPLACED",e.SNOOZED="SNOOZED",e.TOOLTIP_TARGET_MISSING="TOOLTIP_TARGET_MISSING",e.USERFLOWJS="USERFLOWJS",e.USER_CLOSED="USER_CLOSED",e))(U||{}),se=(e=>(e.POSITIVE="POSITIVE",e.NEUTRAL="NEUTRAL",e.NEGATIVE="NEGATIVE",e))(se||{}),ie=(e=>(e.USER_INPUT_TIMEOUT="USER_INPUT_TIMEOUT",e.STEP_TIMEOUT="STEP_TIMEOUT",e))(ie||{}),ne=(e=>(e.SECOND="SECOND",e.MINUTE="MINUTE",e.HOUR="HOUR",e.DAY="DAY",e))(ne||{}),p=(e=>(e.ACTION="ACTION",e.DRAFT="DRAFT",e.LINK="LINK",e.LAUNCHER_SEEN="LAUNCHER_SEEN",e.RESOURCE_CENTER="RESOURCE_CENTER",e.USERFLOWJS="USERFLOWJS",e.ASSISTANT="ASSISTANT",e))(p||{}),re=(e=>(e.LIKE="LIKE",e.DISLIKE="DISLIKE",e))(re||{}),S=(e=>(e.STRING="STRING",e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.DATETIME="DATETIME",e.LIST="LIST",e.RANDOM_AB="RANDOM_AB",e.RANDOM_NUMBER="RANDOM_NUMBER",e.CHECKLIST_TASK="CHECKLIST_TASK",e.FLOW="FLOW",e.FLOW_SESSION="FLOW_SESSION",e.FLOW_STEP="FLOW_STEP",e.FLOW_VERSION="FLOW_VERSION",e))(S||{}),L=(e=>(e.FLOW="FLOW",e.BANNER="BANNER",e.EMBED="EMBED",e.CHECKLIST="CHECKLIST",e.LAUNCHER="LAUNCHER",e.RESOURCE_CENTER="RESOURCE_CENTER",e.SITE="SITE",e.WORKFLOW="WORKFLOW",e))(L||{}),oe=(e=>(e.ALWAYS_TRUE="ALWAYS_TRUE",e.ATTRIBUTE="ATTRIBUTE",e.CHECKLIST_TASK_CLICKED="CHECKLIST_TASK_CLICKED",e.CLAUSE="CLAUSE",e.ELEMENT="ELEMENT",e.EVENT="EVENT",e.FILLED_IN_INPUT="FILLED_IN_INPUT",e.FLOW="FLOW",e.INPUT_VALUE="INPUT_VALUE",e.PAGE="PAGE",e.SEGMENT="SEGMENT",e.TIME="TIME",e))(oe||{}),ae=(e=>(e.AUTO="AUTO",e.MANUAL="MANUAL",e))(ae||{}),ce=(e=>(e.INPUT="INPUT",e))(ce||{}),le=(e=>(e.ABSOLUTE_EQ="ABSOLUTE_EQ",e.ABSOLUTE_GT="ABSOLUTE_GT",e.ABSOLUTE_LT="ABSOLUTE_LT",e.AND="AND",e.BETWEEN="BETWEEN",e.CONTAINS="CONTAINS",e.EMPTY="EMPTY",e.ENDS_WITH="ENDS_WITH",e.EQ="EQ",e.EXCLUDES_ALL="EXCLUDES_ALL",e.EXCLUDES_ANY="EXCLUDES_ANY",e.FALSE="FALSE",e.GT="GT",e.GTE="GTE",e.INCLUDES_ALL="INCLUDES_ALL",e.INCLUDES_ANY="INCLUDES_ANY",e.LT="LT",e.LTE="LTE",e.NE="NE",e.NOT_CONTAINS="NOT_CONTAINS",e.NOT_EMPTY="NOT_EMPTY",e.NOT_REGEX="NOT_REGEX",e.OR="OR",e.REGEX="REGEX",e.RELATIVE_EQ="RELATIVE_EQ",e.RELATIVE_GT="RELATIVE_GT",e.RELATIVE_LT="RELATIVE_LT",e.STARTS_WITH="STARTS_WITH",e.TRUE="TRUE",e.URL="URL",e))(le||{}),ue=(e=>(e.CLICK="CLICK",e.DISABLED="DISABLED",e.MOUSEDOWN="MOUSEDOWN",e.NOT_CLICK="NOT_CLICK",e.NOT_DISABLED="NOT_DISABLED",e.NOT_PRESENT="NOT_PRESENT",e.PRESENT="PRESENT",e))(ue||{}),he=(e=>(e.END_USER="END_USER",e.GROUP="GROUP",e))(he||{}),de=(e=>(e.BETWEEN="BETWEEN",e.EQ="EQ",e.GTE="GTE",e.LTE="LTE",e))(de||{}),fe=(e=>(e.ANY="ANY",e.RELATIVE_BETWEEN="RELATIVE_BETWEEN",e.RELATIVE_GT="RELATIVE_GT",e.RELATIVE_LT="RELATIVE_LT",e))(fe||{}),Ee=(e=>(e.CURRENT_USER="CURRENT_USER",e.CURRENT_USER_CURRENT_GROUP="CURRENT_USER_CURRENT_GROUP",e.CURRENT_GROUP="CURRENT_GROUP",e))(Ee||{}),Se=(e=>(e.ASSET="ASSET",e.CARTOON="CARTOON",e.NONE="NONE",e.URL="URL",e))(Se||{}),Te=(e=>(e.INSIDE="INSIDE",e.OUTSIDE="OUTSIDE",e))(Te||{}),Ie=(e=>(e.TOP_LEFT="TOP_LEFT",e.TOP_CENTER="TOP_CENTER",e.TOP_RIGHT="TOP_RIGHT",e.BOTTOM_RIGHT="BOTTOM_RIGHT",e.BOTTOM_CENTER="BOTTOM_CENTER",e.BOTTOM_LEFT="BOTTOM_LEFT",e.CENTER="CENTER",e))(Ie||{}),ge=(e=>(e.GOOGLE="GOOGLE",e.STANDARD="STANDARD",e))(ge||{}),we=(e=>(e.DISMISS_FIRST_MENU_AFTER="DISMISS_FIRST_MENU_AFTER",e.DISMISS="DISMISS",e))(we||{}),Ce=(e=>(e.DISMISS="DISMISS",e.NONE="NONE",e))(Ce||{}),ke=(e=>(e.DEFAULT="DEFAULT",e.NARROW="NARROW",e.CHAINED_SQUARED="CHAINED_SQUARED",e.CHAINED_ROUNDED="CHAINED_ROUNDED",e.DOTTED="DOTTED",e.NUMBERED="NUMBERED",e))(ke||{}),me=(e=>(e.TOP="TOP",e.BOTTOM="BOTTOM",e))(me||{}),Ue=(e=>(e.DEFAULT="DEFAULT",e.PLAINTEXT="PLAINTEXT",e.CUSTOM="CUSTOM",e))(Ue||{}),Le=(e=>(e.CHECKLIST_OVERRIDE="CHECKLIST_OVERRIDE",e.RESOURCE_CENTER_ONLY="RESOURCE_CENTER_ONLY",e.NONE="NONE",e))(Le||{}),pe=(e=>(e.BUBBLE="BUBBLE",e.END="END",e.ERROR="ERROR",e.FLAG="FLAG",e))(pe||{}),_e=(e=>(e.MANUAL="MANUAL",e.NONE="NONE",e.SYNTHETIC="SYNTHETIC",e))(_e||{}),Ne=(e=>(e.BUBBLE="BUBBLE",e.HIDDEN="HIDDEN",e.MODAL="MODAL",e.TOOLTIP="TOOLTIP",e))(Ne||{}),Ae=(e=>(e.ABOVE="ABOVE",e.BELOW="BELOW",e.LEFT="LEFT",e.RIGHT="RIGHT",e))(Ae||{}),Re=(e=>(e.CLOSE_FLOW="CLOSE_FLOW",e.EVAL_JS="EVAL_JS",e.GO_TO_STEP="GO_TO_STEP",e.NAVIGATE="NAVIGATE",e.SET_ATTRIBUTE="SET_ATTRIBUTE",e.SNOOZE="SNOOZE",e.START_FLOW="START_FLOW",e.TRACK_BUTTON_EVENT="TRACK_BUTTON_EVENT",e))(Re||{}),ve=(e=>(e.NEW_TAB="NEW_TAB",e.SAME_TAB="SAME_TAB",e))(ve||{}),Oe=(e=>(e.SET="SET",e.SET_DATETIME="SET_DATETIME",e.SET_DATETIME_ONCE="SET_DATETIME_ONCE",e.SET_ONCE="SET_ONCE",e.ADD="ADD",e.SUBTRACT="SUBTRACT",e.APPEND="APPEND",e.PREPEND="PREPEND",e.REMOVE="REMOVE",e.UNSET="UNSET",e))(Oe||{}),be=(e=>(e.MULTILINE_TEXT="MULTILINE_TEXT",e.MULTIPLE_CHOICE="MULTIPLE_CHOICE",e.NPS="NPS",e.SCALE="SCALE",e.STARS="STARS",e.TEXT="TEXT",e))(be||{}),De=(e=>(e.CLICK="CLICK",e.FILL="FILL",e.NAVIGATE="NAVIGATE",e))(De||{}),R=(e=>(e.ACTION="ACTION",e.ANNOUNCEMENTS="ANNOUNCEMENTS",e.ASSISTANT="ASSISTANT",e.CHECKLIST="CHECKLIST",e.CONTACT="CONTACT",e.DIVIDER="DIVIDER",e.FLOWS="FLOWS",e.KNOWLEDGE_BASE="KNOWLEDGE_BASE",e.MESSAGE="MESSAGE",e.SUBPAGE="SUBPAGE",e))(R||{}),ye=(e=>(e.CRISP="CRISP",e.CUSTOM="CUSTOM",e.FRESHCHAT="FRESHCHAT",e.HELPSCOUT="HELPSCOUT",e.HUBSPOT="HUBSPOT",e.INTERCOM="INTERCOM",e.ZENDESK="ZENDESK",e.ZENDESK_MESSENGER="ZENDESK_MESSENGER",e))(ye||{}),Me=(e=>(e.BUTTON="BUTTON",e.INPUT="INPUT",e))(Me||{}),Pe=(e=>(e.EMAIL="EMAIL",e.PHONE="PHONE",e.CHAT="CHAT",e))(Pe||{}),Be=(e=>(e.SILENT="SILENT",e.BADGE="BADGE",e.POPOUT="POPOUT",e.MODAL="MODAL",e.TOAST="TOAST",e))(Be||{}),He=(e=>(e.DEFAULT="DEFAULT",e.CUSTOM="CUSTOM",e.NONE="NONE",e))(He||{}),We=(e=>(e.LAUNCHER_CLICK="LAUNCHER_CLICK",e.LAUNCHER_HOVER="LAUNCHER_HOVER",e.TARGET_CLICK="TARGET_CLICK",e.TARGET_HOVER="TARGET_HOVER",e.LAUNCHER_TARGET_CLICK="LAUNCHER_TARGET_CLICK",e.LAUNCHER_TARGET_HOVER="LAUNCHER_TARGET_HOVER",e))(We||{}),V=(e=>(e.ACTIVATE="ACTIVATE",e.DEACTIVATE="DEACTIVATE",e.NEVER="NEVER",e))(V||{}),Ge=(e=>(e.AUTO="AUTO",e.TOP="TOP",e.RIGHT="RIGHT",e.BOTTOM="BOTTOM",e.LEFT="LEFT",e))(Ge||{}),xe=(e=>(e.START="START",e.CENTER="CENTER",e.END="END",e))(xe||{}),Fe=(e=>(e.PERCENT="PERCENT",e.PX="PX",e))(Fe||{}),Ve=(e=>(e.BEACON="BEACON",e.BUTTON="BUTTON",e.HIDDEN="HIDDEN",e.ICON="ICON",e))(Ve||{}),Ke=(e=>(e.LAUNCHER="LAUNCHER",e.TARGET="TARGET",e))(Ke||{}),$e=(e=>(e.BODY_FIRST="BODY_FIRST",e.BODY_LAST="BODY_LAST",e.ELEMENT_FIRST="ELEMENT_FIRST",e.ELEMENT_LAST="ELEMENT_LAST",e.ELEMENT_BEFORE="ELEMENT_BEFORE",e.ELEMENT_AFTER="ELEMENT_AFTER",e))($e||{}),je=(e=>(e.BODY_FIRST="BODY_FIRST",e.BODY_LAST="BODY_LAST",e.ELEMENT_FIRST="ELEMENT_FIRST",e.ELEMENT_LAST="ELEMENT_LAST",e.ELEMENT_BEFORE="ELEMENT_BEFORE",e.ELEMENT_AFTER="ELEMENT_AFTER",e))(je||{}),K=(e=>(e.CHECKLIST="CHECKLIST",e))(K||{}),Ye=(e=>(e.INITIAL="INITIAL",e.FOLLOWUP="FOLLOWUP",e))(Ye||{}),ze=(e=>(e.FLOW="FLOW",e.WORKFLOW="WORKFLOW",e))(ze||{}),Je=(e=>(e.HIDE="HIDE",e.OTHERS="OTHERS",e))(Je||{}),Qe=(e=>(e.ALWAYS="ALWAYS",e.MULTIPLE="MULTIPLE",e.NEVER="NEVER",e.ONCE="ONCE",e.ONCE_PER_GROUP="ONCE_PER_GROUP",e))(Qe||{}),Xe=(e=>(e.NONE="NONE",e.PENDING_SCHEDULE="PENDING_SCHEDULE",e.SCHEDULED="SCHEDULED",e.FIRED="FIRED",e))(Xe||{}),Ze=(e=>(e.NONE="NONE",e.LIKE="LIKE",e.SCALE="SCALE",e))(Ze||{}),qe=(e=>(e.HIDE="HIDE",e.BLOCK="BLOCK",e.OTHERS="OTHERS",e))(qe||{});function et(){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:[e=>!e.match(/\d$/)],"data-id":[e=>!e.match(/\d$/)]},inferenceClassNameFilters:[e=>!e.startsWith("css-")],baseZIndex:1234500,evalJsDisabled:!1}}const f=et();function M(e){return Array.isArray(e)||(e=e?[e]:[]),e=e.map(t=>typeof t=="string"?new RegExp(t):t),e}function Et(e,t){return e.every(s=>typeof s=="function"?s(t):s instanceof RegExp?s.test(t):!0)}function tt(){let e=m();if(f.urlFilter){if(e=f.urlFilter(e),typeof e!="string")throw new h("Userflow.js: URL filter returned non-string value. Please check your userflow.setUrlFilter() implementation.");try{new URL(e)}catch(t){throw new h(`Userflow.js: URL filter returned an invalid URL. Please check your userflow.setUrlFilter() implementation.
3
3
  Returned URL: `+e+`
4
- Error message: `+t.message)}}return e}let K="";try{K=localStorage.getItem("debug")||""}catch{}const $=K.split(",").some(e=>e==="*"||e.startsWith("userflow:*")),o=v("log");o.group=v("group");o.groupCollapsed=v("groupCollapsed");o.groupEnd=function(){$&&console.groupEnd()};let p;function v(e){return function(t,...s){if($){const n=performance.now(),i=p?Math.round(n-p):0;p=n,console[e](`%cuserflow %c${t} %c+${i}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const tt=()=>T(()=>import("./ResourceCenterApp.js").then(e=>e.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,23,24,25,26,27,28,29,30,31]));function st(e){const s=e.version.checklist.tasks.length;return Math.max(0,s-e.taskCompletions.length)}class M{constructor(t){this.observers=new Set,this._value=t}get value(){return this._value}update(t){if(t!==this._value){this._value=t;for(const s of this.observers)s()}}observe(t){return this.observers.add(t),()=>this.observers.delete(t)}}const P=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],it=()=>T(()=>import("./BannerApp.js"),__vite__mapDeps([32,1,2,3,4,5,6,7,16,13,14,15,10,11,12,9,8,17,19,20,18,21,31,22,33,34])),_="1024504",nt=import.meta.url,B=50,rt=5*60*1e3,H="userflowClientState",g="userflowClientSiteId";class ot{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.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=null,this.siteSession=null,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.embedSessions=[],this.workflowSession=null,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.debuggerUI=null,this.debuggerMountInProgress=!1,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.implicitTracking=null,this.initialMessagesQueue=[],this.onBuilderMessage=t=>(this.handleBuilderMessage(t),!1),this.handleBuilderMessage=async t=>{o(`builder ${t.kind} message received`,t);const s="idempotencyKey"in t&&typeof t.idempotencyKey=="string"?t.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const n=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(t.kind){case"userflow:selectElement":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:t.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),d.setItem("previewFlowId",t.flowId),t.testUser?this.identifyTestUser(t.testUser):this.resetTestUser(),t.testStartCondition?this.setSessionStorageState(i=>({...i,activeApp:"startConditionTesting",testStartConditionToken:t.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(t.token),t.isResourceCenter){const i=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===t.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",i))};this.on("resourceCenterChanged",i),i()}});return}case"userflow:testTracker":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0})),t.testUser?this.identifyTestUser(t.testUser):this.resetTestUser(),this.setSessionStorageState(i=>({...i,activeApp:"trackerTesting",trackerTesting:{trackerName:t.trackerName,token:t.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,trackerTesting:null}));return}case"userflow:startSmartFlow":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startSmartFlowAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"smartFlowRecording",smartFlowRecording:{sessionId:t.sessionId,isRecording:!0,startUrl:t.startUrl||null}}));return}case"userflow:smartFlowCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}case"userflow:smartFlowStartOverAck":return;case"userflow:smartFlowComplete":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),B))},this.onUserActivity=()=>this.ensureConnected(),this.mountSitePage=async(t,s)=>{d.setItem(g,s),o("mounting site page"),this.setResourceCenterLauncherHidden(!0);try{const{SitePage:n}=await T(async()=>{const{SitePage:r}=await import("./SitePage.js");return{SitePage:r}},__vite__mapDeps([35,1,2,3,4,5,6,7,19,20,36,37,38,39,40,41,42,43,44,45,28,16,13,14,15,10,11,12,26,27,21,9,46,29,47,48,33,34]));new n(this,t).mount(),o("site page mounted")}catch(n){console.error("Userflow: Failed to mount site page",n)}},this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+_),Z(this.onUrlChange),this.setTargetEnv(new ee),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const t of P)document.addEventListener(t,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),x(this.onUrlChange),this.destroyTargetEnv();for(const t of P)document.removeEventListener(t,this.remountIfNecessary)}setTargetEnv(t){this.destroyTargetEnv(),this.targetEnv=t,t.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new h("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(t){const s=t(this.getSessionStorageState());d.setItem(H,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let t=this.sessionStorageState;if(!t){const s=d.getItem(H);if(s)try{t=JSON.parse(s)}catch(n){console.error("Userflow.js: Parse ElementSelectionState error:",n)}t||(t={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=t}return t}checkTestUserAtBoot(){const t=this.getSessionStorageState().testUser;t&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(t))}async identifyTestUser(t){this.setSessionStorageState(i=>({...i,testUser:t})),this.reset(),this.init(t.clientToken),this.testUserIdentified=!0,this.externalId=t.id;const s=[this.identify(t.id,{name:t.name,email:t.email,signed_up_at:{set_once:new Date().toISOString(),data_type:"datetime"}},{signature:t.signature})],{group:n}=t;n&&(this.groupId=n.id,s.push(this.group(n.id,{name:n.name},{signature:n.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(t=>({...t,testUser:null}))}init(t){if(o("init",t),!t)throw new h("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==t){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=t,this.emit("private:initialised")}}ensureInit(){if(!this.clientToken)throw new h("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new h("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new h("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");const t=/^ct_eu\d+_.+$/.test(this.clientToken)?"e.eu.":"e.";let s=E.serverEndpoint||t+"userflow.com";new URL(nt).hostname==="js.getuserflow.com"&&s==="e.userflow.com"&&(s="e.getuserflow.com");const n="wss://"+s+"/end-users/"+this.clientToken+"/socket";this.socket=new z(n,{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=>{typeof this.featureFlags>"u"&&this.clearInitialMessagesQueue(i.featureFlags),this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.featureFlagEnabled("cff_implicit_events")===!0&&!this.implicitTracking&&this.startImplicitTracking(),!this.featureFlagEnabled("cff_implicit_events")&&this.implicitTracking&&(this.implicitTracking.stop(),this.implicitTracking=null)}).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?`
4
+ Error message: `+t.message)}}return e}let $="";try{$=localStorage.getItem("debug")||""}catch{}const j=$.split(",").some(e=>e==="*"||e.startsWith("userflow:*")),o=O("log");o.group=O("group");o.groupCollapsed=O("groupCollapsed");o.groupEnd=function(){j&&console.groupEnd()};let _;function O(e){return function(t,...s){if(j){const n=performance.now(),i=_?Math.round(n-_):0;_=n,console[e](`%cuserflow %c${t} %c+${i}ms`,"color:#1a57e6;","","color:#1a57e6;",...s)}}}const st=()=>I(()=>import("./ResourceCenterApp.js").then(e=>e.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,23,24,25,26,27,28,29,30]));function it(e){const s=e.version.checklist.tasks.length;return Math.max(0,s-e.taskCompletions.length)}class P{constructor(t){this.observers=new Set,this._value=t}get value(){return this._value}update(t){if(t!==this._value){this._value=t;for(const s of this.observers)s()}}observe(t){return this.observers.add(t),()=>this.observers.delete(t)}}const B=["page:before-change","page:change","turbo:before-cache","turbo:load","turbo:visit","turbolinks:before-cache","turbolinks:load","turbolinks:visit","livewire:navigated","livewire:navigating","livewire:update"],nt=()=>I(()=>import("./BannerApp.js"),__vite__mapDeps([31,1,2,3,4,5,6,15,12,13,14,9,10,11,8,7,16,18,19,17,20,30,21,32,33])),N="1024509",rt=import.meta.url,H=50,ot=300*1e3,W="userflowClientState",w="userflowClientSiteId";class at{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.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=null,this.siteSession=null,this.launcherSessions=[],this.activeLauncherFlowId=null,this.notifications=[],this.embedSessions=[],this.workflowSession=null,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.debuggerUI=null,this.debuggerMountInProgress=!1,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.implicitTracking=null,this.initialMessagesQueue=[],this.onBuilderMessage=t=>(this.handleBuilderMessage(t),!1),this.handleBuilderMessage=async t=>{o(`builder ${t.kind} message received`,t);const s="idempotencyKey"in t&&typeof t.idempotencyKey=="string"?t.idempotencyKey:null;if(s&&this.idempotencyKeysSeen.has(s))return;const n=()=>{s&&this.idempotencyKeysSeen.add(s)};switch(t.kind){case"userflow:selectElement":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:selectElementAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"elementSelection",elementSelection:{mode:"select",elementType:t.elementType}}));return}case"userflow:selectElementCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,elementSelection:null}));return}case"userflow:startFlowWithToken":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startFlowWithTokenAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:null,testStartConditionToken:void 0})),d.setItem("previewFlowId",t.flowId),t.testUser?this.identifyTestUser(t.testUser):this.resetTestUser(),t.testStartCondition?this.setSessionStorageState(i=>({...i,activeApp:"startConditionTesting",testStartConditionToken:t.token})):this.onceIdentified(()=>{if(this.startFlowWithToken(t.token),t.isResourceCenter){const i=()=>{const r=this.resourceCenterSession;r&&r.draftMode&&r.flow.id===t.flowId&&(this.openResourceCenter(),this.off("resourceCenterChanged",i))};this.on("resourceCenterChanged",i),i()}});return}case"userflow:testTracker":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:testTrackerAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0})),t.testUser?this.identifyTestUser(t.testUser):this.resetTestUser(),this.setSessionStorageState(i=>({...i,activeApp:"trackerTesting",trackerTesting:{trackerName:t.trackerName,token:t.token,events:0}}));return}case"userflow:testTrackerCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,trackerTesting:null}));return}case"userflow:startSmartFlow":{n(),this.getTargetEnv().postBuilderMessage({kind:"userflow:startSmartFlowAck",idempotencyKey:t.idempotencyKey}),this.setSessionStorageState(i=>({...i,isTargetTab:!0,activeApp:"smartFlowRecording",smartFlowRecording:{sessionId:t.sessionId,isRecording:!0,startUrl:t.startUrl||null}}));return}case"userflow:smartFlowCancel":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}case"userflow:smartFlowStartOverAck":return;case"userflow:smartFlowComplete":{this.setSessionStorageState(i=>({...i,activeApp:null,smartFlowRecording:null}));return}}},this.onUrlChange=()=>{this.externalId&&(window.clearTimeout(this.flushUrlChangeTimeout),this.flushUrlChangeTimeout=window.setTimeout(()=>this.flushUrlChange(),H))},this.onUserActivity=()=>this.ensureConnected(),this.mountSitePage=async(t,s)=>{d.setItem(w,s),o("mounting site page"),this.setResourceCenterLauncherHidden(!0);try{const{SitePage:n}=await I(async()=>{const{SitePage:r}=await import("./SitePage.js");return{SitePage:r}},__vite__mapDeps([34,1,2,3,4,5,6,18,19,35,36,37,38,39,40,41,42,43,44,27,15,12,13,14,9,10,11,25,26,20,8,45,28,46,47,32,33]));new n(this,t).mount(),o("site page mounted")}catch(n){console.error("Userflow: Failed to mount site page",n)}},this.remountIfNecessary=()=>{!this.ui?.container||document.contains(this.ui.container)||(o("remounting UI because container was missing"),this.remount())},o("constructor, build="+N),q(this.onUrlChange),this.setTargetEnv(new te),this.checkTestUserAtBoot(),this.toggleUI(),this.checkDebuggerSession();for(const t of B)document.addEventListener(t,this.remountIfNecessary)}get socketStatus(){return this._socketStatus}destroy(){o("destroy"),this.reset(),F(this.onUrlChange),this.destroyTargetEnv();for(const t of B)document.removeEventListener(t,this.remountIfNecessary)}setTargetEnv(t){this.destroyTargetEnv(),this.targetEnv=t,t.onBuilderMessage(this.onBuilderMessage)}destroyTargetEnv(){this.targetEnv&&(this.targetEnv.destroy(),this.targetEnv=null)}getTargetEnv(){if(!this.targetEnv)throw new h("Userflow.js: Cannot call getTargetEnv when protocol is not set");return this.targetEnv}setSessionStorageState(t){const s=t(this.getSessionStorageState());d.setItem(W,JSON.stringify(s)),this.sessionStorageState=s,this.toggleUI()}getSessionStorageState(){let t=this.sessionStorageState;if(!t){const s=d.getItem(W);if(s)try{t=JSON.parse(s)}catch(n){console.error("Userflow.js: Parse ElementSelectionState error:",n)}t||(t={testUser:null,activeApp:null,elementSelection:null,trackerTesting:null}),this.sessionStorageState=t}return t}checkTestUserAtBoot(){const t=this.getSessionStorageState().testUser;t&&(o("checkTestUserAtBoot identifying test user"),this.identifyTestUser(t))}async identifyTestUser(t){this.setSessionStorageState(i=>({...i,testUser:t})),this.reset(),this.init(t.clientToken),this.testUserIdentified=!0,this.externalId=t.id;const s=[this.identify(t.id,{name:t.name,email:t.email,signed_up_at:{set_once:new Date().toISOString(),data_type:"datetime"}},{signature:t.signature})],{group:n}=t;n&&(this.groupId=n.id,s.push(this.group(n.id,{name:n.name},{signature:n.signature}))),await Promise.all(s)}resetTestUser(){this.setSessionStorageState(t=>({...t,testUser:null}))}init(t){if(o("init",t),!t)throw new h("userflow.init() was called but missing Userflow.js Token");if(this.clientToken!==t){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=t,this.emit("private:initialised")}}ensureInit(){if(!this.clientToken)throw new h("You must call userflow.init() first")}ensureIdentified(){if(this.ensureInit(),!this.externalId)throw new h("You must call userflow.identify() first");return this.externalId}ensureGroup(){if(this.ensureIdentified(),!this.groupId)throw new h("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");const t=/^ct_eu\d+_.+$/.test(this.clientToken)?"e.eu.":"e.";let s=f.serverEndpoint||t+"userflow.com";new URL(rt).hostname==="js.getuserflow.com"&&s==="e.userflow.com"&&(s="e.getuserflow.com");const n="wss://"+s+"/end-users/"+this.clientToken+"/socket";this.socket=new J(n,{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=>{typeof this.featureFlags>"u"&&this.clearInitialMessagesQueue(i.featureFlags),this.logrocketAppId=i.logrocketAppId,this.featureFlags=new Set(i.featureFlags),o("channel joined"),this._socketStatus!=="connected"&&(this._socketStatus="connected"),this.featureFlagEnabled("cff_implicit_events")===!0&&!this.implicitTracking&&this.startImplicitTracking(),!this.featureFlagEnabled("cff_implicit_events")&&this.implicitTracking&&(this.implicitTracking.stop(),this.implicitTracking=null)}).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
- `+i.details.map(r=>(r.path?`${r.path}: `:"")+r.message):""))})}async startImplicitTracking(){await T(()=>import("./implicit-tracking.js"),__vite__mapDeps([49,12,2,34,33])).then(t=>{this.implicitTracking=new t.ImplicitTracking(this),this.implicitTracking.start()}).catch(t=>o(`Implicit tracking failed to load ${t}`))}makeChannelJoinPayload(){let t;d.getItem(g)&&(t=new URL(k()).searchParams.get("announcement_id")||void 0);const n=this.buildClientContext();this.clientContext=n;const i={protocolVersion:2,userflowClientBuild:_,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,siteSessionId:this.siteSession?.id||null,launchers:this.launcherSessions.map(r=>({flowId:r.flow.id})),trackers:Array.from(this.trackers.values()).map(r=>({flowId:r.tracker.flowId})),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map(r=>({conditionId:r.condition.id,isTrue:r.isTrue})),previewFlowId:d.getItem("previewFlowId"),announcementPreviewId:t,clientContext:n};return o("channel join payload",i),i}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()},rt)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.bannerSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some(t=>t.draftMode)}async send(t,{batch:s,endBatch:n,handlesRejection:i}={}){return(!this.inBatch||!["ToggleClientCondition","UpdateClientContext"].includes(t.kind))&&this.checkPushRateLimit(),this.ensureConnected(),s&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),n?this.endBatch():this.endBatchTimeout=window.setTimeout(()=>{this.endBatch()},B)),this.sendRaw(t,{handlesRejection:i})}clearInitialMessagesQueue(t){if(this.initialMessagesQueue.length===0)return;const s=t.includes("cff_disable_page_views")===!0,n=t.includes("cff_implicit_events")===!1;for(const i of this.initialMessagesQueue){const{message:r,handlesRejection:a,resolve:u,reject:c}=i;if(n&&r.kind==="TrackRawEvent"){u("skipped due to disabled implicit events");continue}if(s&&(r.kind==="TrackEvent"&&r.name==="page_viewed"||r.kind==="TrackRawEvent"&&r.name==="page_viewed")){u("skipped due to disabled page views tracking");continue}this._sendToChannel(r,u,c,{handlesRejection:a})}this.initialMessagesQueue=[]}async sendRaw(t,{handlesRejection:s}={}){return typeof this.featureFlags>"u"?new Promise((n,i)=>{this.initialMessagesQueue.push({message:t,resolve:n,reject:i,handlesRejection:s})}):new Promise((n,i)=>{this._sendToChannel(t,n,i,{handlesRejection:s})})}_sendToChannel(t,s,n,{handlesRejection:i}={}){if(!this.channel){const c=`Userflow.js: send() should not be called if channel is not set. Message kind=${t.kind}`;if(i)throw Error(c);console.log(c,`
7
- Client message:`,t);return}o(`push ${t.kind} message`,t);const r=this.clientClock,a=()=>{this.serverClock=r,this.channel?.off("phx_error",u)},u=this.channel.on("phx_error",c=>{a();const l=`Userflow.js send ${t.kind} got phx_error`;this._socketStatus==="connected"&&console.log(l,`
6
+ `+i.details.map(r=>(r.path?`${r.path}: `:"")+r.message):""))})}async startImplicitTracking(){await I(()=>import("./implicit-tracking.js"),__vite__mapDeps([48,11,2,33,32])).then(t=>{this.implicitTracking=new t.ImplicitTracking(this),this.implicitTracking.start()}).catch(t=>o(`Implicit tracking failed to load ${t}`))}makeChannelJoinPayload(){let t;d.getItem(w)&&(t=new URL(m()).searchParams.get("announcement_id")||void 0);const n=this.buildClientContext();this.clientContext=n;const i={protocolVersion:2,userflowClientBuild:N,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,siteSessionId:this.siteSession?.id||null,launchers:this.launcherSessions.map(r=>({flowId:r.flow.id})),trackers:Array.from(this.trackers.values()).map(r=>({flowId:r.tracker.flowId})),hasDraftSession:this.hasDraftSession(),clientConditions:Array.from(this.clientConditions.values()).map(r=>({conditionId:r.condition.id,isTrue:r.isTrue})),previewFlowId:d.getItem("previewFlowId"),announcementPreviewId:t,clientContext:n};return o("channel join payload",i),i}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()},ot)}hasDraftSession(){return!!this.flowSession?.draftMode||!!this.checklistSession?.draftMode||!!this.bannerSession?.draftMode||!!this.resourceCenterSession?.draftMode||this.launcherSessions.some(t=>t.draftMode)}async send(t,{batch:s,endBatch:n,handlesRejection:i}={}){return(!this.inBatch||!["ToggleClientCondition","UpdateClientContext"].includes(t.kind))&&this.checkPushRateLimit(),this.ensureConnected(),s&&!this.inBatch&&(this.inBatch=!0,this.sendRaw({kind:"BeginBatch"})),this.inBatch&&(window.clearTimeout(this.endBatchTimeout),n?this.endBatch():this.endBatchTimeout=window.setTimeout(()=>{this.endBatch()},H)),this.sendRaw(t,{handlesRejection:i})}clearInitialMessagesQueue(t){if(this.initialMessagesQueue.length===0)return;const s=t.includes("cff_disable_page_views")===!0,n=t.includes("cff_implicit_events")===!1;for(const i of this.initialMessagesQueue){const{message:r,handlesRejection:a,resolve:l,reject:u}=i;if(n&&r.kind==="TrackRawEvent"){l("skipped due to disabled implicit events");continue}if(s&&(r.kind==="TrackEvent"&&r.name==="page_viewed"||r.kind==="TrackRawEvent"&&r.name==="page_viewed")){l("skipped due to disabled page views tracking");continue}this._sendToChannel(r,l,u,{handlesRejection:a})}this.initialMessagesQueue=[]}async sendRaw(t,{handlesRejection:s}={}){return typeof this.featureFlags>"u"?new Promise((n,i)=>{this.initialMessagesQueue.push({message:t,resolve:n,reject:i,handlesRejection:s})}):new Promise((n,i)=>{this._sendToChannel(t,n,i,{handlesRejection:s})})}_sendToChannel(t,s,n,{handlesRejection:i}={}){if(!this.channel){const u=`Userflow.js: send() should not be called if channel is not set. Message kind=${t.kind}`;if(i)throw Error(u);console.log(u,`
7
+ Client message:`,t);return}o(`push ${t.kind} message`,t);const r=this.clientClock,a=()=>{this.serverClock=r,this.channel?.off("phx_error",l)},l=this.channel.on("phx_error",u=>{a();const c=`Userflow.js send ${t.kind} got phx_error`;this._socketStatus==="connected"&&console.log(c,`
8
8
  Client message:`,t,`
9
- Error:`,c),i&&n(new h(l))});this.channel.push("client_message",t).receive("ok",c=>{a(),s(c)}).receive("error",c=>{a();const l=`Userflow.js error reply (${c.code}): ${c.message}`;console.log(l,`
9
+ Error:`,u),i&&n(new h(c))});this.channel.push("client_message",t).receive("ok",u=>{a(),s(u)}).receive("error",u=>{a();const c=`Userflow.js error reply (${u.code}): ${u.message}`;console.log(c,`
10
10
  Client message:`,t,`
11
- Error:`,c),i&&n(new h(l,c.code,c.message))})}endBatch(){this.inBatch=!1,this.sendRaw({kind:"EndBatch"})}checkPushRateLimit(){const t=this.featureFlagEnabled("cff_implicit_events")===!0?200:100,s=Date.now();if(this.pushRateLimitMinuteExpires<s&&(this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=s+60*1e3),this.pushRateLimitMinute>=t)throw new h(`This Userflow.js client has reached a maximum of ${t} operations in the last 1 minute. This is usually due to one of the following:
11
+ Error:`,u),i&&n(new h(c,u.code,u.message))})}endBatch(){this.inBatch=!1,this.sendRaw({kind:"EndBatch"})}checkPushRateLimit(){const t=this.featureFlagEnabled("cff_implicit_events")===!0?200:100,s=Date.now();if(this.pushRateLimitMinuteExpires<s&&(this.pushRateLimitMinute=0,this.pushRateLimitMinuteExpires=s+60*1e3),this.pushRateLimitMinute>=t)throw new h(`This Userflow.js client has reached a maximum of ${t} operations in the last 1 minute. This is usually due to one of the following:
12
12
 
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
- If in doubt, reach out to us at support@userflow.com.`);this.pushRateLimitMinute++}handleServerMessage(t){o(`received ${t.kind} message`,t);const{serverClock:s,flowSession:n,flowSessionClock:i,checklistSession:r,checklistSessionClock:a,bannerSession:u,resourceCenterSession:c}=this;switch(t.kind){case"CheckSessionsAck":this.emit("private:checkSessionsAck");return;case"ServerDebug":return;case"AddLauncher":{const{session:l}=t,I=this.launcherSessions.findIndex(f=>f.flow.id===l.flow.id);I===-1?this.launcherSessions=[...this.launcherSessions,l]:this.launcherSessions=[...this.launcherSessions.slice(0,I),l,...this.launcherSessions.slice(I+1)],this.toggleUI();return}case"AddTracker":{this.addTracker(t.tracker);return}case"AssistantMessageEventWrapper":{this.emit("private:assistantMessageEvent",t);return}case"CancelConditionWaitTimer":window.clearTimeout(this.conditionWaitTimers.get(t.conditionId)),this.conditionWaitTimers.delete(t.conditionId);return;case"ChecklistTaskCompleted":this.unackedTasks.add(t.taskCvid);return;case"ForceGoToStep":if(i>s){o(`ignoring ${t.kind} message due to stale clock flowSessionClock=${i} > serverClock=${s}`);return}n?.id===t.sessionId&&this.emit("gotostep",{session:n,step:{id:t.stepId}});return;case"RemoveLauncher":this.removeLauncher(t.flowId)&&this.toggleUI();return;case"RemoveTracker":{this.removeTracker(t.flowId);return}case"SetBannerSession":this.setBannerSession(t.session),this.toggleUI();return;case"SetChecklistSession":a<=s||r?.id===t.session.id?(this.setChecklistSession(t.session,s),this.toggleUI()):o(`ignoring ${t.kind} message due to stale clock checklistSessionClock=${a} > serverClock=${s}`);return;case"SetFlowSession":i<=s||n?.id===t.session.id?(this.setFlowSession(t.session,s),this.emit("private:setFlowSession",t.session.version.id),this.toggleUI()):o(`ignoring ${t.kind} message due to stale clock flowSessionClock=${i} > serverClock=${s}`);return;case"SetResourceCenterSession":this.setResourceCenterSession(t.session),this.toggleUI();return;case"StartConditionWaitTimer":{if(!this.conditionWaitTimers.has(t.conditionId)){const l=window.setTimeout(()=>{this.conditionWaitTimers.delete(t.conditionId),this.send({kind:"FireConditionWaitTimer",conditionId:t.conditionId},{batch:!0})},parseFloat(t.waitTime)*1e3);this.conditionWaitTimers.set(t.conditionId,l)}return}case"TestStartConditionSuccess":this.emit("private:testStartConditionSuccess");return;case"TrackClientCondition":this.trackClientCondition(t.condition);return;case"UnsetBannerSession":u?.id===t.sessionId&&(this.setBannerSession(null),this.toggleUI());return;case"UnsetChecklistSession":if(a>s){o(`ignoring ${t.kind} message due to stale clock checklistSessionClock=${a} > serverClock=${s}`);return}r?.id===t.sessionId&&(this.setChecklistSession(null,s),this.toggleUI());return;case"UnsetFlowSession":if(i>s){o(`ignoring ${t.kind} message due to stale clock flowSessionClock=${i} > serverClock=${s}`);return}n?.id===t.sessionId&&(this.setFlowSession(null,s),this.toggleUI());return;case"UnsetResourceCenterSession":c?.id===t.sessionId&&(this.setResourceCenterSession(null),this.toggleUI());return;case"UntrackClientCondition":this.untrackClientCondition(t.conditionId);return;case"AddEmbed":{const l=this.embedSessions?.findIndex(I=>I.flow.id===t.session.flow.id);l!==void 0&&l>=0?this.embedSessions=[...this.embedSessions?.slice(0,l)||[],t.session,...this.embedSessions?.slice(l+1)||[]]:this.embedSessions=[...this.embedSessions||[],t.session],this.emit("uistatechange");break}case"RemoveEmbed":{this.embedSessions=(this.embedSessions||[]).filter(l=>l.flow.id!==t.flowId),this.emit("uistatechange");break}case"SetSiteSession":{this.siteSession=t.session,this.emit("private:siteSession",t.session);break}case"UnsetSiteSession":{this.siteSession=null,d.removeItem(g),this.emit("private:unsetSiteSession");break}case"SetWorkflowSession":{this.setWorkFlowSession(t.session),this.toggleUI();break}case"UnsetWorkflowSession":{this.setWorkFlowSession(null),this.toggleUI();break}case"WorkflowFillStepValue":{this.emit("private:workflowFillStepValue",t);break}default:console.warn("Userflow.js: Received unknown message",t);return}}async identify(t,s={},{signature:n}={}){if(o("identify",t),this.ensureInit(),this.testUserIdentified&&t!==this.externalId){o("identify() ignored since a test user has been identified");return}if(typeof t=="number")t=String(t);else if(!t||typeof t!="string")throw new h(`userflow.identify: First argument must be a non-empty string representing the user's ID in your database. Value received: ${JSON.stringify(t)}`);this.externalId&&t!==this.externalId&&(o("identify resetting due to new externalId"),this.reset()),this.externalId=t,this.signature=n||null,this.observeUserActivity(),await Promise.all([this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(s)},{batch:!0}),this.onFirstIdentify()]),this.emit("private:identified")}async identifyAnonymous(t={},s={}){if(!w.isSupported())throw new h("userflow.identifyAnonymous() is not supported when localStorage access is denied.");const n="anonymousId";let i=w.getItem(n);i||(i="anon-"+O(),w.setItem(n,i)),await this.identify(i,t,s)}getInitToken(){return this.clientToken}getIdentifiedUser(){return{externalId:this.externalId}}async updateUser(t={},s={}){o("updateUser"),this.ensureIdentified(),await this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(t)},{batch:!0})}async group(t,s={},{signature:n,membership:i}={}){if(o("group",t),this.ensureIdentified(),this.testUserIdentified&&t!==this.groupId){o("group() ignored since a test user has been identified");return}if(typeof t=="number")t=String(t);else if(!t||typeof t!="string")throw new h(`userflow.group: First argument must be a non-empty string representing the group's ID in your database. Value received: ${JSON.stringify(t)}`);this.groupId=t,this.groupSignature=n||null,await this.send({kind:"UpsertGroup",groupExternalId:t,groupSignature:this.groupSignature,groupAttributes:this.normalizeAttributes(s),membershipAttributes:this.normalizeAttributes(i)},{batch:!0})}async updateGroup(t={},s={}){o("updateGroup");const n=this.ensureGroup();await this.send({kind:"UpsertGroup",groupExternalId:n,groupSignature:this.groupSignature,membershipAttributes:this.normalizeAttributes(s.membership),groupAttributes:this.normalizeAttributes(t)},{batch:!0})}normalizeAttributes(t){if(t==null)return{};if(typeof t!="object")throw new h("Userflow: 'attributes' must be an object.");const s={};for(const n in t){if(!t.hasOwnProperty(n))continue;if(n==="traits"){const r=t[n];Object.assign(s,this.extractLegacyTraits(r));continue}let i=t[n];if(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i==null||Array.isArray(i))s[n]=this.normalizeAttributeLiteralOrList(n,i);else{if(typeof i!="object"||i==null)throw new h(`Userflow: Invalid value for '${n}' attribute.`);if("set"in i)s[n]={set:this.normalizeAttributeLiteralOrList(n,i.set),dataType:this.normalizeDataType(n,i.data_type||i.dataType)};else if("set_once"in i||"setOnce"in i)s[n]={setOnce:this.normalizeAttributeLiteralOrList(n,i.set_once??i.setOnce),dataType:this.normalizeDataType(n,i.data_type||i.dataType)};else if("add"in i){const r=i.add;if(typeof r!="string"&&typeof r!="number")throw new h(`Userflow: Invalid 'add' value for '${n}' attribute. Must be a number or string.`);s[n]={add:r}}else if("subtract"in i){const r=i.subtract;if(typeof r!="string"&&typeof r!="number")throw new h(`Userflow: Invalid 'subtract' value for '${n}' attribute. Must be a number or string.`);s[n]={subtract:r}}else if("append"in i)s[n]={append:this.normalizeAttributeLiteralOrList(n,i.append)};else if("prepend"in i)s[n]={prepend:this.normalizeAttributeLiteralOrList(n,i.prepend)};else if("remove"in i)s[n]={remove:this.normalizeAttributeLiteralOrList(n,i.remove)};else throw new h(`Userflow: Invalid value for '${n}' attribute.`)}}return s}normalizeAttributeLiteralOrList(t,s){return Array.isArray(s)?s.map(n=>this.normalizeAttributeLiteral(t,n)):this.normalizeAttributeLiteral(t,s)}normalizeAttributeLiteral(t,s){if(s==null)return null;if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")return s;throw new h(`Userflow: Invalid value for '${t}' attribute.`)}normalizeDataType(t,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 h(`Userflow: Invalid data_type for '${t}' attribute.`)}extractLegacyTraits(t){if(!t)return{};if(!Array.isArray(t)){const s=[];for(const n in t)t.hasOwnProperty(n)&&s.push({name:n,value:t[n]});t=s}return t.reduce((s,{name:n,value:i,dataType:r})=>{if(typeof n!="string"||n.length>100||!n.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:",n),s;if(typeof i!="string")if(typeof i=="boolean")r||(r="boolean"),i=i?"true":"false";else if(typeof i=="number")r||(r=Number.isInteger(i)?"integer":"decimal"),i=String(i);else return this.warn(`userflow.identify: The value of trait '${n}' is invalid (must be a string, a boolean or a number). The trait will be ignored. Value was:`,i),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 '${n}' is invalid (must be a 'string', 'boolean', 'integer', 'decimal' or 'datetime'). The trait will be ignored. Data type was:`,r),s}return s[n]={set:i,dataType:a},s},{})}async track(t,s={},{userOnly:n}={}){o(`track '${t}'`,s),this.ensureIdentified(),await this.send({kind:"TrackEvent",userOnly:!!n,name:t,attributes:this.normalizeEventAttributes(s)},{batch:!0})}async trackRawEvent(t){const{name:s,attributes:n}=t;o(`track raw event '${s}'`,n),this.ensureIdentified(),await this.send({kind:"TrackRawEvent",name:s,attributes:this.normalizeEventAttributes(n)})}normalizeEventAttributes(t){const s=this.normalizeAttributes(t);for(const n in s){if(!s.hasOwnProperty(n))continue;const i=s[n];if(!(i==null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||Array.isArray(i)||"set"in i))throw new h(`Userflow: Invalid value for '${n}' 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(t){this.isIdentified()?t():this.firstIdentifyCallback=t}checkUrlForStartFlow(){const t=new URL(k()),s=t.searchParams.get("userflow")||t.searchParams.get("studio1_flow")||t.searchParams.get("studio1_walkthrough");s&&(o(`url contained flow ${s}`),this.startFlow({flowId:s,startReason:L.LINK,batch:!0}),t.searchParams.delete("userflow"),t.searchParams.delete("studio1_flow"),t.searchParams.delete("studio1_walkthrough"),window.history.replaceState({},"",t.toString()),this.clientContext=this.buildClientContext(),this.pushUpdateClientContext())}flushUrlChange(){const t=this.buildClientContext();(!this.clientContext||t.pageUrl!==this.clientContext.pageUrl)&&(this.clientContext=t,this.pushUpdateClientContext(),this.trackPageViewed(),this.checkUrlForStartFlow())}async trackPageViewed(){this.featureFlags&&this.featureFlagEnabled("cff_disable_page_views")===!0||(this.pageTrackingDisabled||this.track("page_viewed",{}),this.trackRawPageViewed())}async trackRawPageViewed(){this.featureFlags&&(this.featureFlagEnabled("cff_implicit_events")===!1||this.featureFlagEnabled("cff_disable_page_views")===!0)||this.trackRawEvent({name:"page_viewed",attributes:{id:O(),page_title:document.title,...this.buildClientContext()}})}buildClientContext(){let t=null;const s=d.getItem(g);if(s){const i=new URL(k()).pathname.match(/^\/([^/]+)\/?(?:\/([^/]+)\/?)?$/);i&&(t=i[1])}return{pageUrl:et(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,...s&&{siteId:s},...t&&{localeCode:t}}}pushUpdateClientContext(){this.send({kind:"UpdateClientContext",clientContext:this.clientContext},{batch:!0})}ackCompletedTask(t){this.unackedTasks.delete(t)}taskIsUnacked(t){return this.unackedTasks.has(t)}isIdentified(){return this.externalId!=null}on(t,s){let n=this.listeners.get(t);n||(n=new Set,this.listeners.set(t,n)),n.add(s)}off(t,s){const n=this.listeners.get(t);n&&n.delete(s)}emit(t,...s){const n=this.listeners.get(t);n&&Array.from(n).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.resourceCenterLauncherHidden=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((t,s)=>{this.untrackClientCondition(s)}),this.firstIdentifyCallback=null,this.testUserIdentified=!1,w.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:t,stepCvid:s,startReason:n,once:i,batch:r,replaceCurrent:a}){if(this.ensureIdentified(),a&&this.flowSession&&this.endFlow(this.flowSession,{endReason:m.REPLACED,batch:!0}),o(`startFlow ${t}`,{startReason:n}),this.checklistSession?.flow.id===t){o("startFlow matches current checklist, so showing it instead"),this.showChecklist();return}const u={kind:"StartFlow",flowId:t,stepCvid:s,startReason:n,once:!!i};await this.send(u,{batch:r})}async trackButtonEvent(t,s,n,i){const r={kind:"TrackButtonEvent",eventName:t,stepCvid:n,sessionId:i,token:s};await this.send(r,{batch:!0})}async startFlowWithToken(t){this.ensureIdentified(),o("startFlowWithToken",{token:t}),await this.send({kind:"StartFlowWithToken",token:t},{batch:!0})}optimisticClockUIUpdate(t){this.clientClock++,t(),this.toggleUI()}async showChecklist(){if(this.resourceCenterEmbedsChecklist()&&!this.embedChecklistSessions()){this.openResourceCenter();return}this.embedChecklistSessions()||(this.unmarkExpandPending(),!(!this.checklistSession||this.checklistExpanded)&&(this.ensureIdentified(),this.checklistExpanded=!0,this.toggleUI(),d.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(),d.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"),d.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"),d.removeItem(`resourceCenterOpen:${this.resourceCenterSession.id}`),await this.send({kind:"CloseResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}toggleResourceCenter(){this.resourceCenterOpen?this.closeResourceCenter():this.openResourceCenter()}setResourceCenterLauncherHidden(t){this.resourceCenterLauncherHidden=t,this.toggleUI()}getResourceCenterState(){if(!this.resourceCenterSession)return null;const t=this.resourceCenterEmbedsChecklist(),{checklistSession:s}=this,n=this.resourceCenterSession.version.resourceCenter?.blocks.find(i=>i.type===A.ANNOUNCEMENTS);return{isOpen:this.resourceCenterOpen,hasChecklist:t,uncompletedChecklistTaskCount:t&&s?st(s):0,unreadAnnouncementCount:n?.unreadAnnouncementCount||0}}resourceCenterEmbedsChecklist(){const t=this.resourceCenterSession;return!!t&&!!t.version.resourceCenter?.blocks.some(s=>s.type===A.CHECKLIST)}embedChecklistSessions(){return this.embedSessions.some(t=>!!t.version.embed?.blocks?.some(s=>s.type===V.CHECKLIST))}async endFlow(t,{endReason:s,batch:n}){this.ensureIdentified(),this.optimisticClockUIUpdate(()=>{const{clientClock:u}=this;this.flowSession?.id===t.id&&this.setFlowSession(null,u),this.checklistSession?.id===t.id&&this.setChecklistSession(null,u),this.bannerSession?.id===t.id&&this.setBannerSession(null),this.resourceCenterSession?.id===t.id&&this.setResourceCenterSession(null),this.workflowSession?.id===t.id&&this.setWorkFlowSession(null)});const{flow:i}=t,r={id:i.id,type:i.type.toLowerCase()};i.type===U.CHECKLIST?this.emit("checklistEnded",{checklist:r,endReason:s}):i.type===U.FLOW&&this.emit("flowEnded",{flow:r,endReason:s});const a={kind:"EndFlow",sessionId:t.id,endReason:s};await this.send(a,{batch:n})}async goToStep(t,s){o("goToStep",t.id,s.name||s.id),this.ensureIdentified();const n=this.send({kind:"GoToStep",sessionId:t.id,stepId:s.id});t.currentStep=s,this.emit("gotostep",{session:t,step:s}),await n}async endAllFlows(){o("endAllFlows"),this.optimisticClockUIUpdate(()=>{const{clientClock:t}=this;this.setFlowSession(null,t),this.setChecklistSession(null,t)}),await this.send({kind:"EndAllFlows"})}async endChecklist(){o("endChecklist");const t=this.checklistSession||this.flowSession;t?.flow.type===U.CHECKLIST&&this.endFlow(t,{endReason:m.USERFLOWJS})}setFlowSession(t,s=this.clientClock){const n=this.flowSession;this.flowSession=t,this.flowSessionClock=s,t&&!n&&(this.hideChecklist(),this.closeResourceCenter()),t==null&&this.originalActiveElement&&(typeof this.originalActiveElement.focus=="function"&&this.originalActiveElement.focus(),this.originalActiveElement=void 0)}setWorkFlowSession(t){this.workflowSession=t}setChecklistSession(t,s=this.clientClock){const n=this.checklistSession;this.checklistSession=t,this.checklistSessionClock=s,t===null&&(this.checklistExpanded=!1,this.checklistExpandPending=!1),t&&t.id!==n?.id&&(this.checklistExpanded=!!d.getItem(`checklistExpanded:${t.id}`),t.expandPending&&(this.checklistExpandPending=!0)),this.emit("checklistChanged"),this.emit("resourceCenterChanged")}setBannerSession(t){this.bannerSession=t}setResourceCenterSession(t){const s=this.resourceCenterSession;t=typeof t=="function"?t(this.resourceCenterSession):t,this.resourceCenterSession=t,t===null&&(this.resourceCenterOpen=!1),s&&s.id!==t?.id&&d.removeItem(`resourceCenterOpen:${s.id}`),t&&t.id!==s?.id&&(this.resourceCenterOpen=!!d.getItem(`resourceCenterOpen:${t.id}`)),this.emit("resourceCenterChanged")}launcherSeen(t){this.send({kind:"StartFlow",flowId:t,startReason:L.LAUNCHER_SEEN,once:!1})}activateLauncher(t){const s=this.activeLauncherFlowId&&this.launcherSessions.find(n=>n.flow.id===this.activeLauncherFlowId);s&&this.deactivateLauncher(s),this.activeLauncherFlowId=t.flow.id,this.toggleUI(),this.send({kind:"ActivateLauncher",flowId:t.flow.id})}deactivateLauncher(t){const{launcher:s}=t.version;t.flow.id===this.activeLauncherFlowId&&(s?.dismissOn===F.DEACTIVATE?this.dismissLauncher(t,{endReason:m.LAUNCHER_DEACTIVATED}):(this.activeLauncherFlowId=null,this.toggleUI()))}dismissLauncher(t,{endReason:s}){const n=t.flow.id;this.removeLauncher(n),this.toggleUI(),this.send({kind:"DismissLauncher",flowId:n,endReason:s})}removeLauncher(t){const s=this.launcherSessions.findIndex(n=>n.flow.id===t);return s===-1?!1:(this.launcherSessions=[...this.launcherSessions.slice(0,s),...this.launcherSessions.slice(s+1)],t===this.activeLauncherFlowId&&(this.activeLauncherFlowId=null),!0)}async toggleUI(){const t=this.getSessionStorageState();!this.flowSession&&!this.workflowSession&&(this.checklistExpandPending||this.checklistSession?.version.checklist?.tasks.some(s=>this.taskIsUnacked(s.cvid)))&&this.showChecklist(),t.isTargetTab&&this.monitorTitle(),this.emit("uistatechange"),this.shouldBeMounted()?await this.mountUI():this.unmountUI()}shouldBeMounted(){return this.uiDisabled||this.siteSession?.id||d.getItem(g)?!1:!!this.getSessionStorageState().activeApp||!!this.flowSession||!!this.workflowSession||!!this.checklistSession&&(this.checklistExpanded||!!this.checklistSession?.version.checklist?.launcherEnabled)||!!this.bannerSession||!!this.resourceCenterSession||this.launcherSessions.length>0||this.notifications.length>0}async mountUI(){if(!this.ui){const t=await this.createUI();this.shouldBeMounted()&&!this.ui&&(o("mount UI"),this.ui=t,this.ui.mount())}}unmountUI(){this.ui&&(o("unmount UI"),this.ui.unmount(),this.ui=null)}checkDebuggerSession(){if(this.debuggerUI)return;const t=this.sessionStorageState?.debuggerApp;t&&t?.x&&t?.y&&this.mountDebugger()}async mountDebugger(){if(!this.debuggerMountInProgress){if(this.debuggerUI){this.debuggerUI.unmount();return}this.debuggerMountInProgress=!0;try{const{DebuggerUI:t}=await T(async()=>{const{DebuggerUI:s}=await import("./DebuggerUI.js");return{DebuggerUI:s}},__vite__mapDeps([50,1,2,3,19,20,4,5,6,7,18,13,14,15,10,11,12,21,23,16,48,51,52,46,53,47,29,33,34]));this.debuggerUI=new t(this,_),this.debuggerUI.mount()}catch(t){console.error("Userflow: Failed to mount debugger UI",t)}finally{this.debuggerMountInProgress=!1}}}unMountDebugger(){this.debuggerUI=null}remount(){this.unmountUI(),this.toggleUI()}async createUI(){try{const t=T(()=>import("./ui.js"),__vite__mapDeps([54,1,2,3,19,20,4,5,6,7,33,34]));this.bannerSession&&it(),this.resourceCenterSession&&tt();const{RealUI:s}=await t;return new s(this)}catch(t){throw this.reportCspIssue(),t}}async trackClientCondition(t){if(this.clientConditions.has(t.id))return;o("track client condition",t),this.clientConditions.set(t.id,{condition:t,isTrue:null});const{conditionTypes:s}=await T(async()=>{const{conditionTypes:r}=await import("./flow-condition-types.js").then(a=>a.f);return{conditionTypes:r}},__vite__mapDeps([10,2,11,6,12])),n=s[t.type],i=this.clientConditions.get(t.id);i&&(i.untrack=n.track({sessionData:new M([]),condition:t,callback:r=>{i.isTrue!==r&&(o("client condition truthiness changed",r,i.condition),i.isTrue=r,this.send({kind:"ToggleClientCondition",conditionId:t.id,isTrue:r},{batch:!0}))}}))}untrackClientCondition(t){const s=this.clientConditions.get(t);s&&(o("untrack client condition",s.condition),s.untrack&&s.untrack(),this.clientConditions.delete(t))}async addTracker(t){let s=this.trackers.get(t.flowId);s?s.tracker=t:this.trackers.set(t.flowId,{tracker:t,isTrue:!1});const{conditionTypes:n}=await T(async()=>{const{conditionTypes:c}=await import("./flow-condition-types.js").then(l=>l.f);return{conditionTypes:c}},__vite__mapDeps([10,2,11,6,12])),i=this.trackers.get(t.flowId);if(!i)return;const{tracker:r}=i,{condition:a}=r,u=n[a.type];i.untrack&&i.untrack(),i.untrack=u.track({sessionData:new M(r.data),condition:a,flipBackEvents:!0,callback:c=>{const l=i.isTrue;i.isTrue=c,!l&&c&&this.send({kind:"TrackTrackerEvent",token:r.token},{batch:!0})},description:`event tracker ${r.flowId}`}),this.emit("private:trackerStarted")}removeTracker(t){const s=this.trackers.get(t);s&&(s.untrack&&s.untrack(),this.trackers.delete(t),this.emit("private:trackerStopped"))}monitorTitle(){if(this.titleMonitored)return;this.titleMonitored=!0,this.fixTitle();const t=document.querySelector("title");if(t){const s=new MutationObserver(()=>{this.fixTitle()});s.observe(t,{childList:!0}),this.titleObserver=s}}fixTitle(){const t=document.title,n="[Userflow Preview] "+t.replace(/\[Userflow Preview\]\s*/g,"");t!==n&&(document.title=n)}reportCspIssue(){const t=this.getSessionStorageState();(this.testUserIdentified||t.activeApp)&&!this.cspIssueReported&&(this.cspIssueReported=!0,o("csp issue detected"),N({kind:"userflow:crxCspIssueDetected"}))}getAudio(){return this.audio||(this.audio=new Audio),this.audio}playAudio(t){if(document.hidden)return;const s=this.getAudio();t&&(s.src=t);const n=s.play();this.audioReady=!0,n&&n.catch(i=>{i.name})}pauseAudio(){const t=this.audio;t&&!t.paused&&t.pause()}async getStepSpeech(t,s){return(await this.send({kind:"GetStepSpeechV2",syntheticVoice:t,text:s})).url}featureFlagEnabled(t){return this.featureFlags?this.featureFlags.has(t):!1}showNotification(t,s,n){const r={id:++this.notificationIdCounter,label:t,message:s,type:n};this.notifications=[...this.notifications,r],this.toggleUI()}dismissNotification(t){this.notifications=this.notifications.filter(s=>s.id!==t),this.toggleUI()}warn(...t){console.warn(...t)}nextRef(){return this.refCounter++}}if(typeof window.userflow>"u"||window.userflow._stubbed){const e=Object.assign(window.userflow||{},at());window.userflow=e,window.studio1=e,ct()}function at(){const e=new ot;return{_stubbed:!1,init(t){e.init(t)},identify(t,s={},n={}){return e.identify(t,s,n)},identifyAnonymous(t={},s={}){return e.identifyAnonymous(t,s)},isIdentified(){return e.isIdentified()},updateUser(t,s={}){return e.updateUser(t,s)},group(t,s={},n={}){return e.group(t,s,n)},updateGroup(t,s={}){return e.updateGroup(t,s)},track(t,s={},n={}){return e.track(t,s,n)},start(t,{once:s}={}){return e.startFlow({flowId:t,startReason:L.USERFLOWJS,once:s})},startFlow(t){return console.warn("Userflow.js: userflow.startFlow() has been deprecated. Use userflow.start() instead."),window.userflow.start(t)},startWalk(t){return console.warn("Userflow.js: userflow.startWalk() has been deprecated. Use userflow.start() instead."),window.userflow.start(t)},endAll(){return e.endAllFlows()},endChecklist(){return e.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(){e.openResourceCenter()},closeResourceCenter(){e.closeResourceCenter()},toggleResourceCenter(){e.toggleResourceCenter()},setResourceCenterLauncherHidden(t){e.setResourceCenterLauncherHidden(t)},getResourceCenterState(){return e.getResourceCenterState()},setWalkPosition(){console.warn("Userflow.js: userflow.setWalkPosition() has been deprecated and no longer has any effect.")},reset(){e.reset()},remount(){e.remount()},on(t,s){e.on(t,s)},off(t,s){e.off(t,s)},setCustomInputSelector(t){console.warn("Userflow.js: userflow.setCustomInputSelector() has been deprecated. Use userflow.registerCustomInput() instead. See docs: https://userflow.com/docs/userflow-js"),t&&E.customInputs.push({cssSelector:t})},registerCustomInput(t,s){E.customInputs.push({cssSelector:t,getValue:s})},setCustomNavigate(t){E.customNavigate=t},setUrlFilter(t){E.urlFilter=t},setLinkUrlDecorator(t){E.linkUrlDecorator=t,e.emit("uistatechange")},setInferenceAttributeNames(t){E.inferenceAttributeNames=t},setInferenceAttributeFilter(t,s){E.inferenceAttributeFilters[t]=y(s)},setInferenceClassNameFilter(t){E.inferenceClassNameFilters=y(t)},setScrollPadding(t){E.scrollPadding=t},setCustomScrollIntoView(t){E.customScrollIntoView=t},prepareAudio(){e.playAudio(null)},setShadowDomEnabled(t){console.warn("Userflow.js: userflow.setShadowDomEnabled() has been deprecated. Please remove this call from your Userflow.js snippet. Shadow DOM is supported by default now.")},setPageTrackingDisabled(t){e.pageTrackingDisabled=t},setBaseZIndex(t){E.baseZIndex=t},setServerEndpoint(t){E.serverEndpoint=t},disableEvalJs(){E.evalJsDisabled=!0},_setTargetEnv(t){e.setTargetEnv(t)},debugger(){return e.mountDebugger()},mountSitePage(t,s){return e.mountSitePage(t,s)}}}function ct(){const e=window.userflow,t=window.USERFLOWJS_QUEUE;if(delete window.USERFLOWJS_QUEUE,!(!t||t.length===0)){o(`processing ${t.length} items in the queue`);for(const[s,n,i]of t){if(typeof e[s]!="function"){console.error(`Userflow.js: Invalid method '${s}' in queue`);continue}const r=e[s](...i);n&&r&&typeof r.then=="function"&&r.then(n.resolve,n.reject)}o("queue processed")}}var ft=window.userflow;export{Me as $,S as A,it as B,se as C,Te as D,m as E,oe as F,st as G,$e as H,d as I,De as J,E as K,Pe as L,we as M,Ue as N,me as O,Ce as P,Ae as Q,tt as R,ue as S,Le as T,h as U,pe as V,Qe as W,ye as X,L as Y,Ze as Z,T as _,U as a,te as a0,Fe as a1,He as a2,We as a3,Ve as a4,Ge as a5,xe as a6,Ne as a7,Se as a8,dt as a9,ve as aa,Ie as ab,et as ac,Z as ad,x as ae,le as af,Et as ag,P as ah,je as ai,ze as aj,Ye as ak,Xe as al,ne as am,de as b,he as c,o as d,ft as default,ie as e,ce as f,Je as g,re as h,Ee as i,M as j,Be as k,Ke as l,ae as m,G as n,X as o,w as p,ke as q,_e as r,ge as s,Oe as t,N as u,fe as v,be as w,A as x,k as y,Re as z};
17
+ If in doubt, reach out to us at support@userflow.com.`);this.pushRateLimitMinute++}handleServerMessage(t){o(`received ${t.kind} message`,t);const{serverClock:s,flowSession:n,flowSessionClock:i,checklistSession:r,checklistSessionClock:a,bannerSession:l,resourceCenterSession:u}=this;switch(t.kind){case"CheckSessionsAck":this.emit("private:checkSessionsAck");return;case"ServerDebug":return;case"AddLauncher":{const{session:c}=t,E=this.launcherSessions.findIndex(g=>g.flow.id===c.flow.id);E===-1?this.launcherSessions=[...this.launcherSessions,c]:this.launcherSessions=[...this.launcherSessions.slice(0,E),c,...this.launcherSessions.slice(E+1)],this.toggleUI();return}case"AddTracker":{this.addTracker(t.tracker);return}case"AssistantMessageEventWrapper":{this.emit("private:assistantMessageEvent",t);return}case"CancelConditionWaitTimer":window.clearTimeout(this.conditionWaitTimers.get(t.conditionId)),this.conditionWaitTimers.delete(t.conditionId);return;case"ChecklistTaskCompleted":this.unackedTasks.add(t.taskCvid);return;case"ForceGoToStep":if(i>s){o(`ignoring ${t.kind} message due to stale clock flowSessionClock=${i} > serverClock=${s}`);return}n?.id===t.sessionId&&this.emit("gotostep",{session:n,step:{id:t.stepId}});return;case"RemoveLauncher":this.removeLauncher(t.flowId)&&this.toggleUI();return;case"RemoveTracker":{this.removeTracker(t.flowId);return}case"SetBannerSession":this.setBannerSession(t.session),this.toggleUI();return;case"SetChecklistSession":a<=s||r?.id===t.session.id?(this.setChecklistSession(t.session,s),this.toggleUI()):o(`ignoring ${t.kind} message due to stale clock checklistSessionClock=${a} > serverClock=${s}`);return;case"SetFlowSession":i<=s||n?.id===t.session.id?(this.setFlowSession(t.session,s),this.emit("private:setFlowSession",t.session.version.id),this.toggleUI()):o(`ignoring ${t.kind} message due to stale clock flowSessionClock=${i} > serverClock=${s}`);return;case"SetResourceCenterSession":this.setResourceCenterSession(t.session),this.toggleUI();return;case"StartConditionWaitTimer":{if(!this.conditionWaitTimers.has(t.conditionId)){const c=window.setTimeout(()=>{this.conditionWaitTimers.delete(t.conditionId),this.send({kind:"FireConditionWaitTimer",conditionId:t.conditionId},{batch:!0})},parseFloat(t.waitTime)*1e3);this.conditionWaitTimers.set(t.conditionId,c)}return}case"TestStartConditionSuccess":this.emit("private:testStartConditionSuccess");return;case"TrackClientCondition":this.trackClientCondition(t.condition);return;case"UnsetBannerSession":l?.id===t.sessionId&&(this.setBannerSession(null),this.toggleUI());return;case"UnsetChecklistSession":if(a>s){o(`ignoring ${t.kind} message due to stale clock checklistSessionClock=${a} > serverClock=${s}`);return}r?.id===t.sessionId&&(this.setChecklistSession(null,s),this.toggleUI());return;case"UnsetFlowSession":if(i>s){o(`ignoring ${t.kind} message due to stale clock flowSessionClock=${i} > serverClock=${s}`);return}n?.id===t.sessionId&&(this.setFlowSession(null,s),this.toggleUI());return;case"UnsetResourceCenterSession":u?.id===t.sessionId&&(this.setResourceCenterSession(null),this.toggleUI());return;case"UntrackClientCondition":this.untrackClientCondition(t.conditionId);return;case"AddEmbed":{const c=this.embedSessions?.findIndex(E=>E.flow.id===t.session.flow.id);c!==void 0&&c>=0?this.embedSessions=[...this.embedSessions?.slice(0,c)||[],t.session,...this.embedSessions?.slice(c+1)||[]]:this.embedSessions=[...this.embedSessions||[],t.session],this.emit("uistatechange");break}case"RemoveEmbed":{this.embedSessions=(this.embedSessions||[]).filter(c=>c.flow.id!==t.flowId),this.emit("uistatechange");break}case"SetSiteSession":{this.siteSession=t.session,this.emit("private:siteSession",t.session);break}case"UnsetSiteSession":{this.siteSession=null,d.removeItem(w),this.emit("private:unsetSiteSession");break}case"SetWorkflowSession":{this.setWorkFlowSession(t.session),this.toggleUI();break}case"UnsetWorkflowSession":{this.setWorkFlowSession(null),this.toggleUI();break}case"WorkflowFillStepValue":{this.emit("private:workflowFillStepValue",t);break}default:console.warn("Userflow.js: Received unknown message",t);return}}async identify(t,s={},{signature:n}={}){if(o("identify",t),this.ensureInit(),this.testUserIdentified&&t!==this.externalId){o("identify() ignored since a test user has been identified");return}if(typeof t=="number")t=String(t);else if(!t||typeof t!="string")throw new h(`userflow.identify: First argument must be a non-empty string representing the user's ID in your database. Value received: ${JSON.stringify(t)}`);this.externalId&&t!==this.externalId&&(o("identify resetting due to new externalId"),this.reset()),this.externalId=t,this.signature=n||null,this.observeUserActivity(),await Promise.all([this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(s)},{batch:!0}),this.onFirstIdentify()]),this.emit("private:identified")}async identifyAnonymous(t={},s={}){if(!C.isSupported())throw new h("userflow.identifyAnonymous() is not supported when localStorage access is denied.");const n="anonymousId";let i=C.getItem(n);i||(i="anon-"+b(),C.setItem(n,i)),await this.identify(i,t,s)}getInitToken(){return this.clientToken}getIdentifiedUser(){return{externalId:this.externalId}}async updateUser(t={},s={}){o("updateUser"),this.ensureIdentified(),await this.send({kind:"UpsertUser",attributes:this.normalizeAttributes(t)},{batch:!0})}async group(t,s={},{signature:n,membership:i}={}){if(o("group",t),this.ensureIdentified(),this.testUserIdentified&&t!==this.groupId){o("group() ignored since a test user has been identified");return}if(typeof t=="number")t=String(t);else if(!t||typeof t!="string")throw new h(`userflow.group: First argument must be a non-empty string representing the group's ID in your database. Value received: ${JSON.stringify(t)}`);this.groupId=t,this.groupSignature=n||null,await this.send({kind:"UpsertGroup",groupExternalId:t,groupSignature:this.groupSignature,groupAttributes:this.normalizeAttributes(s),membershipAttributes:this.normalizeAttributes(i)},{batch:!0})}async updateGroup(t={},s={}){o("updateGroup");const n=this.ensureGroup();await this.send({kind:"UpsertGroup",groupExternalId:n,groupSignature:this.groupSignature,membershipAttributes:this.normalizeAttributes(s.membership),groupAttributes:this.normalizeAttributes(t)},{batch:!0})}normalizeAttributes(t){if(t==null)return{};if(typeof t!="object")throw new h("Userflow: 'attributes' must be an object.");const s={};for(const n in t){if(!t.hasOwnProperty(n))continue;if(n==="traits"){const r=t[n];Object.assign(s,this.extractLegacyTraits(r));continue}let i=t[n];if(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i==null||Array.isArray(i))s[n]=this.normalizeAttributeLiteralOrList(n,i);else{if(typeof i!="object"||i==null)throw new h(`Userflow: Invalid value for '${n}' attribute.`);if("set"in i)s[n]={set:this.normalizeAttributeLiteralOrList(n,i.set),dataType:this.normalizeDataType(n,i.data_type||i.dataType)};else if("set_once"in i||"setOnce"in i)s[n]={setOnce:this.normalizeAttributeLiteralOrList(n,i.set_once??i.setOnce),dataType:this.normalizeDataType(n,i.data_type||i.dataType)};else if("add"in i){const r=i.add;if(typeof r!="string"&&typeof r!="number")throw new h(`Userflow: Invalid 'add' value for '${n}' attribute. Must be a number or string.`);s[n]={add:r}}else if("subtract"in i){const r=i.subtract;if(typeof r!="string"&&typeof r!="number")throw new h(`Userflow: Invalid 'subtract' value for '${n}' attribute. Must be a number or string.`);s[n]={subtract:r}}else if("append"in i)s[n]={append:this.normalizeAttributeLiteralOrList(n,i.append)};else if("prepend"in i)s[n]={prepend:this.normalizeAttributeLiteralOrList(n,i.prepend)};else if("remove"in i)s[n]={remove:this.normalizeAttributeLiteralOrList(n,i.remove)};else throw new h(`Userflow: Invalid value for '${n}' attribute.`)}}return s}normalizeAttributeLiteralOrList(t,s){return Array.isArray(s)?s.map(n=>this.normalizeAttributeLiteral(t,n)):this.normalizeAttributeLiteral(t,s)}normalizeAttributeLiteral(t,s){if(s==null)return null;if(typeof s=="string"||typeof s=="number"||typeof s=="boolean")return s;throw new h(`Userflow: Invalid value for '${t}' attribute.`)}normalizeDataType(t,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 h(`Userflow: Invalid data_type for '${t}' attribute.`)}extractLegacyTraits(t){if(!t)return{};if(!Array.isArray(t)){const s=[];for(const n in t)t.hasOwnProperty(n)&&s.push({name:n,value:t[n]});t=s}return t.reduce((s,{name:n,value:i,dataType:r})=>{if(typeof n!="string"||n.length>100||!n.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:",n),s;if(typeof i!="string")if(typeof i=="boolean")r||(r="boolean"),i=i?"true":"false";else if(typeof i=="number")r||(r=Number.isInteger(i)?"integer":"decimal"),i=String(i);else return this.warn(`userflow.identify: The value of trait '${n}' is invalid (must be a string, a boolean or a number). The trait will be ignored. Value was:`,i),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 '${n}' is invalid (must be a 'string', 'boolean', 'integer', 'decimal' or 'datetime'). The trait will be ignored. Data type was:`,r),s}return s[n]={set:i,dataType:a},s},{})}async track(t,s={},{userOnly:n}={}){o(`track '${t}'`,s),this.ensureIdentified(),await this.send({kind:"TrackEvent",userOnly:!!n,name:t,attributes:this.normalizeEventAttributes(s)},{batch:!0})}async trackRawEvent(t){const{name:s,attributes:n}=t;o(`track raw event '${s}'`,n),this.ensureIdentified(),await this.send({kind:"TrackRawEvent",name:s,attributes:this.normalizeEventAttributes(n)})}normalizeEventAttributes(t){const s=this.normalizeAttributes(t);for(const n in s){if(!s.hasOwnProperty(n))continue;const i=s[n];if(!(i==null||typeof i=="string"||typeof i=="boolean"||typeof i=="number"||Array.isArray(i)||"set"in i))throw new h(`Userflow: Invalid value for '${n}' 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(t){this.isIdentified()?t():this.firstIdentifyCallback=t}checkUrlForStartFlow(){const t=new URL(m()),s=t.searchParams.get("userflow")||t.searchParams.get("studio1_flow")||t.searchParams.get("studio1_walkthrough");s&&(o(`url contained flow ${s}`),this.startFlow({flowId:s,startReason:p.LINK,batch:!0}),t.searchParams.delete("userflow"),t.searchParams.delete("studio1_flow"),t.searchParams.delete("studio1_walkthrough"),window.history.replaceState({},"",t.toString()),this.clientContext=this.buildClientContext(),this.pushUpdateClientContext())}flushUrlChange(){const t=this.buildClientContext();(!this.clientContext||t.pageUrl!==this.clientContext.pageUrl)&&(this.clientContext=t,this.pushUpdateClientContext(),this.trackPageViewed(),this.checkUrlForStartFlow())}async trackPageViewed(){this.featureFlags&&this.featureFlagEnabled("cff_disable_page_views")===!0||(this.pageTrackingDisabled||this.track("page_viewed",{}),this.trackRawPageViewed())}async trackRawPageViewed(){this.featureFlags&&(this.featureFlagEnabled("cff_implicit_events")===!1||this.featureFlagEnabled("cff_disable_page_views")===!0)||this.trackRawEvent({name:"page_viewed",attributes:{id:b(),page_title:document.title,...this.buildClientContext()}})}buildClientContext(){let t=null;const s=d.getItem(w);if(s){const i=new URL(m()).pathname.match(/^\/([^/]+)\/?(?:\/([^/]+)\/?)?$/);i&&(t=i[1])}return{pageUrl:tt(),viewportWidth:window.innerWidth,viewportHeight:window.innerHeight,...s&&{siteId:s},...t&&{localeCode:t}}}pushUpdateClientContext(){this.send({kind:"UpdateClientContext",clientContext:this.clientContext},{batch:!0})}ackCompletedTask(t){this.unackedTasks.delete(t)}taskIsUnacked(t){return this.unackedTasks.has(t)}isIdentified(){return this.externalId!=null}on(t,s){let n=this.listeners.get(t);n||(n=new Set,this.listeners.set(t,n)),n.add(s)}off(t,s){const n=this.listeners.get(t);n&&n.delete(s)}emit(t,...s){const n=this.listeners.get(t);n&&Array.from(n).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.resourceCenterLauncherHidden=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((t,s)=>{this.untrackClientCondition(s)}),this.firstIdentifyCallback=null,this.testUserIdentified=!1,C.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:t,stepCvid:s,startReason:n,once:i,batch:r,replaceCurrent:a}){if(this.ensureIdentified(),a&&this.flowSession&&this.endFlow(this.flowSession,{endReason:U.REPLACED,batch:!0}),o(`startFlow ${t}`,{startReason:n}),this.checklistSession?.flow.id===t){o("startFlow matches current checklist, so showing it instead"),this.showChecklist();return}const l={kind:"StartFlow",flowId:t,stepCvid:s,startReason:n,once:!!i};await this.send(l,{batch:r})}async trackButtonEvent(t,s,n,i){const r={kind:"TrackButtonEvent",eventName:t,stepCvid:n,sessionId:i,token:s};await this.send(r,{batch:!0})}async startFlowWithToken(t){this.ensureIdentified(),o("startFlowWithToken",{token:t}),await this.send({kind:"StartFlowWithToken",token:t},{batch:!0})}optimisticClockUIUpdate(t){this.clientClock++,t(),this.toggleUI()}async showChecklist(){if(this.resourceCenterEmbedsChecklist()&&!this.embedChecklistSessions()){this.openResourceCenter();return}this.embedChecklistSessions()||(this.unmarkExpandPending(),!(!this.checklistSession||this.checklistExpanded)&&(this.ensureIdentified(),this.checklistExpanded=!0,this.toggleUI(),d.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(),d.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"),d.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"),d.removeItem(`resourceCenterOpen:${this.resourceCenterSession.id}`),await this.send({kind:"CloseResourceCenter",sessionId:this.resourceCenterSession.id},{batch:!0}))}toggleResourceCenter(){this.resourceCenterOpen?this.closeResourceCenter():this.openResourceCenter()}setResourceCenterLauncherHidden(t){this.resourceCenterLauncherHidden=t,this.toggleUI()}getResourceCenterState(){if(!this.resourceCenterSession)return null;const t=this.resourceCenterEmbedsChecklist(),{checklistSession:s}=this,n=this.resourceCenterSession.version.resourceCenter?.blocks.find(i=>i.type===R.ANNOUNCEMENTS);return{isOpen:this.resourceCenterOpen,hasChecklist:t,uncompletedChecklistTaskCount:t&&s?it(s):0,unreadAnnouncementCount:n?.unreadAnnouncementCount||0}}resourceCenterEmbedsChecklist(){const t=this.resourceCenterSession;return!!t&&!!t.version.resourceCenter?.blocks.some(s=>s.type===R.CHECKLIST)}embedChecklistSessions(){return this.embedSessions.some(t=>!!t.version.embed?.blocks?.some(s=>s.type===K.CHECKLIST))}async endFlow(t,{endReason:s,batch:n}){this.ensureIdentified(),this.optimisticClockUIUpdate(()=>{const{clientClock:l}=this;this.flowSession?.id===t.id&&this.setFlowSession(null,l),this.checklistSession?.id===t.id&&this.setChecklistSession(null,l),this.bannerSession?.id===t.id&&this.setBannerSession(null),this.resourceCenterSession?.id===t.id&&this.setResourceCenterSession(null),this.workflowSession?.id===t.id&&this.setWorkFlowSession(null)});const{flow:i}=t,r={id:i.id,type:i.type.toLowerCase()};i.type===L.CHECKLIST?this.emit("checklistEnded",{checklist:r,endReason:s}):i.type===L.FLOW&&this.emit("flowEnded",{flow:r,endReason:s});const a={kind:"EndFlow",sessionId:t.id,endReason:s};await this.send(a,{batch:n})}async goToStep(t,s){o("goToStep",t.id,s.name||s.id),this.ensureIdentified();const n=this.send({kind:"GoToStep",sessionId:t.id,stepId:s.id});t.currentStep=s,this.emit("gotostep",{session:t,step:s}),await n}async endAllFlows(){o("endAllFlows"),this.optimisticClockUIUpdate(()=>{const{clientClock:t}=this;this.setFlowSession(null,t),this.setChecklistSession(null,t)}),await this.send({kind:"EndAllFlows"})}async endChecklist(){o("endChecklist");const t=this.checklistSession||this.flowSession;t?.flow.type===L.CHECKLIST&&this.endFlow(t,{endReason:U.USERFLOWJS})}setFlowSession(t,s=this.clientClock){const n=this.flowSession;this.flowSession=t,this.flowSessionClock=s,t&&!n&&(this.hideChecklist(),this.closeResourceCenter()),t==null&&this.originalActiveElement&&(typeof this.originalActiveElement.focus=="function"&&this.originalActiveElement.focus(),this.originalActiveElement=void 0)}setWorkFlowSession(t){this.workflowSession=t}setChecklistSession(t,s=this.clientClock){const n=this.checklistSession;this.checklistSession=t,this.checklistSessionClock=s,t===null&&(this.checklistExpanded=!1,this.checklistExpandPending=!1),t&&t.id!==n?.id&&(this.checklistExpanded=!!d.getItem(`checklistExpanded:${t.id}`),t.expandPending&&(this.checklistExpandPending=!0)),this.emit("checklistChanged"),this.emit("resourceCenterChanged")}setBannerSession(t){this.bannerSession=t}setResourceCenterSession(t){const s=this.resourceCenterSession;t=typeof t=="function"?t(this.resourceCenterSession):t,this.resourceCenterSession=t,t===null&&(this.resourceCenterOpen=!1),s&&s.id!==t?.id&&d.removeItem(`resourceCenterOpen:${s.id}`),t&&t.id!==s?.id&&(this.resourceCenterOpen=!!d.getItem(`resourceCenterOpen:${t.id}`)),this.emit("resourceCenterChanged")}launcherSeen(t){this.send({kind:"StartFlow",flowId:t,startReason:p.LAUNCHER_SEEN,once:!1})}activateLauncher(t){const s=this.activeLauncherFlowId&&this.launcherSessions.find(n=>n.flow.id===this.activeLauncherFlowId);s&&this.deactivateLauncher(s),this.activeLauncherFlowId=t.flow.id,this.toggleUI(),this.send({kind:"ActivateLauncher",flowId:t.flow.id})}deactivateLauncher(t){const{launcher:s}=t.version;t.flow.id===this.activeLauncherFlowId&&(s?.dismissOn===V.DEACTIVATE?this.dismissLauncher(t,{endReason:U.LAUNCHER_DEACTIVATED}):(this.activeLauncherFlowId=null,this.toggleUI()))}dismissLauncher(t,{endReason:s}){const n=t.flow.id;this.removeLauncher(n),this.toggleUI(),this.send({kind:"DismissLauncher",flowId:n,endReason:s})}removeLauncher(t){const s=this.launcherSessions.findIndex(n=>n.flow.id===t);return s===-1?!1:(this.launcherSessions=[...this.launcherSessions.slice(0,s),...this.launcherSessions.slice(s+1)],t===this.activeLauncherFlowId&&(this.activeLauncherFlowId=null),!0)}async toggleUI(){const t=this.getSessionStorageState();!this.flowSession&&!this.workflowSession&&(this.checklistExpandPending||this.checklistSession?.version.checklist?.tasks.some(s=>this.taskIsUnacked(s.cvid)))&&this.showChecklist(),t.isTargetTab&&this.monitorTitle(),this.emit("uistatechange"),this.shouldBeMounted()?await this.mountUI():this.unmountUI()}shouldBeMounted(){return this.uiDisabled||this.siteSession?.id||d.getItem(w)?!1:!!this.getSessionStorageState().activeApp||!!this.flowSession||!!this.workflowSession||!!this.checklistSession&&(this.checklistExpanded||!!this.checklistSession?.version.checklist?.launcherEnabled)||!!this.bannerSession||!!this.resourceCenterSession||this.launcherSessions.length>0||this.notifications.length>0}async mountUI(){if(!this.ui){const t=await this.createUI();this.shouldBeMounted()&&!this.ui&&(o("mount UI"),this.ui=t,this.ui.mount())}}unmountUI(){this.ui&&(o("unmount UI"),this.ui.unmount(),this.ui=null)}checkDebuggerSession(){if(this.debuggerUI)return;const t=this.sessionStorageState?.debuggerApp;t&&t?.x&&t?.y&&this.mountDebugger()}async mountDebugger(){if(!this.debuggerMountInProgress){if(this.debuggerUI){this.debuggerUI.unmount();return}this.debuggerMountInProgress=!0;try{const{DebuggerUI:t}=await I(async()=>{const{DebuggerUI:s}=await import("./DebuggerUI.js");return{DebuggerUI:s}},__vite__mapDeps([49,1,2,18,19,3,4,5,6,17,12,13,14,9,10,11,20,22,15,47,46,45,28,32,33]));this.debuggerUI=new t(this,N),this.debuggerUI.mount()}catch(t){console.error("Userflow: Failed to mount debugger UI",t)}finally{this.debuggerMountInProgress=!1}}}unMountDebugger(){this.debuggerUI=null}remount(){this.unmountUI(),this.toggleUI()}async createUI(){try{const t=I(()=>import("./ui.js"),__vite__mapDeps([50,1,2,18,19,3,4,5,6,32,33]));this.bannerSession&&nt(),this.resourceCenterSession&&st();const{RealUI:s}=await t;return new s(this)}catch(t){throw this.reportCspIssue(),t}}async trackClientCondition(t){if(this.clientConditions.has(t.id))return;o("track client condition",t),this.clientConditions.set(t.id,{condition:t,isTrue:null});const{conditionTypes:s}=await I(async()=>{const{conditionTypes:r}=await import("./flow-condition-types.js").then(a=>a.f);return{conditionTypes:r}},__vite__mapDeps([9,2,10,5,11])),n=s[t.type],i=this.clientConditions.get(t.id);i&&(i.untrack=n.track({sessionData:new P([]),condition:t,callback:r=>{i.isTrue!==r&&(o("client condition truthiness changed",r,i.condition),i.isTrue=r,this.send({kind:"ToggleClientCondition",conditionId:t.id,isTrue:r},{batch:!0}))}}))}untrackClientCondition(t){const s=this.clientConditions.get(t);s&&(o("untrack client condition",s.condition),s.untrack&&s.untrack(),this.clientConditions.delete(t))}async addTracker(t){let s=this.trackers.get(t.flowId);s?s.tracker=t:this.trackers.set(t.flowId,{tracker:t,isTrue:!1});const{conditionTypes:n}=await I(async()=>{const{conditionTypes:u}=await import("./flow-condition-types.js").then(c=>c.f);return{conditionTypes:u}},__vite__mapDeps([9,2,10,5,11])),i=this.trackers.get(t.flowId);if(!i)return;const{tracker:r}=i,{condition:a}=r,l=n[a.type];i.untrack&&i.untrack(),i.untrack=l.track({sessionData:new P(r.data),condition:a,flipBackEvents:!0,callback:u=>{const c=i.isTrue;i.isTrue=u,!c&&u&&this.send({kind:"TrackTrackerEvent",token:r.token},{batch:!0})},description:`event tracker ${r.flowId}`}),this.emit("private:trackerStarted")}removeTracker(t){const s=this.trackers.get(t);s&&(s.untrack&&s.untrack(),this.trackers.delete(t),this.emit("private:trackerStopped"))}monitorTitle(){if(this.titleMonitored)return;this.titleMonitored=!0,this.fixTitle();const t=document.querySelector("title");if(t){const s=new MutationObserver(()=>{this.fixTitle()});s.observe(t,{childList:!0}),this.titleObserver=s}}fixTitle(){const t=document.title,n="[Userflow Preview] "+t.replace(/\[Userflow Preview\]\s*/g,"");t!==n&&(document.title=n)}reportCspIssue(){const t=this.getSessionStorageState();(this.testUserIdentified||t.activeApp)&&!this.cspIssueReported&&(this.cspIssueReported=!0,o("csp issue detected"),A({kind:"userflow:crxCspIssueDetected"}))}getAudio(){return this.audio||(this.audio=new Audio),this.audio}playAudio(t){if(document.hidden)return;const s=this.getAudio();t&&(s.src=t);const n=s.play();this.audioReady=!0,n&&n.catch(i=>{i.name})}pauseAudio(){const t=this.audio;t&&!t.paused&&t.pause()}async getStepSpeech(t,s){return(await this.send({kind:"GetStepSpeechV2",syntheticVoice:t,text:s})).url}featureFlagEnabled(t){return this.featureFlags?this.featureFlags.has(t):!1}showNotification(t,s,n){const r={id:++this.notificationIdCounter,label:t,message:s,type:n};this.notifications=[...this.notifications,r],this.toggleUI()}dismissNotification(t){this.notifications=this.notifications.filter(s=>s.id!==t),this.toggleUI()}warn(...t){console.warn(...t)}nextRef(){return this.refCounter++}}if(typeof window.userflow>"u"||window.userflow._stubbed){const e=Object.assign(window.userflow||{},ct());window.userflow=e,window.studio1=e,lt()}function ct(){const e=new at;return{_stubbed:!1,init(t){e.init(t)},identify(t,s={},n={}){return e.identify(t,s,n)},identifyAnonymous(t={},s={}){return e.identifyAnonymous(t,s)},isIdentified(){return e.isIdentified()},updateUser(t,s={}){return e.updateUser(t,s)},group(t,s={},n={}){return e.group(t,s,n)},updateGroup(t,s={}){return e.updateGroup(t,s)},track(t,s={},n={}){return e.track(t,s,n)},start(t,{once:s}={}){return e.startFlow({flowId:t,startReason:p.USERFLOWJS,once:s})},startFlow(t){return console.warn("Userflow.js: userflow.startFlow() has been deprecated. Use userflow.start() instead."),window.userflow.start(t)},startWalk(t){return console.warn("Userflow.js: userflow.startWalk() has been deprecated. Use userflow.start() instead."),window.userflow.start(t)},endAll(){return e.endAllFlows()},endChecklist(){return e.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(){e.openResourceCenter()},closeResourceCenter(){e.closeResourceCenter()},toggleResourceCenter(){e.toggleResourceCenter()},setResourceCenterLauncherHidden(t){e.setResourceCenterLauncherHidden(t)},getResourceCenterState(){return e.getResourceCenterState()},setWalkPosition(){console.warn("Userflow.js: userflow.setWalkPosition() has been deprecated and no longer has any effect.")},reset(){e.reset()},remount(){e.remount()},on(t,s){e.on(t,s)},off(t,s){e.off(t,s)},setCustomInputSelector(t){console.warn("Userflow.js: userflow.setCustomInputSelector() has been deprecated. Use userflow.registerCustomInput() instead. See docs: https://userflow.com/docs/userflow-js"),t&&f.customInputs.push({cssSelector:t})},registerCustomInput(t,s){f.customInputs.push({cssSelector:t,getValue:s})},setCustomNavigate(t){f.customNavigate=t},setUrlFilter(t){f.urlFilter=t},setLinkUrlDecorator(t){f.linkUrlDecorator=t,e.emit("uistatechange")},setInferenceAttributeNames(t){f.inferenceAttributeNames=t},setInferenceAttributeFilter(t,s){f.inferenceAttributeFilters[t]=M(s)},setInferenceClassNameFilter(t){f.inferenceClassNameFilters=M(t)},setScrollPadding(t){f.scrollPadding=t},setCustomScrollIntoView(t){f.customScrollIntoView=t},prepareAudio(){e.playAudio(null)},setShadowDomEnabled(t){console.warn("Userflow.js: userflow.setShadowDomEnabled() has been deprecated. Please remove this call from your Userflow.js snippet. Shadow DOM is supported by default now.")},setPageTrackingDisabled(t){e.pageTrackingDisabled=t},setBaseZIndex(t){f.baseZIndex=t},setServerEndpoint(t){f.serverEndpoint=t},disableEvalJs(){f.evalJsDisabled=!0},_setTargetEnv(t){e.setTargetEnv(t)},debugger(){return e.mountDebugger()},mountSitePage(t,s){return e.mountSitePage(t,s)}}}function lt(){const e=window.userflow,t=window.USERFLOWJS_QUEUE;if(delete window.USERFLOWJS_QUEUE,!(!t||t.length===0)){o(`processing ${t.length} items in the queue`);for(const[s,n,i]of t){if(typeof e[s]!="function"){console.error(`Userflow.js: Invalid method '${s}' in queue`);continue}const r=e[s](...i);n&&r&&typeof r.then=="function"&&r.then(n.resolve,n.reject)}o("queue processed")}}var St=window.userflow;export{$e as $,Be as A,Te as B,S as C,Qe as D,U as E,ge as F,Ee as G,he as H,nt as I,st as J,R as K,ye as L,d as M,it as N,Le as O,Ue as P,Me as Q,He as R,P as S,Pe as T,h as U,qe as V,Xe as W,C as X,Ie as Y,Ae as Z,I as _,se as a,A as a0,x as a1,Z as a2,me as a3,ke as a4,we as a5,_e as a6,pe as a7,Ce as a8,ie as a9,De as aa,je as ab,Ve as ac,We as ad,Ge as ae,Ke as af,xe as ag,Fe as ah,Ye as ai,Ze as aj,Je as ak,ze as al,re as am,Se as b,f as c,o as d,St as default,Re as e,ve as f,m as g,p as h,Oe as i,be as j,le as k,oe as l,tt as m,ue as n,q as o,Ne as p,ce as q,ae as r,ft as s,Et as t,F as u,B as v,ne as w,de as x,fe as y,L as z};
18
18
  //# sourceMappingURL=userflow.js.map
@@ -1,4 +1,4 @@
1
- (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]="644a364a-362f-41f6-9469-df603c5438fe",t._sentryDebugIdIdentifier="sentry-dbid-644a364a-362f-41f6-9469-df603c5438fe")}catch{}})();function c(t){"@babel/helpers - typeof";return c=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c(t)}function _(t,e){if(c(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(c(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function m(t){var e=_(t,"string");return c(e)=="symbol"?e:e+""}function O(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function A(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),n.forEach(function(o){O(t,o,r[o])})}return t}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function p(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m(n.key),n)}}function E(t,e,r){return e&&p(t.prototype,e),r&&p(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function w(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t,e){if(e&&(c(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(t)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},y(t,e)}function C(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function R(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function P(t){if(Array.isArray(t))return t}function S(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,o,l,u,f=[],i=!0,a=!1;try{if(l=(r=r.call(t)).next,e!==0)for(;!(i=(n=l.call(r)).done)&&(f.push(n.value),f.length!==e);i=!0);}catch(g){a=!0,o=g}finally{try{if(!i&&r.return!=null&&(u=r.return(),Object(u)!==u))return}finally{if(a)throw o}}return f}}function b(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function v(t,e){if(t){if(typeof t=="string")return b(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?b(t,e):void 0}}function I(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k(t,e){return P(t)||S(t,e)||v(t,e)||I()}function x(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=v(t))||e){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(a){throw a},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,u=!0,f=!1;return{s:function(){r=r.call(t)},n:function(){var a=r.next();return u=a.done,a},e:function(a){f=!0,l=a},f:function(){try{u||r.return==null||r.return()}finally{if(f)throw l}}}}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h=function(){return!!t})()}function D(t){var e=h();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return j(this,r)}}function L(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,y(t,e)}function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},d.apply(null,arguments)}export{c as _,C as a,D as b,T as c,O as d,w as e,E as f,x as g,d as h,A as i,j,s as k,L as l,k as m,R as n};
1
+ (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]="855badc1-29b7-4829-928b-bb108c3d88bb",t._sentryDebugIdIdentifier="sentry-dbid-855badc1-29b7-4829-928b-bb108c3d88bb")}catch{}})();function f(t){"@babel/helpers - typeof";return f=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},f(t)}function _(t,e){if(f(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(f(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function m(t){var e=_(t,"string");return f(e)=="symbol"?e:e+""}function O(t,e,r){return(e=m(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function A(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?Object(arguments[e]):{},n=Object.keys(r);typeof Object.getOwnPropertySymbols=="function"&&n.push.apply(n,Object.getOwnPropertySymbols(r).filter(function(o){return Object.getOwnPropertyDescriptor(r,o).enumerable})),n.forEach(function(o){O(t,o,r[o])})}return t}function T(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function b(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,m(n.key),n)}}function E(t,e,r){return e&&b(t.prototype,e),r&&b(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function w(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function j(t,e){if(e&&(f(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return w(t)}function s(t){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(t)}function y(t,e){return y=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},y(t,e)}function C(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y(t,e)}function R(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function P(t){if(Array.isArray(t))return t}function S(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,o,l,a,c=[],i=!0,u=!1;try{if(l=(r=r.call(t)).next,e!==0)for(;!(i=(n=l.call(r)).done)&&(c.push(n.value),c.length!==e);i=!0);}catch(g){u=!0,o=g}finally{try{if(!i&&r.return!=null&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}function p(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function v(t,e){if(t){if(typeof t=="string")return p(t,e);var r={}.toString.call(t).slice(8,-1);return r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set"?Array.from(t):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?p(t,e):void 0}}function I(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
2
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k(t,e){return P(t)||S(t,e)||v(t,e)||I()}function x(t,e){var r=typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(!r){if(Array.isArray(t)||(r=v(t))||e){r&&(t=r);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(u){throw u},f:o}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
3
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var l,a=!0,c=!1;return{s:function(){r=r.call(t)},n:function(){var u=r.next();return a=u.done,u},e:function(u){c=!0,l=u},f:function(){try{a||r.return==null||r.return()}finally{if(c)throw l}}}}function h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(h=function(){return!!t})()}function D(t){var e=h();return function(){var r,n=s(t);if(e){var o=s(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return j(this,r)}}function L(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,y(t,e)}function d(){return d=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},d.apply(null,arguments)}export{C as _,E as a,T as b,j as c,s as d,w as e,A as f,f as g,O as h,k as i,D as j,x as k,d as l,L as m,R as n};
4
4
  //# sourceMappingURL=vendor.babel.runtime.js.map
@@ -1,2 +1,2 @@
1
- (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]="047ce69f-d720-429b-9705-458692338a9e",E._sentryDebugIdIdentifier="sentry-dbid-047ce69f-d720-429b-9705-458692338a9e")}catch{}})();var we=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ue=Math.ceil,H=Math.floor,U="[BigNumber Error] ",ge=U+"Number primitive has more than 15 significant digits: ",z=1e14,d=14,ce=9007199254740991,ae=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],J=1e7,M=1e9;function pe(E){var N,_,D,g=h.prototype={constructor:h,toString:null,valueOf:null},R=new h(1),x=20,S=4,C=-7,k=21,Q=-1e7,$=1e7,Z=!1,b=1,Y=0,te={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},K="0123456789abcdefghijklmnopqrstuvwxyz";function h(e,r){var i,s,t,l,c,n,f,u,o=this;if(!(o instanceof h))return new h(e,r);if(r==null){if(e&&e._isBigNumber===!0){o.s=e.s,!e.c||e.e>$?o.c=o.e=null:e.e<Q?o.c=[o.e=0]:(o.e=e.e,o.c=e.c.slice());return}if((n=typeof e=="number")&&e*0==0){if(o.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,c=e;c>=10;c/=10,l++);l>$?o.c=o.e=null:(o.e=l,o.c=[e]);return}u=String(e)}else{if(!we.test(u=String(e)))return D(o,u,n);o.s=u.charCodeAt(0)==45?(u=u.slice(1),-1):1}(l=u.indexOf("."))>-1&&(u=u.replace(".","")),(c=u.search(/e/i))>0?(l<0&&(l=c),l+=+u.slice(c+1),u=u.substring(0,c)):l<0&&(l=u.length)}else{if(v(r,2,K.length,"Base"),r==10)return o=new h(e),y(o,x+o.e+1,S);if(u=String(e),n=typeof e=="number"){if(e*0!=0)return D(o,u,n,r);if(o.s=1/e<0?(u=u.slice(1),-1):1,h.DEBUG&&u.replace(/^0\.0*|\./,"").length>15)throw Error(ge+e)}else o.s=u.charCodeAt(0)===45?(u=u.slice(1),-1):1;for(i=K.slice(0,r),l=c=0,f=u.length;c<f;c++)if(i.indexOf(s=u.charAt(c))<0){if(s=="."){if(c>l){l=f;continue}}else if(!t&&(u==u.toUpperCase()&&(u=u.toLowerCase())||u==u.toLowerCase()&&(u=u.toUpperCase()))){t=!0,c=-1,l=0;continue}return D(o,String(e),n,r)}n=!1,u=_(u,r,10,o.s),(l=u.indexOf("."))>-1?u=u.replace(".",""):l=u.length}for(c=0;u.charCodeAt(c)===48;c++);for(f=u.length;u.charCodeAt(--f)===48;);if(u=u.slice(c,++f)){if(f-=c,n&&h.DEBUG&&f>15&&(e>ce||e!==H(e)))throw Error(ge+o.s*e);if((l=l-c-1)>$)o.c=o.e=null;else if(l<Q)o.c=[o.e=0];else{if(o.e=l,o.c=[],c=(l+1)%d,l<0&&(c+=d),c<f){for(c&&o.c.push(+u.slice(0,c)),f-=d;c<f;)o.c.push(+u.slice(c,c+=d));c=d-(u=u.slice(c)).length}else c-=f;for(;c--;u+="0");o.c.push(+u)}}else o.c=[o.e=0]}h.clone=pe,h.ROUND_UP=0,h.ROUND_DOWN=1,h.ROUND_CEIL=2,h.ROUND_FLOOR=3,h.ROUND_HALF_UP=4,h.ROUND_HALF_DOWN=5,h.ROUND_HALF_EVEN=6,h.ROUND_HALF_CEIL=7,h.ROUND_HALF_FLOOR=8,h.EUCLID=9,h.config=h.set=function(e){var r,i;if(e!=null)if(typeof e=="object"){if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(i=e[r],v(i,0,M,r),x=i),e.hasOwnProperty(r="ROUNDING_MODE")&&(i=e[r],v(i,0,8,r),S=i),e.hasOwnProperty(r="EXPONENTIAL_AT")&&(i=e[r],i&&i.pop?(v(i[0],-M,0,r),v(i[1],0,M,r),C=i[0],k=i[1]):(v(i,-M,M,r),C=-(k=i<0?-i:i))),e.hasOwnProperty(r="RANGE"))if(i=e[r],i&&i.pop)v(i[0],-M,-1,r),v(i[1],1,M,r),Q=i[0],$=i[1];else if(v(i,-M,M,r),i)Q=-($=i<0?-i:i);else throw Error(U+r+" cannot be zero: "+i);if(e.hasOwnProperty(r="CRYPTO"))if(i=e[r],i===!!i)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Z=i;else throw Z=!i,Error(U+"crypto unavailable");else Z=i;else throw Error(U+r+" not true or false: "+i);if(e.hasOwnProperty(r="MODULO_MODE")&&(i=e[r],v(i,0,9,r),b=i),e.hasOwnProperty(r="POW_PRECISION")&&(i=e[r],v(i,0,M,r),Y=i),e.hasOwnProperty(r="FORMAT"))if(i=e[r],typeof i=="object")te=i;else throw Error(U+r+" not an object: "+i);if(e.hasOwnProperty(r="ALPHABET"))if(i=e[r],typeof i=="string"&&!/^.$|[+-.\s]|(.).*\1/.test(i))K=i;else throw Error(U+r+" invalid: "+i)}else throw Error(U+"Object expected: "+e);return{DECIMAL_PLACES:x,ROUNDING_MODE:S,EXPONENTIAL_AT:[C,k],RANGE:[Q,$],CRYPTO:Z,MODULO_MODE:b,POW_PRECISION:Y,FORMAT:te,ALPHABET:K}},h.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!h.DEBUG)return!0;var r,i,s=e.c,t=e.e,l=e.s;e:if({}.toString.call(s)=="[object Array]"){if((l===1||l===-1)&&t>=-M&&t<=M&&t===H(t)){if(s[0]===0){if(t===0&&s.length===1)return!0;break e}if(r=(t+1)%d,r<1&&(r+=d),String(s[0]).length==r){for(r=0;r<s.length;r++)if(i=s[r],i<0||i>=z||i!==H(i))break e;if(i!==0)return!0}}}else if(s===null&&t===null&&(l===null||l===1||l===-1))return!0;throw Error(U+"Invalid BigNumber: "+e)},h.maximum=h.max=function(){return he(arguments,g.lt)},h.minimum=h.min=function(){return he(arguments,g.gt)},h.random=function(){var e=9007199254740992,r=Math.random()*e&2097151?function(){return H(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(i){var s,t,l,c,n,f=0,u=[],o=new h(R);if(i==null?i=x:v(i,0,M),c=ue(i/d),Z)if(crypto.getRandomValues){for(s=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)n=s[f]*131072+(s[f+1]>>>11),n>=9e15?(t=crypto.getRandomValues(new Uint32Array(2)),s[f]=t[0],s[f+1]=t[1]):(u.push(n%1e14),f+=2);f=c/2}else if(crypto.randomBytes){for(s=crypto.randomBytes(c*=7);f<c;)n=(s[f]&31)*281474976710656+s[f+1]*1099511627776+s[f+2]*4294967296+s[f+3]*16777216+(s[f+4]<<16)+(s[f+5]<<8)+s[f+6],n>=9e15?crypto.randomBytes(7).copy(s,f):(u.push(n%1e14),f+=7);f=c/7}else throw Z=!1,Error(U+"crypto unavailable");if(!Z)for(;f<c;)n=r(),n<9e15&&(u[f++]=n%1e14);for(c=u[--f],i%=d,c&&i&&(n=ae[d-i],u[f]=H(c/n)*n);u[f]===0;u.pop(),f--);if(f<0)u=[l=0];else{for(l=-1;u[0]===0;u.splice(0,1),l-=d);for(f=1,n=u[0];n>=10;n/=10,f++);f<d&&(l-=d-f)}return o.e=l,o.c=u,o}}(),h.sum=function(){for(var e=1,r=arguments,i=new h(r[0]);e<r.length;)i=i.plus(r[e++]);return i},_=function(){var e="0123456789";function r(i,s,t,l){for(var c,n=[0],f,u=0,o=i.length;u<o;){for(f=n.length;f--;n[f]*=s);for(n[0]+=l.indexOf(i.charAt(u++)),c=0;c<n.length;c++)n[c]>t-1&&(n[c+1]==null&&(n[c+1]=0),n[c+1]+=n[c]/t|0,n[c]%=t)}return n.reverse()}return function(i,s,t,l,c){var n,f,u,o,a,p,w,m,I=i.indexOf("."),T=x,O=S;for(I>=0&&(o=Y,Y=0,i=i.replace(".",""),m=new h(s),p=m.pow(i.length-I),Y=o,m.c=r(W(F(p.c),p.e,"0"),10,t,e),m.e=m.c.length),w=r(i,s,t,c?(n=K,e):(n=e,K)),u=o=w.length;w[--o]==0;w.pop());if(!w[0])return n.charAt(0);if(I<0?--u:(p.c=w,p.e=u,p.s=l,p=N(p,m,T,O,t),w=p.c,a=p.r,u=p.e),f=u+T+1,I=w[f],o=t/2,a=a||f<0||w[f+1]!=null,a=O<4?(I!=null||a)&&(O==0||O==(p.s<0?3:2)):I>o||I==o&&(O==4||a||O==6&&w[f-1]&1||O==(p.s<0?8:7)),f<1||!w[0])i=a?W(n.charAt(1),-T,n.charAt(0)):n.charAt(0);else{if(w.length=f,a)for(--t;++w[--f]>t;)w[f]=0,f||(++u,w=[1].concat(w));for(o=w.length;!w[--o];);for(I=0,i="";I<=o;i+=n.charAt(w[I++]));i=W(i,u,n.charAt(0))}return i}}(),N=function(){function e(s,t,l){var c,n,f,u,o=0,a=s.length,p=t%J,w=t/J|0;for(s=s.slice();a--;)f=s[a]%J,u=s[a]/J|0,c=w*f+u*p,n=p*f+c%J*J+o,o=(n/l|0)+(c/J|0)+w*u,s[a]=n%l;return o&&(s=[o].concat(s)),s}function r(s,t,l,c){var n,f;if(l!=c)f=l>c?1:-1;else for(n=f=0;n<l;n++)if(s[n]!=t[n]){f=s[n]>t[n]?1:-1;break}return f}function i(s,t,l,c){for(var n=0;l--;)s[l]-=n,n=s[l]<t[l]?1:0,s[l]=n*c+s[l]-t[l];for(;!s[0]&&s.length>1;s.splice(0,1));}return function(s,t,l,c,n){var f,u,o,a,p,w,m,I,T,O,A,P,re,oe,se,X,ee,G=s.s==t.s?1:-1,L=s.c,B=t.c;if(!L||!L[0]||!B||!B[0])return new h(!s.s||!t.s||(L?B&&L[0]==B[0]:!B)?NaN:L&&L[0]==0||!B?G*0:G/0);for(I=new h(G),T=I.c=[],u=s.e-t.e,G=l+u+1,n||(n=z,u=q(s.e/d)-q(t.e/d),G=G/d|0),o=0;B[o]==(L[o]||0);o++);if(B[o]>(L[o]||0)&&u--,G<0)T.push(1),a=!0;else{for(oe=L.length,X=B.length,o=0,G+=2,p=H(n/(B[0]+1)),p>1&&(B=e(B,p,n),L=e(L,p,n),X=B.length,oe=L.length),re=X,O=L.slice(0,X),A=O.length;A<X;O[A++]=0);ee=B.slice(),ee=[0].concat(ee),se=B[0],B[1]>=n/2&&se++;do{if(p=0,f=r(B,O,X,A),f<0){if(P=O[0],X!=A&&(P=P*n+(O[1]||0)),p=H(P/se),p>1)for(p>=n&&(p=n-1),w=e(B,p,n),m=w.length,A=O.length;r(w,O,m,A)==1;)p--,i(w,X<m?ee:B,m,n),m=w.length,f=1;else p==0&&(f=p=1),w=B.slice(),m=w.length;if(m<A&&(w=[0].concat(w)),i(O,w,A,n),A=O.length,f==-1)for(;r(B,O,X,A)<1;)p++,i(O,X<A?ee:B,A,n),A=O.length}else f===0&&(p++,O=[0]);T[o++]=p,O[0]?O[A++]=L[re]||0:(O=[L[re]],A=1)}while((re++<oe||O[0]!=null)&&G--);a=O[0]!=null,T[0]||T.splice(0,1)}if(n==z){for(o=1,G=T[0];G>=10;G/=10,o++);y(I,l+(I.e=o+u*d-1)+1,c,a)}else I.e=u,I.r=+a;return I}}();function fe(e,r,i,s){var t,l,c,n,f;if(i==null?i=S:v(i,0,8),!e.c)return e.toString();if(t=e.c[0],c=e.e,r==null)f=F(e.c),f=s==1||s==2&&(c<=C||c>=k)?ne(f,c):W(f,c,"0");else if(e=y(new h(e),r,i),l=e.e,f=F(e.c),n=f.length,s==1||s==2&&(r<=l||l<=C)){for(;n<r;f+="0",n++);f=ne(f,l)}else if(r-=c,f=W(f,l,"0"),l+1>n){if(--r>0)for(f+=".";r--;f+="0");}else if(r+=l-n,r>0)for(l+1==n&&(f+=".");r--;f+="0");return e.s<0&&t?"-"+f:f}function he(e,r){for(var i,s=1,t=new h(e[0]);s<e.length;s++)if(i=new h(e[s]),i.s)r.call(t,i)&&(t=i);else{t=i;break}return t}function le(e,r,i){for(var s=1,t=r.length;!r[--t];r.pop());for(t=r[0];t>=10;t/=10,s++);return(i=s+i*d-1)>$?e.c=e.e=null:i<Q?e.c=[e.e=0]:(e.e=i,e.c=r),e}D=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,i=/^\.([^.]+)$/,s=/^-?(Infinity|NaN)$/,t=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(l,c,n,f){var u,o=n?c:c.replace(t,"");if(s.test(o))l.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(e,function(a,p,w){return u=(w=w.toLowerCase())=="x"?16:w=="b"?2:8,!f||f==u?p:a}),f&&(u=f,o=o.replace(r,"$1").replace(i,"0.$1")),c!=o))return new h(o,u);if(h.DEBUG)throw Error(U+"Not a"+(f?" base "+f:"")+" number: "+c);l.s=null}l.c=l.e=null}}();function y(e,r,i,s){var t,l,c,n,f,u,o,a=e.c,p=ae;if(a){e:{for(t=1,n=a[0];n>=10;n/=10,t++);if(l=r-t,l<0)l+=d,c=r,f=a[u=0],o=f/p[t-c-1]%10|0;else if(u=ue((l+1)/d),u>=a.length)if(s){for(;a.length<=u;a.push(0));f=o=0,t=1,l%=d,c=l-d+1}else break e;else{for(f=n=a[u],t=1;n>=10;n/=10,t++);l%=d,c=l-d+t,o=c<0?0:f/p[t-c-1]%10|0}if(s=s||r<0||a[u+1]!=null||(c<0?f:f%p[t-c-1]),s=i<4?(o||s)&&(i==0||i==(e.s<0?3:2)):o>5||o==5&&(i==4||s||i==6&&(l>0?c>0?f/p[t-c]:0:a[u-1])%10&1||i==(e.s<0?8:7)),r<1||!a[0])return a.length=0,s?(r-=e.e+1,a[0]=p[(d-r%d)%d],e.e=-r||0):a[0]=e.e=0,e;if(l==0?(a.length=u,n=1,u--):(a.length=u+1,n=p[d-l],a[u]=c>0?H(f/p[t-c]%p[c])*n:0),s)for(;;)if(u==0){for(l=1,c=a[0];c>=10;c/=10,l++);for(c=a[0]+=n,n=1;c>=10;c/=10,n++);l!=n&&(e.e++,a[0]==z&&(a[0]=1));break}else{if(a[u]+=n,a[u]!=z)break;a[u--]=0,n=1}for(l=a.length;a[--l]===0;a.pop());}e.e>$?e.c=e.e=null:e.e<Q&&(e.c=[e.e=0])}return e}function V(e){var r,i=e.e;return i===null?e.toString():(r=F(e.c),r=i<=C||i>=k?ne(r,i):W(r,i,"0"),e.s<0?"-"+r:r)}return g.absoluteValue=g.abs=function(){var e=new h(this);return e.s<0&&(e.s=1),e},g.comparedTo=function(e,r){return j(this,new h(e,r))},g.decimalPlaces=g.dp=function(e,r){var i,s,t,l=this;if(e!=null)return v(e,0,M),r==null?r=S:v(r,0,8),y(new h(l),e+l.e+1,r);if(!(i=l.c))return null;if(s=((t=i.length-1)-q(this.e/d))*d,t=i[t])for(;t%10==0;t/=10,s--);return s<0&&(s=0),s},g.dividedBy=g.div=function(e,r){return N(this,new h(e,r),x,S)},g.dividedToIntegerBy=g.idiv=function(e,r){return N(this,new h(e,r),0,1)},g.exponentiatedBy=g.pow=function(e,r){var i,s,t,l,c,n,f,u,o,a=this;if(e=new h(e),e.c&&!e.isInteger())throw Error(U+"Exponent not an integer: "+V(e));if(r!=null&&(r=new h(r)),n=e.e>14,!a.c||!a.c[0]||a.c[0]==1&&!a.e&&a.c.length==1||!e.c||!e.c[0])return o=new h(Math.pow(+V(a),n?2-ie(e):+V(e))),r?o.mod(r):o;if(f=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new h(NaN);s=!f&&a.isInteger()&&r.isInteger(),s&&(a=a.mod(r))}else{if(e.e>9&&(a.e>0||a.e<-1||(a.e==0?a.c[0]>1||n&&a.c[1]>=24e7:a.c[0]<8e13||n&&a.c[0]<=9999975e7)))return l=a.s<0&&ie(e)?-0:0,a.e>-1&&(l=1/l),new h(f?1/l:l);Y&&(l=ue(Y/d+2))}for(n?(i=new h(.5),f&&(e.s=1),u=ie(e)):(t=Math.abs(+V(e)),u=t%2),o=new h(R);;){if(u){if(o=o.times(a),!o.c)break;l?o.c.length>l&&(o.c.length=l):s&&(o=o.mod(r))}if(t){if(t=H(t/2),t===0)break;u=t%2}else if(e=e.times(i),y(e,e.e+1,1),e.e>14)u=ie(e);else{if(t=+V(e),t===0)break;u=t%2}a=a.times(a),l?a.c&&a.c.length>l&&(a.c.length=l):s&&(a=a.mod(r))}return s?o:(f&&(o=R.div(o)),r?o.mod(r):l?y(o,Y,S,c):o)},g.integerValue=function(e){var r=new h(this);return e==null?e=S:v(e,0,8),y(r,r.e+1,e)},g.isEqualTo=g.eq=function(e,r){return j(this,new h(e,r))===0},g.isFinite=function(){return!!this.c},g.isGreaterThan=g.gt=function(e,r){return j(this,new h(e,r))>0},g.isGreaterThanOrEqualTo=g.gte=function(e,r){return(r=j(this,new h(e,r)))===1||r===0},g.isInteger=function(){return!!this.c&&q(this.e/d)>this.c.length-2},g.isLessThan=g.lt=function(e,r){return j(this,new h(e,r))<0},g.isLessThanOrEqualTo=g.lte=function(e,r){return(r=j(this,new h(e,r)))===-1||r===0},g.isNaN=function(){return!this.s},g.isNegative=function(){return this.s<0},g.isPositive=function(){return this.s>0},g.isZero=function(){return!!this.c&&this.c[0]==0},g.minus=function(e,r){var i,s,t,l,c=this,n=c.s;if(e=new h(e,r),r=e.s,!n||!r)return new h(NaN);if(n!=r)return e.s=-r,c.plus(e);var f=c.e/d,u=e.e/d,o=c.c,a=e.c;if(!f||!u){if(!o||!a)return o?(e.s=-r,e):new h(a?c:NaN);if(!o[0]||!a[0])return a[0]?(e.s=-r,e):new h(o[0]?c:S==3?-0:0)}if(f=q(f),u=q(u),o=o.slice(),n=f-u){for((l=n<0)?(n=-n,t=o):(u=f,t=a),t.reverse(),r=n;r--;t.push(0));t.reverse()}else for(s=(l=(n=o.length)<(r=a.length))?n:r,n=r=0;r<s;r++)if(o[r]!=a[r]){l=o[r]<a[r];break}if(l&&(t=o,o=a,a=t,e.s=-e.s),r=(s=a.length)-(i=o.length),r>0)for(;r--;o[i++]=0);for(r=z-1;s>n;){if(o[--s]<a[s]){for(i=s;i&&!o[--i];o[i]=r);--o[i],o[s]+=z}o[s]-=a[s]}for(;o[0]==0;o.splice(0,1),--u);return o[0]?le(e,o,u):(e.s=S==3?-1:1,e.c=[e.e=0],e)},g.modulo=g.mod=function(e,r){var i,s,t=this;return e=new h(e,r),!t.c||!e.s||e.c&&!e.c[0]?new h(NaN):!e.c||t.c&&!t.c[0]?new h(t):(b==9?(s=e.s,e.s=1,i=N(t,e,0,3),e.s=s,i.s*=s):i=N(t,e,0,b),e=t.minus(i.times(e)),!e.c[0]&&b==1&&(e.s=t.s),e)},g.multipliedBy=g.times=function(e,r){var i,s,t,l,c,n,f,u,o,a,p,w,m,I,T,O=this,A=O.c,P=(e=new h(e,r)).c;if(!A||!P||!A[0]||!P[0])return!O.s||!e.s||A&&!A[0]&&!P||P&&!P[0]&&!A?e.c=e.e=e.s=null:(e.s*=O.s,!A||!P?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(s=q(O.e/d)+q(e.e/d),e.s*=O.s,f=A.length,a=P.length,f<a&&(m=A,A=P,P=m,t=f,f=a,a=t),t=f+a,m=[];t--;m.push(0));for(I=z,T=J,t=a;--t>=0;){for(i=0,p=P[t]%T,w=P[t]/T|0,c=f,l=t+c;l>t;)u=A[--c]%T,o=A[c]/T|0,n=w*u+o*p,u=p*u+n%T*T+m[l]+i,i=(u/I|0)+(n/T|0)+w*o,m[l--]=u%I;m[l]=i}return i?++s:m.splice(0,1),le(e,m,s)},g.negated=function(){var e=new h(this);return e.s=-e.s||null,e},g.plus=function(e,r){var i,s=this,t=s.s;if(e=new h(e,r),r=e.s,!t||!r)return new h(NaN);if(t!=r)return e.s=-r,s.minus(e);var l=s.e/d,c=e.e/d,n=s.c,f=e.c;if(!l||!c){if(!n||!f)return new h(t/0);if(!n[0]||!f[0])return f[0]?e:new h(n[0]?s:t*0)}if(l=q(l),c=q(c),n=n.slice(),t=l-c){for(t>0?(c=l,i=f):(t=-t,i=n),i.reverse();t--;i.push(0));i.reverse()}for(t=n.length,r=f.length,t-r<0&&(i=f,f=n,n=i,r=t),t=0;r;)t=(n[--r]=n[r]+f[r]+t)/z|0,n[r]=z===n[r]?0:n[r]%z;return t&&(n=[t].concat(n),++c),le(e,n,c)},g.precision=g.sd=function(e,r){var i,s,t,l=this;if(e!=null&&e!==!!e)return v(e,1,M),r==null?r=S:v(r,0,8),y(new h(l),e,r);if(!(i=l.c))return null;if(t=i.length-1,s=t*d+1,t=i[t]){for(;t%10==0;t/=10,s--);for(t=i[0];t>=10;t/=10,s++);}return e&&l.e+1>s&&(s=l.e+1),s},g.shiftedBy=function(e){return v(e,-ce,ce),this.times("1e"+e)},g.squareRoot=g.sqrt=function(){var e,r,i,s,t,l=this,c=l.c,n=l.s,f=l.e,u=x+4,o=new h("0.5");if(n!==1||!c||!c[0])return new h(!n||n<0&&(!c||c[0])?NaN:c?l:1/0);if(n=Math.sqrt(+V(l)),n==0||n==1/0?(r=F(c),(r.length+f)%2==0&&(r+="0"),n=Math.sqrt(+r),f=q((f+1)/2)-(f<0||f%2),n==1/0?r="5e"+f:(r=n.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),i=new h(r)):i=new h(n+""),i.c[0]){for(f=i.e,n=f+u,n<3&&(n=0);;)if(t=i,i=o.times(t.plus(N(l,t,u,1))),F(t.c).slice(0,n)===(r=F(i.c)).slice(0,n))if(i.e<f&&--n,r=r.slice(n-3,n+1),r=="9999"||!s&&r=="4999"){if(!s&&(y(t,t.e+x+2,0),t.times(t).eq(l))){i=t;break}u+=4,n+=4,s=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(i,i.e+x+2,1),e=!i.times(i).eq(l));break}}return y(i,i.e+x+1,S,e)},g.toExponential=function(e,r){return e!=null&&(v(e,0,M),e++),fe(this,e,r,1)},g.toFixed=function(e,r){return e!=null&&(v(e,0,M),e=e+this.e+1),fe(this,e,r)},g.toFormat=function(e,r,i){var s,t=this;if(i==null)e!=null&&r&&typeof r=="object"?(i=r,r=null):e&&typeof e=="object"?(i=e,e=r=null):i=te;else if(typeof i!="object")throw Error(U+"Argument not an object: "+i);if(s=t.toFixed(e,r),t.c){var l,c=s.split("."),n=+i.groupSize,f=+i.secondaryGroupSize,u=i.groupSeparator||"",o=c[0],a=c[1],p=t.s<0,w=p?o.slice(1):o,m=w.length;if(f&&(l=n,n=f,f=l,m-=l),n>0&&m>0){for(l=m%n||n,o=w.substr(0,l);l<m;l+=n)o+=u+w.substr(l,n);f>0&&(o+=u+w.slice(l)),p&&(o="-"+o)}s=a?o+(i.decimalSeparator||"")+((f=+i.fractionGroupSize)?a.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):a):o}return(i.prefix||"")+s+(i.suffix||"")},g.toFraction=function(e){var r,i,s,t,l,c,n,f,u,o,a,p,w=this,m=w.c;if(e!=null&&(n=new h(e),!n.isInteger()&&(n.c||n.s!==1)||n.lt(R)))throw Error(U+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+V(n));if(!m)return new h(w);for(r=new h(R),u=i=new h(R),s=f=new h(R),p=F(m),l=r.e=p.length-w.e-1,r.c[0]=ae[(c=l%d)<0?d+c:c],e=!e||n.comparedTo(r)>0?l>0?r:u:n,c=$,$=1/0,n=new h(p),f.c[0]=0;o=N(n,r,0,1),t=i.plus(o.times(s)),t.comparedTo(e)!=1;)i=s,s=t,u=f.plus(o.times(t=u)),f=t,r=n.minus(o.times(t=r)),n=t;return t=N(e.minus(i),s,0,1),f=f.plus(t.times(u)),i=i.plus(t.times(s)),f.s=u.s=w.s,l=l*2,a=N(u,s,l,S).minus(w).abs().comparedTo(N(f,i,l,S).minus(w).abs())<1?[u,s]:[f,i],$=c,a},g.toNumber=function(){return+V(this)},g.toPrecision=function(e,r){return e!=null&&v(e,1,M),fe(this,e,r,2)},g.toString=function(e){var r,i=this,s=i.s,t=i.e;return t===null?s?(r="Infinity",s<0&&(r="-"+r)):r="NaN":(e==null?r=t<=C||t>=k?ne(F(i.c),t):W(F(i.c),t,"0"):e===10?(i=y(new h(i),x+t+1,S),r=W(F(i.c),i.e,"0")):(v(e,2,K.length,"Base"),r=_(W(F(i.c),t,"0"),10,e,s,!0)),s<0&&i.c[0]&&(r="-"+r)),r},g.valueOf=g.toJSON=function(){return V(this)},g._isBigNumber=!0,g[Symbol.toStringTag]="BigNumber",g[Symbol.for("nodejs.util.inspect.custom")]=g.valueOf,E!=null&&h.set(E),h}function q(E){var N=E|0;return E>0||E===N?N:N-1}function F(E){for(var N,_,D=1,g=E.length,R=E[0]+"";D<g;){for(N=E[D++]+"",_=d-N.length;_--;N="0"+N);R+=N}for(g=R.length;R.charCodeAt(--g)===48;);return R.slice(0,g+1||1)}function j(E,N){var _,D,g=E.c,R=N.c,x=E.s,S=N.s,C=E.e,k=N.e;if(!x||!S)return null;if(_=g&&!g[0],D=R&&!R[0],_||D)return _?D?0:-S:x;if(x!=S)return x;if(_=x<0,D=C==k,!g||!R)return D?0:!g^_?1:-1;if(!D)return C>k^_?1:-1;for(S=(C=g.length)<(k=R.length)?C:k,x=0;x<S;x++)if(g[x]!=R[x])return g[x]>R[x]^_?1:-1;return C==k?0:C>k^_?1:-1}function v(E,N,_,D){if(E<N||E>_||E!==H(E))throw Error(U+(D||"Argument")+(typeof E=="number"?E<N||E>_?" out of range: ":" not an integer: ":" not a primitive number: ")+String(E))}function ie(E){var N=E.c.length-1;return q(E.e/d)==N&&E.c[N]%2!=0}function ne(E,N){return(E.length>1?E.charAt(0)+"."+E.slice(1):E)+(N<0?"e":"e+")+N}function W(E,N,_){var D,g;if(N<0){for(g=_+".";++N;g+=_);E=g+E}else if(D=E.length,++N>D){for(g=_,N-=D;--N;g+=_);E+=g}else N<D&&(E=E.slice(0,N)+"."+E.slice(N));return E}var Ee=pe();export{Ee as B};
1
+ (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]="047ce69f-d720-429b-9705-458692338a9e",E._sentryDebugIdIdentifier="sentry-dbid-047ce69f-d720-429b-9705-458692338a9e")}catch{}})();var we=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,ue=Math.ceil,H=Math.floor,U="[BigNumber Error] ",ge=U+"Number primitive has more than 15 significant digits: ",z=1e14,d=14,ce=9007199254740991,ae=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],J=1e7,M=1e9;function pe(E){var N,_,D,g=h.prototype={constructor:h,toString:null,valueOf:null},R=new h(1),x=20,S=4,C=-7,k=21,Q=-1e7,$=1e7,Z=!1,b=1,Y=0,te={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},K="0123456789abcdefghijklmnopqrstuvwxyz";function h(e,r){var i,s,t,l,c,n,f,u,o=this;if(!(o instanceof h))return new h(e,r);if(r==null){if(e&&e._isBigNumber===!0){o.s=e.s,!e.c||e.e>$?o.c=o.e=null:e.e<Q?o.c=[o.e=0]:(o.e=e.e,o.c=e.c.slice());return}if((n=typeof e=="number")&&e*0==0){if(o.s=1/e<0?(e=-e,-1):1,e===~~e){for(l=0,c=e;c>=10;c/=10,l++);l>$?o.c=o.e=null:(o.e=l,o.c=[e]);return}u=String(e)}else{if(!we.test(u=String(e)))return D(o,u,n);o.s=u.charCodeAt(0)==45?(u=u.slice(1),-1):1}(l=u.indexOf("."))>-1&&(u=u.replace(".","")),(c=u.search(/e/i))>0?(l<0&&(l=c),l+=+u.slice(c+1),u=u.substring(0,c)):l<0&&(l=u.length)}else{if(v(r,2,K.length,"Base"),r==10)return o=new h(e),y(o,x+o.e+1,S);if(u=String(e),n=typeof e=="number"){if(e*0!=0)return D(o,u,n,r);if(o.s=1/e<0?(u=u.slice(1),-1):1,h.DEBUG&&u.replace(/^0\.0*|\./,"").length>15)throw Error(ge+e)}else o.s=u.charCodeAt(0)===45?(u=u.slice(1),-1):1;for(i=K.slice(0,r),l=c=0,f=u.length;c<f;c++)if(i.indexOf(s=u.charAt(c))<0){if(s=="."){if(c>l){l=f;continue}}else if(!t&&(u==u.toUpperCase()&&(u=u.toLowerCase())||u==u.toLowerCase()&&(u=u.toUpperCase()))){t=!0,c=-1,l=0;continue}return D(o,String(e),n,r)}n=!1,u=_(u,r,10,o.s),(l=u.indexOf("."))>-1?u=u.replace(".",""):l=u.length}for(c=0;u.charCodeAt(c)===48;c++);for(f=u.length;u.charCodeAt(--f)===48;);if(u=u.slice(c,++f)){if(f-=c,n&&h.DEBUG&&f>15&&(e>ce||e!==H(e)))throw Error(ge+o.s*e);if((l=l-c-1)>$)o.c=o.e=null;else if(l<Q)o.c=[o.e=0];else{if(o.e=l,o.c=[],c=(l+1)%d,l<0&&(c+=d),c<f){for(c&&o.c.push(+u.slice(0,c)),f-=d;c<f;)o.c.push(+u.slice(c,c+=d));c=d-(u=u.slice(c)).length}else c-=f;for(;c--;u+="0");o.c.push(+u)}}else o.c=[o.e=0]}h.clone=pe,h.ROUND_UP=0,h.ROUND_DOWN=1,h.ROUND_CEIL=2,h.ROUND_FLOOR=3,h.ROUND_HALF_UP=4,h.ROUND_HALF_DOWN=5,h.ROUND_HALF_EVEN=6,h.ROUND_HALF_CEIL=7,h.ROUND_HALF_FLOOR=8,h.EUCLID=9,h.config=h.set=function(e){var r,i;if(e!=null)if(typeof e=="object"){if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(i=e[r],v(i,0,M,r),x=i),e.hasOwnProperty(r="ROUNDING_MODE")&&(i=e[r],v(i,0,8,r),S=i),e.hasOwnProperty(r="EXPONENTIAL_AT")&&(i=e[r],i&&i.pop?(v(i[0],-M,0,r),v(i[1],0,M,r),C=i[0],k=i[1]):(v(i,-M,M,r),C=-(k=i<0?-i:i))),e.hasOwnProperty(r="RANGE"))if(i=e[r],i&&i.pop)v(i[0],-M,-1,r),v(i[1],1,M,r),Q=i[0],$=i[1];else if(v(i,-M,M,r),i)Q=-($=i<0?-i:i);else throw Error(U+r+" cannot be zero: "+i);if(e.hasOwnProperty(r="CRYPTO"))if(i=e[r],i===!!i)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))Z=i;else throw Z=!i,Error(U+"crypto unavailable");else Z=i;else throw Error(U+r+" not true or false: "+i);if(e.hasOwnProperty(r="MODULO_MODE")&&(i=e[r],v(i,0,9,r),b=i),e.hasOwnProperty(r="POW_PRECISION")&&(i=e[r],v(i,0,M,r),Y=i),e.hasOwnProperty(r="FORMAT"))if(i=e[r],typeof i=="object")te=i;else throw Error(U+r+" not an object: "+i);if(e.hasOwnProperty(r="ALPHABET"))if(i=e[r],typeof i=="string"&&!/^.$|[+-.\s]|(.).*\1/.test(i))K=i;else throw Error(U+r+" invalid: "+i)}else throw Error(U+"Object expected: "+e);return{DECIMAL_PLACES:x,ROUNDING_MODE:S,EXPONENTIAL_AT:[C,k],RANGE:[Q,$],CRYPTO:Z,MODULO_MODE:b,POW_PRECISION:Y,FORMAT:te,ALPHABET:K}},h.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!h.DEBUG)return!0;var r,i,s=e.c,t=e.e,l=e.s;e:if({}.toString.call(s)=="[object Array]"){if((l===1||l===-1)&&t>=-M&&t<=M&&t===H(t)){if(s[0]===0){if(t===0&&s.length===1)return!0;break e}if(r=(t+1)%d,r<1&&(r+=d),String(s[0]).length==r){for(r=0;r<s.length;r++)if(i=s[r],i<0||i>=z||i!==H(i))break e;if(i!==0)return!0}}}else if(s===null&&t===null&&(l===null||l===1||l===-1))return!0;throw Error(U+"Invalid BigNumber: "+e)},h.maximum=h.max=function(){return he(arguments,g.lt)},h.minimum=h.min=function(){return he(arguments,g.gt)},h.random=(function(){var e=9007199254740992,r=Math.random()*e&2097151?function(){return H(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(i){var s,t,l,c,n,f=0,u=[],o=new h(R);if(i==null?i=x:v(i,0,M),c=ue(i/d),Z)if(crypto.getRandomValues){for(s=crypto.getRandomValues(new Uint32Array(c*=2));f<c;)n=s[f]*131072+(s[f+1]>>>11),n>=9e15?(t=crypto.getRandomValues(new Uint32Array(2)),s[f]=t[0],s[f+1]=t[1]):(u.push(n%1e14),f+=2);f=c/2}else if(crypto.randomBytes){for(s=crypto.randomBytes(c*=7);f<c;)n=(s[f]&31)*281474976710656+s[f+1]*1099511627776+s[f+2]*4294967296+s[f+3]*16777216+(s[f+4]<<16)+(s[f+5]<<8)+s[f+6],n>=9e15?crypto.randomBytes(7).copy(s,f):(u.push(n%1e14),f+=7);f=c/7}else throw Z=!1,Error(U+"crypto unavailable");if(!Z)for(;f<c;)n=r(),n<9e15&&(u[f++]=n%1e14);for(c=u[--f],i%=d,c&&i&&(n=ae[d-i],u[f]=H(c/n)*n);u[f]===0;u.pop(),f--);if(f<0)u=[l=0];else{for(l=-1;u[0]===0;u.splice(0,1),l-=d);for(f=1,n=u[0];n>=10;n/=10,f++);f<d&&(l-=d-f)}return o.e=l,o.c=u,o}})(),h.sum=function(){for(var e=1,r=arguments,i=new h(r[0]);e<r.length;)i=i.plus(r[e++]);return i},_=(function(){var e="0123456789";function r(i,s,t,l){for(var c,n=[0],f,u=0,o=i.length;u<o;){for(f=n.length;f--;n[f]*=s);for(n[0]+=l.indexOf(i.charAt(u++)),c=0;c<n.length;c++)n[c]>t-1&&(n[c+1]==null&&(n[c+1]=0),n[c+1]+=n[c]/t|0,n[c]%=t)}return n.reverse()}return function(i,s,t,l,c){var n,f,u,o,a,p,w,m,I=i.indexOf("."),T=x,O=S;for(I>=0&&(o=Y,Y=0,i=i.replace(".",""),m=new h(s),p=m.pow(i.length-I),Y=o,m.c=r(W(F(p.c),p.e,"0"),10,t,e),m.e=m.c.length),w=r(i,s,t,c?(n=K,e):(n=e,K)),u=o=w.length;w[--o]==0;w.pop());if(!w[0])return n.charAt(0);if(I<0?--u:(p.c=w,p.e=u,p.s=l,p=N(p,m,T,O,t),w=p.c,a=p.r,u=p.e),f=u+T+1,I=w[f],o=t/2,a=a||f<0||w[f+1]!=null,a=O<4?(I!=null||a)&&(O==0||O==(p.s<0?3:2)):I>o||I==o&&(O==4||a||O==6&&w[f-1]&1||O==(p.s<0?8:7)),f<1||!w[0])i=a?W(n.charAt(1),-T,n.charAt(0)):n.charAt(0);else{if(w.length=f,a)for(--t;++w[--f]>t;)w[f]=0,f||(++u,w=[1].concat(w));for(o=w.length;!w[--o];);for(I=0,i="";I<=o;i+=n.charAt(w[I++]));i=W(i,u,n.charAt(0))}return i}})(),N=(function(){function e(s,t,l){var c,n,f,u,o=0,a=s.length,p=t%J,w=t/J|0;for(s=s.slice();a--;)f=s[a]%J,u=s[a]/J|0,c=w*f+u*p,n=p*f+c%J*J+o,o=(n/l|0)+(c/J|0)+w*u,s[a]=n%l;return o&&(s=[o].concat(s)),s}function r(s,t,l,c){var n,f;if(l!=c)f=l>c?1:-1;else for(n=f=0;n<l;n++)if(s[n]!=t[n]){f=s[n]>t[n]?1:-1;break}return f}function i(s,t,l,c){for(var n=0;l--;)s[l]-=n,n=s[l]<t[l]?1:0,s[l]=n*c+s[l]-t[l];for(;!s[0]&&s.length>1;s.splice(0,1));}return function(s,t,l,c,n){var f,u,o,a,p,w,m,I,T,O,A,P,re,oe,se,X,ee,G=s.s==t.s?1:-1,L=s.c,B=t.c;if(!L||!L[0]||!B||!B[0])return new h(!s.s||!t.s||(L?B&&L[0]==B[0]:!B)?NaN:L&&L[0]==0||!B?G*0:G/0);for(I=new h(G),T=I.c=[],u=s.e-t.e,G=l+u+1,n||(n=z,u=q(s.e/d)-q(t.e/d),G=G/d|0),o=0;B[o]==(L[o]||0);o++);if(B[o]>(L[o]||0)&&u--,G<0)T.push(1),a=!0;else{for(oe=L.length,X=B.length,o=0,G+=2,p=H(n/(B[0]+1)),p>1&&(B=e(B,p,n),L=e(L,p,n),X=B.length,oe=L.length),re=X,O=L.slice(0,X),A=O.length;A<X;O[A++]=0);ee=B.slice(),ee=[0].concat(ee),se=B[0],B[1]>=n/2&&se++;do{if(p=0,f=r(B,O,X,A),f<0){if(P=O[0],X!=A&&(P=P*n+(O[1]||0)),p=H(P/se),p>1)for(p>=n&&(p=n-1),w=e(B,p,n),m=w.length,A=O.length;r(w,O,m,A)==1;)p--,i(w,X<m?ee:B,m,n),m=w.length,f=1;else p==0&&(f=p=1),w=B.slice(),m=w.length;if(m<A&&(w=[0].concat(w)),i(O,w,A,n),A=O.length,f==-1)for(;r(B,O,X,A)<1;)p++,i(O,X<A?ee:B,A,n),A=O.length}else f===0&&(p++,O=[0]);T[o++]=p,O[0]?O[A++]=L[re]||0:(O=[L[re]],A=1)}while((re++<oe||O[0]!=null)&&G--);a=O[0]!=null,T[0]||T.splice(0,1)}if(n==z){for(o=1,G=T[0];G>=10;G/=10,o++);y(I,l+(I.e=o+u*d-1)+1,c,a)}else I.e=u,I.r=+a;return I}})();function fe(e,r,i,s){var t,l,c,n,f;if(i==null?i=S:v(i,0,8),!e.c)return e.toString();if(t=e.c[0],c=e.e,r==null)f=F(e.c),f=s==1||s==2&&(c<=C||c>=k)?ne(f,c):W(f,c,"0");else if(e=y(new h(e),r,i),l=e.e,f=F(e.c),n=f.length,s==1||s==2&&(r<=l||l<=C)){for(;n<r;f+="0",n++);f=ne(f,l)}else if(r-=c,f=W(f,l,"0"),l+1>n){if(--r>0)for(f+=".";r--;f+="0");}else if(r+=l-n,r>0)for(l+1==n&&(f+=".");r--;f+="0");return e.s<0&&t?"-"+f:f}function he(e,r){for(var i,s=1,t=new h(e[0]);s<e.length;s++)if(i=new h(e[s]),i.s)r.call(t,i)&&(t=i);else{t=i;break}return t}function le(e,r,i){for(var s=1,t=r.length;!r[--t];r.pop());for(t=r[0];t>=10;t/=10,s++);return(i=s+i*d-1)>$?e.c=e.e=null:i<Q?e.c=[e.e=0]:(e.e=i,e.c=r),e}D=(function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,i=/^\.([^.]+)$/,s=/^-?(Infinity|NaN)$/,t=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(l,c,n,f){var u,o=n?c:c.replace(t,"");if(s.test(o))l.s=isNaN(o)?null:o<0?-1:1;else{if(!n&&(o=o.replace(e,function(a,p,w){return u=(w=w.toLowerCase())=="x"?16:w=="b"?2:8,!f||f==u?p:a}),f&&(u=f,o=o.replace(r,"$1").replace(i,"0.$1")),c!=o))return new h(o,u);if(h.DEBUG)throw Error(U+"Not a"+(f?" base "+f:"")+" number: "+c);l.s=null}l.c=l.e=null}})();function y(e,r,i,s){var t,l,c,n,f,u,o,a=e.c,p=ae;if(a){e:{for(t=1,n=a[0];n>=10;n/=10,t++);if(l=r-t,l<0)l+=d,c=r,f=a[u=0],o=f/p[t-c-1]%10|0;else if(u=ue((l+1)/d),u>=a.length)if(s){for(;a.length<=u;a.push(0));f=o=0,t=1,l%=d,c=l-d+1}else break e;else{for(f=n=a[u],t=1;n>=10;n/=10,t++);l%=d,c=l-d+t,o=c<0?0:f/p[t-c-1]%10|0}if(s=s||r<0||a[u+1]!=null||(c<0?f:f%p[t-c-1]),s=i<4?(o||s)&&(i==0||i==(e.s<0?3:2)):o>5||o==5&&(i==4||s||i==6&&(l>0?c>0?f/p[t-c]:0:a[u-1])%10&1||i==(e.s<0?8:7)),r<1||!a[0])return a.length=0,s?(r-=e.e+1,a[0]=p[(d-r%d)%d],e.e=-r||0):a[0]=e.e=0,e;if(l==0?(a.length=u,n=1,u--):(a.length=u+1,n=p[d-l],a[u]=c>0?H(f/p[t-c]%p[c])*n:0),s)for(;;)if(u==0){for(l=1,c=a[0];c>=10;c/=10,l++);for(c=a[0]+=n,n=1;c>=10;c/=10,n++);l!=n&&(e.e++,a[0]==z&&(a[0]=1));break}else{if(a[u]+=n,a[u]!=z)break;a[u--]=0,n=1}for(l=a.length;a[--l]===0;a.pop());}e.e>$?e.c=e.e=null:e.e<Q&&(e.c=[e.e=0])}return e}function V(e){var r,i=e.e;return i===null?e.toString():(r=F(e.c),r=i<=C||i>=k?ne(r,i):W(r,i,"0"),e.s<0?"-"+r:r)}return g.absoluteValue=g.abs=function(){var e=new h(this);return e.s<0&&(e.s=1),e},g.comparedTo=function(e,r){return j(this,new h(e,r))},g.decimalPlaces=g.dp=function(e,r){var i,s,t,l=this;if(e!=null)return v(e,0,M),r==null?r=S:v(r,0,8),y(new h(l),e+l.e+1,r);if(!(i=l.c))return null;if(s=((t=i.length-1)-q(this.e/d))*d,t=i[t])for(;t%10==0;t/=10,s--);return s<0&&(s=0),s},g.dividedBy=g.div=function(e,r){return N(this,new h(e,r),x,S)},g.dividedToIntegerBy=g.idiv=function(e,r){return N(this,new h(e,r),0,1)},g.exponentiatedBy=g.pow=function(e,r){var i,s,t,l,c,n,f,u,o,a=this;if(e=new h(e),e.c&&!e.isInteger())throw Error(U+"Exponent not an integer: "+V(e));if(r!=null&&(r=new h(r)),n=e.e>14,!a.c||!a.c[0]||a.c[0]==1&&!a.e&&a.c.length==1||!e.c||!e.c[0])return o=new h(Math.pow(+V(a),n?2-ie(e):+V(e))),r?o.mod(r):o;if(f=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new h(NaN);s=!f&&a.isInteger()&&r.isInteger(),s&&(a=a.mod(r))}else{if(e.e>9&&(a.e>0||a.e<-1||(a.e==0?a.c[0]>1||n&&a.c[1]>=24e7:a.c[0]<8e13||n&&a.c[0]<=9999975e7)))return l=a.s<0&&ie(e)?-0:0,a.e>-1&&(l=1/l),new h(f?1/l:l);Y&&(l=ue(Y/d+2))}for(n?(i=new h(.5),f&&(e.s=1),u=ie(e)):(t=Math.abs(+V(e)),u=t%2),o=new h(R);;){if(u){if(o=o.times(a),!o.c)break;l?o.c.length>l&&(o.c.length=l):s&&(o=o.mod(r))}if(t){if(t=H(t/2),t===0)break;u=t%2}else if(e=e.times(i),y(e,e.e+1,1),e.e>14)u=ie(e);else{if(t=+V(e),t===0)break;u=t%2}a=a.times(a),l?a.c&&a.c.length>l&&(a.c.length=l):s&&(a=a.mod(r))}return s?o:(f&&(o=R.div(o)),r?o.mod(r):l?y(o,Y,S,c):o)},g.integerValue=function(e){var r=new h(this);return e==null?e=S:v(e,0,8),y(r,r.e+1,e)},g.isEqualTo=g.eq=function(e,r){return j(this,new h(e,r))===0},g.isFinite=function(){return!!this.c},g.isGreaterThan=g.gt=function(e,r){return j(this,new h(e,r))>0},g.isGreaterThanOrEqualTo=g.gte=function(e,r){return(r=j(this,new h(e,r)))===1||r===0},g.isInteger=function(){return!!this.c&&q(this.e/d)>this.c.length-2},g.isLessThan=g.lt=function(e,r){return j(this,new h(e,r))<0},g.isLessThanOrEqualTo=g.lte=function(e,r){return(r=j(this,new h(e,r)))===-1||r===0},g.isNaN=function(){return!this.s},g.isNegative=function(){return this.s<0},g.isPositive=function(){return this.s>0},g.isZero=function(){return!!this.c&&this.c[0]==0},g.minus=function(e,r){var i,s,t,l,c=this,n=c.s;if(e=new h(e,r),r=e.s,!n||!r)return new h(NaN);if(n!=r)return e.s=-r,c.plus(e);var f=c.e/d,u=e.e/d,o=c.c,a=e.c;if(!f||!u){if(!o||!a)return o?(e.s=-r,e):new h(a?c:NaN);if(!o[0]||!a[0])return a[0]?(e.s=-r,e):new h(o[0]?c:S==3?-0:0)}if(f=q(f),u=q(u),o=o.slice(),n=f-u){for((l=n<0)?(n=-n,t=o):(u=f,t=a),t.reverse(),r=n;r--;t.push(0));t.reverse()}else for(s=(l=(n=o.length)<(r=a.length))?n:r,n=r=0;r<s;r++)if(o[r]!=a[r]){l=o[r]<a[r];break}if(l&&(t=o,o=a,a=t,e.s=-e.s),r=(s=a.length)-(i=o.length),r>0)for(;r--;o[i++]=0);for(r=z-1;s>n;){if(o[--s]<a[s]){for(i=s;i&&!o[--i];o[i]=r);--o[i],o[s]+=z}o[s]-=a[s]}for(;o[0]==0;o.splice(0,1),--u);return o[0]?le(e,o,u):(e.s=S==3?-1:1,e.c=[e.e=0],e)},g.modulo=g.mod=function(e,r){var i,s,t=this;return e=new h(e,r),!t.c||!e.s||e.c&&!e.c[0]?new h(NaN):!e.c||t.c&&!t.c[0]?new h(t):(b==9?(s=e.s,e.s=1,i=N(t,e,0,3),e.s=s,i.s*=s):i=N(t,e,0,b),e=t.minus(i.times(e)),!e.c[0]&&b==1&&(e.s=t.s),e)},g.multipliedBy=g.times=function(e,r){var i,s,t,l,c,n,f,u,o,a,p,w,m,I,T,O=this,A=O.c,P=(e=new h(e,r)).c;if(!A||!P||!A[0]||!P[0])return!O.s||!e.s||A&&!A[0]&&!P||P&&!P[0]&&!A?e.c=e.e=e.s=null:(e.s*=O.s,!A||!P?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(s=q(O.e/d)+q(e.e/d),e.s*=O.s,f=A.length,a=P.length,f<a&&(m=A,A=P,P=m,t=f,f=a,a=t),t=f+a,m=[];t--;m.push(0));for(I=z,T=J,t=a;--t>=0;){for(i=0,p=P[t]%T,w=P[t]/T|0,c=f,l=t+c;l>t;)u=A[--c]%T,o=A[c]/T|0,n=w*u+o*p,u=p*u+n%T*T+m[l]+i,i=(u/I|0)+(n/T|0)+w*o,m[l--]=u%I;m[l]=i}return i?++s:m.splice(0,1),le(e,m,s)},g.negated=function(){var e=new h(this);return e.s=-e.s||null,e},g.plus=function(e,r){var i,s=this,t=s.s;if(e=new h(e,r),r=e.s,!t||!r)return new h(NaN);if(t!=r)return e.s=-r,s.minus(e);var l=s.e/d,c=e.e/d,n=s.c,f=e.c;if(!l||!c){if(!n||!f)return new h(t/0);if(!n[0]||!f[0])return f[0]?e:new h(n[0]?s:t*0)}if(l=q(l),c=q(c),n=n.slice(),t=l-c){for(t>0?(c=l,i=f):(t=-t,i=n),i.reverse();t--;i.push(0));i.reverse()}for(t=n.length,r=f.length,t-r<0&&(i=f,f=n,n=i,r=t),t=0;r;)t=(n[--r]=n[r]+f[r]+t)/z|0,n[r]=z===n[r]?0:n[r]%z;return t&&(n=[t].concat(n),++c),le(e,n,c)},g.precision=g.sd=function(e,r){var i,s,t,l=this;if(e!=null&&e!==!!e)return v(e,1,M),r==null?r=S:v(r,0,8),y(new h(l),e,r);if(!(i=l.c))return null;if(t=i.length-1,s=t*d+1,t=i[t]){for(;t%10==0;t/=10,s--);for(t=i[0];t>=10;t/=10,s++);}return e&&l.e+1>s&&(s=l.e+1),s},g.shiftedBy=function(e){return v(e,-ce,ce),this.times("1e"+e)},g.squareRoot=g.sqrt=function(){var e,r,i,s,t,l=this,c=l.c,n=l.s,f=l.e,u=x+4,o=new h("0.5");if(n!==1||!c||!c[0])return new h(!n||n<0&&(!c||c[0])?NaN:c?l:1/0);if(n=Math.sqrt(+V(l)),n==0||n==1/0?(r=F(c),(r.length+f)%2==0&&(r+="0"),n=Math.sqrt(+r),f=q((f+1)/2)-(f<0||f%2),n==1/0?r="5e"+f:(r=n.toExponential(),r=r.slice(0,r.indexOf("e")+1)+f),i=new h(r)):i=new h(n+""),i.c[0]){for(f=i.e,n=f+u,n<3&&(n=0);;)if(t=i,i=o.times(t.plus(N(l,t,u,1))),F(t.c).slice(0,n)===(r=F(i.c)).slice(0,n))if(i.e<f&&--n,r=r.slice(n-3,n+1),r=="9999"||!s&&r=="4999"){if(!s&&(y(t,t.e+x+2,0),t.times(t).eq(l))){i=t;break}u+=4,n+=4,s=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(y(i,i.e+x+2,1),e=!i.times(i).eq(l));break}}return y(i,i.e+x+1,S,e)},g.toExponential=function(e,r){return e!=null&&(v(e,0,M),e++),fe(this,e,r,1)},g.toFixed=function(e,r){return e!=null&&(v(e,0,M),e=e+this.e+1),fe(this,e,r)},g.toFormat=function(e,r,i){var s,t=this;if(i==null)e!=null&&r&&typeof r=="object"?(i=r,r=null):e&&typeof e=="object"?(i=e,e=r=null):i=te;else if(typeof i!="object")throw Error(U+"Argument not an object: "+i);if(s=t.toFixed(e,r),t.c){var l,c=s.split("."),n=+i.groupSize,f=+i.secondaryGroupSize,u=i.groupSeparator||"",o=c[0],a=c[1],p=t.s<0,w=p?o.slice(1):o,m=w.length;if(f&&(l=n,n=f,f=l,m-=l),n>0&&m>0){for(l=m%n||n,o=w.substr(0,l);l<m;l+=n)o+=u+w.substr(l,n);f>0&&(o+=u+w.slice(l)),p&&(o="-"+o)}s=a?o+(i.decimalSeparator||"")+((f=+i.fractionGroupSize)?a.replace(new RegExp("\\d{"+f+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):a):o}return(i.prefix||"")+s+(i.suffix||"")},g.toFraction=function(e){var r,i,s,t,l,c,n,f,u,o,a,p,w=this,m=w.c;if(e!=null&&(n=new h(e),!n.isInteger()&&(n.c||n.s!==1)||n.lt(R)))throw Error(U+"Argument "+(n.isInteger()?"out of range: ":"not an integer: ")+V(n));if(!m)return new h(w);for(r=new h(R),u=i=new h(R),s=f=new h(R),p=F(m),l=r.e=p.length-w.e-1,r.c[0]=ae[(c=l%d)<0?d+c:c],e=!e||n.comparedTo(r)>0?l>0?r:u:n,c=$,$=1/0,n=new h(p),f.c[0]=0;o=N(n,r,0,1),t=i.plus(o.times(s)),t.comparedTo(e)!=1;)i=s,s=t,u=f.plus(o.times(t=u)),f=t,r=n.minus(o.times(t=r)),n=t;return t=N(e.minus(i),s,0,1),f=f.plus(t.times(u)),i=i.plus(t.times(s)),f.s=u.s=w.s,l=l*2,a=N(u,s,l,S).minus(w).abs().comparedTo(N(f,i,l,S).minus(w).abs())<1?[u,s]:[f,i],$=c,a},g.toNumber=function(){return+V(this)},g.toPrecision=function(e,r){return e!=null&&v(e,1,M),fe(this,e,r,2)},g.toString=function(e){var r,i=this,s=i.s,t=i.e;return t===null?s?(r="Infinity",s<0&&(r="-"+r)):r="NaN":(e==null?r=t<=C||t>=k?ne(F(i.c),t):W(F(i.c),t,"0"):e===10?(i=y(new h(i),x+t+1,S),r=W(F(i.c),i.e,"0")):(v(e,2,K.length,"Base"),r=_(W(F(i.c),t,"0"),10,e,s,!0)),s<0&&i.c[0]&&(r="-"+r)),r},g.valueOf=g.toJSON=function(){return V(this)},g._isBigNumber=!0,g[Symbol.toStringTag]="BigNumber",g[Symbol.for("nodejs.util.inspect.custom")]=g.valueOf,E!=null&&h.set(E),h}function q(E){var N=E|0;return E>0||E===N?N:N-1}function F(E){for(var N,_,D=1,g=E.length,R=E[0]+"";D<g;){for(N=E[D++]+"",_=d-N.length;_--;N="0"+N);R+=N}for(g=R.length;R.charCodeAt(--g)===48;);return R.slice(0,g+1||1)}function j(E,N){var _,D,g=E.c,R=N.c,x=E.s,S=N.s,C=E.e,k=N.e;if(!x||!S)return null;if(_=g&&!g[0],D=R&&!R[0],_||D)return _?D?0:-S:x;if(x!=S)return x;if(_=x<0,D=C==k,!g||!R)return D?0:!g^_?1:-1;if(!D)return C>k^_?1:-1;for(S=(C=g.length)<(k=R.length)?C:k,x=0;x<S;x++)if(g[x]!=R[x])return g[x]>R[x]^_?1:-1;return C==k?0:C>k^_?1:-1}function v(E,N,_,D){if(E<N||E>_||E!==H(E))throw Error(U+(D||"Argument")+(typeof E=="number"?E<N||E>_?" out of range: ":" not an integer: ":" not a primitive number: ")+String(E))}function ie(E){var N=E.c.length-1;return q(E.e/d)==N&&E.c[N]%2!=0}function ne(E,N){return(E.length>1?E.charAt(0)+"."+E.slice(1):E)+(N<0?"e":"e+")+N}function W(E,N,_){var D,g;if(N<0){for(g=_+".";++N;g+=_);E=g+E}else if(D=E.length,++N>D){for(g=_,N-=D;--N;g+=_);E+=g}else N<D&&(E=E.slice(0,N)+"."+E.slice(N));return E}var Ee=pe();export{Ee as B};
2
2
  //# sourceMappingURL=vendor.bignumber.js.js.map
@@ -1,3 +1,3 @@
1
- (function(){try{var T=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g=new Error().stack;g&&(T._sentryDebugIds=T._sentryDebugIds||{},T._sentryDebugIds[g]="6f354589-4868-4013-a834-80eecefe5a39",T._sentryDebugIdIdentifier="sentry-dbid-6f354589-4868-4013-a834-80eecefe5a39")}catch{}})();var B={};(function T(g,C,k,P){var A=!!(g.Worker&&g.Blob&&g.Promise&&g.OffscreenCanvas&&g.OffscreenCanvasRenderingContext2D&&g.HTMLCanvasElement&&g.HTMLCanvasElement.prototype.transferControlToOffscreen&&g.URL&&g.URL.createObjectURL),L=typeof Path2D=="function"&&typeof DOMMatrix=="function",V=function(){if(!g.OffscreenCanvas)return!1;var r=new OffscreenCanvas(1,1),e=r.getContext("2d");e.fillRect(0,0,1,1);var a=r.transferToImageBitmap();try{e.createPattern(a,"no-repeat")}catch{return!1}return!0}();function N(){}function x(r){var e=C.exports.Promise,a=e!==void 0?e:g.Promise;return typeof a=="function"?new a(r):(r(N,N),null)}var E=function(r,e){return{transform:function(a){if(r)return a;if(e.has(a))return e.get(a);var t=new OffscreenCanvas(a.width,a.height),o=t.getContext("2d");return o.drawImage(a,0,0),e.set(a,t),t},clear:function(){e.clear()}}}(V,new Map),F=function(){var r=Math.floor(16.666666666666668),e,a,t={},o=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(e=function(i){var l=Math.random();return t[l]=requestAnimationFrame(function n(s){o===s||o+r-1<s?(o=s,delete t[l],i()):t[l]=requestAnimationFrame(n)}),l},a=function(i){t[i]&&cancelAnimationFrame(t[i])}):(e=function(i){return setTimeout(i,r)},a=function(i){return clearTimeout(i)}),{frame:e,cancel:a}}(),Z=function(){var r,e,a={};function t(o){function i(l,n){o.postMessage({options:l||{},callback:n})}o.init=function(n){var s=n.transferControlToOffscreen();o.postMessage({canvas:s},[s])},o.fire=function(n,s,u){if(e)return i(n,null),e;var d=Math.random().toString(36).slice(2);return e=x(function(h){function f(m){m.data.callback===d&&(delete a[d],o.removeEventListener("message",f),e=null,E.clear(),u(),h())}o.addEventListener("message",f),i(n,d),a[d]=f.bind(null,{data:{callback:d}})}),e},o.reset=function(){o.postMessage({reset:!0});for(var n in a)a[n](),delete a[n]}}return function(){if(r)return r;if(!k&&A){var o=["var CONFETTI, SIZE = {}, module = {};","("+T.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
2
- `);try{r=new Worker(URL.createObjectURL(new Blob([o])))}catch(i){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",i),null}t(r)}return r}}(),q={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function H(r,e){return e?e(r):r}function G(r){return r!=null}function v(r,e,a){return H(r&&G(r[e])?r[e]:q[e],a)}function J(r){return r<0?0:Math.floor(r)}function K(r,e){return Math.floor(Math.random()*(e-r))+r}function S(r){return parseInt(r,16)}function Q(r){return r.map($)}function $(r){var e=String(r).replace(/[^0-9a-f]/gi,"");return e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),{r:S(e.substring(0,2)),g:S(e.substring(2,4)),b:S(e.substring(4,6))}}function X(r){var e=v(r,"origin",Object);return e.x=v(e,"x",Number),e.y=v(e,"y",Number),e}function Y(r){r.width=document.documentElement.clientWidth,r.height=document.documentElement.clientHeight}function ee(r){var e=r.getBoundingClientRect();r.width=e.width,r.height=e.height}function re(r){var e=document.createElement("canvas");return e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=r,e}function ae(r,e,a,t,o,i,l,n,s){r.save(),r.translate(e,a),r.rotate(i),r.scale(t,o),r.arc(0,0,1,l,n,s),r.restore()}function ne(r){var e=r.angle*(Math.PI/180),a=r.spread*(Math.PI/180);return{x:r.x,y:r.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:r.startVelocity*.5+Math.random()*r.startVelocity,angle2D:-e+(.5*a-Math.random()*a),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:r.color,shape:r.shape,tick:0,totalTicks:r.ticks,decay:r.decay,drift:r.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:r.gravity*3,ovalScalar:.6,scalar:r.scalar,flat:r.flat}}function te(r,e){e.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.x+10*e.scalar,e.wobbleY=e.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);var a=e.tick++/e.totalTicks,t=e.x+e.random*e.tiltCos,o=e.y+e.random*e.tiltSin,i=e.wobbleX+e.random*e.tiltCos,l=e.wobbleY+e.random*e.tiltSin;if(r.fillStyle="rgba("+e.color.r+", "+e.color.g+", "+e.color.b+", "+(1-a)+")",r.beginPath(),L&&e.shape.type==="path"&&typeof e.shape.path=="string"&&Array.isArray(e.shape.matrix))r.fill(ie(e.shape.path,e.shape.matrix,e.x,e.y,Math.abs(i-t)*.1,Math.abs(l-o)*.1,Math.PI/10*e.wobble));else if(e.shape.type==="bitmap"){var n=Math.PI/10*e.wobble,s=Math.abs(i-t)*.1,u=Math.abs(l-o)*.1,d=e.shape.bitmap.width*e.scalar,h=e.shape.bitmap.height*e.scalar,f=new DOMMatrix([Math.cos(n)*s,Math.sin(n)*s,-Math.sin(n)*u,Math.cos(n)*u,e.x,e.y]);f.multiplySelf(new DOMMatrix(e.shape.matrix));var m=r.createPattern(E.transform(e.shape.bitmap),"no-repeat");m.setTransform(f),r.globalAlpha=1-a,r.fillStyle=m,r.fillRect(e.x-d/2,e.y-h/2,d,h),r.globalAlpha=1}else if(e.shape==="circle")r.ellipse?r.ellipse(e.x,e.y,Math.abs(i-t)*e.ovalScalar,Math.abs(l-o)*e.ovalScalar,Math.PI/10*e.wobble,0,2*Math.PI):ae(r,e.x,e.y,Math.abs(i-t)*e.ovalScalar,Math.abs(l-o)*e.ovalScalar,Math.PI/10*e.wobble,0,2*Math.PI);else if(e.shape==="star")for(var c=Math.PI/2*3,M=4*e.scalar,p=8*e.scalar,y=e.x,w=e.y,I=5,b=Math.PI/I;I--;)y=e.x+Math.cos(c)*p,w=e.y+Math.sin(c)*p,r.lineTo(y,w),c+=b,y=e.x+Math.cos(c)*M,w=e.y+Math.sin(c)*M,r.lineTo(y,w),c+=b;else r.moveTo(Math.floor(e.x),Math.floor(e.y)),r.lineTo(Math.floor(e.wobbleX),Math.floor(o)),r.lineTo(Math.floor(i),Math.floor(l)),r.lineTo(Math.floor(t),Math.floor(e.wobbleY));return r.closePath(),r.fill(),e.tick<e.totalTicks}function oe(r,e,a,t,o){var i=e.slice(),l=r.getContext("2d"),n,s,u=x(function(d){function h(){n=s=null,l.clearRect(0,0,t.width,t.height),E.clear(),o(),d()}function f(){k&&!(t.width===P.width&&t.height===P.height)&&(t.width=r.width=P.width,t.height=r.height=P.height),!t.width&&!t.height&&(a(r),t.width=r.width,t.height=r.height),l.clearRect(0,0,t.width,t.height),i=i.filter(function(m){return te(l,m)}),i.length?n=F.frame(f):h()}n=F.frame(f),s=h});return{addFettis:function(d){return i=i.concat(d),u},canvas:r,promise:u,reset:function(){n&&F.cancel(n),s&&s()}}}function D(r,e){var a=!r,t=!!v(e||{},"resize"),o=!1,i=v(e,"disableForReducedMotion",Boolean),l=A&&!!v(e||{},"useWorker"),n=l?Z():null,s=a?Y:ee,u=r&&n?!!r.__confetti_initialized:!1,d=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,h;function f(c,M,p){for(var y=v(c,"particleCount",J),w=v(c,"angle",Number),I=v(c,"spread",Number),b=v(c,"startVelocity",Number),ce=v(c,"decay",Number),ue=v(c,"gravity",Number),he=v(c,"drift",Number),j=v(c,"colors",Q),de=v(c,"ticks",Number),U=v(c,"shapes"),fe=v(c,"scalar"),ve=!!v(c,"flat"),_=X(c),z=y,R=[],me=r.width*_.x,ge=r.height*_.y;z--;)R.push(ne({x:me,y:ge,angle:w,spread:I,startVelocity:b,color:j[z%j.length],shape:U[K(0,U.length)],ticks:de,decay:ce,gravity:ue,drift:he,scalar:fe,flat:ve}));return h?h.addFettis(R):(h=oe(r,R,s,M,p),h.promise)}function m(c){var M=i||v(c,"disableForReducedMotion",Boolean),p=v(c,"zIndex",Number);if(M&&d)return x(function(b){b()});a&&h?r=h.canvas:a&&!r&&(r=re(p),document.body.appendChild(r)),t&&!u&&s(r);var y={width:r.width,height:r.height};n&&!u&&n.init(r),u=!0,n&&(r.__confetti_initialized=!0);function w(){if(n){var b={getBoundingClientRect:function(){if(!a)return r.getBoundingClientRect()}};s(b),n.postMessage({resize:{width:b.width,height:b.height}});return}y.width=y.height=null}function I(){h=null,t&&(o=!1,g.removeEventListener("resize",w)),a&&r&&(document.body.contains(r)&&document.body.removeChild(r),r=null,u=!1)}return t&&!o&&(o=!0,g.addEventListener("resize",w,!1)),n?n.fire(c,y,I):f(c,y,I)}return m.reset=function(){n&&n.reset(),h&&h.reset()},m}var O;function W(){return O||(O=D(null,{useWorker:!0,resize:!0})),O}function ie(r,e,a,t,o,i,l){var n=new Path2D(r),s=new Path2D;s.addPath(n,new DOMMatrix(e));var u=new Path2D;return u.addPath(s,new DOMMatrix([Math.cos(l)*o,Math.sin(l)*o,-Math.sin(l)*i,Math.cos(l)*i,a,t])),u}function le(r){if(!L)throw new Error("path confetti are not supported in this browser");var e,a;typeof r=="string"?e=r:(e=r.path,a=r.matrix);var t=new Path2D(e),o=document.createElement("canvas"),i=o.getContext("2d");if(!a){for(var l=1e3,n=l,s=l,u=0,d=0,h,f,m=0;m<l;m+=2)for(var c=0;c<l;c+=2)i.isPointInPath(t,m,c,"nonzero")&&(n=Math.min(n,m),s=Math.min(s,c),u=Math.max(u,m),d=Math.max(d,c));h=u-n,f=d-s;var M=10,p=Math.min(M/h,M/f);a=[p,0,0,p,-Math.round(h/2+n)*p,-Math.round(f/2+s)*p]}return{type:"path",path:e,matrix:a}}function se(r){var e,a=1,t="#000000",o='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof r=="string"?e=r:(e=r.text,a="scalar"in r?r.scalar:a,o="fontFamily"in r?r.fontFamily:o,t="color"in r?r.color:t);var i=10*a,l=""+i+"px "+o,n=new OffscreenCanvas(i,i),s=n.getContext("2d");s.font=l;var u=s.measureText(e),d=Math.ceil(u.actualBoundingBoxRight+u.actualBoundingBoxLeft),h=Math.ceil(u.actualBoundingBoxAscent+u.actualBoundingBoxDescent),f=2,m=u.actualBoundingBoxLeft+f,c=u.actualBoundingBoxAscent+f;d+=f+f,h+=f+f,n=new OffscreenCanvas(d,h),s=n.getContext("2d"),s.font=l,s.fillStyle=t,s.fillText(e,m,c);var M=1/a;return{type:"bitmap",bitmap:n.transferToImageBitmap(),matrix:[M,0,0,M,-d*M/2,-h*M/2]}}C.exports=function(){return W().apply(this,arguments)},C.exports.reset=function(){W().reset()},C.exports.create=D,C.exports.shapeFromPath=le,C.exports.shapeFromText=se})(function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}}(),B,!1);const Me=B.exports;B.exports.create;export{Me as c};
1
+ (function(){try{var T=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},g=new Error().stack;g&&(T._sentryDebugIds=T._sentryDebugIds||{},T._sentryDebugIds[g]="e24bc9eb-e6ba-408a-9527-a37411f4204a",T._sentryDebugIdIdentifier="sentry-dbid-e24bc9eb-e6ba-408a-9527-a37411f4204a")}catch{}})();var B={};(function T(g,C,k,P){var A=!!(g.Worker&&g.Blob&&g.Promise&&g.OffscreenCanvas&&g.OffscreenCanvasRenderingContext2D&&g.HTMLCanvasElement&&g.HTMLCanvasElement.prototype.transferControlToOffscreen&&g.URL&&g.URL.createObjectURL),L=typeof Path2D=="function"&&typeof DOMMatrix=="function",V=(function(){if(!g.OffscreenCanvas)return!1;var r=new OffscreenCanvas(1,1),e=r.getContext("2d");e.fillRect(0,0,1,1);var a=r.transferToImageBitmap();try{e.createPattern(a,"no-repeat")}catch{return!1}return!0})();function N(){}function x(r){var e=C.exports.Promise,a=e!==void 0?e:g.Promise;return typeof a=="function"?new a(r):(r(N,N),null)}var E=(function(r,e){return{transform:function(a){if(r)return a;if(e.has(a))return e.get(a);var t=new OffscreenCanvas(a.width,a.height),o=t.getContext("2d");return o.drawImage(a,0,0),e.set(a,t),t},clear:function(){e.clear()}}})(V,new Map),F=(function(){var r=Math.floor(16.666666666666668),e,a,t={},o=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(e=function(i){var l=Math.random();return t[l]=requestAnimationFrame(function n(s){o===s||o+r-1<s?(o=s,delete t[l],i()):t[l]=requestAnimationFrame(n)}),l},a=function(i){t[i]&&cancelAnimationFrame(t[i])}):(e=function(i){return setTimeout(i,r)},a=function(i){return clearTimeout(i)}),{frame:e,cancel:a}})(),Z=(function(){var r,e,a={};function t(o){function i(l,n){o.postMessage({options:l||{},callback:n})}o.init=function(n){var s=n.transferControlToOffscreen();o.postMessage({canvas:s},[s])},o.fire=function(n,s,u){if(e)return i(n,null),e;var d=Math.random().toString(36).slice(2);return e=x(function(h){function f(m){m.data.callback===d&&(delete a[d],o.removeEventListener("message",f),e=null,E.clear(),u(),h())}o.addEventListener("message",f),i(n,d),a[d]=f.bind(null,{data:{callback:d}})}),e},o.reset=function(){o.postMessage({reset:!0});for(var n in a)a[n](),delete a[n]}}return function(){if(r)return r;if(!k&&A){var o=["var CONFETTI, SIZE = {}, module = {};","("+T.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
2
+ `);try{r=new Worker(URL.createObjectURL(new Blob([o])))}catch(i){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("🎊 Could not load worker",i),null}t(r)}return r}})(),q={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function H(r,e){return e?e(r):r}function $(r){return r!=null}function v(r,e,a){return H(r&&$(r[e])?r[e]:q[e],a)}function G(r){return r<0?0:Math.floor(r)}function J(r,e){return Math.floor(Math.random()*(e-r))+r}function S(r){return parseInt(r,16)}function K(r){return r.map(Q)}function Q(r){var e=String(r).replace(/[^0-9a-f]/gi,"");return e.length<6&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),{r:S(e.substring(0,2)),g:S(e.substring(2,4)),b:S(e.substring(4,6))}}function X(r){var e=v(r,"origin",Object);return e.x=v(e,"x",Number),e.y=v(e,"y",Number),e}function Y(r){r.width=document.documentElement.clientWidth,r.height=document.documentElement.clientHeight}function ee(r){var e=r.getBoundingClientRect();r.width=e.width,r.height=e.height}function re(r){var e=document.createElement("canvas");return e.style.position="fixed",e.style.top="0px",e.style.left="0px",e.style.pointerEvents="none",e.style.zIndex=r,e}function ae(r,e,a,t,o,i,l,n,s){r.save(),r.translate(e,a),r.rotate(i),r.scale(t,o),r.arc(0,0,1,l,n,s),r.restore()}function ne(r){var e=r.angle*(Math.PI/180),a=r.spread*(Math.PI/180);return{x:r.x,y:r.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:r.startVelocity*.5+Math.random()*r.startVelocity,angle2D:-e+(.5*a-Math.random()*a),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:r.color,shape:r.shape,tick:0,totalTicks:r.ticks,decay:r.decay,drift:r.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:r.gravity*3,ovalScalar:.6,scalar:r.scalar,flat:r.flat}}function te(r,e){e.x+=Math.cos(e.angle2D)*e.velocity+e.drift,e.y+=Math.sin(e.angle2D)*e.velocity+e.gravity,e.velocity*=e.decay,e.flat?(e.wobble=0,e.wobbleX=e.x+10*e.scalar,e.wobbleY=e.y+10*e.scalar,e.tiltSin=0,e.tiltCos=0,e.random=1):(e.wobble+=e.wobbleSpeed,e.wobbleX=e.x+10*e.scalar*Math.cos(e.wobble),e.wobbleY=e.y+10*e.scalar*Math.sin(e.wobble),e.tiltAngle+=.1,e.tiltSin=Math.sin(e.tiltAngle),e.tiltCos=Math.cos(e.tiltAngle),e.random=Math.random()+2);var a=e.tick++/e.totalTicks,t=e.x+e.random*e.tiltCos,o=e.y+e.random*e.tiltSin,i=e.wobbleX+e.random*e.tiltCos,l=e.wobbleY+e.random*e.tiltSin;if(r.fillStyle="rgba("+e.color.r+", "+e.color.g+", "+e.color.b+", "+(1-a)+")",r.beginPath(),L&&e.shape.type==="path"&&typeof e.shape.path=="string"&&Array.isArray(e.shape.matrix))r.fill(ie(e.shape.path,e.shape.matrix,e.x,e.y,Math.abs(i-t)*.1,Math.abs(l-o)*.1,Math.PI/10*e.wobble));else if(e.shape.type==="bitmap"){var n=Math.PI/10*e.wobble,s=Math.abs(i-t)*.1,u=Math.abs(l-o)*.1,d=e.shape.bitmap.width*e.scalar,h=e.shape.bitmap.height*e.scalar,f=new DOMMatrix([Math.cos(n)*s,Math.sin(n)*s,-Math.sin(n)*u,Math.cos(n)*u,e.x,e.y]);f.multiplySelf(new DOMMatrix(e.shape.matrix));var m=r.createPattern(E.transform(e.shape.bitmap),"no-repeat");m.setTransform(f),r.globalAlpha=1-a,r.fillStyle=m,r.fillRect(e.x-d/2,e.y-h/2,d,h),r.globalAlpha=1}else if(e.shape==="circle")r.ellipse?r.ellipse(e.x,e.y,Math.abs(i-t)*e.ovalScalar,Math.abs(l-o)*e.ovalScalar,Math.PI/10*e.wobble,0,2*Math.PI):ae(r,e.x,e.y,Math.abs(i-t)*e.ovalScalar,Math.abs(l-o)*e.ovalScalar,Math.PI/10*e.wobble,0,2*Math.PI);else if(e.shape==="star")for(var c=Math.PI/2*3,M=4*e.scalar,b=8*e.scalar,p=e.x,w=e.y,I=5,y=Math.PI/I;I--;)p=e.x+Math.cos(c)*b,w=e.y+Math.sin(c)*b,r.lineTo(p,w),c+=y,p=e.x+Math.cos(c)*M,w=e.y+Math.sin(c)*M,r.lineTo(p,w),c+=y;else r.moveTo(Math.floor(e.x),Math.floor(e.y)),r.lineTo(Math.floor(e.wobbleX),Math.floor(o)),r.lineTo(Math.floor(i),Math.floor(l)),r.lineTo(Math.floor(t),Math.floor(e.wobbleY));return r.closePath(),r.fill(),e.tick<e.totalTicks}function oe(r,e,a,t,o){var i=e.slice(),l=r.getContext("2d"),n,s,u=x(function(d){function h(){n=s=null,l.clearRect(0,0,t.width,t.height),E.clear(),o(),d()}function f(){k&&!(t.width===P.width&&t.height===P.height)&&(t.width=r.width=P.width,t.height=r.height=P.height),!t.width&&!t.height&&(a(r),t.width=r.width,t.height=r.height),l.clearRect(0,0,t.width,t.height),i=i.filter(function(m){return te(l,m)}),i.length?n=F.frame(f):h()}n=F.frame(f),s=h});return{addFettis:function(d){return i=i.concat(d),u},canvas:r,promise:u,reset:function(){n&&F.cancel(n),s&&s()}}}function D(r,e){var a=!r,t=!!v(e||{},"resize"),o=!1,i=v(e,"disableForReducedMotion",Boolean),l=A&&!!v(e||{},"useWorker"),n=l?Z():null,s=a?Y:ee,u=r&&n?!!r.__confetti_initialized:!1,d=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,h;function f(c,M,b){for(var p=v(c,"particleCount",G),w=v(c,"angle",Number),I=v(c,"spread",Number),y=v(c,"startVelocity",Number),ce=v(c,"decay",Number),ue=v(c,"gravity",Number),he=v(c,"drift",Number),j=v(c,"colors",K),de=v(c,"ticks",Number),U=v(c,"shapes"),fe=v(c,"scalar"),ve=!!v(c,"flat"),_=X(c),z=p,R=[],me=r.width*_.x,ge=r.height*_.y;z--;)R.push(ne({x:me,y:ge,angle:w,spread:I,startVelocity:y,color:j[z%j.length],shape:U[J(0,U.length)],ticks:de,decay:ce,gravity:ue,drift:he,scalar:fe,flat:ve}));return h?h.addFettis(R):(h=oe(r,R,s,M,b),h.promise)}function m(c){var M=i||v(c,"disableForReducedMotion",Boolean),b=v(c,"zIndex",Number);if(M&&d)return x(function(y){y()});a&&h?r=h.canvas:a&&!r&&(r=re(b),document.body.appendChild(r)),t&&!u&&s(r);var p={width:r.width,height:r.height};n&&!u&&n.init(r),u=!0,n&&(r.__confetti_initialized=!0);function w(){if(n){var y={getBoundingClientRect:function(){if(!a)return r.getBoundingClientRect()}};s(y),n.postMessage({resize:{width:y.width,height:y.height}});return}p.width=p.height=null}function I(){h=null,t&&(o=!1,g.removeEventListener("resize",w)),a&&r&&(document.body.contains(r)&&document.body.removeChild(r),r=null,u=!1)}return t&&!o&&(o=!0,g.addEventListener("resize",w,!1)),n?n.fire(c,p,I):f(c,p,I)}return m.reset=function(){n&&n.reset(),h&&h.reset()},m}var O;function W(){return O||(O=D(null,{useWorker:!0,resize:!0})),O}function ie(r,e,a,t,o,i,l){var n=new Path2D(r),s=new Path2D;s.addPath(n,new DOMMatrix(e));var u=new Path2D;return u.addPath(s,new DOMMatrix([Math.cos(l)*o,Math.sin(l)*o,-Math.sin(l)*i,Math.cos(l)*i,a,t])),u}function le(r){if(!L)throw new Error("path confetti are not supported in this browser");var e,a;typeof r=="string"?e=r:(e=r.path,a=r.matrix);var t=new Path2D(e),o=document.createElement("canvas"),i=o.getContext("2d");if(!a){for(var l=1e3,n=l,s=l,u=0,d=0,h,f,m=0;m<l;m+=2)for(var c=0;c<l;c+=2)i.isPointInPath(t,m,c,"nonzero")&&(n=Math.min(n,m),s=Math.min(s,c),u=Math.max(u,m),d=Math.max(d,c));h=u-n,f=d-s;var M=10,b=Math.min(M/h,M/f);a=[b,0,0,b,-Math.round(h/2+n)*b,-Math.round(f/2+s)*b]}return{type:"path",path:e,matrix:a}}function se(r){var e,a=1,t="#000000",o='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof r=="string"?e=r:(e=r.text,a="scalar"in r?r.scalar:a,o="fontFamily"in r?r.fontFamily:o,t="color"in r?r.color:t);var i=10*a,l=""+i+"px "+o,n=new OffscreenCanvas(i,i),s=n.getContext("2d");s.font=l;var u=s.measureText(e),d=Math.ceil(u.actualBoundingBoxRight+u.actualBoundingBoxLeft),h=Math.ceil(u.actualBoundingBoxAscent+u.actualBoundingBoxDescent),f=2,m=u.actualBoundingBoxLeft+f,c=u.actualBoundingBoxAscent+f;d+=f+f,h+=f+f,n=new OffscreenCanvas(d,h),s=n.getContext("2d"),s.font=l,s.fillStyle=t,s.fillText(e,m,c);var M=1/a;return{type:"bitmap",bitmap:n.transferToImageBitmap(),matrix:[M,0,0,M,-d*M/2,-h*M/2]}}C.exports=function(){return W().apply(this,arguments)},C.exports.reset=function(){W().reset()},C.exports.create=D,C.exports.shapeFromPath=le,C.exports.shapeFromText=se})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),B,!1);const Me=B.exports;B.exports.create;export{Me as c};
3
3
  //# sourceMappingURL=vendor.canvas-confetti.js.map