HEX
Server: Apache/2.4.25
System: Linux ion14 4.9.0-8-amd64 #1 SMP Debian 4.9.144-3.1 (2019-02-19) x86_64
User: (10087)
PHP: 7.4.30
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,system, exec, shell_exec, passthru, popen, proc_open
Upload Files
File: /home/www/web115/wordpress/wp-content/themes/neve/assets/apps/dashboard/build/dashboard.js
(()=>{var e,t={672:(e,t,n)=>{"use strict";const r=window.wp.element,a=window.wp.data;var s=n(247),i=n.n(s);const o=window.wp.i18n,l=window.wp.api,c=()=>{let e;return l.loadPromise.then((()=>(e=new l.models.Settings,e.fetch())))},d=(e,t,n=!1,r=!0)=>{e=(r?"nv_pro_":"")+e+(n?"_status":"");const a=new l.models.Settings({[e]:t});return new Promise((n=>{a.save().then((r=>{r&&!r[e]!==t||n({success:!1}),n(m(e,r))}))}))},u=(e,t=!1,n=!0)=>p(e,t,{},"GET",n),p=async(e,t=!1,n={},r="POST",a=!0)=>{const s={method:r,headers:{Accept:"application/json","Content-Type":"application/json"}};return a&&(s.headers["x-wp-nonce"]=neveDash.nonce),"POST"===r&&(s.body=JSON.stringify(n)),await fetch(e,s).then((e=>t?e:e.json()))},m=(e,t)=>"nv_pro_typekit_id"!==e||t.neve_pro_typekit_data?{success:!0}:{message:(0,o.__)("Typekit Project ID is invalid","neve"),success:!1},h=window.wp.components,f=({labels:e={},pluginData:t,successActivation:n,autoInstall:a=!1,smallButton:s=!1,description:i})=>{const{slug:l,pluginState:c,activateURL:d,name:p}=t,{getPluginStateBaseURL:m,pluginsURL:f,canInstallPlugins:g,canActivatePlugins:b,isOtterProInstalled:v}=neveDash,[_,y]=(0,r.useState)(!1),[w,k]=(0,r.useState)(!1),[x,E]=(0,r.useState)(c),[j,N]=(0,r.useState)({firstLabel:!1,installing:`${(0,o.__)("Installing","neve")}...`,activating:`${(0,o.__)("Activating","neve")}...`,installActivate:(0,o.__)("Install and Activate","neve"),activate:(0,o.__)("Activate","neve")});(0,r.useEffect)((()=>{var t;t=e,N({...j,...!1!==t.firstLabel&&{firstLabel:t.firstLabel},...t.installing&&{installing:t.installing},...t.activating&&{activating:t.activating},...t.installActivate&&{installActivate:t.installActivate},...t.activate&&{activate:t.activate}})}),[]);const C=e=>_||!j.firstLabel?j[e]:j.firstLabel,S=()=>{N({...j,firstLabel:!1})},I=()=>{y("installing"),S(),wp.updates.ajax("install-plugin",{slug:l,success:()=>{T()},error:e=>{"folder_exists"===e.errorCode?T():k(e.errorMessage||(0,o.__)("Something went wrong while installing the plugin.","neve"))}})},T=()=>{y("activating"),E("activate"),S(),d?u(d,!0).then((e=>{e.ok?"updateState"===n(E)&&L():k((0,o.__)("Could not activate plugin.","neve"))})):window.location.href=f};(0,r.useEffect)((()=>{a&&("install"===x&&I(),"activate"===x&&T())}),[a]);const L=()=>{u(`${m}${l}`,!1,!0).then((e=>{E(e.state)}))},O=e=>_===e;return w?(0,r.createElement)("h1",{className:"error"},w):(()=>{const e=g&&b,n=()=>!e&&("install"===x&&!g||"activate"===x&&!b||!("otter-blocks"!==t.slug&&"otter-pro"!==t.slug||v)&&!g),a=()=>!!_||n(),l={install:(0,r.createElement)(h.Button,{disabled:a(),isPrimary:!O("installing"),isSmall:s,isSecondary:O("installing"),className:O("installing")&&"is-loading",icon:O("installing")&&"update",onClick:I},O("installing")?C("installing"):C("installActivate")),activate:d&&(0,r.createElement)(h.Button,{disabled:a(),isSmall:s,isPrimary:!O("activating"),isSecondary:O("activating"),className:O("activating")&&"is-loading",icon:O("activating")&&"update",onClick:T},O("activating")?C("activating"):C("activate"))},c=n()?(0,r.createElement)(h.Tooltip,{text:(0,o.sprintf)(// translators: %s: Plugin name.
(0,o.__)("Ask your admin to enable %s on your site","neve"),p),position:"top center"},l[x]):l[x];return(0,r.createElement)(r.Fragment,null,i,l.hasOwnProperty(x)&&c)})()},g=(0,a.withSelect)((e=>{const{getPlugins:t}=e("neve-dashboard");return{templatesPluginData:t()["templates-patterns-collection"]}}))((({templatesPluginData:e})=>{const{tpcPath:t,tpcAdminURL:n,canInstallPlugins:a,assets:s}=neveDash,i=n+(a?"&onboarding=yes":""),o=(null==e?void 0:e.cta)||"install";return(0,r.createElement)("div",{className:"unavailable-starter-sites"},(0,r.createElement)("div",{className:"ss-background",style:{backgroundImage:`url(${s}/starter.jpg)`}}),(0,r.createElement)("div",{className:"content-wrap"},(0,r.createElement)(f,{pluginData:{name:"Cloud Templates & Patterns Collection",slug:"templates-patterns-collection",pluginBasename:t,pluginState:o,activateURL:(null==e?void 0:e.activate)||""},successActivation:()=>{window.location.href=i},successUpdate:()=>{window.location.href=i},description:(0,r.createElement)(r.Fragment,null,(0,r.createElement)("h1",null,"deactivate"===o?neveDash.strings.starterSitesUnavailableUpdate:neveDash.strings.starterSitesUnavailableActive),(0,r.createElement)("br",null))})))})),b=window.wp.compose,v=(0,b.compose)((0,a.withSelect)((e=>{const{getLicense:t}=e("neve-dashboard");return{license:t()}})))((({license:e,setTab:t})=>{const{customLayoutsNeveProURL:n,assets:a}=neveDash,s=neveDash.pro||neveDash.hasOldPro,i=s?(0,o.__)("Activate","neve"):(0,o.__)("Free vs Pro","neve");return(0,r.useEffect)((()=>{e&&"valid"===e.valid&&(t("pro"),window.location.href="edit.php?post_type=neve_custom_layouts")}),[e]),(0,r.createElement)("div",{className:"unavailable-custom-layouts"},(0,r.createElement)("div",{className:"ss-background",style:{backgroundImage:`url(${a}/starter.jpg)`}}),(0,r.createElement)("div",{className:"content-wrap"},(0,r.createElement)("img",{src:`${a}/logo.svg`,alt:"Neve"}),(0,r.createElement)("h1",null,(0,o.__)("Custom Layouts","neve")),(0,r.createElement)("p",null,(0,o.__)("Get access to all Pro features and power-up your website","neve")),(0,r.createElement)("iframe",{width:"560",height:"315",src:"https://www.youtube.com/embed/4XFoSHTHpes",title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0}),(0,r.createElement)(h.Button,{target:"_blank",rel:"external noreferrer noopener",href:n,variant:"primary"},(0,o.__)("Get Neve Pro Now","neve"),(0,r.createElement)("span",{className:"components-visually-hidden"},(0,o.__)("(opens in a new tab)","neve"))),(0,r.createElement)(h.Button,{variant:"link",onClick:s?()=>{t("pro")}:()=>{t("free-pro")}},i)))}));var _=n(184),y=n.n(_);const w=e=>{const{icon:t,iconAlt:n,title:a,description:s,children:i,classNames:o,dashicon:l,lockIcon:c}=e;return(0,r.createElement)("div",{className:y()(["card",o])},c&&(0,r.createElement)(h.Icon,{className:"icon dashicon",icon:"lock"}),(0,r.createElement)("div",{className:"card-header"},t&&(l?(0,r.createElement)(h.Icon,{className:"icon dashicon",icon:t}):(0,r.createElement)("img",{className:"icon",src:t,alt:n||"icon"})),a&&(0,r.createElement)("h3",{className:"title"},a)),(0,r.createElement)("div",{className:"card-content"},s&&(0,r.createElement)("p",{className:"card-description"},s),i))},k=(0,a.withSelect)((e=>{const{getLicenseTier:t}=e("neve-dashboard");return{tier:t()}}))((e=>{const{setTab:t,tier:n}=e,{pro:a,whiteLabel:s,customizerShortcuts:i,tpcAdminURL:l}=neveDash,c=s&&s.hideStarterSites;return(0,r.createElement)(r.Fragment,null,!c&&(0,r.createElement)(w,{icon:neveDash.assets+"squares.svg",title:(0,o.__)("Starter Sites","neve"),description:neveDash.strings.starterSitesCardDescription},!neveDash.isValidLicense&&(0,r.createElement)("p",null,neveDash.strings.starterSitesCardUpsellMessage),(0,r.createElement)("div",{className:"card-button-wrap"},F["starter-sites"]?(0,r.createElement)(h.Button,{isPrimary:!0,onClick:()=>{t("starter-sites")}},(0,o.__)("Go to Starter Sites","neve")):(0,r.createElement)(h.Button,{href:l,isPrimary:!0},(0,o.__)("Go to Starter Sites","neve")),!neveDash.isValidLicense&&(0,r.createElement)(h.Button,{target:"_blank",rel:"external noreferrer noopener",href:neveDash.startSitesgetNeveProURL,isSecondary:!0},(0,o.__)("Get Neve Pro","neve"),(0,r.createElement)("span",{className:"components-visually-hidden"},(0,o.__)("(opens in a new tab)","neve"))))),(0,r.createElement)(w,{classNames:"customizer-quick-links",icon:neveDash.assets+"compass.svg",title:(0,o.__)("Customizer quick links","neve")},(()=>{const e=Math.ceil(i.length/2),t=[i.slice(0,e),i.slice(e)];return(0,r.createElement)("div",{className:"columns"},t.map(((e,t)=>(0,r.createElement)("div",{className:"col",key:t},e.map(((t,n)=>(0,r.createElement)(r.Fragment,{key:n},(0,r.createElement)(h.Button,{isLink:!0,href:t.link},t.text),n!==e.length-1&&(0,r.createElement)("hr",null))))))))})()),!s&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(w,{icon:neveDash.assets+"page.svg",title:(0,o.__)("Getting Started? Check help and docs","neve"),description:(0,o.__)("Need more details? Please check our full documentation for detailed information on how to use Neve.","neve")},(0,r.createElement)(h.Button,{isLink:!0,onClick:()=>t("help")},(0,o.__)("Go to docs","neve"))),(0,r.createElement)(w,{icon:neveDash.assets+"template-cloud.svg",title:"Templates Cloud",lockIcon:!a,description:(0,o.__)("Boost productivity and speed up your workflow by saving all your designs and share them automatically to all your sites in 1-click.","neve")},3!==n&&(0,r.createElement)(h.ExternalLink,{href:"https://docs.themeisle.com/article/1354-neve-template-cloud-library"},(0,o.__)("Discover Templates Cloud","neve")),3===n&&(0,r.createElement)(h.ExternalLink,{href:"https://docs.themeisle.com/article/1354-neve-template-cloud-library"},(0,o.__)("Learn how to use Templates Cloud","neve")))),!a&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)(w,{classNames:"woo-card",icon:"cart",dashicon:!0,lockIcon:!0,title:(0,o.__)("WooCommerce Booster","neve"),description:(0,o.__)("Empower your online store with awesome new features, specially designed for a smooth WooCommerce integration.","neve")},(0,r.createElement)(h.ExternalLink,{href:"https://docs.themeisle.com/article/1058-woocommerce-booster-documentation"},(0,o.__)("Learn more","neve"))),(0,r.createElement)(w,{classNames:"block-editor-card",icon:"block-default",dashicon:!0,lockIcon:!0,title:(0,o.__)("Block Editor Booster","neve"),description:(0,o.__)("Enhance your Gutenberg experience with new blocks, including Business Hours, Popup, Review Comparison Table and more.","neve")},(0,r.createElement)(h.ExternalLink,{href:"https://docs.themeisle.com/article/1473-neve-block-editor-booster-module"},(0,o.__)("Learn more","neve")))))})),x=e=>{const{isOpen:t,title:n,slug:a,children:s}=e,i=a?"seen"===window.localStorage.getItem(a):null,[o,l]=(0,r.useState)(!i&&t),c=y()(["accordion",{open:o,closed:!o}]);return(0,r.createElement)("div",{className:c},(0,r.createElement)("button",{"aria-expanded":o,className:"accordion-header",onClick:()=>{o&&!i&&void 0!==a&&window.localStorage.setItem(a,"seen"),l(!o)}},n&&(0,r.createElement)("div",{className:"accordion-title"},n),(0,r.createElement)(h.Dashicon,{icon:o?"arrow-up-alt2":"arrow-down-alt2"})),(0,r.createElement)("div",{className:"accordion-body",style:{height:o?"auto":"0px"}},s&&s))},E=(0,b.compose)((0,a.withSelect)((e=>{const{getProOption:t}=e("neve-dashboard");return{getOption:e=>t(e)}})),(0,a.withDispatch)((e=>{const{changeModuleOption:t,setToast:n}=e("neve-dashboard");return{changeOption:(e,n)=>t(e,n),setToast:e=>n(e)}})))((({slug:e,label:t,placeholder:n,getOption:a,setToast:s,changeOption:i})=>{const[l,c]=(0,r.useState)(a(e)),[u,p]=(0,r.useState)(!1);return(0,r.createElement)("div",{className:"module-option text"},(0,r.createElement)("form",{onSubmit:t=>{t.preventDefault(),p(!0),d(e,l).then((t=>{if(t.success)return i(e,l),s(!0),p(!1),!1;s(!!t.message&&t.message),p(!1)}))}},t&&(0,r.createElement)("label",{htmlFor:e},t),(0,r.createElement)("div",{className:"input-wrap"},(0,r.createElement)("input",{id:e,placeholder:n,value:l,onChange:t=>{var n;c(t.target.value),"typekit_id"===e&&(null===(n=window.tiTrk)||void 0===n||n.with("neve").add({feature:"typekit-fonts",featureComponent:"typekit-id",featureValue:"enabled"}))}}),(0,r.createElement)("div",{className:"actions"},(0,r.createElement)(h.Button,{className:u?"is-loading":null,type:"submit",disabled:u,label:(0,o.__)("Save","neve"),icon:u?"update":"editor-break"})))))})),j=(0,b.compose)((0,a.withSelect)((e=>{const{getProOption:t}=e("neve-dashboard");return{getOption:e=>t(e)}})),(0,a.withDispatch)((e=>{const{changeModuleOption:t,setToast:n}=e("neve-dashboard");return{changeOption:(e,n)=>t(e,n),setToast:e=>n(e)}})))((({slug:e,label:t,choices:n,getOption:a,changeOption:s,setToast:i})=>(0,r.createElement)("div",{className:"module-option toggle"},(0,r.createElement)(h.SelectControl,{style:{minWidth:"200px"},label:t,value:a(e)||"css",onChange:t=>{var n;null===(n=window.tiTrk)||void 0===n||n.with("neve").set(e,{feature:"module-settings",featureComponent:e,featureValue:t}),d(e,t).then((n=>{if(n.success)return s(e,t),i(!0),!1;i(!1)}))},options:Object.keys(n).map((e=>({label:n[e],value:e})))})))),N=(0,b.compose)((0,a.withSelect)((e=>{const{getProOption:t}=e("neve-dashboard");return{getOption:e=>t(e)}})),(0,a.withDispatch)((e=>{const{changeModuleOption:t,setToast:n}=e("neve-dashboard");return{changeOption:(e,n)=>t(e,n),setToast:e=>n(e)}})))((({slug:e,label:t,documentation:n,getOption:a,changeOption:s,setToast:i})=>{const[o,l]=(0,r.useState)(!1);return(0,r.createElement)("div",{className:"module-option toggle"},(0,r.createElement)(h.ToggleControl,{checked:a(e)||!1,label:t,onChange:t=>{var n;l(!0),null===(n=window.tiTrk)||void 0===n||n.with("neve").set(e,{feature:"module-settings",featureComponent:e,featureValue:t}),d(e,t).then((n=>{if(n.success)return s(e,t),i(!0),l(!1),!1;i(!1),l(!1)}))}}),". "," ",!neveDash.whiteLabel&&n&&n.url&&(0,r.createElement)(h.ExternalLink,{href:n.url},n.label),o&&(0,r.createElement)(h.Dashicon,{size:18,icon:"update",className:"is-loading"}))})),C=window.wp.neve.components,S=(0,b.compose)((0,a.withSelect)((e=>{const{getProOption:t}=e("neve-dashboard");return{getOption:e=>t(e)}})),(0,a.withDispatch)((e=>{const{changeModuleOption:t,setToast:n}=e("neve-dashboard");return{changeOption:(e,n)=>t(e,n),setToast:e=>n(e)}})))((({slug:e,label:t,choices:n,getOption:a,changeOption:s,setToast:i})=>(0,r.createElement)("div",{className:"module-option neve-multiselect"},(0,r.createElement)(C.MultiSelect,{style:{minWidth:"200px"},label:t,choices:n,currentValue:a(e)||["category"],onChange:t=>{var n;null===(n=window.tiTrk)||void 0===n||n.with("neve").set(e,{feature:"module-settings",featureComponent:e,featureValue:t}),d(e,t).then((n=>{if(n.success)return s(e,t),i(!0),!1;i(!1)}))}})))),I=window.React,T=(0,b.compose)((0,a.withDispatch)((e=>{const{changeModuleStatus:t}=e("neve-dashboard");return{changeModuleStatus:t}})))((({slug:e,plugins:t,buttonLabels:n,changeModuleStatus:a})=>{t=t.filter((e=>["install","activate"].includes(e.pluginState)));const s=t.length>0,[i,o]=(0,r.useState)(0),[l,c]=(0,r.useState)(!1),[d,u]=(0,r.useState)(s),p=t[i];return(0,I.useEffect)((()=>{s&&a(e,!1)}),[]),d&&["install","activate"].includes(p.pluginState)&&(0,r.createElement)(f,{labels:n[p.slug],pluginData:p,autoInstall:l,successActivation:n=>{if(t.length-1===i)return u(!1),void a(e,!0);o(i+1),n(p.pluginState),c(!0)}})})),L=({slug:e})=>((0,r.useEffect)((()=>{window.dispatchEvent(new CustomEvent("neve-dashboard-react-placeholder",{detail:{slug:e}}))}),[]),(0,r.createElement)("div",{id:e})),O=(0,b.compose)((0,a.withSelect)((e=>{const{getModuleStatus:t,getLicenseTier:n,getProOption:r}=e("neve-dashboard");return{getOption:e=>r(e),getModuleStatus:e=>t(e),tier:n()}})),(0,a.withDispatch)((e=>{const{changeModuleStatus:t,setToast:n}=e("neve-dashboard");return{changeModuleStatus:(e,n)=>t(e,n),setToast:e=>n(e)}})))((({slug:e,setToast:t,getOption:n,changeModuleStatus:a,getModuleStatus:s,tier:i})=>{const[l,c]=(0,r.useState)(!1),{nicename:u,description:p,availabilityLevel:m,options:f,links:g,documentation:b,required_actions:v,manageableDependentPlugins:_,manageablePluginsLabels:w,dependentPlugins:k}=neveDash.modules[e],{upgradeLinks:C}=neveDash,I=e=>n(e);return(0,r.createElement)("div",{className:y()(["card","module-card",e])},(0,r.createElement)("div",{className:"card-header"},(0,r.createElement)("h3",{className:"title"},u),(0,r.createElement)("div",{className:"toggle-wrap"},i<m?(0,r.createElement)(h.Button,{isPrimary:!0,href:C[m]},(0,o.__)("Upgrade","neve")):(0,r.createElement)(r.Fragment,null,v&&!_&&(0,r.createElement)("span",{className:"required",dangerouslySetInnerHTML:{__html:v}}),l&&(0,r.createElement)(h.Dashicon,{size:18,icon:"update",className:"is-loading"}),_&&(0,r.createElement)(T,{slug:e,plugins:k,buttonLabels:w}),!v&&"block_editor_booster"!==e&&(0,r.createElement)(h.ToggleControl,{checked:s(e)||!1,onChange:n=>{c(!0),d(e,n,!0).then((r=>{if(r.success)return a(e,n),c(!1),t((n?(0,o.__)("Module Activated","neve"):(0,o.__)("Module Deactivated.","neve"))+` (${u})`),!1;c(!1),t((0,o.__)("Could not activate module. Please try again.","neve"))}))}})))),(0,r.createElement)("div",{className:"card-content"},(0,r.createElement)("p",{className:"card-description"},p+" ",b.url&&(0,r.createElement)(h.ExternalLink,{href:b.url},(0,o.__)("Learn More","neve"))),g&&s(e)&&(0,r.createElement)("div",{className:"actions"},g.map(((e,t)=>(0,r.createElement)(h.Button,{key:t,isSecondary:!0,href:e.url},e.label)))),0<f.length&&!0===s(e)&&-1<i&&(0,r.createElement)("div",{className:"module-options"},f.map(((t,n)=>{const{label:a,options:i}=t;return(0,r.createElement)(x,{key:n,title:a,slug:e,isOpen:!!s(e)&&!v},(0,r.createElement)("div",null,Object.keys(i).map(((e,t)=>{const{label:n,type:a,placeholder:s,documentation:o,choices:l,depends_on:c}=i[e];return(0,r.createElement)(r.Fragment,{key:t},"text"===a&&(0,r.createElement)(E,{label:n,slug:e,placeholder:s}),"toggle"===a&&(0,r.createElement)(N,{label:n,slug:e,documentation:o}),"select"===a&&(0,r.createElement)(j,{label:n,slug:e,choices:l}),("multi_select"===a&&void 0===c||"multi_select"===a&&I(c))&&(0,r.createElement)(S,{label:n,slug:e,choices:l}),("react"===a&&void 0===c||"react"===a&&I(c))&&(0,r.createElement)(L,{slug:e}))}))))})))))})),D=()=>{const{modules:e,hasOldPro:t,strings:n}=neveDash;return t?(0,r.createElement)("div",{className:"col"},(0,r.createElement)("div",{className:"card"},(0,r.createElement)("h2",null,n.updateOldPro))):(0,r.createElement)("div",{className:"col"},Object.keys(e).map(((e,t)=>(0,r.createElement)(O,{key:t,slug:e}))))},A=(0,a.withDispatch)((e=>{const{setPluginState:t}=e("neve-dashboard");return{setPluginState:(e,n)=>t(e,n)}}))((({slug:e,data:t,setPluginState:n})=>{const{banner:a,name:s,description:i,version:l,author:c,url:d,premium:p,network:m}=t,{canInstallPlugins:f,canActivatePlugins:g}=neveDash,b=t.cta,[v,_]=(0,r.useState)(!1),w={install:{static:(0,o.__)("Install","neve"),progress:(0,o.__)("Installing","neve")},activate:{static:(0,o.__)("Activate","neve"),progress:(0,o.__)("Activating","neve")},deactivate:{static:(0,o.__)("Deactivate","neve"),progress:(0,o.__)("Deactivating","neve")},external:(0,o.__)("Learn More","neve")},k=()=>"external"===b?null:(0,r.createElement)(h.Button,{className:"plugin-action",isPrimary:["install","activate"].includes(b),isSecondary:"deactivate"===b,disabled:!!v||x,onClick:()=>{if(_(!0),"install"===b)return(e=>new Promise((t=>{wp.updates.ajax("install-plugin",{slug:e,success:()=>{t({success:!0})},error:()=>{t({success:!1})}})})))(e).then((t=>{if(!t.success)return _(!1),!1;_(!1),n(e,"activate")})),!1;u(t[b],!0).then((t=>{if(!t.ok)return _(!1),!1;n(e,"activate"===b?"deactivate":"activate"),"templates-patterns-collection"===e&&(window.location.href=neveDash.tpcAdminURL+(neveDash.canInstallPlugins?"&onboarding=yes":"")),_(!1)}))}},!v&&w[b].static,v&&(0,r.createElement)("span",{style:{display:"flex",alignItems:"center"}},(0,r.createElement)(h.Dashicon,{icon:"update"}),w[b].progress+"...")),x=!f&&"install"===b||!g&&"activate"===b||m&&"deactivate"===b||!1,E=x?(0,r.createElement)(h.Tooltip,{text:(0,o.sprintf)(// translators: %s: Plugin name.
(0,o.__)("Ask your admin to handle %s on your site","neve"),s),position:"top center"},k()):k();return(0,r.createElement)("div",{className:y()(["card","plugin",e])},(0,r.createElement)("div",{className:"card-header"},(0,r.createElement)("img",{src:a,alt:(0,o.__)("Banner Image","name")}),p&&(0,r.createElement)("span",{className:"premium-label"},"Premium")),(0,r.createElement)("div",{className:"card-body"},(0,r.createElement)("h3",{className:"card-title"},s),(0,r.createElement)("p",{className:"card-description"},i)),(0,r.createElement)("div",{className:"card-footer"},(0,r.createElement)("div",{className:"plugin-data"},l&&(0,r.createElement)("span",{className:"version"},"v",l," | "),c&&(0,r.createElement)("span",{className:"author"},c)),E,"external"===b&&(0,r.createElement)(h.ExternalLink,{className:"plugin-action",href:d},w[b])))})),M=(0,a.withSelect)((e=>{const{getPlugins:t}=e("neve-dashboard");return{plugins:t()}}))((({plugins:e})=>e?(0,r.createElement)(r.Fragment,null,Object.keys(e).map((t=>(0,r.createElement)(A,{key:t,slug:t,data:e[t]})))):null)),P=e=>{const{setTab:t}=e;let{docsURL:n,codexURL:a,supportURL:s,whiteLabel:i,assets:l}=neveDash;const{supportCardDescription:c,docsCardDescription:d}=neveDash.strings;return i&&i.agencyURL&&(s=i.agencyURL,n=i.agencyURL),(0,r.createElement)(r.Fragment,null,!i&&(0,r.createElement)(w,{icon:l+"arrows.svg",title:(0,o.__)("Build a landing page with a drag-and-drop content builder","neve"),description:(0,o.__)("In the documentation below you will find an easy way to build a great looking landing page using a drag-and-drop content builder plugin.","neve")},(0,r.createElement)(h.ExternalLink,{href:"http://docs.themeisle.com/article/219-how-to-build-a-landing-page-with-a-drag-and-drop-content-builder"},(0,o.__)("Learn More","neve"))),(0,r.createElement)(w,{icon:l+"page.svg",title:(0,o.__)("Documentation","neve"),description:d},!i&&(0,r.createElement)(h.ExternalLink,{href:a},(0,o.__)("Go to Neve Codex","neve")),(0,r.createElement)(h.ExternalLink,{href:n},(0,o.__)("Go to docs","neve")),!i&&(0,r.createElement)(h.Button,{isLink:!0,className:"facebook-badge",href:"https://www.facebook.com/groups/648646435537266/",target:"_blank",rel:"external noreferrer noopener"},(0,r.createElement)("span",{className:"components-visually-hidden"},(0,o.__)("(opens in a new tab)","neve")),(0,r.createElement)(h.Icon,{icon:"facebook-alt"}),(0,r.createElement)("span",null,(0,o.__)("Join our Facebook Group","neve")))),!i&&(0,r.createElement)(w,{icon:l+"clone.svg",title:(0,o.__)("Create a child theme","neve"),description:(0,o.__)("If you want to make changes to the theme's files, those changes are likely to be overwritten when you next update the theme. In order to prevent that from happening, you need to create a child theme. For this, please follow the documentation below.","neve")},(0,r.createElement)(h.ExternalLink,{href:"http://docs.themeisle.com/article/14-how-to-create-a-child-theme"},(0,o.__)("Learn More","neve"))),(0,r.createElement)(w,{icon:neveDash.assets+"buoy.svg",title:(0,o.__)("Contact Support","neve"),description:c},(0,r.createElement)(h.Button,{isPrimary:!0,href:s,target:"_blank",rel:"external noreferrer noopener"},(0,r.createElement)("span",{className:"components-visually-hidden"},(0,o.__)("(opens in a new tab)","neve")),(0,o.__)("Contact Support","neve"))),!i&&(0,r.createElement)(w,{icon:l+"tachometer.svg",title:(0,o.__)("Speed up your site","neve"),description:(0,o.__)("If you find yourself in a situation where everything on your site is running very slowly, you might consider having a look at the documentation below where you will find the most common issues causing this and possible solutions for each of the issues.","neve")},(0,r.createElement)(h.ExternalLink,{href:"http://docs.themeisle.com/article/63-speed-up-your-wordpress-site"},(0,o.__)("Learn More","neve"))),!i&&(0,r.createElement)(w,{icon:l+"list.svg",title:(0,o.__)("Changelog","neve"),description:(0,o.__)("Want to get the gist on the latest theme changes? Just consult our changelog below to get a taste of the recent fixes and features implemented.","neve"),ßßßßß:!0},(0,r.createElement)(h.Button,{isLink:!0,onClick:()=>t("changelog")},(0,o.__)("View Changelog","neve"))))},U=()=>{const{changelog:e,changelogPro:t}=neveDash,[n,a]=(0,r.useState)(!1);return(0,r.createElement)("div",{className:"card"},t&&(0,r.createElement)("div",{className:"changelog-tabs"},(0,r.createElement)("span",null,(0,o.__)("Show changelog for","neve")),(0,r.createElement)("a",{href:"#changelog-neve",className:y()([{active:!n}]),onClick:()=>{a(!1)}},"Neve"),(0,r.createElement)("a",{href:"#show-for-pro",className:y()([{active:n}]),onClick:()=>{a(!0)}},"Neve Pro")),(n?t:e).map(((e,t)=>{const{date:n,version:a,tweaks:s,fixes:i,features:l}=e;if(!s&&!i&&!l)return null;const c=(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"version"},"v",a)," -"," ",(0,r.createElement)("span",{className:"date"},n));return(0,r.createElement)(x,{key:t,isOpen:0===t,title:c},l&&(0,r.createElement)("div",{className:"features changelog-category"},(0,r.createElement)("div",{className:"label-wrap"},(0,r.createElement)("span",{className:"label success"},(0,o.__)("Features","neve"))),(0,r.createElement)("ul",{className:"entries"},l.map(((e,t)=>(0,r.createElement)("li",{key:t,dangerouslySetInnerHTML:{__html:e}}))))),i&&(0,r.createElement)("div",{className:"bugs changelog-category"},(0,r.createElement)("div",{className:"label-wrap"},(0,r.createElement)("span",{className:"label error"},(0,o.__)("Bug Fixes","neve"))),(0,r.createElement)("ul",{className:"entries"},i.map(((e,t)=>(0,r.createElement)("li",{key:t,dangerouslySetInnerHTML:{__html:e}}))))),s&&(0,r.createElement)("div",{className:"tweaks changelog-category"},(0,r.createElement)("div",{className:"label-wrap"},(0,r.createElement)("span",{className:"label info"},(0,o.__)("Tweaks","neve"))),(0,r.createElement)("ul",{className:"entries"},s.map(((e,t)=>(0,r.createElement)("li",{key:t,dangerouslySetInnerHTML:{__html:e}}))))))})))},q=({item:e})=>{const{title:t,description:n,inLite:a,docsLink:s,presentational:i}=e,[l,c]=(0,r.useState)(!1),d=()=>c(!0),u=()=>c(!1);return(0,r.createElement)("tr",{className:"feature-row"},(0,r.createElement)("td",{className:"large"},(0,r.createElement)("div",{className:"feat-wrap"},(0,r.createElement)("h4",null,i?(0,r.createElement)(h.ExternalLink,{href:neveDash.allfeaturesNeveProURL},t):t),(0,r.createElement)("span",{onMouseEnter:e=>{e.preventDefault(),d()},onMouseLeave:e=>{e.preventDefault(),u()},onFocus:e=>{e.preventDefault(),d()},onBlur:e=>{e.preventDefault(),u()}},(()=>{if(!i)return(0,r.createElement)(h.Dashicon,{icon:"info"})})(),l&&(0,r.createElement)("div",{className:"tooltip-content"},(0,r.createElement)("div",{className:"tooltip-inner"},(0,r.createElement)("p",null,n+" ",s&&void 0!==r.createInterpolateElement&&(0,r.createInterpolateElement)((0,o.__)("More details <external_link>here</external_link>.","neve"),{external_link:(0,r.createElement)(h.ExternalLink,{href:s},"#dumptext")}))))))),(()=>{if(!i)return(0,r.createElement)("td",{className:y()(["indicator",{error:!a,success:a}])},(0,r.createElement)(h.Dashicon,{size:30,icon:a?"yes":"no-alt"}))})(),(()=>{if(!i)return(0,r.createElement)("td",{className:"indicator success"},(0,r.createElement)(h.Dashicon,{size:30,icon:"yes"}))})())},R=()=>{const{featureData:e}=neveDash;return(0,r.createElement)("div",{className:"col"},(0,r.createElement)("table",{className:"card table"},(0,r.createElement)("tbody",{className:"table-body"},(0,r.createElement)("tr",{className:"table-head"},(0,r.createElement)("th",{className:"large"}),(0,r.createElement)("th",{className:"indicator"},"Neve"),(0,r.createElement)("th",{className:"indicator"},"Neve Pro")),e.map(((e,t)=>(0,r.createElement)(q,{key:t,item:e}))))),(0,r.createElement)("div",{className:"card upsell"},(0,r.createElement)("p",null,(0,o.__)("Get access to all Pro features and power-up your website","neve")),(0,r.createElement)(h.Button,{target:"_blank",rel:"external noreferrer noopener",href:neveDash.upgradeURL,isPrimary:!0},(0,o.__)("Get Neve Pro Now","neve"),(0,r.createElement)("span",{className:"components-visually-hidden"},(0,o.__)("(opens in a new tab)","neve")))))},B=()=>{let e=window.location.hash;return"string"!=typeof window.location.hash?null:(e=e.substring(1),Object.keys(F).includes(e)?e:null)},F={start:{label:(0,o.__)("Welcome","neve"),render:e=>(0,r.createElement)(k,{setTab:e})},"starter-sites":{label:(0,o.__)("Starter Sites","neve"),render:()=>(0,r.createElement)(g,null)},"custom-layouts":{label:(0,o.__)("Custom Layouts","neve"),render:e=>(0,r.createElement)(v,{setTab:e})},"free-pro":{label:(0,o.__)("Free vs Pro","neve"),render:()=>(0,r.createElement)(R,null)},plugins:{label:(0,o.__)("Plugins","neve"),render:()=>(0,r.createElement)(M,null)},help:{label:(0,o.__)("Help","neve"),render:e=>(0,r.createElement)(P,{setTab:e})},changelog:{label:(0,o.__)("Changelog","neve"),render:()=>(0,r.createElement)(U,null)}},{plugins:Z}=neveDash,z=Z["templates-patterns-collection"]&&"deactivate"===Z["templates-patterns-collection"].cta,$=Z["templates-patterns-collection"]&&1===i()(Z["templates-patterns-collection"].version,"1.0.10");z&&$&&delete F["starter-sites"],(neveDash.pro||neveDash.hasOldPro)&&neveDash.license&&"valid"===neveDash.license.valid&&delete F["custom-layouts"],(neveDash.pro||neveDash.hasOldPro)&&(F.pro={label:neveDash.strings.proTabTitle,render:()=>(0,r.createElement)(D,null)},delete F["free-pro"]),neveDash.whiteLabel&&(delete F.changelog,delete F.plugins,neveDash.whiteLabel.hideStarterSites&&delete F["starter-sites"]),neveDash.hidePluginsTab&&delete F.plugins;const H=e=>{const t=()=>{const t=B();null!==t&&e.setTab(t)};return(0,r.useEffect)((()=>(t(),window.addEventListener("hashchange",t),()=>{window.removeEventListener("hashchange",t)})),[]),(0,r.createElement)("header",null,(0,r.createElement)("div",{className:"container"},(0,r.createElement)("div",{className:"top"},(0,r.createElement)("h1",{className:"heading"},neveDash.strings.header),(0,r.createElement)("span",{className:"version"},neveDash.version),!neveDash.whiteLabel&&(0,r.createElement)("img",{src:neveDash.assets+"logo.svg",alt:(0,o.__)("Neve Theme Logo","neve")})),(()=>{const{currentTab:t,setTab:n}=e;return(0,r.createElement)("nav",{className:"navigation"},Object.keys(F).map(((e,a)=>(0,r.createElement)("li",{key:a},(0,r.createElement)("a",{href:"#"+e,className:y()([e,t===e?"active":""]),onClick:t=>{t.preventDefault(),n(e),(e=>{window.location.hash=e})(e)}},F[e].label)))))})()))},V=window.wp.primitives,W=(0,r.createElement)(V.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(V.Path,{d:"M18.2 17c0 .7-.6 1.2-1.2 1.2H7c-.7 0-1.2-.6-1.2-1.2V7c0-.7.6-1.2 1.2-1.2h3.2V4.2H7C5.5 4.2 4.2 5.5 4.2 7v10c0 1.5 1.2 2.8 2.8 2.8h10c1.5 0 2.8-1.2 2.8-2.8v-3.6h-1.5V17zM14.9 3v1.5h3.7l-6.4 6.4 1.1 1.1 6.4-6.4v3.7h1.5V3h-6.3z"})),Q=({data:e,slug:t})=>{const[n,a]=(0,r.useState)(!1),{text:s,cta:i,type:l,update:c,url:d,targetBlank:u}=e,{canInstallPlugins:p}=neveDash,[m,f]=(0,r.useState)(!1),[g,b]=(0,r.useState)(!1),[v,_]=(0,r.useState)(null),w=y()(["notification",t,l&&!g?l:"",{"success hidden":"done"===g,error:"error"===g}]),k=()=>!i||g?null:(0,r.createElement)(h.Button,{isSecondary:!0,disabled:m||!p,className:y()({"is-loading":m}),onClick:()=>{c&&(()=>{if(!c.type)return!1;f(!0),new Promise((e=>{if("theme"===c.type){if(!c.slug)return!1;wp.updates.ajax("update-theme",{slug:c.slug,success:()=>{e({success:!0})},error:t=>{_(t.errorMessage),e({success:!1})}})}if("plugin"===c.type){if("sparks-for-woocommerce"===c.slug)return void(window.location.href=window.neveDash.sparksInstallActivateEndpoint);if(!c.slug||!c.path)return!1;wp.updates.ajax("update-plugin",{slug:c.slug,plugin:c.path,success:()=>{e({success:!0})},error:t=>{_(t.errorMessage),e({success:!1})}})}if("otter"===c.type){if(!c.slug||!c.path)return!1;"otter-old"===c.slug&&wp.updates.ajax("update-plugin",{slug:c.slug,plugin:c.path,success:()=>{e({success:!0}),window.location.href=window.neveDash.otterProInstall},error:t=>{_(t.errorMessage),e({success:!1})}}),"otter-new"===c.slug&&(window.location.href=window.neveDash.otterProInstall)}})).then((e=>{if(!e.success)return b("error"),f(!1),!1;b("done"),f(!1),a(!0),delete neveDash.notifications[c.slug]}))})()}},m?(0,r.createElement)("span",null,(0,r.createElement)(h.Dashicon,{icon:"update"})," ",(0,o.__)("In Progress","neve")+"..."," "):i),x=p?k():(0,r.createElement)(h.Tooltip,{text:(0,o.sprintf)(// translators: %s: Plugin and theme names.
(0,o.__)("Ask your admin to update %s on your site","neve"),"Neve and Neve Pro"),position:"top center",style:{opacity:1}},k());return c?(0,r.createElement)((()=>(0,r.createElement)("div",{className:w},!g&&(0,r.createElement)("p",null,s),"done"===g&&(0,r.createElement)("p",null,(0,r.createElement)(h.Dashicon,{icon:"yes"}),(0,o.__)("Done!","neve")),"error"===g&&(0,r.createElement)("p",null,(0,r.createElement)(h.Dashicon,{icon:"no"}),v||(0,o.__)("An error occured. Please reload the page and try again.","neve")),x)),null):(0,r.createElement)((()=>(0,r.createElement)("div",{className:w},(0,r.createElement)("p",{dangerouslySetInnerHTML:{__html:s}}),d&&i&&(0,r.createElement)(h.Button,{isSecondary:!0,target:u?"_blank":"",href:d},i,u&&(0,r.createElement)(h.Icon,{size:20,icon:W})))),null)},G=()=>neveDash.notifications?1>neveDash.notifications.length?null:(0,r.createElement)("div",{className:"notifications"},Object.keys(neveDash.notifications).map(((e,t)=>(0,r.createElement)(Q,{key:t,data:neveDash.notifications[e],slug:e})))):null,K=({currentTab:e,setTab:t})=>{const n=y()(["tab-content","columns",e]);return(0,r.createElement)("div",{className:n},F[e].render(t))},Y=(0,a.withSelect)((e=>{const{getLicense:t}=e("neve-dashboard");return{license:t()}}))((({license:e})=>{if(!e||!e.valid||"valid"!==e.valid)return null;const{supportData:t}=e;return t&&t.text&&t.url?(0,r.createElement)(h.Button,{style:{width:"100%",justifyContent:"center",fontWeight:"700",fontSize:"14px",padding:"28px 0",backgroundColor:"#ffffff",marginBottom:"24px"},variant:"secondary",href:t.url,target:"_blank"},t.text):null})),X=({message:e,dismiss:t,time:n,type:a="info"})=>{(0,r.useEffect)((()=>{const e=setTimeout((()=>{t(""),clearTimeout(e)}),n||2e3)}));const s=y()(["toast","components-animate__appear","is-from-middle",a]);return(0,r.createElement)("div",{className:s},(0,r.createElement)(h.Dashicon,{icon:{info:"info",error:"no",success:"yes",warning:"warning"}[a]}),(0,r.createElement)("span",null,e))},J=(0,b.compose)((0,a.withDispatch)((e=>{const{changeLicense:t,setSettings:n}=e("neve-dashboard");return{setSettings:e=>n(e),changeLicense:e=>{t(e)}}})),(0,a.withSelect)((e=>{const{getLicense:t}=e("neve-dashboard");return{license:t()}})))((({isVisible:e,setSettings:t,changeLicense:n,license:a})=>{const{proApi:s}=neveDash,[i,l]=(0,r.useState)(a&&"valid"===a.valid&&a.key||""),[d,u]=(0,r.useState)(!1),[m,f]=(0,r.useState)(""),[g,b]=(0,r.useState)("success"),{valid:v,expiration:_}=a,{whiteLabel:w,strings:k}=neveDash,{licenseCardHeading:x,licenseCardDescription:E}=k;if(!e)return null;if(w&&w.hideLicense)return null;let j="";return d||(j="valid"===v?(0,o.__)("Deactivate","neve"):(0,o.__)("Activate","neve")),"activating"===d&&(j=(0,o.__)("Activating","neve"),j=(0,o.__)("Deactivating","neve")),(0,r.createElement)("aside",{className:"sidebar card license"},(0,r.createElement)("div",{className:"sidebar-section"},x&&(0,r.createElement)("h4",null,x),!w&&E&&(0,r.createElement)("p",{dangerouslySetInnerHTML:{__html:E}}),(0,r.createElement)("form",{className:"license-form",onSubmit:e=>{e.preventDefault(),(()=>{const e="valid"===v?"deactivate":"activate";u("activate"===e?"activating":"deactivating"),((e,t,n=!1)=>p(e,n,t))(s+"/toggle_license",{key:i,action:e}).then((r=>{b(r.success?"success":"error"),l("activate"===e?i:""),f(r.message),u(!1),r.license&&(n(r.license),c().then((e=>{t(e)})))}))})()}},(0,r.createElement)("input",{type:"text",id:"license-field",name:"license-field",disabled:"valid"===v,onChange:e=>{const t=e.target.value.replace(/\s+/g,"");l(t)},value:"valid"===v?"******************************"+i.slice(-5):i,placeholder:(0,o.__)("Enter License Key","neve")}),(0,r.createElement)(h.Button,{isPrimary:"valid"!==v,isSecondary:"valid"===v,disabled:d||!i,type:"submit"},j)),m&&(0,r.createElement)(X,{type:g,dismiss:f,message:m}),"expired"===v||"valid"===v&&(0,r.createElement)("div",{className:"license-footer"},(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:y()(["status-icon","valid"===v?"success":"error"])},(0,r.createElement)(h.Dashicon,{size:14,icon:"valid"===v?"yes":"no"})),(0,r.createElement)("span",{className:"validity"},"valid"===v?(0,o.__)("Valid","neve"):(0,o.__)("Expired","neve")),_&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"separator"},"-"),(0,r.createElement)("span",{className:"expires"},("valid"===v?(0,o.__)("Expires","neve"):(0,o.__)("Expired","neve"))+" "+_))))))})),ee=(0,b.compose)((0,a.withDispatch)((e=>{const{setToast:t,setLogger:n}=e("neve-dashboard");return{setToast:e=>t(e),setLogger:e=>n(e)}})),(0,a.withSelect)((e=>{const{getOption:t}=e("neve-dashboard");return{loggerValue:t("neve_logger_flag")}})))((({currentTab:e,setToast:t,loggerValue:n,setLogger:a})=>{const[s,i]=(0,r.useState)("yes"===n);return(0,r.createElement)("div",{className:"sidebar-wrap"},!neveDash.whiteLabel&&neveDash.pro&&(0,r.createElement)(Y,null),neveDash.pro&&(0,r.createElement)(J,{isVisible:"pro"===e}),!neveDash.whiteLabel&&(0,r.createElement)("aside",{className:"sidebar card"},(0,r.createElement)("div",{className:"sidebar-section"},(0,r.createElement)("h4",null,(0,o.__)("Neve Community","neve")),(0,r.createElement)("p",null,void 0!==r.createInterpolateElement&&(0,r.createInterpolateElement)((0,o.__)("Share opinions, ask questions and help each other on our Neve community! Keep up with what we’re working on and vote to help us prioritize on our <external_link>public roadmap</external_link>.","neve"),{external_link:(0,r.createElement)(h.ExternalLink,{href:"https://github.com/Codeinwp/neve/discussions"},"#dumptext")})),(0,r.createElement)(h.ExternalLink,{href:"https://www.facebook.com/groups/648646435537266/"},(0,o.__)("Join our Facebook Group","neve"))),(0,r.createElement)("hr",null),(0,r.createElement)("div",{className:"sidebar-section"},(0,r.createElement)("h4",null,(0,o.__)("Leave us a review","neve")),(0,r.createElement)("p",null,(0,o.__)("Are you are enjoying Neve? We would love to hear your feedback.","neve")),(0,r.createElement)(h.ExternalLink,{href:"https://wordpress.org/support/theme/neve/reviews/#new-post"},(0,o.__)("Submit a review","neve"))),(0,r.createElement)("hr",null),(0,r.createElement)("div",{className:"sidebar-section"},(0,r.createElement)("h4",null,(0,o.__)("Contributing","neve")),(0,r.createElement)("p",null,(0,o.__)("Become a contributor by opting in to our anonymous data tracking. We guarantee no sensitive data is collected.","neve")," ",(0,r.createElement)(h.ExternalLink,{href:"https://docs.themeisle.com/article/1122-neve-usage-tracking"},(0,o.__)("What do we track?","neve"))),(0,r.createElement)(h.ToggleControl,{checked:s,label:(0,o.__)("Allow Anonymous Tracking","neve"),onChange:e=>{i(e),d("neve_logger_flag",e?"yes":"no",!1,!1).then((n=>{if(!n.success)return t((0,o.__)("Could not update option. Please try again.","neve")),i(!e),!1;a(e?"yes":"no"),t((0,o.__)("Option Updated","neve"))}))}}))))})),te=()=>(0,r.createElement)("div",{className:"mock-dash"},(0,r.createElement)("header",null,(0,r.createElement)("div",{className:"container"},(0,r.createElement)("div",{className:"top"},(0,r.createElement)("h1",{className:"heading loading"}),(0,r.createElement)("span",{className:"version loading"},"v2.6.2"),!neveDash.whiteLabel&&(0,r.createElement)("div",{className:"loading logo"})),(0,r.createElement)("nav",{className:"navigation"},Array.from(Array(6)).map(((e,t)=>(0,r.createElement)("li",{key:t},(0,r.createElement)("a",{className:"loading"}))))))),(0,r.createElement)("div",{className:"container content"},(0,r.createElement)("div",{className:"main"},neveDash.notifications&&(0,r.createElement)("div",{className:"notifications"},Object.keys(neveDash.notifications).map(((e,t)=>(0,r.createElement)("div",{key:t,className:"notification loading placeholder"})))),(0,r.createElement)("div",{className:"tab-content columns start"},(0,r.createElement)("div",{className:"card"},(0,r.createElement)("div",{className:"card-header"},(0,r.createElement)("div",{className:"loading icon"}),(0,r.createElement)("h3",{className:"loading title"})),(0,r.createElement)("div",{className:"card-content"},(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("button",{style:{marginTop:"auto"},type:"button",className:"loading components-button is-button is-default is-primary"}))),(0,r.createElement)("div",{className:"card customizer-quick-links"},(0,r.createElement)("div",{className:"card-header"},(0,r.createElement)("div",{className:"loading icon"}),(0,r.createElement)("h3",{className:"loading title"})),(0,r.createElement)("div",{className:"card-content"},(0,r.createElement)("div",{className:"columns"},(0,r.createElement)("div",{className:"col"},(0,r.createElement)("span",{className:"loading link"}),(0,r.createElement)("hr",null),(0,r.createElement)("span",{className:"loading link"}),(0,r.createElement)("hr",null),(0,r.createElement)("span",{className:"loading link"}),(0,r.createElement)("hr",null),(0,r.createElement)("span",{className:"loading link"})),(0,r.createElement)("div",{className:"col"},(0,r.createElement)("span",{className:"loading link"}),(0,r.createElement)("hr",null),(0,r.createElement)("span",{className:"loading link"}),(0,r.createElement)("hr",null),(0,r.createElement)("span",{className:"loading link"}),(0,r.createElement)("hr",null),(0,r.createElement)("span",{className:"loading link"}))))),(0,r.createElement)("div",{className:"card"},(0,r.createElement)("div",{className:"card-header"},(0,r.createElement)("div",{className:"loading icon"}),(0,r.createElement)("h3",{className:"loading title"})),(0,r.createElement)("div",{className:"card-content"},(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("button",{type:"button",className:"loading components-button is-button is-default is-primary"}))))),(0,r.createElement)("div",{className:"sidebar-wrap"},!neveDash.whiteLabel&&(0,r.createElement)("aside",{className:"sidebar card"},(0,r.createElement)("div",{className:"sidebar-section"},(0,r.createElement)("h4",{className:"loading"}),(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("span",{className:"loading link components-button is-primary"})),(0,r.createElement)("hr",null),(0,r.createElement)("div",{className:"sidebar-section"},(0,r.createElement)("h4",{className:"loading"}),(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("span",{className:"loading link"})),(0,r.createElement)("hr",null),(0,r.createElement)("div",{className:"sidebar-section"},(0,r.createElement)("h4",{className:"loading"}),(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("p",{className:"loading card-description"}),(0,r.createElement)("span",{className:"loading link"})))))),ne=(0,b.compose)((0,a.withDispatch)((e=>{const{setToast:t}=e("neve-dashboard");return{setToast:e=>t(e)}})),(0,a.withSelect)((e=>{const{getToast:t}=e("neve-dashboard");return{toast:()=>t()}})))((({toast:e,setToast:t})=>{(0,r.useEffect)((()=>{setTimeout((()=>{t(null)}),3e3)}),[]);const n=e(),a={opacity:null===n?0:1};let s=(0,o.__)("Option Updated","neve");return!1===n&&(s=(0,o.__)("Could not Update Option. Please try again.","neve")),"boolean"!=typeof n&&(s=e()),(0,r.createElement)("div",{style:a},(0,r.createElement)(h.Snackbar,{className:"dash-notice"},s))})),re=()=>{var e,t,n,a,s,i,o,l,c,d;return Boolean(null===(e=window.neveDash)||void 0===e||null===(t=e.deal)||void 0===t?void 0:t.active)?(0,r.createElement)("div",{className:"nv-deal"},(0,r.createElement)("a",{href:null===(n=neveDash)||void 0===n||null===(a=n.deal)||void 0===a?void 0:a.linkDashboard,target:"_blank",rel:"external noreferrer noopener"},(0,r.createElement)("img",{src:null===(s=neveDash)||void 0===s||null===(i=s.deal)||void 0===i?void 0:i.bannerUrl,alt:null===(o=neveDash)||void 0===o||null===(l=o.deal)||void 0===l?void 0:l.bannerAlt}),(0,r.createElement)("div",{className:"nv-urgency"},null===(c=neveDash)||void 0===c||null===(d=c.deal)||void 0===d?void 0:d.urgencyText))):(0,r.createElement)(r.Fragment,null)},ae=(0,b.compose)((0,a.withDispatch)((e=>{const{setSettings:t,setTab:n}=e("neve-dashboard");return{setSettings:e=>t(e),setTab:e=>n(e)}})),(0,a.withSelect)((e=>{const{getToast:t,getTab:n}=e("neve-dashboard");return{toast:t(),currentTab:n()}})))((({setSettings:e,toast:t,currentTab:n,setTab:a})=>{const[s,i]=(0,r.useState)(!0);return(0,r.useEffect)((()=>{c().then((t=>{e(t),i(!1)}))}),[]),s?(0,r.createElement)(te,null):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(H,{currentTab:n,setTab:a}),(0,r.createElement)("div",{className:"content-wrap"},(0,r.createElement)("div",{className:"container content"},(0,r.createElement)("div",{className:"main"},(0,r.createElement)(re,null),"starter-sites"!==n&&(0,r.createElement)(G,null),(0,r.createElement)(K,{currentTab:n,setTab:a})),"starter-sites"!==n&&"custom-layouts"!==n&&(0,r.createElement)(ee,{currentTab:n}))),t&&(0,r.createElement)(ne,null))})),se={settings:{},plugins:neveDash.plugins||{},tier:neveDash.pro?neveDash.license.tier:0,toast:null,currentTab:"start",license:neveDash.pro?neveDash.license:{}},ie=B();null!==ie&&(se.currentTab=ie);function oe(){"#pro"===window.location.hash&&function(){let e=document.querySelector('.toplevel_page_neve-welcome a[href*="edit.php?post_type=neve_custom_layouts"]');(0,a.subscribe)((()=>{const t=(0,a.select)("neve-dashboard").getModuleStatus("custom_layouts");var n,r,s;t&&!e?e=function(e,t){const n=document.createElement("a");n.setAttribute("href",null==t?void 0:t.linkSubMenu),n.textContent=null==t?void 0:t.labelSubMenu;const r=document.querySelector('.toplevel_page_neve-welcome .wp-submenu a[href*="customize.php"]');if(!r)return;const a=r.parentNode,s=document.createElement("li");return s.appendChild(n),a.parentNode.insertBefore(s,a.nextSibling),n}(0,null===(n=window)||void 0===n||null===(r=n.neveDash)||void 0===r||null===(s=r.moduleObserver)||void 0===s?void 0:s.customLayouts):!t&&e&&(e.parentNode.remove(),e=void 0)}))}()}"loading"!==document.readyState?oe():document.addEventListener("DOMContentLoaded",(function(){oe()}));const le=e=>({ok:!1,error:e});async function ce(e,t,n,r){const a=new URL(t,e),s=JSON.stringify(r),i=(o=fetch,(...e)=>{try{return{ok:!0,data:o(...e)}}catch(e){return{ok:!1,error:e}}})(a.toString(),{method:n,headers:{"Content-Type":"application/json"},body:s});var o;if(!1===i.ok)return le(i.error);const l=await i.data,{data:c}=await l.json();return l.ok?(e=>({ok:!0,data:e}))(c):le({code:"network_error",message:l.statusText,status:l.status,url:a})}class de{constructor(e,t){this.apiHost=e,this.environmentId=t}async create(e){return ce(this.apiHost,`/api/v1/client/${this.environmentId}/actions`,"POST",e)}}class ue{constructor(e,t){this.apiHost=e,this.environmentId=t}async create(e){return ce(this.apiHost,`/api/v1/client/${this.environmentId}/displays`,"POST",e)}async update(e,t){return ce(this.apiHost,`/api/v1/client/${this.environmentId}/displays/${e}`,"PUT",t)}}class pe{constructor(e,t){this.apiHost=e,this.environmentId=t}async create(e){return ce(this.apiHost,`/api/v1/client/${this.environmentId}/people`,"POST",{environmentId:this.environmentId,userId:e})}async update(e,t){return ce(this.apiHost,`/api/v1/client/${this.environmentId}/people/${e}`,"POST",t)}}class me{constructor(e,t){this.apiHost=e,this.environmentId=t}async create(e){return ce(this.apiHost,`/api/v1/client/${this.environmentId}/responses`,"POST",e)}async update({responseId:e,finished:t,data:n,ttc:r}){return ce(this.apiHost,`/api/v1/client/${this.environmentId}/responses/${e}`,"PUT",{finished:t,data:n,ttc:r})}}class he{constructor(e,t){this.apiHost=e,this.environmentId=t}async uploadFile(e,{allowedFileExtensions:t,surveyId:n}={}){if(!(e instanceof Blob&&e instanceof File))throw new Error("Invalid file type. Expected Blob or File, but received "+typeof e);const r={fileName:e.name,fileType:e.type,allowedFileExtensions:t,surveyId:n},a=await fetch(`${this.apiHost}/api/v1/client/${this.environmentId}/storage`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!a.ok)throw new Error(`Upload failed with status: ${a.status}`);const s=await a.json(),{data:i}=s,{signedUrl:o,fileUrl:l,signingData:c,presignedFields:d}=i;let u={};if(c){const{signature:t,timestamp:r,uuid:a}=c;u={"X-File-Type":e.type,"X-File-Name":encodeURIComponent(e.name),"X-Survey-ID":n??"","X-Signature":t,"X-Timestamp":String(r),"X-UUID":a}}const p=new FormData;d&&Object.keys(d).forEach((e=>{p.append(e,d[e])})),p.append("file",e);const m=await fetch(o,{method:"POST",...c?{headers:u}:{},body:p});if(!m.ok){const e=await m.json();throw new Error(`${e.message}`)}return l}}class fe{constructor(e){const{apiHost:t,environmentId:n}=e;this.response=new me(t,n),this.display=new ue(t,n),this.action=new de(t,n),this.people=new pe(t,n),this.storage=new he(t,n)}}class ge{constructor(e){this.client=new fe(e)}}class be{constructor(){this.logLevel="error"}static getInstance(){return be.instance||(be.instance=new be),be.instance}configure(e){e&&void 0!==e.logLevel&&(this.logLevel=e.logLevel)}logger(e,t){if("debug"===t&&"debug"!==this.logLevel)return;const n=`🧱 Formbricks - ${(new Date).toISOString()} [${t.toUpperCase()}] - ${e}`;"error"===t?console.error(n):console.log(n)}debug(e){this.logger(e,"debug")}error(e){this.logger(e,"error")}}const ve=e=>({ok:!0,value:e}),_e=e=>({ok:!1,error:e}),ye=e=>(...t)=>{try{return{ok:!0,value:e(...t)}}catch(e){return{ok:!1,error:e}}},we=be.getInstance(),ke=class e{constructor(e){this.customized=!1,e?(this.handleError=e,this.customized=!0):this.handleError=e=>be.getInstance().error(JSON.stringify(e))}static getInstance(){return e.instance||(e.instance=new e),e.instance}static init(t){this.initialized=!0,e.instance=new e(t)}printStatus(){we.debug("Custom error handler: "+(this.customized?"yes":"no"))}handle(e){this.handleError(e)}};ke.initialized=!1;let xe=ke;const Ee="formbricks-js";class je{constructor(){this.config=null;const e=this.loadFromLocalStorage();e.ok&&(this.config=e.value)}static getInstance(){return je.instance||(je.instance=new je),je.instance}update(e){if(e){const t=new Date((new Date).getTime()+9e5);this.config={...this.config,...e,expiresAt:t},this.saveToLocalStorage()}}get(){if(!this.config)throw new Error("config is null, maybe the init function was not called?");return this.config}loadFromLocalStorage(){if("undefined"!=typeof window){const e=localStorage.getItem(Ee);if(e){const t=JSON.parse(e);return t.expiresAt&&new Date(t.expiresAt)<=new Date?_e(new Error("Config in local storage has expired")):ve(JSON.parse(e))}}return _e(new Error("No or invalid config in local storage"))}saveToLocalStorage(){return ye((()=>localStorage.setItem(Ee,JSON.stringify(this.config))))()}resetConfig(){return this.config=null,ye((()=>localStorage.removeItem(Ee)))()}}class Ne{constructor(e,t){this.queue=[],this.isRequestInProgress=!1,this.config=e,this.surveyState=t,this.api=new ge({apiHost:e.apiHost,environmentId:e.environmentId})}add(e){this.surveyState.accumulateResponse(e),this.config.setSurveyState&&this.config.setSurveyState(this.surveyState),this.queue.push(e),this.processQueue()}async processQueue(){if(this.isRequestInProgress)return;if(0===this.queue.length)return;this.isRequestInProgress=!0;const e=this.queue[0];let t=0;for(;t<this.config.retryAttempts;){if(await this.sendResponse(e)){this.queue.shift();break}console.error("Formbricks: Failed to send response. Retrying...",t),t++}t>=this.config.retryAttempts&&(console.error("Failed to send response after 2 attempts."),this.surveyState.responseAcc.finished&&this.config.onResponseSendingFailed&&this.config.onResponseSendingFailed(this.surveyState.responseAcc),this.queue.shift()),this.isRequestInProgress=!1,this.processQueue()}async sendResponse(e){try{if(null!==this.surveyState.responseId)await this.api.client.response.update({...e,responseId:this.surveyState.responseId});else{const t=await this.api.client.response.create({...e,surveyId:this.surveyState.surveyId,userId:this.surveyState.userId||null,singleUseId:this.surveyState.singleUseId||null});if(!t.ok)throw new Error("Could not create response");this.surveyState.displayId&&await this.api.client.display.update(this.surveyState.displayId,{responseId:t.data.id}),this.surveyState.updateResponseId(t.data.id),this.config.setSurveyState&&this.config.setSurveyState(this.surveyState)}return!0}catch(e){return console.error(e),!1}}updateSurveyState(e){this.surveyState=e}}class Ce{constructor(e,t,n,r){this.responseId=null,this.displayId=null,this.userId=null,this.responseAcc={finished:!1,data:{},ttc:{}},this.surveyId=e,this.userId=r??null,this.singleUseId=t??null,this.responseId=n??null}setSurveyId(e){this.surveyId=e,this.clear()}copy(){const e=new Ce(this.surveyId,this.singleUseId??void 0,this.responseId??void 0,this.userId??void 0);return e.responseId=this.responseId,e.responseAcc=this.responseAcc,e}updateResponseId(e){this.responseId=e}updateDisplayId(e){this.displayId=e}updateUserId(e){this.userId=e}accumulateResponse(e){this.responseAcc={finished:e.finished,ttc:e.ttc,data:{...this.responseAcc.data,...e.data}}}isResponseFinished(){return this.responseAcc.finished}clear(){this.responseId=null,this.responseAcc={finished:!1,data:{},ttc:{}}}}const Se=Ce;var Ie,Te,Le,Oe,De,Ae,Me,Pe={},Ue=[],qe=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Re=Array.isArray;function Be(e,t){for(var n in t)e[n]=t[n];return e}function Fe(e){var t=e.parentNode;t&&t.removeChild(e)}function Ze(e,t,n){var r,a,s,i={};for(s in t)"key"==s?r=t[s]:"ref"==s?a=t[s]:i[s]=t[s];if(arguments.length>2&&(i.children=arguments.length>3?Ie.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)void 0===i[s]&&(i[s]=e.defaultProps[s]);return ze(e,i,r,a,null)}function ze(e,t,n,r,a){var s={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==a?++Le:a,__i:-1,__u:0};return null==a&&null!=Te.vnode&&Te.vnode(s),s}function $e(e){return e.children}function He(e,t){this.props=e,this.context=t}function Ve(e,t){if(null==t)return e.__?Ve(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?Ve(e):null}function We(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return We(e)}}function Qe(e){(!e.__d&&(e.__d=!0)&&Oe.push(e)&&!Ge.__r++||De!==Te.debounceRendering)&&((De=Te.debounceRendering)||Ae)(Ge)}function Ge(){var e,t,n,r,a,s,i,o,l;for(Oe.sort(Me);e=Oe.shift();)e.__d&&(t=Oe.length,r=void 0,s=(a=(n=e).__v).__e,o=[],l=[],(i=n.__P)&&((r=Be({},a)).__v=a.__v+1,Te.vnode&&Te.vnode(r),at(i,r,a,n.__n,void 0!==i.ownerSVGElement,32&a.__u?[s]:null,o,null==s?Ve(a):s,!!(32&a.__u),l),r.__.__k[r.__i]=r,st(o,r,l),r.__e!=s&&We(r)),Oe.length>t&&Oe.sort(Me));Ge.__r=0}function Ke(e,t,n,r,a,s,i,o,l,c,d){var u,p,m,h,f,g=r&&r.__k||Ue,b=t.length;for(n.__d=l,function(e,t,n){var r,a,s,i,o,l=t.length,c=n.length,d=c,u=0;for(e.__k=[],r=0;r<l;r++)null!=(a=e.__k[r]=null==(a=t[r])||"boolean"==typeof a||"function"==typeof a?null:"string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?ze(null,a,null,null,a):Re(a)?ze($e,{children:a},null,null,null):void 0===a.constructor&&a.__b>0?ze(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a)?(a.__=e,a.__b=e.__b+1,o=Je(a,n,i=r+u,d),a.__i=o,s=null,-1!==o&&(d--,(s=n[o])&&(s.__u|=131072)),null==s||null===s.__v?(-1==o&&u--,"function"!=typeof a.type&&(a.__u|=65536)):o!==i&&(o===i+1?u++:o>i?d>l-i?u+=o-i:u--:u=o<i&&o==i-1?o-i:0,o!==r+u&&(a.__u|=65536))):(s=n[r])&&null==s.key&&s.__e&&(s.__e==e.__d&&(e.__d=Ve(s)),ot(s,s,!1),n[r]=null,d--);if(d)for(r=0;r<c;r++)null!=(s=n[r])&&0==(131072&s.__u)&&(s.__e==e.__d&&(e.__d=Ve(s)),ot(s,s))}(n,t,g),l=n.__d,u=0;u<b;u++)null!=(m=n.__k[u])&&"boolean"!=typeof m&&"function"!=typeof m&&(p=-1===m.__i?Pe:g[m.__i]||Pe,m.__i=u,at(e,m,p,a,s,i,o,l,c,d),h=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&it(p.ref,null,m),d.push(m.ref,m.__c||h,m)),null==f&&null!=h&&(f=h),65536&m.__u||p.__k===m.__k?l=Ye(m,l,e):"function"==typeof m.type&&void 0!==m.__d?l=m.__d:h&&(l=h.nextSibling),m.__d=void 0,m.__u&=-196609);n.__d=l,n.__e=f}function Ye(e,t,n){var r,a;if("function"==typeof e.type){for(r=e.__k,a=0;r&&a<r.length;a++)r[a]&&(r[a].__=e,t=Ye(r[a],t,n));return t}return e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e),t&&t.nextSibling}function Xe(e,t){return t=t||[],null==e||"boolean"==typeof e||(Re(e)?e.some((function(e){Xe(e,t)})):t.push(e)),t}function Je(e,t,n,r){var a=e.key,s=e.type,i=n-1,o=n+1,l=t[n];if(null===l||l&&a==l.key&&s===l.type)return n;if(r>(null!=l&&0==(131072&l.__u)?1:0))for(;i>=0||o<t.length;){if(i>=0){if((l=t[i])&&0==(131072&l.__u)&&a==l.key&&s===l.type)return i;i--}if(o<t.length){if((l=t[o])&&0==(131072&l.__u)&&a==l.key&&s===l.type)return o;o++}}return-1}function et(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||qe.test(t)?n:n+"px"}function tt(e,t,n,r,a){var s;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||et(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||et(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])s=t!==(t=t.replace(/(PointerCapture)$|Capture$/,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+s]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,s?rt:nt,s)):e.removeEventListener(t,s?rt:nt,s);else{if(a)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function nt(e){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(Te.event?Te.event(e):e)}function rt(e){return this.l[e.type+!0](Te.event?Te.event(e):e)}function at(e,t,n,r,a,s,i,o,l,c){var d,u,p,m,h,f,g,b,v,_,y,w,k,x,E,j=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),s=[o=t.__e=n.__e]),(d=Te.__b)&&d(t);e:if("function"==typeof j)try{if(b=t.props,v=(d=j.contextType)&&r[d.__c],_=d?v?v.props.value:d.__:r,n.__c?g=(u=t.__c=n.__c).__=u.__E:("prototype"in j&&j.prototype.render?t.__c=u=new j(b,_):(t.__c=u=new He(b,_),u.constructor=j,u.render=lt),v&&v.sub(u),u.props=b,u.state||(u.state={}),u.context=_,u.__n=r,p=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=j.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Be({},u.__s)),Be(u.__s,j.getDerivedStateFromProps(b,u.__s))),m=u.props,h=u.state,u.__v=t,p)null==j.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==j.getDerivedStateFromProps&&b!==m&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(b,_),!u.__e&&(null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(b,u.__s,_)||t.__v===n.__v)){for(t.__v!==n.__v&&(u.props=b,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),y=0;y<u._sb.length;y++)u.__h.push(u._sb[y]);u._sb=[],u.__h.length&&i.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(b,u.__s,_),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(m,h,f)}))}if(u.context=_,u.props=b,u.__P=e,u.__e=!1,w=Te.__r,k=0,"prototype"in j&&j.prototype.render){for(u.state=u.__s,u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),x=0;x<u._sb.length;x++)u.__h.push(u._sb[x]);u._sb=[]}else do{u.__d=!1,w&&w(t),d=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++k<25);u.state=u.__s,null!=u.getChildContext&&(r=Be(Be({},r),u.getChildContext())),p||null==u.getSnapshotBeforeUpdate||(f=u.getSnapshotBeforeUpdate(m,h)),Ke(e,Re(E=null!=d&&d.type===$e&&null==d.key?d.props.children:d)?E:[E],t,n,r,a,s,i,o,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&i.push(u),g&&(u.__E=u.__=null)}catch(e){t.__v=null,l||null!=s?(t.__e=o,t.__u|=l?160:32,s[s.indexOf(o)]=null):(t.__e=n.__e,t.__k=n.__k),Te.__e(e,t,n)}else null==s&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,a,s,i,o,l){var c,d,u,p,m,h,f,g=n.props,b=t.props,v=t.type;if("svg"===v&&(a=!0),null!=s)for(c=0;c<s.length;c++)if((m=s[c])&&"setAttribute"in m==!!v&&(v?m.localName===v:3===m.nodeType)){e=m,s[c]=null;break}if(null==e){if(null===v)return document.createTextNode(b);e=a?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,b.is&&b),s=null,o=!1}if(null===v)g===b||o&&e.data===b||(e.data=b);else{if(s=s&&Ie.call(e.childNodes),g=n.props||Pe,!o&&null!=s)for(g={},c=0;c<e.attributes.length;c++)g[(m=e.attributes[c]).name]=m.value;for(c in g)m=g[c],"children"==c||("dangerouslySetInnerHTML"==c?u=m:"key"===c||c in b||tt(e,c,null,m,a));for(c in b)m=b[c],"children"==c?p=m:"dangerouslySetInnerHTML"==c?d=m:"value"==c?h=m:"checked"==c?f=m:"key"===c||o&&"function"!=typeof m||g[c]===m||tt(e,c,m,g[c],a);if(d)o||u&&(d.__html===u.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(u&&(e.innerHTML=""),Ke(e,Re(p)?p:[p],t,n,r,a&&"foreignObject"!==v,s,i,s?s[0]:n.__k&&Ve(n,0),o,l),null!=s)for(c=s.length;c--;)null!=s[c]&&Fe(s[c]);o||(c="value",void 0!==h&&(h!==e[c]||"progress"===v&&!h||"option"===v&&h!==g[c])&&tt(e,c,h,g[c],!1),c="checked",void 0!==f&&f!==e[c]&&tt(e,c,f,g[c],!1))}return e}(n.__e,t,n,r,a,s,i,l,c);(d=Te.diffed)&&d(t)}function st(e,t,n){t.__d=void 0;for(var r=0;r<n.length;r++)it(n[r],n[++r],n[++r]);Te.__c&&Te.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Te.__e(e,t.__v)}}))}function it(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Te.__e(e,n)}}function ot(e,t,n){var r,a;if(Te.unmount&&Te.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||it(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Te.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(a=0;a<r.length;a++)r[a]&&ot(r[a],t,n||"function"!=typeof e.type);n||null==e.__e||Fe(e.__e),e.__=e.__e=e.__d=void 0}function lt(e,t,n){return this.constructor(e,n)}Ie=Ue.slice,Te={__e:function(e,t,n,r){for(var a,s,i;t=t.__;)if((a=t.__c)&&!a.__)try{if((s=a.constructor)&&null!=s.getDerivedStateFromError&&(a.setState(s.getDerivedStateFromError(e)),i=a.__d),null!=a.componentDidCatch&&(a.componentDidCatch(e,r||{}),i=a.__d),i)return a.__E=a}catch(t){e=t}throw e}},Le=0,He.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Be({},this.state),"function"==typeof e&&(e=e(Be({},n),this.props)),e&&Be(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Qe(this))},He.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Qe(this))},He.prototype.render=$e,Oe=[],Ae="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Me=function(e,t){return e.__v.__b-t.__v.__b},Ge.__r=0;var ct=0;function dt(e,t,n,r,a,s){var i,o,l={};for(o in t)"ref"==o?i=t[o]:l[o]=t[o];var c={type:e,props:l,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:--ct,__i:-1,__u:0,__source:a,__self:s};if("function"==typeof e&&(i=e.defaultProps))for(o in i)void 0===l[o]&&(l[o]=i[o]);return Te.vnode&&Te.vnode(c),c}function ut(){return dt("a",{href:"https://formbricks.com?utm_source=survey_branding",target:"_blank",tabIndex:-1,className:"mb-5 mt-2 flex justify-center",children:dt("p",{className:"text-signature text-xs",children:["Powered by"," ",dt("b",{children:dt("span",{className:"text-info-text hover:text-heading",children:"Formbricks"})})]})})}const pt=(...e)=>e.filter(Boolean).join(" "),mt=e=>{for(let t=0;t<e.length;t++){const n=Math.floor(Math.random()*(t+1));[e[t],e[n]]=[e[n],e[t]]}},ht=(e,t)=>{const n=[...e],r=n.findIndex((e=>"other"===e.id)),a=-1!==r?n.splice(r,1)[0]:null;if("all"===t)mt(n);else if("exceptLast"===t){const e=n.pop();mt(n),n.push(e)}return a&&n.push(a),n},ft=(e,t)=>{var n;const r=e.questions[t],a=e.questions.length,s=Math.floor(a/2),i=(null==(n=null==r?void 0:r.logic)?void 0:n.map((e=>e.destination)))||[];let o=t||.5;const l=(()=>{const t=e.questions.filter((e=>i.includes(e.id))).sort(((t,n)=>e.questions.indexOf(t)-e.questions.indexOf(n))).pop();return e.questions.findIndex((e=>e.id===(null==t?void 0:t.id)))})();return l>0&&(o=Math.min(s,l-1)),i.includes("end")&&(o=s),o};var gt,bt,vt,_t,yt=0,wt=[],kt=[],xt=Te.__b,Et=Te.__r,jt=Te.diffed,Nt=Te.__c,Ct=Te.unmount;function St(e,t){Te.__h&&Te.__h(bt,e,yt||t),yt=0;var n=bt.__H||(bt.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:kt}),n.__[e]}function It(e){return yt=1,function(e,t,n){var r=St(gt++,2);if(r.t=e,!r.__c&&(r.__=[Bt(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=bt,!bt.u)){var a=function(e,t,n){if(!r.__c.__H)return!0;var a=r.__c.__H.__.filter((function(e){return e.__c}));if(a.every((function(e){return!e.__N})))return!s||s.call(this,e,t,n);var i=!1;return a.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}})),!(!i&&r.__c.props===e)&&(!s||s.call(this,e,t,n))};bt.u=!0;var s=bt.shouldComponentUpdate,i=bt.componentWillUpdate;bt.componentWillUpdate=function(e,t,n){if(this.__e){var r=s;s=void 0,a(e,t,n),s=r}i&&i.call(this,e,t,n)},bt.shouldComponentUpdate=a}return r.__N||r.__}(Bt,e)}function Tt(e,t){var n=St(gt++,3);!Te.__s&&Rt(n.__H,t)&&(n.__=e,n.i=t,bt.__H.__h.push(n))}function Lt(e){return yt=5,Ot((function(){return{current:e}}),[])}function Ot(e,t){var n=St(gt++,7);return Rt(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function Dt(e,t){return yt=8,Ot((function(){return e}),t)}function At(){for(var e;e=wt.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ut),e.__H.__h.forEach(qt),e.__H.__h=[]}catch(t){e.__H.__h=[],Te.__e(t,e.__v)}}Te.__b=function(e){bt=null,xt&&xt(e)},Te.__r=function(e){Et&&Et(e),gt=0;var t=(bt=e.__c).__H;t&&(vt===bt?(t.__h=[],bt.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=kt,e.__N=e.i=void 0}))):(t.__h.forEach(Ut),t.__h.forEach(qt),t.__h=[],gt=0)),vt=bt},Te.diffed=function(e){jt&&jt(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==wt.push(t)&&_t===Te.requestAnimationFrame||((_t=Te.requestAnimationFrame)||Pt)(At)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==kt&&(e.__=e.__V),e.i=void 0,e.__V=kt}))),vt=bt=null},Te.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Ut),e.__h=e.__h.filter((function(e){return!e.__||qt(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Te.__e(n,e.__v)}})),Nt&&Nt(e,t)},Te.unmount=function(e){Ct&&Ct(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Ut(e)}catch(e){t=e}})),n.__H=void 0,t&&Te.__e(t,n.__v))};var Mt="function"==typeof requestAnimationFrame;function Pt(e){var t,n=function(){clearTimeout(r),Mt&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Mt&&(t=requestAnimationFrame(n))}function Ut(e){var t=bt,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),bt=t}function qt(e){var t=bt;e.__c=e.__(),bt=t}function Rt(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Bt(e,t){return"function"==typeof t?t(e):t}function Ft({progress:e}){return dt("div",{className:"bg-accent-bg h-2 w-full overflow-hidden rounded-full",children:dt("div",{className:"transition-width bg-brand z-20 h-2 rounded-full duration-500",style:{width:`${Math.floor(100*e)}%`}})})}function Zt({survey:e,questionId:t}){const n=Ot((()=>e.questions.findIndex((e=>e.id===t))),[e,t]),r=Dt(((e,t,n)=>{if(0===t.questions.length)return 0;let r=t.questions.findIndex((t=>t.id===e));-1===r&&(r=0);const a=ft(t,r)/t.questions.length;let s=n;return a>n?s=a:a<=n&&n+.1<=1&&(s=n+.1),s}),[]),a=Ot((()=>{let t=0,n=[];return e.questions.forEach((a=>{t=r(a.id,e,t),n.push(t)})),n}),[r,e]);return dt(Ft,{progress:"end"===t?1:a[n]})}function zt({survey:e,onClose:t,children:n}){const[r,a]=It(100),[s,i]=It(!1),o=Lt(performance.now()),l=Lt(null),c=()=>{null!==l.current&&(i(!0),cancelAnimationFrame(l.current),l.current=null)};return Tt((()=>{if(!e.autoClose)return;const n=()=>{const r=1e3*e.autoClose,s=performance.now()-o.current,i=Math.max(0,r-s);a(i/r),i>0?l.current=requestAnimationFrame(n):(c(),t())};return a(1),l.current=requestAnimationFrame(n),()=>c()}),[e.autoClose,t]),dt($e,{children:[!s&&e.autoClose&&dt(Ft,{progress:r}),dt("div",{onClick:c,onMouseOver:c,className:"h-full w-full",children:n})]})}function $t(e,t){switch(e.condition){case"equals":return Array.isArray(t)&&1===t.length&&t.includes(e.value)||(null==t?void 0:t.toString())===e.value;case"notEquals":return t!==e.value;case"lessThan":return void 0!==e.value&&t<e.value;case"lessEqual":return void 0!==e.value&&t<=e.value;case"greaterThan":return void 0!==e.value&&t>e.value;case"greaterEqual":return void 0!==e.value&&t>=e.value;case"includesAll":return Array.isArray(t)&&Array.isArray(e.value)&&e.value.every((e=>t.includes(e)));case"includesOne":return Array.isArray(t)&&Array.isArray(e.value)&&e.value.some((e=>t.includes(e)));case"accepted":return"accepted"===t;case"clicked":return"clicked"===t;case"submitted":return"string"==typeof t?"dismissed"!==t&&""!==t&&null!==t:Array.isArray(t)?t.length>0:"number"==typeof t&&null!==t;case"skipped":return Array.isArray(t)&&0===t.length||""===t||null==t||"dismissed"===t;case"uploaded":return Array.isArray(t)?t.length>0:"skipped"!==t&&""!==t&&null!==t;case"notUploaded":return Array.isArray(t)&&0===t.length||""===t||null===t||"skipped"===t;default:return!1}}function Ht({onClick:e,backButtonLabel:t,tabIndex:n=2}){return dt("button",{tabIndex:n,type:"button",className:pt("border-back-button-border text-heading focus:ring-focus flex items-center rounded-md border px-3 py-3 text-base font-medium leading-4 shadow-sm hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2"),onClick:e,children:t||"Back"})}function Vt({buttonLabel:e,isLastQuestion:t,onClick:n,tabIndex:r=1,focus:a=!1,type:s="submit"}){return dt("button",{ref:Dt((e=>{e&&a&&setTimeout((()=>{e.focus()}),200)}),[a]),type:s,tabIndex:r,autoFocus:a,className:"bg-brand border-submit-button-border text-on-brand focus:ring-focus flex items-center rounded-md border px-3 py-3 text-base font-medium leading-4 shadow-sm hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2",onClick:n,children:e||(t?"Finish":"Next")})}function Wt({headline:e,questionId:t,required:n=!0,alignTextCenter:r=!1}){return dt("label",{htmlFor:t,className:"text-heading mb-1.5 block text-base font-semibold leading-6",children:dt("div",{className:"flex items-center  "+(r?"justify-center":"justify-between"),children:[e,!n&&dt("span",{className:"text-info-text ml-2 self-start text-sm font-normal leading-7",tabIndex:-1,children:"Optional"})]})})}function Qt(e){function t(e,t){let n=t.replace(/\s+/g,"").toLowerCase();return!(!["src","href","xlink:href","srcdoc"].includes(e)||!(n.includes("javascript:")||n.includes("data:")||n.includes("<script>")))||!!e.startsWith("on")}function n(e){let n=e.attributes;for(let r=n.length-1;r>=0;r--){let{name:a,value:s}=n[r];t(a,s)?e.removeAttribute(a):"srcdoc"===a&&e.setAttribute(a,Qt(s))}}let r=(new DOMParser).parseFromString(e,"text/html").body||document.createElement("body");return r.querySelectorAll("script").forEach((e=>{e.remove()})),function e(t){let r=Array.from(t.children);for(let t of r)n(t),e(t)}(r),r.innerHTML}function Gt({htmlString:e,questionId:t}){return e?dt("label",{htmlFor:t,className:"fb-htmlbody",dangerouslySetInnerHTML:{__html:Qt(e)}}):null}function Kt({imgUrl:e,altText:t="Image"}){return dt("div",{className:"mb-4 rounded-md",children:dt("img",{src:e,alt:t,className:"mb-4 rounded-md"})})}function Yt(e,t){for(var n in e)if("__source"!==n&&!(n in t))return!0;for(var r in t)if("__source"!==r&&e[r]!==t[r])return!0;return!1}function Xt(e){this.props=e}(Xt.prototype=new He).isPureReactComponent=!0,Xt.prototype.shouldComponentUpdate=function(e,t){return Yt(this.props,e)||Yt(this.state,t)};var Jt=Te.__b;Te.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Jt&&Jt(e)};var en=Te.__e;Te.__e=function(e,t,n,r){if(e.then)for(var a,s=t;s=s.__;)if((a=s.__c)&&a.__c)return null==t.__e&&(t.__e=n.__e,t.__k=n.__k),a.__c(e,t);en(e,t,n,r)};var tn=Te.unmount;function nn(e,t,n){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach((function(e){"function"==typeof e.__c&&e.__c()})),e.__c.__H=null),null!=(e=function(e,t){for(var n in t)e[n]=t[n];return e}({},e)).__c&&(e.__c.__P===n&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map((function(e){return nn(e,t,n)}))),e}function rn(e,t,n){return e&&n&&(e.__v=null,e.__k=e.__k&&e.__k.map((function(e){return rn(e,t,n)})),e.__c&&e.__c.__P===t&&(e.__e&&n.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=n)),e}function an(){this.__u=0,this.t=null,this.__b=null}function sn(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function on(){this.u=null,this.o=null}Te.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),tn&&tn(e)},(an.prototype=new He).__c=function(e,t){var n=t.__c,r=this;null==r.t&&(r.t=[]),r.t.push(n);var a=sn(r.__v),s=!1,i=function(){s||(s=!0,n.__R=null,a?a(o):o())};n.__R=i;var o=function(){if(!--r.__u){if(r.state.__a){var e=r.state.__a;r.__v.__k[0]=rn(e,e.__c.__P,e.__c.__O)}var t;for(r.setState({__a:r.__b=null});t=r.t.pop();)t.forceUpdate()}};r.__u++||32&t.__u||r.setState({__a:r.__b=r.__v.__k[0]}),e.then(i,i)},an.prototype.componentWillUnmount=function(){this.t=[]},an.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var n=document.createElement("div"),r=this.__v.__k[0].__c;this.__v.__k[0]=nn(this.__b,n,r.__O=r.__P)}this.__b=null}var a=t.__a&&Ze($e,null,e.fallback);return a&&(a.__u&=-33),[Ze($e,null,t.__a?null:e.children),a]};var ln=function(e,t,n){if(++n[1]===n[0]&&e.o.delete(t),e.props.revealOrder&&("t"!==e.props.revealOrder[0]||!e.o.size))for(n=e.u;n;){for(;n.length>3;)n.pop()();if(n[1]<n[0])break;e.u=n=n[2]}};(on.prototype=new He).__a=function(e){var t=this,n=sn(t.__v),r=t.o.get(e);return r[0]++,function(a){var s=function(){t.props.revealOrder?(r.push(a),ln(t,e,r)):a()};n?n(s):s()}},on.prototype.render=function(e){this.u=null,this.o=new Map;var t=Xe(e.children);e.revealOrder&&"b"===e.revealOrder[0]&&t.reverse();for(var n=t.length;n--;)this.o.set(t[n],this.u=[1,0,this.u]);return e.children},on.prototype.componentDidUpdate=on.prototype.componentDidMount=function(){var e=this;this.o.forEach((function(t,n){ln(e,n,t)}))};var cn="undefined"!=typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103,dn=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,un=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,pn=/[A-Z0-9]/g,mn="undefined"!=typeof document,hn=function(e){return("undefined"!=typeof Symbol&&"symbol"==typeof Symbol()?/fil|che|rad/:/fil|che|ra/).test(e)};He.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach((function(e){Object.defineProperty(He.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})}));var fn=Te.event;function gn(){}function bn(){return this.cancelBubble}function vn(){return this.defaultPrevented}Te.event=function(e){return fn&&(e=fn(e)),e.persist=gn,e.isPropagationStopped=bn,e.isDefaultPrevented=vn,e.nativeEvent=e};var yn={enumerable:!1,configurable:!0,get:function(){return this.class}},wn=Te.vnode;Te.vnode=function(e){"string"==typeof e.type&&function(e){var t=e.props,n=e.type,r={};for(var a in t){var s=t[a];if(!("value"===a&&"defaultValue"in t&&null==s||mn&&"children"===a&&"noscript"===n||"class"===a||"className"===a)){var i=a.toLowerCase();"defaultValue"===a&&"value"in t&&null==t.value?a="value":"download"===a&&!0===s?s="":"ondoubleclick"===i?a="ondblclick":"onchange"!==i||"input"!==n&&"textarea"!==n||hn(t.type)?"onfocus"===i?a="onfocusin":"onblur"===i?a="onfocusout":un.test(a)?a=i:-1===n.indexOf("-")&&dn.test(a)?a=a.replace(pn,"-$&").toLowerCase():null===s&&(s=void 0):i=a="oninput","oninput"===i&&r[a=i]&&(a="oninputCapture"),r[a]=s}}"select"==n&&r.multiple&&Array.isArray(r.value)&&(r.value=Xe(t.children).forEach((function(e){e.props.selected=-1!=r.value.indexOf(e.props.value)}))),"select"==n&&null!=r.defaultValue&&(r.value=Xe(t.children).forEach((function(e){e.props.selected=r.multiple?-1!=r.defaultValue.indexOf(e.props.value):r.defaultValue==e.props.value}))),t.class&&!t.className?(r.class=t.class,Object.defineProperty(r,"className",yn)):(t.className&&!t.class||t.class&&t.className)&&(r.class=r.className=t.className),e.props=r}(e),e.$$typeof=cn,wn&&wn(e)};var kn=Te.__r;Te.__r=function(e){kn&&kn(e),e.__c};var xn=Te.diffed;Te.diffed=function(e){xn&&xn(e);var t=e.props,n=e.__e;null!=n&&"textarea"===e.type&&"value"in t&&t.value!==n.value&&(n.value=null==t.value?"":t.value)};const En=(e,t,n)=>e.hasOwnProperty(t)?{...e,[t]:e[t]+n}:{...e,[t]:n},jn=(e,t,n,r,a)=>{Tt((()=>{a(performance.now())}),[e]),Tt((()=>{const s=()=>{if("visible"===document.visibilityState)a(performance.now());else{const a=En(t,e,performance.now()-r);n(a)}};return document.addEventListener("visibilitychange",s),()=>{document.removeEventListener("visibilitychange",s)}}),[])};function Nn({question:e,onSubmit:t,onBack:n,isFirstQuestion:r,isLastQuestion:a,ttc:s,setTtc:i}){const[o,l]=It(performance.now());return jn(e.id,s,i,o,l),dt("div",{children:[e.imageUrl&&dt(Kt,{imgUrl:e.imageUrl}),dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(Gt,{htmlString:e.html,questionId:e.id}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!r&&dt(Ht,{backButtonLabel:e.backButtonLabel,onClick:()=>{const r=En(s,e.id,performance.now()-o);i(r),t({[e.id]:""},r),n()}}),dt("div",{className:"flex w-full justify-end",children:[!e.required&&dt("button",{tabIndex:0,type:"button",onClick:()=>{const n=En(s,e.id,performance.now()-o);i(n),t({[e.id]:"dismissed"},n)},className:"text-heading focus:ring-focus mr-4 flex items-center rounded-md px-3 py-3 text-base font-medium leading-4 hover:opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2",children:e.dismissButtonLabel||"Skip"}),dt(Vt,{buttonLabel:e.buttonLabel,isLastQuestion:a,focus:!0,onClick:()=>{var n;e.buttonExternal&&e.buttonUrl&&(null==(n=null==window?void 0:window.open(e.buttonUrl,"_blank"))||n.focus());const r=En(s,e.id,performance.now()-o);i(r),t({[e.id]:"clicked"},r)},type:"button"})]})]})]})}function Cn(e="https://app.cal.com/embed/embed.js"){return function(e,t,n){let r=function(e,t){e.q.push(t)},a=e.document;e.Cal=e.Cal||function(){let s=e.Cal,i=arguments;if(s.loaded||(s.ns={},s.q=s.q||[],a.head.appendChild(a.createElement("script")).src=t,s.loaded=!0),i[0]===n){const e=function(){r(e,arguments)},t=i[1];return e.q=e.q||[],void("string"==typeof t?(s.ns[t]=e)&&r(e,i):r(s,i))}r(s,i)}}(window,e,"init"),window.Cal}function Sn({question:e,onSuccessfulBooking:t}){const n=Ot((()=>{const e=Cn("https://cal.com/embed.js"),n={"cal-border-subtle":"transparent","cal-border-booker":"transparent"};return e("ui",{theme:"light",cssVarsPerTheme:{light:{...n},dark:{"cal-bg-muted":"transparent","cal-bg":"transparent",...n}}}),e("on",{action:"bookingSuccessful",callback:()=>{t()}}),e}),[t]);return Tt((()=>{document.querySelectorAll("cal-inline").forEach((e=>e.remove())),n("inline",{elementOrSelector:"#fb-cal-embed",calLink:e.calUserName})}),[n,e.calUserName]),dt("div",{className:"relative mt-4",children:dt("div",{id:"fb-cal-embed",className:pt("h-96 overflow-auto rounded-lg border border-slate-200")})})}function In({subheader:e,questionId:t}){return dt("label",{htmlFor:t,className:"text-subheading block text-sm font-normal leading-6",children:e})}function Tn({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:o,setTtc:l}){const[c,d]=It(performance.now());jn(e.id,o,l,c,d);const[u,p]=It(""),m=Dt((()=>{n({[e.id]:"booked"});const t=En(o,e.id,performance.now()-c);l(t),r({[e.id]:"booked"},t)}),[n,r,e.id,l,c,o]);return dt("form",{onSubmit:a=>{if(a.preventDefault(),e.required&&!t)return void p("Please book an appointment");const s=En(o,e.id,performance.now()-c);l(s),n({[e.id]:t}),r({[e.id]:t},s)},className:"w-full",children:[dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(In,{subheader:e.subheader,questionId:e.id}),dt($e,{children:[u&&dt("span",{className:"text-red-500",children:u}),dt(Sn,{question:e,onSuccessfulBooking:m},e.id)]}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!s&&dt(Ht,{backButtonLabel:e.backButtonLabel,onClick:()=>{a()}}),dt("div",{}),!e.required&&dt(Vt,{buttonLabel:e.buttonLabel,isLastQuestion:i,onClick:()=>{}})]})]})}function Ln({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:o,setTtc:l}){const[c,d]=It(performance.now());return jn(e.id,o,l,c,d),dt("div",{children:[e.imageUrl&&dt(Kt,{imgUrl:e.imageUrl}),dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(Gt,{htmlString:e.html||"",questionId:e.id}),dt("form",{onSubmit:n=>{n.preventDefault();const a=En(o,e.id,performance.now()-c);l(a),r({[e.id]:t},a)},children:[dt("label",{tabIndex:1,onKeyDown:t=>{"Enter"==t.key&&n({[e.id]:"accepted"})},className:"border-border bg-survey-bg text-heading hover:bg-accent-bg focus:bg-accent-bg focus:ring-border-highlight relative z-10 mt-4 flex w-full cursor-pointer items-center rounded-md border p-4 text-sm focus:outline-none focus:ring-2 focus:ring-offset-2",children:[dt("input",{type:"checkbox",id:e.id,name:e.id,value:e.label,onChange:t=>{t.target instanceof HTMLInputElement&&t.target.checked?n({[e.id]:"accepted"}):n({[e.id]:"dismissed"})},checked:"accepted"===t,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":`${e.id}-label`,required:e.required}),dt("span",{id:`${e.id}-label`,className:"ml-3 font-medium",children:e.label})]}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!s&&dt(Ht,{tabIndex:3,backButtonLabel:e.backButtonLabel,onClick:()=>{const n=En(o,e.id,performance.now()-c);l(n),r({[e.id]:t},n),a()}}),dt("div",{}),dt(Vt,{tabIndex:2,buttonLabel:e.buttonLabel,isLastQuestion:i,onClick:()=>{}})]})]})]})}Cn.toString();var On={SURVEYS_PACKAGE_BUILD:"surveys",NVM_INC:"/Users/matthiasnannt/.nvm/versions/node/v20.10.0/include/node",MANPATH:"/Users/matthiasnannt/.nvm/versions/node/v20.10.0/share/man:/opt/homebrew/share/man:/usr/share/man:/usr/local/share/man:/Users/matthiasnannt/.nvm/versions/node/v20.10.0/share/man:/opt/homebrew/share/man::",npm_config_legacy_peer_deps:"true",TERM_PROGRAM:"vscode",NODE:"/Users/matthiasnannt/Library/pnpm/pnpm",npm_package_homepage:"https://formbricks.com",INIT_CWD:"/Users/matthiasnannt/Developer/formbricks/packages/surveys",NVM_CD_FLAGS:"-q",TURBO_INVOCATION_DIR:"/Users/matthiasnannt/Developer/formbricks",_P9K_TTY:"/dev/ttys005",npm_package_devDependencies_vite:"^5.0.10",SHELL:"/bin/zsh",TERM:"xterm-256color",npm_config_shamefully_hoist:"true",HOMEBREW_REPOSITORY:"/opt/homebrew",TMPDIR:"/var/folders/zk/_n2g5c910zzccj1m8q1mg58h0000gn/T/",npm_package_devDependencies_eslint_config_turbo:"latest",npm_package_scripts_lint:"eslint . --ext .ts,.js,.tsx,.jsx",CONDA_SHLVL:"1",npm_package_devDependencies_concurrently:"8.2.2",CONDA_PROMPT_MODIFIER:"(base) ",TERM_PROGRAM_VERSION:"1.85.1",npm_package_scripts_dev:"SURVEYS_PACKAGE_MODE=development vite build --watch",MallocNanoZone:"0",ORIGINAL_XDG_CURRENT_DESKTOP:"undefined",ZDOTDIR:"/Users/matthiasnannt",npm_package_devDependencies__formbricks_types:"workspace:*",npm_config_registry:"https://registry.npmjs.org/",npm_package_sideEffects:"false",npm_package_devDependencies__formbricks_lib:"workspace:*",npm_package_repository_url:"https://github.com/formbricks/formbricks",PNPM_HOME:"/Users/matthiasnannt/Library/pnpm",ZSH:"/Users/matthiasnannt/.oh-my-zsh",npm_package_scripts_build_question_date:"tsc && SURVEYS_PACKAGE_BUILD=question-date vite build",npm_package_description:"Formbricks-surveys is a helper library to embed surveys into your application",NVM_DIR:"/Users/matthiasnannt/.nvm",USER:"matthiasnannt",npm_package_license:"MIT",COMMAND_MODE:"unix2003",npm_package_exports___import:"./dist/index.mjs",CONDA_EXE:"/Users/matthiasnannt/anaconda3/bin/conda",PNPM_SCRIPT_SRC_DIR:"/Users/matthiasnannt/Developer/formbricks/packages/surveys",npm_package_devDependencies_vite_tsconfig_paths:"^4.2.3",SSH_AUTH_SOCK:"/private/tmp/com.apple.launchd.0aMot443u0/Listeners",npm_package_devDependencies_postcss:"^8.4.32",__CF_USER_TEXT_ENCODING:"0x1F5:0x0:0x0",npm_execpath:"/Users/matthiasnannt/Library/pnpm/pnpm",npm_package_scripts_go:'concurrently "pnpm dev" "serve dist -p 3003"',npm_package_devDependencies_preact:"^10.19.3",npm_package_module:"./dist/index.mjs",PAGER:"less",npm_config_frozen_lockfile:"",LSCOLORS:"Gxfxcxdxbxegedabagacad",_CE_CONDA:"",npm_config_access:"public",npm_package_devDependencies_react_date_picker:"^10.6.0",npm_package_devDependencies__preact_preset_vite:"^2.8.1",PATH:"/Users/matthiasnannt/Developer/formbricks/packages/surveys/node_modules/.bin:/snapshot/dist/node-gyp-bin:/Users/matthiasnannt/Developer/formbricks/node_modules/.bin:/Users/matthiasnannt/Developer/formbricks/packages/surveys/node_modules/.bin:/snapshot/dist/node-gyp-bin:/Users/matthiasnannt/Developer/formbricks/node_modules/.bin:/Users/matthiasnannt/Developer/formbricks/node_modules/.bin:/snapshot/dist/node-gyp-bin:/Users/matthiasnannt/Developer/formbricks/node_modules/.bin:/Users/matthiasnannt/.docker/bin:/Users/matthiasnannt/Library/pnpm:/Users/matthiasnannt/.yarn/bin:/Users/matthiasnannt/.config/yarn/global/node_modules/.bin:/Users/matthiasnannt/anaconda3/bin:/Users/matthiasnannt/.nvm/versions/node/v20.10.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run/com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/bin:/Library/Apple/usr/bin",npm_config_auto_install_peers:"true",CONDA_PREFIX:"/Users/matthiasnannt/anaconda3",USER_ZDOTDIR:"/Users/matthiasnannt",__CFBundleIdentifier:"com.microsoft.VSCode",npm_command:"run-script",npm_package_devDependencies_terser:"^5.26.0",npm_package_devDependencies_tailwindcss:"^3.4.0",PWD:"/Users/matthiasnannt/Developer/formbricks/packages/surveys",npm_package_scripts_preview:"vite preview",npm_lifecycle_event:"build:surveys",P9K_SSH:"0",npm_package_types:"./dist/index.d.ts",npm_package_repository_type:"git",npm_package_name:"@formbricks/surveys",LANG:"en_US.UTF-8",P9K_TTY:"old",npm_package_scripts_build:"pnpm run build:surveys && pnpm run build:question-date",npm_config_node_linker:"hoisted",TURBO_HASH:"0916a53b9f093b5c",VSCODE_GIT_ASKPASS_EXTRA_ARGS:"--ms-enable-electron-run-as-node",XPC_FLAGS:"0x0",npm_package_devDependencies_vite_plugin_dts:"^3.7.0",npm_package_devDependencies_eslint_config_prettier:"^9.1.0",npm_package_main:"./dist/index.js",npm_package_version:"1.4.1",XPC_SERVICE_NAME:"0",_CE_M:"",npm_package_devDependencies_autoprefixer:"^10.4.16",VSCODE_INJECTION:"1",HOME:"/Users/matthiasnannt",SHLVL:"4",npm_package_source:"./src/index.ts",VSCODE_GIT_ASKPASS_MAIN:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass-main.js",npm_config_enable_pre_post_scripts:"true",npm_package_devDependencies__calcom_embed_snippet:"1.1.2",HOMEBREW_PREFIX:"/opt/homebrew",CONDA_PYTHON_EXE:"/Users/matthiasnannt/anaconda3/bin/python",LESS:"-R",LOGNAME:"matthiasnannt",npm_lifecycle_script:"tsc && SURVEYS_PACKAGE_BUILD=surveys vite build",npm_package_exports___require:"./dist/index.umd.js",VSCODE_GIT_IPC_HANDLE:"/var/folders/zk/_n2g5c910zzccj1m8q1mg58h0000gn/T/vscode-git-4d21f99dcc.sock",npm_config_shared_workspace_shrinkwrap:"true",npm_package_devDependencies__formbricks_tsconfig:"workspace:*",CONDA_DEFAULT_ENV:"base",NVM_BIN:"/Users/matthiasnannt/.nvm/versions/node/v20.10.0/bin",npm_config_user_agent:"pnpm/8.12.0 npm/? node/v18.5.0 darwin arm64",GIT_ASKPASS:"/Applications/Visual Studio Code.app/Contents/Resources/app/extensions/git/dist/askpass.sh",HOMEBREW_CELLAR:"/opt/homebrew/Cellar",INFOPATH:"/opt/homebrew/share/info:/opt/homebrew/share/info:",VSCODE_GIT_ASKPASS_NODE:"/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin)",npm_config_link_workspace_packages:"true",npm_package_files_0:"dist",npm_config_init_author_name:"Matthias Nannt",npm_package_devDependencies_serve:"14.2.1",npm_package_scripts_clean:"rimraf .turbo node_modules dist",npm_package_scripts_build_surveys:"tsc && SURVEYS_PACKAGE_BUILD=surveys vite build",npm_node_execpath:"/Users/matthiasnannt/Library/pnpm/pnpm",COLORTERM:"truecolor",_:"/Users/matthiasnannt/Developer/formbricks/node_modules/.bin/vite",NODE_ENV:"production"};function Dn({question:e,value:t,onSubmit:n,onBack:r,isFirstQuestion:a,isLastQuestion:s,onChange:i,setTtc:o,ttc:l}){const[c,d]=It(performance.now()),[u,p]=It(""),[m,h]=It(!0);jn(e.id,l,o,c,d);const f=t?new Date(t):void 0;return Tt((()=>{if(!window.initDatePicker){const t=document.createElement("script");return t.src="development"===On.SURVEYS_PACKAGE_MODE?"http://localhost:3003/question-date.umd.js":"https://unpkg.com/@formbricks/surveys@^1.4.0/dist/question-date.umd.js",t.async=!0,document.body.appendChild(t),t.onload=()=>{window.initDatePicker(document.getElementById("date-picker-root"),f,e.format),h(!1)},()=>{document.body.removeChild(t)}}{h(!1);const t=document.getElementById("datePickerContainer");t&&t.remove(),window.initDatePicker(document.getElementById("date-picker-root"),f,e.format)}return()=>{}}),[e.format,e.id]),Tt((()=>{window.addEventListener("dateChange",(t=>{const n=t.detail,r=6e4*n.getTimezoneOffset(),a=new Date(n.getTime()-r).toISOString().split("T")[0];i({[e.id]:a})}))}),[i,e.id]),Tt((()=>{t&&u&&p("")}),[t]),dt("form",{onSubmit:r=>{if(r.preventDefault(),e.required&&!t)return void p("Please select a date.");const a=En(l,e.id,performance.now()-c);o(a),n({[e.id]:t},a)},className:"w-full",children:[dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(In,{subheader:e.subheader,questionId:e.id}),dt("div",{className:"text-red-600",children:dt("span",{children:u})}),dt("div",{className:pt("my-4",u&&"rounded-lg border-2 border-red-500"),id:"date-picker-root",children:m&&dt("div",{className:"relative flex h-12 w-full cursor-pointer appearance-none items-center justify-center rounded-lg border border-slate-300 bg-white text-left text-base font-normal text-slate-900 hover:bg-slate-50 focus:outline-none focus:ring-2 focus:ring-neutral-900 focus:ring-offset-1",children:dt("span",{className:"h-6 w-6 animate-spin rounded-full border-b-2 border-neutral-900",style:{borderTopColor:"transparent"}})})}),dt("div",{className:"mt-4 flex w-full justify-between",children:[dt("div",{children:!a&&dt(Ht,{backButtonLabel:e.backButtonLabel,onClick:()=>{const t=En(l,e.id,performance.now()-c);o(t),r()}})}),dt(Vt,{isLastQuestion:s,onClick:()=>{},buttonLabel:e.buttonLabel})]})]})}function An({allowedFileExtensions:e,surveyId:t,onUploadCallback:n,onFileUpload:r,fileUrls:a,maxSizeInMB:s,allowMultipleFiles:i}){const[o,l]=It([]),[c,d]=It(!1),u=Ot((()=>!(c||!i&&a&&a.length>0)),[i,a,c]);return dt("div",{className:"items-left relative mt-3 flex w-full cursor-pointer flex-col justify-center rounded-lg border-2 border-dashed border-slate-300 bg-slate-50 hover:bg-slate-100 dark:border-slate-600 dark:bg-slate-700 dark:hover:border-slate-500 dark:hover:bg-slate-800",children:[dt("div",{children:a&&(null==a?void 0:a.map(((e,t)=>dt("div",{className:"relative m-2 rounded-md bg-slate-200",children:[dt("div",{className:"absolute right-0 top-0 m-2",children:dt("div",{className:"flex h-5 w-5 items-center justify-center rounded-md bg-slate-100 hover:bg-slate-50",children:dt("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 26 26",strokeWidth:1,stroke:"currentColor",className:"h-5 text-slate-700 hover:text-slate-900",onClick:e=>((e,t)=>{if(t.stopPropagation(),a){const t=[...o];t.splice(e,1),l(t);const r=[...a];r.splice(e,1),n(r)}})(t,e),children:dt("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 9l10 10m0-10L9 19"})})})}),dt("div",{className:"flex flex-col items-center justify-center p-2",children:[dt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",class:"lucide lucide-file",className:"h-6 text-slate-500",children:[dt("path",{d:"M14.5 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7.5L14.5 2z"}),dt("polyline",{points:"14 2 14 8 20 8"})]}),dt("p",{className:"mt-1 text-sm text-slate-600 dark:text-slate-400",children:decodeURIComponent(e).split("/").pop()})]})]},t))))}),dt("div",{children:[c&&dt("div",{className:"inset-0 flex animate-pulse items-center justify-center rounded-lg bg-slate-100 py-4",children:dt("label",{htmlFor:"selectedFile",className:"text-sm font-medium text-slate-500",children:"Uploading..."})}),dt("label",{htmlFor:"selectedFile",onDragOver:e=>(e=>{e.preventDefault(),e.stopPropagation(),e.dataTransfer.dropEffect="copy"})(e),onDrop:c=>(async c=>{c.preventDefault(),c.stopPropagation();const u=Array.from(c.dataTransfer.files);if(!i&&u.length>1)alert("Only one file can be uploaded at a time.");else if(u.length>0){const i=u.filter((t=>!(e&&e.length>0)||e.includes(t.type.substring(t.type.lastIndexOf("/")+1))));if(i.length>0){const c=[];for(const n of i)if(s)if((await n.arrayBuffer()).byteLength/1024>1024*s)alert(`File should be less than ${s} MB`);else{d(!0);try{const a=await r(n,{allowedFileExtensions:e,surveyId:t});l([...o,n]),c.push(a)}catch(e){d(!1),"File size exceeds the 10 MB limit"===e.message?alert(e.message):alert("Upload failed! Please try again.")}}else{d(!0);try{const a=await r(n,{allowedFileExtensions:e,surveyId:t});l([...o,n]),c.push(a)}catch(e){d(!1),"File size exceeds the 10 MB limit"===e.message?alert(e.message):alert("Upload failed! Please try again.")}}d(!1),n(a?[...a,...c]:c)}else alert("no selected files are valid")}})(c),children:u&&dt("div",{className:"flex flex-col items-center justify-center py-6",children:[dt("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor",className:"h-6 text-slate-500",children:dt("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5m-13.5-9L12 3m0 0l4.5 4.5M12 3v13.5"})}),dt("p",{className:"mt-2 text-sm text-slate-500 dark:text-slate-400",children:dt("span",{className:"font-medium",children:"Click or drag to upload files."})}),dt("input",{type:"file",id:"selectedFile",name:"selectedFile",accept:null==e?void 0:e.map((e=>`.${e}`)).join(","),className:"hidden",onChange:i=>{const c=i.target;c.files&&(async i=>{if(i)if(s)if((await i.arrayBuffer()).byteLength/1024>1024*s)alert(`File should be less than ${s} MB`);else{d(!0);try{const s=await r(i,{allowedFileExtensions:e,surveyId:t});l([...o,i]),d(!1),n(a?[...a,s]:[s])}catch(e){d(!1),"File size exceeds the 10 MB limit"===e.message?alert(e.message):alert("Upload failed! Please try again.")}}else{d(!0);try{const s=await r(i,{allowedFileExtensions:e,surveyId:t});l([...o,i]),d(!1),n(a?[...a,s]:[s])}catch(e){d(!1),"File size exceeds the 10 MB limit"===e.message?alert(e.message):alert("Upload failed! Please try again.")}}else alert("Please select a file")})(c.files[0])}})]})})]})]})}function Mn({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,surveyId:o,onFileUpload:l,ttc:c,setTtc:d}){const[u,p]=It(performance.now());return jn(e.id,c,d,u,p),dt("form",{onSubmit:n=>{n.preventDefault();const a=En(c,e.id,performance.now()-u);d(a),e.required?t&&("string"==typeof t||Array.isArray(t))&&t.length>0?r({[e.id]:"string"==typeof t?[t]:t},a):alert("Please upload a file"):r(t?{[e.id]:"string"==typeof t?[t]:t}:{[e.id]:"skipped"},a)},className:"w-full",children:[dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(In,{subheader:e.subheader,questionId:e.id}),dt(An,{surveyId:o,onFileUpload:l,onUploadCallback:t=>{n(t?{[e.id]:t}:{[e.id]:"skipped"})},fileUrls:t,allowMultipleFiles:e.allowMultipleFiles,...e.allowedFileExtensions?{allowedFileExtensions:e.allowedFileExtensions}:{},...e.maxSizeInMB?{maxSizeInMB:e.maxSizeInMB}:{}}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!s&&dt(Ht,{backButtonLabel:e.backButtonLabel,onClick:()=>{a()}}),dt("div",{}),dt(Vt,{buttonLabel:e.buttonLabel,isLastQuestion:i,onClick:()=>{}})]})]})}function Pn({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:o,setTtc:l}){const[c,d]=It(performance.now());jn(e.id,o,l,c,d);const u=Dt((()=>e.choices.filter((e=>"other"!==e.id)).map((e=>e.label))),[e]),[p,m]=It(!1),[h,f]=It("");Tt((()=>{m(!!t&&(Array.isArray(t)?t:[t]).some((e=>!1===u().includes(e)))),f(Array.isArray(t)&&t.filter((t=>!e.choices.find((e=>e.label===t))))[0]||"")}),[e.id]);const g=Ot((()=>{if(!e.choices)return[];const t=e.choices.filter((e=>"other"!==e.id));return e.shuffleOption?ht(t,e.shuffleOption):t}),[e.choices,e.shuffleOption]),b=g.map((e=>e.label)),v=Ot((()=>e.choices.find((e=>"other"===e.id))),[e.choices]),_=Lt(null);Tt((()=>{var e;p&&(null==(e=_.current)||e.focus())}),[p]);const y=r=>{const a=!b.includes(r);if(Array.isArray(t)){if(a){const a=t.filter((e=>b.includes(e)));return n({[e.id]:[...a,r]})}return n({[e.id]:[...t,r]})}return n({[e.id]:[r]})},w=r=>Array.isArray(t)?n({[e.id]:t.filter((e=>e!==r))}):n({[e.id]:[]});return dt("form",{onSubmit:a=>{a.preventDefault();const s=null==t?void 0:t.filter((e=>u().includes(e)||e===h));n({[e.id]:s});const i=En(o,e.id,performance.now()-c);l(i),r({[e.id]:t},i)},className:"w-full",children:[e.imageUrl&&dt(Kt,{imgUrl:e.imageUrl}),dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(In,{subheader:e.subheader,questionId:e.id}),dt("div",{className:"mt-4",children:dt("fieldset",{children:[dt("legend",{className:"sr-only",children:"Options"}),dt("div",{className:"bg-survey-bg relative max-h-[42vh] space-y-2 overflow-y-auto rounded-md py-0.5 pr-2",children:[g.map(((n,r)=>dt("label",{tabIndex:r+1,onKeyDown:e=>{"Enter"==e.key&&(Array.isArray(t)&&t.includes(n.label)?w(n.label):y(n.label))},className:pt(t===n.label?"border-border-highlight bg-accent-selected-bg z-10":"border-border","text-heading focus-within:border-border-highlight hover:bg-accent-bg focus:bg-accent-bg relative flex cursor-pointer flex-col rounded-md border p-4 focus:outline-none"),children:dt("span",{className:"flex items-center text-sm",children:[dt("input",{type:"checkbox",id:n.id,name:e.id,tabIndex:-1,value:n.label,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":`${n.id}-label`,onChange:e=>{var t;(null==(t=e.target)?void 0:t.checked)?y(n.label):w(n.label)},checked:Array.isArray(t)&&t.includes(n.label),required:!(e.required&&Array.isArray(t)&&t.length)&&e.required}),dt("span",{id:`${n.id}-label`,className:"ml-3 font-medium",children:n.label})]})},n.id))),v&&dt("label",{tabIndex:g.length+1,className:pt(t===v.label?"border-border-highlight bg-accent-selected-bg z-10":"border-border","text-heading focus-within:border-border-highlight focus-within:bg-accent-bg hover:bg-accent-bg relative flex cursor-pointer flex-col rounded-md border p-4 focus:outline-none"),onKeyDown:e=>{"Enter"==e.key&&m(!p)},children:[dt("span",{className:"flex items-center text-sm",children:[dt("input",{type:"checkbox",tabIndex:-1,id:v.id,name:e.id,value:v.label,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":`${v.id}-label`,onChange:e=>{var t;if(m(!p),null==(t=e.target)?void 0:t.checked){if(!h)return;y(h)}else w(h)},checked:p}),dt("span",{id:`${v.id}-label`,className:"ml-3 font-medium",children:v.label})]}),p&&dt("input",{ref:_,id:`${v.id}-label`,name:e.id,tabIndex:g.length+1,value:h,onChange:e=>{f(e.currentTarget.value),y(e.currentTarget.value)},onKeyDown:n=>{if("Enter"==n.key){const n=En(o,e.id,performance.now()-c);l(n),setTimeout((()=>{r({[e.id]:t},n)}),100)}},placeholder:"Please specify",className:"placeholder:text-placeholder border-border bg-survey-bg text-heading focus:ring-focus mt-3 flex h-10 w-full rounded-md border px-3 py-2 text-sm  focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",required:e.required,"aria-labelledby":`${v.id}-label`})]})]})]})}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!s&&dt(Ht,{tabIndex:g.length+3,backButtonLabel:e.backButtonLabel,onClick:()=>{const t=En(o,e.id,performance.now()-c);l(t),a()}}),dt("div",{}),dt(Vt,{tabIndex:g.length+2,buttonLabel:e.buttonLabel,isLastQuestion:i,onClick:()=>{}})]})]})}function Un({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:o,setTtc:l}){const[c,d]=It(performance.now());jn(e.id,o,l,c,d);const[u,p]=It(!1),m=Ot((()=>{if(!e.choices)return[];const t=e.choices.filter((e=>"other"!==e.id));return e.shuffleOption?ht(t,e.shuffleOption):t}),[e.choices,e.shuffleOption]),h=Ot((()=>e.choices.find((e=>"other"===e.id))),[e.choices]);Tt((()=>{p(!!t&&!e.choices.find((e=>e.label===t)))}),[e.id]);const f=Lt(null);return Tt((()=>{var e;u&&(null==(e=f.current)||e.focus())}),[u]),dt("form",{onSubmit:n=>{n.preventDefault();const a=En(o,e.id,performance.now()-c);l(a),r({[e.id]:t},a)},className:"w-full",children:[e.imageUrl&&dt(Kt,{imgUrl:e.imageUrl}),dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(In,{subheader:e.subheader,questionId:e.id}),dt("div",{className:"mt-4",children:dt("fieldset",{children:[dt("legend",{className:"sr-only",children:"Options"}),dt("div",{className:"bg-survey-bg relative max-h-[42vh] space-y-2 overflow-y-auto rounded-md py-0.5 pr-2",role:"radiogroup",children:[m.map(((a,s)=>dt("label",{tabIndex:s+1,onKeyDown:t=>{if("Enter"==t.key){n({[e.id]:a.label});const t=En(o,e.id,performance.now()-c);l(t),setTimeout((()=>{r({[e.id]:a.label},t)}),350)}},className:pt(t===a.label?"border-border-highlight bg-accent-selected-bg z-10":"border-border","text-heading focus-within:border-border-highlight focus-within:bg-accent-bg hover:bg-accent-bg relative flex cursor-pointer flex-col rounded-md border p-4 focus:outline-none"),children:dt("span",{className:"flex items-center text-sm",children:[dt("input",{tabIndex:-1,type:"radio",id:a.id,name:e.id,value:a.label,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":`${a.id}-label`,onChange:()=>{p(!1),n({[e.id]:a.label})},checked:t===a.label,required:e.required&&0===s}),dt("span",{id:`${a.id}-label`,className:"ml-3 font-medium",children:a.label})]})},a.id))),h&&dt("label",{tabIndex:m.length+1,className:pt(t===h.label?"border-border-highlight bg-accent-selected-bg z-10":"border-border","text-heading focus-within:border-border-highlight focus-within:bg-accent-bg hover:bg-accent-bg relative flex cursor-pointer flex-col rounded-md border p-4 focus:outline-none"),onKeyDown:t=>{"Enter"==t.key&&(p(!u),u||n({[e.id]:""}))},children:[dt("span",{className:"flex items-center text-sm",children:[dt("input",{type:"radio",id:h.id,tabIndex:-1,name:e.id,value:h.label,className:"border-brand text-brand h-4 w-4 border focus:ring-0 focus:ring-offset-0","aria-labelledby":`${h.id}-label`,onChange:()=>{p(!u),n({[e.id]:""})},checked:u}),dt("span",{id:`${h.id}-label`,className:"ml-3 font-medium",children:h.label})]}),u&&dt("input",{ref:f,tabIndex:m.length+1,id:`${h.id}-label`,name:e.id,value:t,onChange:t=>{n({[e.id]:t.currentTarget.value})},onKeyDown:n=>{if("Enter"==n.key){const n=En(o,e.id,performance.now()-c);l(n),setTimeout((()=>{r({[e.id]:t},n)}),100)}},placeholder:"Please specify",className:"placeholder:text-placeholder border-border bg-survey-bg text-heading focus:ring-focus mt-3 flex h-10 w-full rounded-md border px-3 py-2 text-sm  focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",required:e.required,"aria-labelledby":`${h.id}-label`})]})]})]})}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!s&&dt(Ht,{backButtonLabel:e.backButtonLabel,tabIndex:m.length+3,onClick:()=>{const t=En(o,e.id,performance.now()-c);l(t),a()}}),dt("div",{}),dt(Vt,{tabIndex:m.length+2,buttonLabel:e.buttonLabel,isLastQuestion:i,onClick:()=>{}})]})]})}function qn({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:o,setTtc:l}){const[c,d]=It(performance.now());return jn(e.id,o,l,c,d),dt("form",{onSubmit:n=>{n.preventDefault();const a=En(o,e.id,performance.now()-c);l(a),r({[e.id]:t},a)},children:[e.imageUrl&&dt(Kt,{imgUrl:e.imageUrl}),dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(In,{subheader:e.subheader,questionId:e.id}),dt("div",{className:"my-4",children:dt("fieldset",{children:[dt("legend",{className:"sr-only",children:"Options"}),dt("div",{className:"flex",children:Array.from({length:11},((e,t)=>t)).map(((a,s)=>dt("label",{tabIndex:s+1,onKeyDown:t=>{if("Enter"==t.key){const t=En(o,e.id,performance.now()-c);l(t),r({[e.id]:a},t)}},className:pt(t===a?"border-border-highlight bg-accent-selected-bg z-10":"border-border","bg-survey-bg text-heading hover:bg-accent-bg relative h-10 flex-1 cursor-pointer border text-center text-sm leading-10 first:rounded-l-md last:rounded-r-md focus:outline-none"),children:[dt("input",{type:"radio",name:"nps",value:a,checked:t===a,className:"absolute h-full w-full cursor-pointer opacity-0",onClick:()=>{if(e.required){const t=En(o,e.id,performance.now()-c);l(t),r({[e.id]:a},t)}n({[e.id]:a})},required:e.required}),a]},a)))}),dt("div",{className:"text-info-text flex justify-between px-1.5 text-xs leading-6",children:[dt("p",{children:e.lowerLabel}),dt("p",{children:e.upperLabel})]})]})}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!s&&dt(Ht,{tabIndex:i?12:13,backButtonLabel:e.backButtonLabel,onClick:()=>{const t=En(o,e.id,performance.now()-c);l(t),a()}}),dt("div",{}),!e.required&&dt(Vt,{tabIndex:12,buttonLabel:e.buttonLabel,isLastQuestion:i,onClick:()=>{}})]})]})}function Rn({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,autoFocus:o=!0,ttc:l,setTtc:c}){const[d,u]=It(performance.now());jn(e.id,l,c,d,u);const p=t=>{n({[e.id]:t})},m=Dt((e=>{e&&o&&e.focus()}),[e.id]);return dt("form",{onSubmit:n=>{n.preventDefault();const a=En(l,e.id,performance.now()-d);c(a),r({[e.id]:t,inputType:e.inputType},a)},className:"w-full",children:[e.imageUrl&&dt(Kt,{imgUrl:e.imageUrl}),dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(In,{subheader:e.subheader,questionId:e.id}),dt("div",{className:"mt-4",children:!1===e.longAnswer?dt("input",{ref:m,tabIndex:1,name:e.id,id:e.id,placeholder:e.placeholder,required:e.required,value:t||"",type:e.inputType,onInput:e=>p(e.currentTarget.value),autoFocus:o,className:"border-border bg-survey-bg focus:border-border-highlight block w-full rounded-md border p-2 shadow-sm focus:outline-none focus:ring-0 sm:text-sm",onKeyDown:n=>{if("Enter"===n.key&&(a=t,e.required&&!(null==a?void 0:a.trim())))n.preventDefault();else if("Enter"===n.key){const n=En(l,e.id,performance.now()-d);c(n),r({[e.id]:t,inputType:e.inputType},n)}var a},pattern:"phone"===e.inputType?"[+][0-9 ]+":".*",title:"phone"===e.inputType?"Enter a valid phone number":void 0}):dt("textarea",{ref:m,rows:3,name:e.id,tabIndex:1,id:e.id,placeholder:e.placeholder,required:e.required,value:t,type:e.inputType,onInput:e=>p(e.currentTarget.value),autoFocus:o,className:"border-border bg-survey-bg text-subheading focus:border-border-highlight block w-full rounded-md border p-2 shadow-sm focus:ring-0 sm:text-sm",pattern:"phone"===e.inputType?"[+][0-9 ]+":".*",title:"phone"===e.inputType?"Please enter a valid phone number":void 0})}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!s&&dt(Ht,{backButtonLabel:e.backButtonLabel,onClick:()=>{const t=En(l,e.id,performance.now()-d);c(t),a()}}),dt("div",{}),dt(Vt,{buttonLabel:e.buttonLabel,isLastQuestion:i,onClick:()=>{}})]})]})}function Bn({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:o,setTtc:l}){const[c,d]=It(performance.now());jn(e.id,o,l,c,d);const u=r=>{Array.isArray(t)&&t.includes(r)?(r=>{let a=[];a=e.allowMulti&&Array.isArray(t)?t.filter((e=>e!==r)):[],n({[e.id]:a})})(r):(r=>{let a=[];a=e.allowMulti&&Array.isArray(t)?[...t,r]:[r],n({[e.id]:a})})(r)};Tt((()=>{!e.allowMulti&&Array.isArray(t)&&t.length>1&&n({[e.id]:[]})}),[e.allowMulti]);const p=e.choices;return dt("form",{onSubmit:n=>{n.preventDefault();const a=En(o,e.id,performance.now()-c);l(a),r({[e.id]:t},a)},className:"w-full",children:[e.imageUrl&&dt(Kt,{imgUrl:e.imageUrl}),dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(In,{subheader:e.subheader,questionId:e.id}),dt("div",{className:"mt-4",children:dt("fieldset",{children:[dt("legend",{className:"sr-only",children:"Options"}),dt("div",{className:"rounded-m bg-survey-bg relative grid max-h-[42vh] grid-cols-2 gap-x-5 gap-y-4 overflow-y-auto pr-2.5",children:p.map(((n,r)=>dt("label",{tabIndex:r+1,htmlFor:n.id,onKeyDown:e=>{"Enter"==e.key&&u(n.id)},onClick:()=>u(n.id),className:pt(Array.isArray(t)&&t.includes(n.id)?"border-brand text-brand z-10 border-4 shadow-xl focus:border-4":"","border-border focus:border-border-highlight focus:bg-accent-selected-bg relative box-border inline-block h-28 w-full overflow-hidden rounded-xl border focus:outline-none"),children:[dt("img",{src:n.imageUrl,id:n.id,alt:n.imageUrl.split("/").pop(),className:"h-full w-full object-cover"}),e.allowMulti?dt("input",{id:`${n.id}-checked`,name:`${n.id}-checkbox`,type:"checkbox",tabIndex:-1,checked:Array.isArray(t)&&t.includes(n.id),className:pt("border-border pointer-events-none absolute right-2 top-2 z-20 h-5 w-5 rounded border",Array.isArray(t)&&t.includes(n.id)?"border-brand text-brand":""),required:!(e.required&&Array.isArray(t)&&t.length)&&e.required}):dt("input",{id:`${n.id}-radio`,name:`${n.id}-radio`,type:"radio",tabIndex:-1,checked:Array.isArray(t)&&t.includes(n.id),className:pt("border-border pointer-events-none absolute right-2 top-2 z-20 h-5 w-5 rounded-full border",Array.isArray(t)&&t.includes(n.id)?"border-brand text-brand":""),required:!(e.required&&Array.isArray(t)&&t.length)&&e.required})]},n.id)))})]})}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!s&&dt(Ht,{tabIndex:p.length+3,backButtonLabel:e.backButtonLabel,onClick:()=>{const t=En(o,e.id,performance.now()-c);l(t),a()}}),dt("div",{}),dt(Vt,{tabIndex:p.length+2,buttonLabel:e.buttonLabel,isLastQuestion:i,onClick:()=>{}})]})]})}const Fn=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m21.88 23.92c5.102-0.06134 7.273-1.882 8.383-3.346"}),dt("path",{stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",d:"m46.24 47.56c0-2.592-2.867-7.121-10.25-6.93-6.974 0.1812-10.22 4.518-10.22 7.111s4.271-1.611 10.05-1.492c6.317 0.13 10.43 3.903 10.43 1.311z"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m23.16 28.47c5.215 1.438 5.603 0.9096 8.204 1.207 1.068 0.1221-2.03 2.67-7.282 4.397"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m50.12 23.92c-5.102-0.06134-7.273-1.882-8.383-3.346"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m48.84 28.47c-5.215 1.438-5.603 0.9096-8.204 1.207-1.068 0.1221 2.03 2.67 7.282 4.397"})]})}),Zn=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m22.88 23.92c5.102-0.06134 7.273-1.882 8.383-3.346"}),dt("path",{stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",d:"m46.24 47.56c0-2.592-2.867-7.121-10.25-6.93-6.974 0.1812-10.22 4.518-10.22 7.111s4.271-1.611 10.05-1.492c6.317 0.13 10.43 3.903 10.43 1.311z"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m49.12 23.92c-5.102-0.06134-7.273-1.882-8.383-3.346"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m48.24 30.51c-6.199 1.47-7.079 1.059-8.868-1.961"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"m23.76 30.51c6.199 1.47 7.079 1.059 8.868-1.961"})]})}),zn=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),dt("line",{x1:"44.5361",x2:"50.9214",y1:"21.4389",y2:"24.7158",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2"}),dt("line",{x1:"26.9214",x2:"20.5361",y1:"21.4389",y2:"24.7158",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M24,28c2.3334,1.3333,4.6666,2.6667,7,4c-2.3334,1.3333-4.6666,2.6667-7,4"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M48,28c-2.3334,1.3333-4.6666,2.6667-7,4c2.3334,1.3333,4.6666,2.6667,7,4"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M28,51c0.2704-0.3562,1-8,8.4211-8.0038C43,42.9929,43.6499,50.5372,44,51C38.6667,51,33.3333,51,28,51z"})]})}),$n=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M26.5,48c1.8768-3.8326,5.8239-6.1965,10-6c3.8343,0.1804,7.2926,2.4926,9,6"}),dt("path",{d:"M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"}),dt("path",{d:"M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"})]})}),Hn=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"m44.7 43.92c-6.328-1.736-11.41-0.906-17.4 1.902"}),dt("path",{d:"M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"}),dt("path",{d:"M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"})]})}),Vn=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeMiterlimit:"10",strokeWidth:"2",...e}),dt("line",{x1:"27",x2:"45",y1:"43",y2:"43",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeMiterlimit:"10",strokeWidth:"2"}),dt("path",{d:"M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"}),dt("path",{d:"M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"})]})}),Wn=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",...e}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M45.8149,44.9293 c-2.8995,1.6362-6.2482,2.5699-9.8149,2.5699s-6.9153-0.9336-9.8149-2.5699"}),dt("path",{d:"M30,31c0,1.6568-1.3448,3-3,3c-1.6553,0-3-1.3433-3-3c0-1.6552,1.3447-3,3-3C28.6552,28,30,29.3448,30,31"}),dt("path",{d:"M48,31c0,1.6568-1.3447,3-3,3s-3-1.3433-3-3c0-1.6552,1.3447-3,3-3S48,29.3448,48,31"})]})}),Qn=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",...e}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M45.8147,45.2268a15.4294,15.4294,0,0,1-19.6294,0"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M31.6941,33.4036a4.7262,4.7262,0,0,0-8.6382,0"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M48.9441,33.4036a4.7262,4.7262,0,0,0-8.6382,0"})]})}),Gn=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",...e}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M50.595,41.64a11.5554,11.5554,0,0,1-.87,4.49c-12.49,3.03-25.43.34-27.49-.13a11.4347,11.4347,0,0,1-.83-4.36h.11s14.8,3.59,28.89.07Z"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M49.7251,46.13c-1.79,4.27-6.35,7.23-13.69,7.23-7.41,0-12.03-3.03-13.8-7.36C24.2951,46.47,37.235,49.16,49.7251,46.13Z"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M31.6941,32.4036a4.7262,4.7262,0,0,0-8.6382,0"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeMiterlimit:"10",strokeWidth:"2",d:"M48.9441,32.4036a4.7262,4.7262,0,0,0-8.6382,0"})]})}),Kn=e=>dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48,children:dt("g",{id:"line",children:[dt("circle",{cx:"36",cy:"36",r:"23",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",...e}),dt("polyline",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",points:"25.168 27.413 31.755 31.427 25.168 35.165"}),dt("polyline",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",points:"46.832 27.413 40.245 31.427 46.832 35.165"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M50.595,41.64a11.5554,11.5554,0,0,1-.87,4.49c-12.49,3.03-25.43.34-27.49-.13a11.4347,11.4347,0,0,1-.83-4.36h.11s14.8,3.59,28.89.07Z"}),dt("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M49.7251,46.13c-1.79,4.27-6.35,7.23-13.69,7.23-7.41,0-12.03-3.03-13.8-7.36C24.2951,46.47,37.235,49.16,49.7251,46.13Z"})]})});function Yn({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:o,setTtc:l}){const[c,d]=It(0),[u,p]=It(performance.now());jn(e.id,o,l,u,p);const m=t=>{if(n({[e.id]:t}),e.required){const n=En(o,e.id,performance.now()-u);l(n),r({[e.id]:t},n)}},h=({number:n})=>dt("input",{type:"radio",name:"rating",value:n,className:"absolute left-0 h-full w-full cursor-pointer opacity-0",onChange:()=>m(n),required:e.required,checked:t===n});return dt("form",{onSubmit:n=>{n.preventDefault();const a=En(o,e.id,performance.now()-u);l(a),r({[e.id]:t},a)},className:"w-full",children:[e.imageUrl&&dt(Kt,{imgUrl:e.imageUrl}),dt(Wt,{headline:e.headline,questionId:e.id,required:e.required}),dt(In,{subheader:e.subheader,questionId:e.id}),dt("div",{className:"mb-4 mt-6 flex items-center justify-center",children:dt("fieldset",{className:"w-full ",children:[dt("legend",{className:"sr-only",children:"Choices"}),dt("div",{className:"flex pb-2",children:Array.from({length:e.range},((e,t)=>t+1)).map(((n,r,a)=>dt("span",{onMouseOver:()=>d(n),onMouseLeave:()=>d(0),className:"bg-survey-bg relative flex-1 cursor-pointer text-center text-sm leading-[2.8rem]",children:"number"===e.scale?dt("label",{tabIndex:r+1,onKeyDown:e=>{"Enter"==e.key&&m(n)},className:pt(t===n?"bg-accent-selected-bg border-border-highlight z-10":"",a.length===n?"rounded-r-md":"",1===n?"rounded-l-md":"","text-heading hover:bg-accent-bg focus:bg-accent-bg block h-full w-full border focus:outline-none"),children:[dt(h,{number:n}),n]}):"star"===e.scale?dt("label",{tabIndex:r+1,onKeyDown:e=>{"Enter"==e.key&&m(n)},className:pt("flex h-full w-full justify-center focus:outline-none",n<=c?"text-amber-400":"text-slate-300","hover:text-amber-400"),onFocus:()=>d(n),onBlur:()=>d(0),children:[dt(h,{number:n}),dt("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-14 max-h-full w-14",children:dt("path",{fillRule:"evenodd",d:"M11.48 3.499a.562.562 0 011.04 0l2.125 5.111a.563.563 0 00.475.345l5.518.442c.499.04.701.663.321.988l-4.204 3.602a.563.563 0 00-.182.557l1.285 5.385a.562.562 0 01-.84.61l-4.725-2.885a.563.563 0 00-.586 0L6.982 20.54a.562.562 0 01-.84-.61l1.285-5.386a.562.562 0 00-.182-.557l-4.204-3.602a.563.563 0 01.321-.988l5.518-.442a.563.563 0 00.475-.345L11.48 3.5z"})})]}):dt("label",{className:pt("flex h-full w-full justify-center",t===n||c===n?"stroke-rating-selected text-rating-selected":"stroke-heading text-heading"),tabIndex:r+1,onKeyDown:e=>{"Enter"==e.key&&m(n)},onFocus:()=>d(n),onBlur:()=>d(0),children:[dt(h,{number:n}),dt(Xn,{active:t===n||c===n,idx:r,range:e.range})]})},n)))}),dt("div",{className:"text-subheading flex justify-between px-1.5 text-xs leading-6",children:[dt("p",{className:"w-1/2 text-left",children:e.lowerLabel}),dt("p",{className:"w-1/2 text-right",children:e.upperLabel})]})]})}),dt("div",{className:"mt-4 flex w-full justify-between",children:[!s&&dt(Ht,{tabIndex:!e.required||t?e.range+2:e.range+1,backButtonLabel:e.backButtonLabel,onClick:()=>{const t=En(o,e.id,performance.now()-u);l(t),a()}}),dt("div",{}),(!e.required||t)&&dt(Vt,{tabIndex:e.range+1,buttonLabel:e.buttonLabel,isLastQuestion:i,onClick:()=>{}})]})]})}function Xn({active:e,idx:t,range:n}){const r="fill-rating-fill",a="fill-none";let s=[dt(Fn,{className:e?r:a}),dt(Zn,{className:e?r:a}),dt(zn,{className:e?r:a}),dt($n,{className:e?r:a}),dt(Hn,{className:e?r:a}),dt(Vn,{className:e?r:a}),dt(Wn,{className:e?r:a}),dt(Qn,{className:e?r:a}),dt(Gn,{className:e?r:a}),dt(Kn,{className:e?r:a})];return 7==n?s=[s[1],s[3],s[4],s[5],s[6],s[8],s[9]]:5==n?s=[s[3],s[4],s[5],s[6],s[7]]:4==n?s=[s[4],s[5],s[6],s[7]]:3==n&&(s=[s[4],s[5],s[7]]),s[t]}var Jn,er,tr;dt("svg",{viewBox:"0 0 72 72",xmlns:"http://www.w3.org/2000/svg",width:48,height:48}),(er=Jn||(Jn={})).assertEqual=e=>e,er.assertIs=function(e){},er.assertNever=function(_x){throw new Error},er.arrayToEnum=e=>{const t={};for(const n of e)t[n]=n;return t},er.getValidEnumValues=e=>{const t=er.objectKeys(e).filter((t=>"number"!=typeof e[e[t]])),n={};for(const r of t)n[r]=e[r];return er.objectValues(n)},er.objectValues=e=>er.objectKeys(e).map((function(t){return e[t]})),er.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.push(n);return t},er.find=(e,t)=>{for(const n of e)if(t(n))return n},er.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&isFinite(e)&&Math.floor(e)===e,er.joinValues=function(e,t=" | "){return e.map((e=>"string"==typeof e?`'${e}'`:e)).join(t)},er.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t,(tr||(tr={})).mergeShapes=(e,t)=>({...e,...t});const nr=Jn.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),rr=e=>{switch(typeof e){case"undefined":return nr.undefined;case"string":return nr.string;case"number":return isNaN(e)?nr.nan:nr.number;case"boolean":return nr.boolean;case"function":return nr.function;case"bigint":return nr.bigint;case"symbol":return nr.symbol;case"object":return Array.isArray(e)?nr.array:null===e?nr.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?nr.promise:"undefined"!=typeof Map&&e instanceof Map?nr.map:"undefined"!=typeof Set&&e instanceof Set?nr.set:"undefined"!=typeof Date&&e instanceof Date?nr.date:nr.object;default:return nr.unknown}},ar=Jn.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class sr extends Error{constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){const t=e||function(e){return e.message},n={_errors:[]},r=e=>{for(const a of e.issues)if("invalid_union"===a.code)a.unionErrors.map(r);else if("invalid_return_type"===a.code)r(a.returnTypeError);else if("invalid_arguments"===a.code)r(a.argumentsError);else if(0===a.path.length)n._errors.push(t(a));else{let e=n,r=0;for(;r<a.path.length;){const n=a.path[r];r===a.path.length-1?(e[n]=e[n]||{_errors:[]},e[n]._errors.push(t(a))):e[n]=e[n]||{_errors:[]},e=e[n],r++}}};return r(this),n}toString(){return this.message}get message(){return JSON.stringify(this.issues,Jn.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=(e=>e.message)){const t={},n=[];for(const r of this.issues)r.path.length>0?(t[r.path[0]]=t[r.path[0]]||[],t[r.path[0]].push(e(r))):n.push(e(r));return{formErrors:n,fieldErrors:t}}get formErrors(){return this.flatten()}}sr.create=e=>new sr(e);const ir=(e,t)=>{let n;switch(e.code){case ar.invalid_type:n=e.received===nr.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case ar.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,Jn.jsonStringifyReplacer)}`;break;case ar.unrecognized_keys:n=`Unrecognized key(s) in object: ${Jn.joinValues(e.keys,", ")}`;break;case ar.invalid_union:n="Invalid input";break;case ar.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${Jn.joinValues(e.options)}`;break;case ar.invalid_enum_value:n=`Invalid enum value. Expected ${Jn.joinValues(e.options)}, received '${e.received}'`;break;case ar.invalid_arguments:n="Invalid function arguments";break;case ar.invalid_return_type:n="Invalid function return type";break;case ar.invalid_date:n="Invalid date";break;case ar.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:Jn.assertNever(e.validation):n="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case ar.too_small:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case ar.too_big:n="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case ar.custom:n="Invalid input";break;case ar.invalid_intersection_types:n="Intersection results could not be merged";break;case ar.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case ar.not_finite:n="Number must be finite";break;default:n=t.defaultError,Jn.assertNever(e)}return{message:n}};let or=ir;function lr(){return or}const cr=e=>{const{data:t,path:n,errorMaps:r,issueData:a}=e,s=[...n,...a.path||[]],i={...a,path:s};let o="";const l=r.filter((e=>!!e)).slice().reverse();for(const e of l)o=e(i,{data:t,defaultError:o}).message;return{...a,path:s,message:a.message||o}};function dr(e,t){const n=cr({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,lr(),ir].filter((e=>!!e))});e.common.issues.push(n)}class ur{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const n=[];for(const r of t){if("aborted"===r.status)return pr;"dirty"===r.status&&e.dirty(),n.push(r.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,t){const n=[];for(const e of t)n.push({key:await e.key,value:await e.value});return ur.mergeObjectSync(e,n)}static mergeObjectSync(e,t){const n={};for(const r of t){const{key:t,value:a}=r;if("aborted"===t.status)return pr;if("aborted"===a.status)return pr;"dirty"===t.status&&e.dirty(),"dirty"===a.status&&e.dirty(),"__proto__"===t.value||void 0===a.value&&!r.alwaysSet||(n[t.value]=a.value)}return{status:e.value,value:n}}}const pr=Object.freeze({status:"aborted"}),mr=e=>({status:"dirty",value:e}),hr=e=>({status:"valid",value:e}),fr=e=>"aborted"===e.status,gr=e=>"dirty"===e.status,br=e=>"valid"===e.status,vr=e=>"undefined"!=typeof Promise&&e instanceof Promise;var _r,yr;(yr=_r||(_r={})).errToObj=e=>"string"==typeof e?{message:e}:e||{},yr.toString=e=>"string"==typeof e?e:null==e?void 0:e.message;class wr{constructor(e,t,n,r){this._cachedPath=[],this.parent=e,this.data=t,this._path=n,this._key=r}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const kr=(e,t)=>{if(br(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new sr(e.common.issues);return this._error=t,this._error}}};function xr(e){if(!e)return{};const{errorMap:t,invalid_type_error:n,required_error:r,description:a}=e;if(t&&(n||r))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:a}:{errorMap:(e,t)=>"invalid_type"!==e.code?{message:t.defaultError}:void 0===t.data?{message:null!=r?r:t.defaultError}:{message:null!=n?n:t.defaultError},description:a}}class Er{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return rr(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:rr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ur,ctx:{common:e.parent.common,data:e.data,parsedType:rr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(vr(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const n=this.safeParse(e,t);if(n.success)return n.data;throw n.error}safeParse(e,t){var n;const r={common:{issues:[],async:null!==(n=null==t?void 0:t.async)&&void 0!==n&&n,contextualErrorMap:null==t?void 0:t.errorMap},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rr(e)},a=this._parseSync({data:e,path:r.path,parent:r});return kr(r,a)}async parseAsync(e,t){const n=await this.safeParseAsync(e,t);if(n.success)return n.data;throw n.error}async safeParseAsync(e,t){const n={common:{issues:[],contextualErrorMap:null==t?void 0:t.errorMap,async:!0},path:(null==t?void 0:t.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:rr(e)},r=this._parse({data:e,path:n.path,parent:n}),a=await(vr(r)?r:Promise.resolve(r));return kr(n,a)}refine(e,t){const n=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement(((t,r)=>{const a=e(t),s=()=>r.addIssue({code:ar.custom,...n(t)});return"undefined"!=typeof Promise&&a instanceof Promise?a.then((e=>!!e||(s(),!1))):!!a||(s(),!1)}))}refinement(e,t){return this._refinement(((n,r)=>!!e(n)||(r.addIssue("function"==typeof t?t(n,r):t),!1)))}_refinement(e){return new ua({schema:this,typeName:xa.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return pa.create(this,this._def)}nullable(){return ma.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Vr.create(this,this._def)}promise(){return da.create(this,this._def)}or(e){return Gr.create([this,e],this._def)}and(e){return Jr.create(this,e,this._def)}transform(e){return new ua({...xr(this._def),schema:this,typeName:xa.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ha({...xr(this._def),innerType:this,defaultValue:t,typeName:xa.ZodDefault})}brand(){return new va({typeName:xa.ZodBranded,type:this,...xr(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new fa({...xr(this._def),innerType:this,catchValue:t,typeName:xa.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return _a.create(this,e)}readonly(){return ya.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const jr=/^c[^\s-]{8,}$/i,Nr=/^[a-z][a-z0-9]*$/,Cr=/^[0-9A-HJKMNP-TV-Z]{26}$/,Sr=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Ir=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let Tr;const Lr=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,Or=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/;class Dr extends Er{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==nr.string){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.string,received:t.parsedType}),pr}const t=new ur;let n;for(const i of this._def.checks)if("min"===i.kind)e.data.length<i.value&&(n=this._getOrReturnCtx(e,n),dr(n,{code:ar.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("max"===i.kind)e.data.length>i.value&&(n=this._getOrReturnCtx(e,n),dr(n,{code:ar.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),t.dirty());else if("length"===i.kind){const r=e.data.length>i.value,a=e.data.length<i.value;(r||a)&&(n=this._getOrReturnCtx(e,n),r?dr(n,{code:ar.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):a&&dr(n,{code:ar.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),t.dirty())}else if("email"===i.kind)Ir.test(e.data)||(n=this._getOrReturnCtx(e,n),dr(n,{validation:"email",code:ar.invalid_string,message:i.message}),t.dirty());else if("emoji"===i.kind)Tr||(Tr=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),Tr.test(e.data)||(n=this._getOrReturnCtx(e,n),dr(n,{validation:"emoji",code:ar.invalid_string,message:i.message}),t.dirty());else if("uuid"===i.kind)Sr.test(e.data)||(n=this._getOrReturnCtx(e,n),dr(n,{validation:"uuid",code:ar.invalid_string,message:i.message}),t.dirty());else if("cuid"===i.kind)jr.test(e.data)||(n=this._getOrReturnCtx(e,n),dr(n,{validation:"cuid",code:ar.invalid_string,message:i.message}),t.dirty());else if("cuid2"===i.kind)Nr.test(e.data)||(n=this._getOrReturnCtx(e,n),dr(n,{validation:"cuid2",code:ar.invalid_string,message:i.message}),t.dirty());else if("ulid"===i.kind)Cr.test(e.data)||(n=this._getOrReturnCtx(e,n),dr(n,{validation:"ulid",code:ar.invalid_string,message:i.message}),t.dirty());else if("url"===i.kind)try{new URL(e.data)}catch(r){n=this._getOrReturnCtx(e,n),dr(n,{validation:"url",code:ar.invalid_string,message:i.message}),t.dirty()}else"regex"===i.kind?(i.regex.lastIndex=0,i.regex.test(e.data)||(n=this._getOrReturnCtx(e,n),dr(n,{validation:"regex",code:ar.invalid_string,message:i.message}),t.dirty())):"trim"===i.kind?e.data=e.data.trim():"includes"===i.kind?e.data.includes(i.value,i.position)||(n=this._getOrReturnCtx(e,n),dr(n,{code:ar.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),t.dirty()):"toLowerCase"===i.kind?e.data=e.data.toLowerCase():"toUpperCase"===i.kind?e.data=e.data.toUpperCase():"startsWith"===i.kind?e.data.startsWith(i.value)||(n=this._getOrReturnCtx(e,n),dr(n,{code:ar.invalid_string,validation:{startsWith:i.value},message:i.message}),t.dirty()):"endsWith"===i.kind?e.data.endsWith(i.value)||(n=this._getOrReturnCtx(e,n),dr(n,{code:ar.invalid_string,validation:{endsWith:i.value},message:i.message}),t.dirty()):"datetime"===i.kind?((s=i).precision?s.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${s.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${s.precision}}Z$`):0===s.precision?s.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):s.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$")).test(e.data)||(n=this._getOrReturnCtx(e,n),dr(n,{code:ar.invalid_string,validation:"datetime",message:i.message}),t.dirty()):"ip"===i.kind?(r=e.data,("v4"!==(a=i.version)&&a||!Lr.test(r))&&("v6"!==a&&a||!Or.test(r))&&(n=this._getOrReturnCtx(e,n),dr(n,{validation:"ip",code:ar.invalid_string,message:i.message}),t.dirty())):Jn.assertNever(i);var r,a,s;return{status:t.value,value:e.data}}_regex(e,t,n){return this.refinement((t=>e.test(t)),{validation:t,code:ar.invalid_string,..._r.errToObj(n)})}_addCheck(e){return new Dr({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._r.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._r.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._r.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._r.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._r.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._r.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._r.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._r.errToObj(e)})}datetime(e){var t;return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===(null==e?void 0:e.precision)?null:null==e?void 0:e.precision,offset:null!==(t=null==e?void 0:e.offset)&&void 0!==t&&t,..._r.errToObj(null==e?void 0:e.message)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,..._r.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:null==t?void 0:t.position,..._r.errToObj(null==t?void 0:t.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,..._r.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,..._r.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,..._r.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,..._r.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,..._r.errToObj(t)})}nonempty(e){return this.min(1,_r.errToObj(e))}trim(){return new Dr({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Dr({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Dr({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find((e=>"datetime"===e.kind))}get isEmail(){return!!this._def.checks.find((e=>"email"===e.kind))}get isURL(){return!!this._def.checks.find((e=>"url"===e.kind))}get isEmoji(){return!!this._def.checks.find((e=>"emoji"===e.kind))}get isUUID(){return!!this._def.checks.find((e=>"uuid"===e.kind))}get isCUID(){return!!this._def.checks.find((e=>"cuid"===e.kind))}get isCUID2(){return!!this._def.checks.find((e=>"cuid2"===e.kind))}get isULID(){return!!this._def.checks.find((e=>"ulid"===e.kind))}get isIP(){return!!this._def.checks.find((e=>"ip"===e.kind))}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function Ar(e,t){const n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,a=n>r?n:r;return parseInt(e.toFixed(a).replace(".",""))%parseInt(t.toFixed(a).replace(".",""))/Math.pow(10,a)}Dr.create=e=>{var t;return new Dr({checks:[],typeName:xa.ZodString,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...xr(e)})};class Mr extends Er{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==nr.number){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.number,received:t.parsedType}),pr}let t;const n=new ur;for(const r of this._def.checks)"int"===r.kind?Jn.isInteger(e.data)||(t=this._getOrReturnCtx(e,t),dr(t,{code:ar.invalid_type,expected:"integer",received:"float",message:r.message}),n.dirty()):"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),dr(t,{code:ar.too_small,minimum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),dr(t,{code:ar.too_big,maximum:r.value,type:"number",inclusive:r.inclusive,exact:!1,message:r.message}),n.dirty()):"multipleOf"===r.kind?0!==Ar(e.data,r.value)&&(t=this._getOrReturnCtx(e,t),dr(t,{code:ar.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):"finite"===r.kind?Number.isFinite(e.data)||(t=this._getOrReturnCtx(e,t),dr(t,{code:ar.not_finite,message:r.message}),n.dirty()):Jn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,_r.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_r.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_r.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_r.toString(t))}setLimit(e,t,n,r){return new Mr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:_r.toString(r)}]})}_addCheck(e){return new Mr({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_r.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_r.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_r.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_r.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_r.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_r.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:_r.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_r.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_r.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find((e=>"int"===e.kind||"multipleOf"===e.kind&&Jn.isInteger(e.value)))}get isFinite(){let e=null,t=null;for(const n of this._def.checks){if("finite"===n.kind||"int"===n.kind||"multipleOf"===n.kind)return!0;"min"===n.kind?(null===t||n.value>t)&&(t=n.value):"max"===n.kind&&(null===e||n.value<e)&&(e=n.value)}return Number.isFinite(t)&&Number.isFinite(e)}}Mr.create=e=>new Mr({checks:[],typeName:xa.ZodNumber,coerce:(null==e?void 0:e.coerce)||!1,...xr(e)});class Pr extends Er{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==nr.bigint){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.bigint,received:t.parsedType}),pr}let t;const n=new ur;for(const r of this._def.checks)"min"===r.kind?(r.inclusive?e.data<r.value:e.data<=r.value)&&(t=this._getOrReturnCtx(e,t),dr(t,{code:ar.too_small,type:"bigint",minimum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"max"===r.kind?(r.inclusive?e.data>r.value:e.data>=r.value)&&(t=this._getOrReturnCtx(e,t),dr(t,{code:ar.too_big,type:"bigint",maximum:r.value,inclusive:r.inclusive,message:r.message}),n.dirty()):"multipleOf"===r.kind?e.data%r.value!==BigInt(0)&&(t=this._getOrReturnCtx(e,t),dr(t,{code:ar.not_multiple_of,multipleOf:r.value,message:r.message}),n.dirty()):Jn.assertNever(r);return{status:n.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,_r.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_r.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_r.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_r.toString(t))}setLimit(e,t,n,r){return new Pr({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:n,message:_r.toString(r)}]})}_addCheck(e){return new Pr({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_r.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_r.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_r.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_r.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_r.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}Pr.create=e=>{var t;return new Pr({checks:[],typeName:xa.ZodBigInt,coerce:null!==(t=null==e?void 0:e.coerce)&&void 0!==t&&t,...xr(e)})};class Ur extends Er{_parse(e){if(this._def.coerce&&(e.data=Boolean(e.data)),this._getType(e)!==nr.boolean){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.boolean,received:t.parsedType}),pr}return hr(e.data)}}Ur.create=e=>new Ur({typeName:xa.ZodBoolean,coerce:(null==e?void 0:e.coerce)||!1,...xr(e)});class qr extends Er{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==nr.date){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.date,received:t.parsedType}),pr}if(isNaN(e.data.getTime()))return dr(this._getOrReturnCtx(e),{code:ar.invalid_date}),pr;const t=new ur;let n;for(const r of this._def.checks)"min"===r.kind?e.data.getTime()<r.value&&(n=this._getOrReturnCtx(e,n),dr(n,{code:ar.too_small,message:r.message,inclusive:!0,exact:!1,minimum:r.value,type:"date"}),t.dirty()):"max"===r.kind?e.data.getTime()>r.value&&(n=this._getOrReturnCtx(e,n),dr(n,{code:ar.too_big,message:r.message,inclusive:!0,exact:!1,maximum:r.value,type:"date"}),t.dirty()):Jn.assertNever(r);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new qr({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:_r.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:_r.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}qr.create=e=>new qr({checks:[],coerce:(null==e?void 0:e.coerce)||!1,typeName:xa.ZodDate,...xr(e)});class Rr extends Er{_parse(e){if(this._getType(e)!==nr.symbol){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.symbol,received:t.parsedType}),pr}return hr(e.data)}}Rr.create=e=>new Rr({typeName:xa.ZodSymbol,...xr(e)});class Br extends Er{_parse(e){if(this._getType(e)!==nr.undefined){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.undefined,received:t.parsedType}),pr}return hr(e.data)}}Br.create=e=>new Br({typeName:xa.ZodUndefined,...xr(e)});class Fr extends Er{_parse(e){if(this._getType(e)!==nr.null){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.null,received:t.parsedType}),pr}return hr(e.data)}}Fr.create=e=>new Fr({typeName:xa.ZodNull,...xr(e)});class Zr extends Er{constructor(){super(...arguments),this._any=!0}_parse(e){return hr(e.data)}}Zr.create=e=>new Zr({typeName:xa.ZodAny,...xr(e)});class zr extends Er{constructor(){super(...arguments),this._unknown=!0}_parse(e){return hr(e.data)}}zr.create=e=>new zr({typeName:xa.ZodUnknown,...xr(e)});class $r extends Er{_parse(e){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.never,received:t.parsedType}),pr}}$r.create=e=>new $r({typeName:xa.ZodNever,...xr(e)});class Hr extends Er{_parse(e){if(this._getType(e)!==nr.undefined){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.void,received:t.parsedType}),pr}return hr(e.data)}}Hr.create=e=>new Hr({typeName:xa.ZodVoid,...xr(e)});class Vr extends Er{_parse(e){const{ctx:t,status:n}=this._processInputParams(e),r=this._def;if(t.parsedType!==nr.array)return dr(t,{code:ar.invalid_type,expected:nr.array,received:t.parsedType}),pr;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(dr(t,{code:e?ar.too_big:ar.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),n.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(dr(t,{code:ar.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),n.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(dr(t,{code:ar.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),n.dirty()),t.common.async)return Promise.all([...t.data].map(((e,n)=>r.type._parseAsync(new wr(t,e,t.path,n))))).then((e=>ur.mergeArray(n,e)));const a=[...t.data].map(((e,n)=>r.type._parseSync(new wr(t,e,t.path,n))));return ur.mergeArray(n,a)}get element(){return this._def.type}min(e,t){return new Vr({...this._def,minLength:{value:e,message:_r.toString(t)}})}max(e,t){return new Vr({...this._def,maxLength:{value:e,message:_r.toString(t)}})}length(e,t){return new Vr({...this._def,exactLength:{value:e,message:_r.toString(t)}})}nonempty(e){return this.min(1,e)}}function Wr(e){if(e instanceof Qr){const t={};for(const n in e.shape){const r=e.shape[n];t[n]=pa.create(Wr(r))}return new Qr({...e._def,shape:()=>t})}return e instanceof Vr?new Vr({...e._def,type:Wr(e.element)}):e instanceof pa?pa.create(Wr(e.unwrap())):e instanceof ma?ma.create(Wr(e.unwrap())):e instanceof ea?ea.create(e.items.map((e=>Wr(e)))):e}Vr.create=(e,t)=>new Vr({type:e,minLength:null,maxLength:null,exactLength:null,typeName:xa.ZodArray,...xr(t)});class Qr extends Er{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const e=this._def.shape(),t=Jn.objectKeys(e);return this._cached={shape:e,keys:t}}_parse(e){if(this._getType(e)!==nr.object){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.object,received:t.parsedType}),pr}const{status:t,ctx:n}=this._processInputParams(e),{shape:r,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof $r&&"strip"===this._def.unknownKeys))for(const e in n.data)a.includes(e)||s.push(e);const i=[];for(const e of a){const t=r[e],a=n.data[e];i.push({key:{status:"valid",value:e},value:t._parse(new wr(n,a,n.path,e)),alwaysSet:e in n.data})}if(this._def.catchall instanceof $r){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of s)i.push({key:{status:"valid",value:e},value:{status:"valid",value:n.data[e]}});else if("strict"===e)s.length>0&&(dr(n,{code:ar.unrecognized_keys,keys:s}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of s){const r=n.data[t];i.push({key:{status:"valid",value:t},value:e._parse(new wr(n,r,n.path,t)),alwaysSet:t in n.data})}}return n.common.async?Promise.resolve().then((async()=>{const e=[];for(const t of i){const n=await t.key;e.push({key:n,value:await t.value,alwaysSet:t.alwaysSet})}return e})).then((e=>ur.mergeObjectSync(t,e))):ur.mergeObjectSync(t,i)}get shape(){return this._def.shape()}strict(e){return _r.errToObj,new Qr({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,n)=>{var r,a,s,i;const o=null!==(s=null===(a=(r=this._def).errorMap)||void 0===a?void 0:a.call(r,t,n).message)&&void 0!==s?s:n.defaultError;return"unrecognized_keys"===t.code?{message:null!==(i=_r.errToObj(e).message)&&void 0!==i?i:o}:{message:o}}}:{}})}strip(){return new Qr({...this._def,unknownKeys:"strip"})}passthrough(){return new Qr({...this._def,unknownKeys:"passthrough"})}extend(e){return new Qr({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Qr({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:xa.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new Qr({...this._def,catchall:e})}pick(e){const t={};return Jn.objectKeys(e).forEach((n=>{e[n]&&this.shape[n]&&(t[n]=this.shape[n])})),new Qr({...this._def,shape:()=>t})}omit(e){const t={};return Jn.objectKeys(this.shape).forEach((n=>{e[n]||(t[n]=this.shape[n])})),new Qr({...this._def,shape:()=>t})}deepPartial(){return Wr(this)}partial(e){const t={};return Jn.objectKeys(this.shape).forEach((n=>{const r=this.shape[n];e&&!e[n]?t[n]=r:t[n]=r.optional()})),new Qr({...this._def,shape:()=>t})}required(e){const t={};return Jn.objectKeys(this.shape).forEach((n=>{if(e&&!e[n])t[n]=this.shape[n];else{let e=this.shape[n];for(;e instanceof pa;)e=e._def.innerType;t[n]=e}})),new Qr({...this._def,shape:()=>t})}keyof(){return oa(Jn.objectKeys(this.shape))}}Qr.create=(e,t)=>new Qr({shape:()=>e,unknownKeys:"strip",catchall:$r.create(),typeName:xa.ZodObject,...xr(t)}),Qr.strictCreate=(e,t)=>new Qr({shape:()=>e,unknownKeys:"strict",catchall:$r.create(),typeName:xa.ZodObject,...xr(t)}),Qr.lazycreate=(e,t)=>new Qr({shape:e,unknownKeys:"strip",catchall:$r.create(),typeName:xa.ZodObject,...xr(t)});class Gr extends Er{_parse(e){const{ctx:t}=this._processInputParams(e),n=this._def.options;if(t.common.async)return Promise.all(n.map((async e=>{const n={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:n}),ctx:n}}))).then((function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const n of e)if("dirty"===n.result.status)return t.common.issues.push(...n.ctx.common.issues),n.result;const n=e.map((e=>new sr(e.ctx.common.issues)));return dr(t,{code:ar.invalid_union,unionErrors:n}),pr}));{let e;const r=[];for(const a of n){const n={...t,common:{...t.common,issues:[]},parent:null},s=a._parseSync({data:t.data,path:t.path,parent:n});if("valid"===s.status)return s;"dirty"!==s.status||e||(e={result:s,ctx:n}),n.common.issues.length&&r.push(n.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const a=r.map((e=>new sr(e)));return dr(t,{code:ar.invalid_union,unionErrors:a}),pr}}get options(){return this._def.options}}Gr.create=(e,t)=>new Gr({options:e,typeName:xa.ZodUnion,...xr(t)});const Kr=e=>e instanceof sa?Kr(e.schema):e instanceof ua?Kr(e.innerType()):e instanceof ia?[e.value]:e instanceof la?e.options:e instanceof ca?Object.keys(e.enum):e instanceof ha?Kr(e._def.innerType):e instanceof Br?[void 0]:e instanceof Fr?[null]:null;class Yr extends Er{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==nr.object)return dr(t,{code:ar.invalid_type,expected:nr.object,received:t.parsedType}),pr;const n=this.discriminator,r=t.data[n],a=this.optionsMap.get(r);return a?t.common.async?a._parseAsync({data:t.data,path:t.path,parent:t}):a._parseSync({data:t.data,path:t.path,parent:t}):(dr(t,{code:ar.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),pr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,n){const r=new Map;for(const n of t){const t=Kr(n.shape[e]);if(!t)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const a of t){if(r.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);r.set(a,n)}}return new Yr({typeName:xa.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:r,...xr(n)})}}function Xr(e,t){const n=rr(e),r=rr(t);if(e===t)return{valid:!0,data:e};if(n===nr.object&&r===nr.object){const n=Jn.objectKeys(t),r=Jn.objectKeys(e).filter((e=>-1!==n.indexOf(e))),a={...e,...t};for(const n of r){const r=Xr(e[n],t[n]);if(!r.valid)return{valid:!1};a[n]=r.data}return{valid:!0,data:a}}if(n===nr.array&&r===nr.array){if(e.length!==t.length)return{valid:!1};const n=[];for(let r=0;r<e.length;r++){const a=Xr(e[r],t[r]);if(!a.valid)return{valid:!1};n.push(a.data)}return{valid:!0,data:n}}return n===nr.date&&r===nr.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}class Jr extends Er{_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=(e,r)=>{if(fr(e)||fr(r))return pr;const a=Xr(e.value,r.value);return a.valid?((gr(e)||gr(r))&&t.dirty(),{status:t.value,value:a.data}):(dr(n,{code:ar.invalid_intersection_types}),pr)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then((([e,t])=>r(e,t))):r(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Jr.create=(e,t,n)=>new Jr({left:e,right:t,typeName:xa.ZodIntersection,...xr(n)});class ea extends Er{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==nr.array)return dr(n,{code:ar.invalid_type,expected:nr.array,received:n.parsedType}),pr;if(n.data.length<this._def.items.length)return dr(n,{code:ar.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pr;!this._def.rest&&n.data.length>this._def.items.length&&(dr(n,{code:ar.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...n.data].map(((e,t)=>{const r=this._def.items[t]||this._def.rest;return r?r._parse(new wr(n,e,n.path,t)):null})).filter((e=>!!e));return n.common.async?Promise.all(r).then((e=>ur.mergeArray(t,e))):ur.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new ea({...this._def,rest:e})}}ea.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ea({items:e,typeName:xa.ZodTuple,rest:null,...xr(t)})};class ta extends Er{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==nr.object)return dr(n,{code:ar.invalid_type,expected:nr.object,received:n.parsedType}),pr;const r=[],a=this._def.keyType,s=this._def.valueType;for(const e in n.data)r.push({key:a._parse(new wr(n,e,n.path,e)),value:s._parse(new wr(n,n.data[e],n.path,e))});return n.common.async?ur.mergeObjectAsync(t,r):ur.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,n){return new ta(t instanceof Er?{keyType:e,valueType:t,typeName:xa.ZodRecord,...xr(n)}:{keyType:Dr.create(),valueType:e,typeName:xa.ZodRecord,...xr(t)})}}class na extends Er{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==nr.map)return dr(n,{code:ar.invalid_type,expected:nr.map,received:n.parsedType}),pr;const r=this._def.keyType,a=this._def.valueType,s=[...n.data.entries()].map((([e,t],s)=>({key:r._parse(new wr(n,e,n.path,[s,"key"])),value:a._parse(new wr(n,t,n.path,[s,"value"]))})));if(n.common.async){const e=new Map;return Promise.resolve().then((async()=>{for(const n of s){const r=await n.key,a=await n.value;if("aborted"===r.status||"aborted"===a.status)return pr;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}))}{const e=new Map;for(const n of s){const r=n.key,a=n.value;if("aborted"===r.status||"aborted"===a.status)return pr;"dirty"!==r.status&&"dirty"!==a.status||t.dirty(),e.set(r.value,a.value)}return{status:t.value,value:e}}}}na.create=(e,t,n)=>new na({valueType:t,keyType:e,typeName:xa.ZodMap,...xr(n)});class ra extends Er{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.parsedType!==nr.set)return dr(n,{code:ar.invalid_type,expected:nr.set,received:n.parsedType}),pr;const r=this._def;null!==r.minSize&&n.data.size<r.minSize.value&&(dr(n,{code:ar.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&n.data.size>r.maxSize.value&&(dr(n,{code:ar.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const a=this._def.valueType;function s(e){const n=new Set;for(const r of e){if("aborted"===r.status)return pr;"dirty"===r.status&&t.dirty(),n.add(r.value)}return{status:t.value,value:n}}const i=[...n.data.values()].map(((e,t)=>a._parse(new wr(n,e,n.path,t))));return n.common.async?Promise.all(i).then((e=>s(e))):s(i)}min(e,t){return new ra({...this._def,minSize:{value:e,message:_r.toString(t)}})}max(e,t){return new ra({...this._def,maxSize:{value:e,message:_r.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ra.create=(e,t)=>new ra({valueType:e,minSize:null,maxSize:null,typeName:xa.ZodSet,...xr(t)});class aa extends Er{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==nr.function)return dr(t,{code:ar.invalid_type,expected:nr.function,received:t.parsedType}),pr;function n(e,n){return cr({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,lr(),ir].filter((e=>!!e)),issueData:{code:ar.invalid_arguments,argumentsError:n}})}function r(e,n){return cr({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,lr(),ir].filter((e=>!!e)),issueData:{code:ar.invalid_return_type,returnTypeError:n}})}const a={errorMap:t.common.contextualErrorMap},s=t.data;if(this._def.returns instanceof da){const e=this;return hr((async function(...t){const i=new sr([]),o=await e._def.args.parseAsync(t,a).catch((e=>{throw i.addIssue(n(t,e)),i})),l=await Reflect.apply(s,this,o);return await e._def.returns._def.type.parseAsync(l,a).catch((e=>{throw i.addIssue(r(l,e)),i}))}))}{const e=this;return hr((function(...t){const i=e._def.args.safeParse(t,a);if(!i.success)throw new sr([n(t,i.error)]);const o=Reflect.apply(s,this,i.data),l=e._def.returns.safeParse(o,a);if(!l.success)throw new sr([r(o,l.error)]);return l.data}))}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new aa({...this._def,args:ea.create(e).rest(zr.create())})}returns(e){return new aa({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,n){return new aa({args:e||ea.create([]).rest(zr.create()),returns:t||zr.create(),typeName:xa.ZodFunction,...xr(n)})}}class sa extends Er{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}sa.create=(e,t)=>new sa({getter:e,typeName:xa.ZodLazy,...xr(t)});class ia extends Er{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return dr(t,{received:t.data,code:ar.invalid_literal,expected:this._def.value}),pr}return{status:"valid",value:e.data}}get value(){return this._def.value}}function oa(e,t){return new la({values:e,typeName:xa.ZodEnum,...xr(t)})}ia.create=(e,t)=>new ia({value:e,typeName:xa.ZodLiteral,...xr(t)});class la extends Er{_parse(e){if("string"!=typeof e.data){const t=this._getOrReturnCtx(e),n=this._def.values;return dr(t,{expected:Jn.joinValues(n),received:t.parsedType,code:ar.invalid_type}),pr}if(-1===this._def.values.indexOf(e.data)){const t=this._getOrReturnCtx(e),n=this._def.values;return dr(t,{received:t.data,code:ar.invalid_enum_value,options:n}),pr}return hr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e){return la.create(e)}exclude(e){return la.create(this.options.filter((t=>!e.includes(t))))}}la.create=oa;class ca extends Er{_parse(e){const t=Jn.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==nr.string&&n.parsedType!==nr.number){const e=Jn.objectValues(t);return dr(n,{expected:Jn.joinValues(e),received:n.parsedType,code:ar.invalid_type}),pr}if(-1===t.indexOf(e.data)){const e=Jn.objectValues(t);return dr(n,{received:n.data,code:ar.invalid_enum_value,options:e}),pr}return hr(e.data)}get enum(){return this._def.values}}ca.create=(e,t)=>new ca({values:e,typeName:xa.ZodNativeEnum,...xr(t)});class da extends Er{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==nr.promise&&!1===t.common.async)return dr(t,{code:ar.invalid_type,expected:nr.promise,received:t.parsedType}),pr;const n=t.parsedType===nr.promise?t.data:Promise.resolve(t.data);return hr(n.then((e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap}))))}}da.create=(e,t)=>new da({type:e,typeName:xa.ZodPromise,...xr(t)});class ua extends Er{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===xa.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:t,ctx:n}=this._processInputParams(e),r=this._def.effect||null,a={addIssue:e=>{dr(n,e),e.fatal?t.abort():t.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),"preprocess"===r.type){const e=r.transform(n.data,a);return n.common.issues.length?{status:"dirty",value:n.data}:n.common.async?Promise.resolve(e).then((e=>this._def.schema._parseAsync({data:e,path:n.path,parent:n}))):this._def.schema._parseSync({data:e,path:n.path,parent:n})}if("refinement"===r.type){const e=e=>{const t=r.refinement(e,a);if(n.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===n.common.async){const r=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===r.status?pr:("dirty"===r.status&&t.dirty(),e(r.value),{status:t.value,value:r.value})}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((n=>"aborted"===n.status?pr:("dirty"===n.status&&t.dirty(),e(n.value).then((()=>({status:t.value,value:n.value}))))))}if("transform"===r.type){if(!1===n.common.async){const e=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!br(e))return e;const s=r.transform(e.value,a);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:s}}return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then((e=>br(e)?Promise.resolve(r.transform(e.value,a)).then((e=>({status:t.value,value:e}))):e))}Jn.assertNever(r)}}ua.create=(e,t,n)=>new ua({schema:e,typeName:xa.ZodEffects,effect:t,...xr(n)}),ua.createWithPreprocess=(e,t,n)=>new ua({schema:t,effect:{type:"preprocess",transform:e},typeName:xa.ZodEffects,...xr(n)});class pa extends Er{_parse(e){return this._getType(e)===nr.undefined?hr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}pa.create=(e,t)=>new pa({innerType:e,typeName:xa.ZodOptional,...xr(t)});class ma extends Er{_parse(e){return this._getType(e)===nr.null?hr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ma.create=(e,t)=>new ma({innerType:e,typeName:xa.ZodNullable,...xr(t)});class ha extends Er{_parse(e){const{ctx:t}=this._processInputParams(e);let n=t.data;return t.parsedType===nr.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ha.create=(e,t)=>new ha({innerType:e,typeName:xa.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...xr(t)});class fa extends Er{_parse(e){const{ctx:t}=this._processInputParams(e),n={...t,common:{...t.common,issues:[]}},r=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return vr(r)?r.then((e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new sr(n.common.issues)},input:n.data})}))):{status:"valid",value:"valid"===r.status?r.value:this._def.catchValue({get error(){return new sr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}fa.create=(e,t)=>new fa({innerType:e,typeName:xa.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...xr(t)});class ga extends Er{_parse(e){if(this._getType(e)!==nr.nan){const t=this._getOrReturnCtx(e);return dr(t,{code:ar.invalid_type,expected:nr.nan,received:t.parsedType}),pr}return{status:"valid",value:e.data}}}ga.create=e=>new ga({typeName:xa.ZodNaN,...xr(e)});const ba=Symbol("zod_brand");class va extends Er{_parse(e){const{ctx:t}=this._processInputParams(e),n=t.data;return this._def.type._parse({data:n,path:t.path,parent:t})}unwrap(){return this._def.type}}class _a extends Er{_parse(e){const{status:t,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const e=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?pr:"dirty"===e.status?(t.dirty(),mr(e.value)):this._def.out._parseAsync({data:e.value,path:n.path,parent:n})})();{const e=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return"aborted"===e.status?pr:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:n.path,parent:n})}}static create(e,t){return new _a({in:e,out:t,typeName:xa.ZodPipeline})}}class ya extends Er{_parse(e){const t=this._def.innerType._parse(e);return br(t)&&(t.value=Object.freeze(t.value)),t}}ya.create=(e,t)=>new ya({innerType:e,typeName:xa.ZodReadonly,...xr(t)});const wa=(e,t={},n)=>e?Zr.create().superRefine(((r,a)=>{var s,i;if(!e(r)){const e="function"==typeof t?t(r):"string"==typeof t?{message:t}:t,o=null===(i=null!==(s=e.fatal)&&void 0!==s?s:n)||void 0===i||i,l="string"==typeof e?{message:e}:e;a.addIssue({code:"custom",...l,fatal:o})}})):Zr.create(),ka={object:Qr.lazycreate};var xa,Ea;(Ea=xa||(xa={})).ZodString="ZodString",Ea.ZodNumber="ZodNumber",Ea.ZodNaN="ZodNaN",Ea.ZodBigInt="ZodBigInt",Ea.ZodBoolean="ZodBoolean",Ea.ZodDate="ZodDate",Ea.ZodSymbol="ZodSymbol",Ea.ZodUndefined="ZodUndefined",Ea.ZodNull="ZodNull",Ea.ZodAny="ZodAny",Ea.ZodUnknown="ZodUnknown",Ea.ZodNever="ZodNever",Ea.ZodVoid="ZodVoid",Ea.ZodArray="ZodArray",Ea.ZodObject="ZodObject",Ea.ZodUnion="ZodUnion",Ea.ZodDiscriminatedUnion="ZodDiscriminatedUnion",Ea.ZodIntersection="ZodIntersection",Ea.ZodTuple="ZodTuple",Ea.ZodRecord="ZodRecord",Ea.ZodMap="ZodMap",Ea.ZodSet="ZodSet",Ea.ZodFunction="ZodFunction",Ea.ZodLazy="ZodLazy",Ea.ZodLiteral="ZodLiteral",Ea.ZodEnum="ZodEnum",Ea.ZodEffects="ZodEffects",Ea.ZodNativeEnum="ZodNativeEnum",Ea.ZodOptional="ZodOptional",Ea.ZodNullable="ZodNullable",Ea.ZodDefault="ZodDefault",Ea.ZodCatch="ZodCatch",Ea.ZodPromise="ZodPromise",Ea.ZodBranded="ZodBranded",Ea.ZodPipeline="ZodPipeline",Ea.ZodReadonly="ZodReadonly";const ja=Dr.create,Na=Mr.create,Ca=ga.create,Sa=Pr.create,Ia=Ur.create,Ta=qr.create,La=Rr.create,Oa=Br.create,Da=Fr.create,Aa=Zr.create,Ma=zr.create,Pa=$r.create,Ua=Hr.create,qa=Vr.create,Ra=Qr.create,Ba=Qr.strictCreate,Fa=Gr.create,Za=Yr.create,za=Jr.create,$a=ea.create,Ha=ta.create,Va=na.create,Wa=ra.create,Qa=aa.create,Ga=sa.create,Ka=ia.create,Ya=la.create,Xa=ca.create,Ja=da.create,es=ua.create,ts=pa.create,ns=ma.create,rs=ua.createWithPreprocess,as=_a.create,ss={string:e=>Dr.create({...e,coerce:!0}),number:e=>Mr.create({...e,coerce:!0}),boolean:e=>Ur.create({...e,coerce:!0}),bigint:e=>Pr.create({...e,coerce:!0}),date:e=>qr.create({...e,coerce:!0})},is=pr;var os=Object.freeze({__proto__:null,defaultErrorMap:ir,setErrorMap:function(e){or=e},getErrorMap:lr,makeIssue:cr,EMPTY_PATH:[],addIssueToContext:dr,ParseStatus:ur,INVALID:pr,DIRTY:mr,OK:hr,isAborted:fr,isDirty:gr,isValid:br,isAsync:vr,get util(){return Jn},get objectUtil(){return tr},ZodParsedType:nr,getParsedType:rr,ZodType:Er,ZodString:Dr,ZodNumber:Mr,ZodBigInt:Pr,ZodBoolean:Ur,ZodDate:qr,ZodSymbol:Rr,ZodUndefined:Br,ZodNull:Fr,ZodAny:Zr,ZodUnknown:zr,ZodNever:$r,ZodVoid:Hr,ZodArray:Vr,ZodObject:Qr,ZodUnion:Gr,ZodDiscriminatedUnion:Yr,ZodIntersection:Jr,ZodTuple:ea,ZodRecord:ta,ZodMap:na,ZodSet:ra,ZodFunction:aa,ZodLazy:sa,ZodLiteral:ia,ZodEnum:la,ZodNativeEnum:ca,ZodPromise:da,ZodEffects:ua,ZodTransformer:ua,ZodOptional:pa,ZodNullable:ma,ZodDefault:ha,ZodCatch:fa,ZodNaN:ga,BRAND:ba,ZodBranded:va,ZodPipeline:_a,ZodReadonly:ya,custom:wa,Schema:Er,ZodSchema:Er,late:ka,get ZodFirstPartyTypeKind(){return xa},coerce:ss,any:Aa,array:qa,bigint:Sa,boolean:Ia,date:Ta,discriminatedUnion:Za,effect:es,enum:Ya,function:Qa,instanceof:(e,t={message:`Input not instance of ${e.name}`})=>wa((t=>t instanceof e),t),intersection:za,lazy:Ga,literal:Ka,map:Va,nan:Ca,nativeEnum:Xa,never:Pa,null:Da,nullable:ns,number:Na,object:Ra,oboolean:()=>Ia().optional(),onumber:()=>Na().optional(),optional:ts,ostring:()=>ja().optional(),pipeline:as,preprocess:rs,promise:Ja,record:Ha,set:Wa,strictObject:Ba,string:ja,symbol:La,transformer:es,tuple:$a,undefined:Oa,union:Fa,unknown:Ma,void:Ua,NEVER:is,ZodIssueCode:ar,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),ZodError:sr});os.string(),os.number(),os.number().optional();const ls=os.string().regex(/^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$/),cs=os.enum(["bottomLeft","bottomRight","topLeft","topRight","center"]),ds=os.enum(["png","jpeg","jpg","pdf","doc","docx","xls","xlsx","ppt","pptx","plain","csv","mp4","mov","avi","mkv","webm","zip","rar","7z","tar"]),us=os.object({enabled:os.boolean(),headline:os.optional(os.string()),subheader:os.optional(os.string())});var ps=(e=>(e.FileUpload="fileUpload",e.OpenText="openText",e.MultipleChoiceSingle="multipleChoiceSingle",e.MultipleChoiceMulti="multipleChoiceMulti",e.NPS="nps",e.CTA="cta",e.Rating="rating",e.Consent="consent",e.PictureSelection="pictureSelection",e.Cal="cal",e.Date="date",e))(ps||{});const ms=os.object({enabled:os.boolean(),headline:os.optional(os.string()),html:os.string().optional(),fileUrl:os.string().optional(),buttonLabel:os.string().optional(),timeToFinish:os.boolean().default(!0),showResponseCount:os.boolean().default(!1)}),hs=os.object({enabled:os.boolean(),fieldIds:os.optional(os.array(os.string()))}),fs=os.object({brandColor:ls.nullish(),highlightBorderColor:ls.nullish(),placement:cs.nullish(),clickOutsideClose:os.boolean().nullish(),darkOverlay:os.boolean().nullish()});os.enum(["animation","color","image"]);const gs=os.object({bg:os.string().nullish(),bgType:os.enum(["animation","color","image"]).nullish(),brightness:os.number().nullish()}),bs=os.object({background:gs.nullish()}),vs=os.object({enabled:os.boolean().optional(),heading:os.string().optional(),subheading:os.string().optional()}).nullable().optional(),_s=os.object({enabled:os.boolean(),heading:os.optional(os.string()),subheading:os.optional(os.string()),isEncrypted:os.boolean()}).nullable(),ys=os.object({name:os.optional(os.string()),subheading:os.optional(os.string())}).optional(),ws=os.object({id:os.string(),label:os.string()}),ks=os.object({id:os.string(),imageUrl:os.string()}),xs=os.enum(["accepted","clicked","submitted","skipped","equals","notEquals","lessThan","lessEqual","greaterThan","greaterEqual","includesAll","includesOne","uploaded","notUploaded","booked"]),Es=os.object({condition:xs.optional(),value:os.union([os.string(),os.array(os.string())]).optional(),destination:os.union([os.string(),os.literal("end")]).optional()}),js=Es.extend({condition:os.enum(["uploaded","notUploaded"]).optional(),value:os.undefined()}),Ns=Es.extend({condition:os.enum(["submitted","skipped"]).optional(),value:os.undefined()}),Cs=Es.extend({condition:os.enum(["skipped","accepted"]).optional(),value:os.undefined()}),Ss=Es.extend({condition:os.enum(["submitted","skipped","equals","notEquals"]).optional(),value:os.string().optional()}),Is=Es.extend({condition:os.enum(["submitted","skipped","includesAll","includesOne","equals"]).optional(),value:os.union([os.array(os.string()),os.string()]).optional()}),Ts=Es.extend({condition:os.enum(["equals","notEquals","lessThan","lessEqual","greaterThan","greaterEqual","submitted","skipped"]).optional(),value:os.union([os.string(),os.number()]).optional()}),Ls=Es.extend({condition:os.enum(["clicked","submitted","skipped"]).optional(),value:os.undefined()}),Os=Es.extend({condition:os.enum(["equals","notEquals","lessThan","lessEqual","greaterThan","greaterEqual","submitted","skipped"]).optional(),value:os.union([os.string(),os.number()]).optional()}),Ds=Es.extend({condition:os.enum(["submitted","skipped"]).optional(),value:os.undefined()}),As=Es.extend({condition:os.enum(["booked","skipped"]).optional(),value:os.undefined()}),Ms=os.union([Ns,Cs,Ss,Is,Ts,Ls,Os,Ds,js,As]),Ps=os.object({id:os.string(),type:os.string(),headline:os.string(),subheader:os.string().optional(),imageUrl:os.string().optional(),required:os.boolean(),buttonLabel:os.string().optional(),backButtonLabel:os.string().optional(),scale:os.enum(["number","smiley","star"]).optional(),range:os.union([os.literal(5),os.literal(3),os.literal(4),os.literal(7),os.literal(10)]).optional(),logic:os.array(Ms).optional(),isDraft:os.boolean().optional()}),Us=os.enum(["text","email","url","number","phone"]),qs=Ps.extend({type:os.literal("openText"),placeholder:os.string().optional(),longAnswer:os.boolean().optional(),logic:os.array(Ns).optional(),inputType:Us.optional().default("text")}),Rs=Ps.extend({type:os.literal("consent"),html:os.string().optional(),label:os.string(),dismissButtonLabel:os.string().optional(),placeholder:os.string().optional(),logic:os.array(Cs).optional()}),Bs=Ps.extend({type:os.literal("multipleChoiceSingle"),choices:os.array(ws),logic:os.array(Ss).optional(),shuffleOption:os.enum(["none","all","exceptLast"]).optional()}),Fs=Ps.extend({type:os.literal("multipleChoiceMulti"),choices:os.array(ws),logic:os.array(Is).optional(),shuffleOption:os.enum(["none","all","exceptLast"]).optional()}),Zs=Ps.extend({type:os.literal("nps"),lowerLabel:os.string(),upperLabel:os.string(),logic:os.array(Ts).optional()}),zs=Ps.extend({type:os.literal("cta"),html:os.string().optional(),buttonUrl:os.string().optional(),buttonExternal:os.boolean(),dismissButtonLabel:os.string().optional(),logic:os.array(Ls).optional()}),$s=Ps.extend({type:os.literal("rating"),scale:os.enum(["number","smiley","star"]),range:os.union([os.literal(5),os.literal(3),os.literal(4),os.literal(7),os.literal(10)]),lowerLabel:os.string(),upperLabel:os.string(),logic:os.array(Os).optional()}),Hs=Ps.extend({type:os.literal("date"),html:os.string().optional(),format:os.enum(["M-d-y","d-M-y","y-M-d"])}),Vs=Ps.extend({type:os.literal("pictureSelection"),allowMulti:os.boolean().optional().default(!1),choices:os.array(ks),logic:os.array(Ds).optional()}),Ws=Ps.extend({type:os.literal("fileUpload"),allowMultipleFiles:os.boolean(),maxSizeInMB:os.number().optional(),allowedFileExtensions:os.array(ds).optional(),logic:os.array(js).optional()}),Qs=Ps.extend({type:os.literal("cal"),calUserName:os.string(),logic:os.array(As).optional()}),Gs=os.union([qs,Rs,Bs,Fs,Zs,zs,$s,Vs,Hs,Ws,Qs]),Ks=os.array(Gs),Ys=os.object({attributeClassId:os.string().cuid2(),condition:os.enum(["equals","notEquals"]),value:os.string()}),Xs=os.enum(["displayOnce","displayMultiple","respondMultiple"]),Js=os.enum(["web","email","link","mobile"]),ei=os.enum(["draft","inProgress","paused","completed"]);function ti({question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,autoFocus:o=!0,ttc:l,setTtc:c,surveyId:d,onFileUpload:u}){return e.type===ps.OpenText?dt(Rn,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,autoFocus:o,ttc:l,setTtc:c}):e.type===ps.MultipleChoiceSingle?dt(Un,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:l,setTtc:c}):e.type===ps.MultipleChoiceMulti?dt(Pn,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:l,setTtc:c}):e.type===ps.NPS?dt(qn,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:l,setTtc:c}):e.type===ps.CTA?dt(Nn,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:l,setTtc:c}):e.type===ps.Rating?dt(Yn,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:l,setTtc:c}):e.type===ps.Consent?dt(Ln,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:l,setTtc:c}):e.type===ps.Date?dt(Dn,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:l,setTtc:c}):e.type===ps.PictureSelection?dt(Bn,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:l,setTtc:c}):e.type===ps.FileUpload?dt(Mn,{surveyId:d,question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,onFileUpload:u,ttc:l,setTtc:c}):e.type===ps.Cal?dt(Tn,{question:e,value:t,onChange:n,onSubmit:r,onBack:a,isFirstQuestion:s,isLastQuestion:i,ttc:l,setTtc:c}):null}function ni({redirectUrl:e,isRedirectDisabled:t}){const[n,r]=It(5);return Tt((()=>{if(e){const n=setInterval((()=>{r((r=>r<=0?(clearInterval(n),t||(window.location.href=e),0):r-1))}),1e3)}return()=>clearInterval(void 0)}),[e,t]),e?dt("div",{children:dt("div",{className:"bg-accent-bg text-subheading mt-10 rounded-md p-2 text-sm",children:[dt("span",{children:"You're redirected in "}),dt("span",{children:n})]})}):null}function ri({headline:e,subheader:t,redirectUrl:n,isRedirectDisabled:r}){return dt("div",{className:"text-center",children:[dt("div",{className:"text-brand flex items-center justify-center",children:dt("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-24 w-24",children:dt("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75L11.25 15 15 9.75M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),dt("span",{className:"bg-shadow mb-[10px] inline-block h-1 w-16 rounded-[100%]"}),dt("div",{children:[dt(Wt,{alignTextCenter:!0,headline:e,questionId:"thankYouCard"}),dt(In,{subheader:t,questionId:"thankYouCard"}),dt(ni,{redirectUrl:n,isRedirectDisabled:r})]})]})}os.object({id:os.string().cuid2(),createdAt:os.date(),updatedAt:os.date(),name:os.string(),type:Js,environmentId:os.string(),status:ei,attributeFilters:os.array(Ys),displayOption:Xs,autoClose:os.number().nullable(),triggers:os.array(os.string()),redirectUrl:os.string().url().nullable(),recontactDays:os.number().nullable(),welcomeCard:ms,questions:Ks,thankYouCard:us,hiddenFields:hs,delay:os.number(),autoComplete:os.number().nullable(),closeOnDate:os.date().nullable(),productOverwrites:fs.nullable(),styling:bs.nullable(),surveyClosedMessage:vs.nullable(),singleUse:_s.nullable(),verifyEmail:ys.nullable(),pin:os.string().nullable().optional(),resultShareKey:os.string().nullable()}),os.object({name:os.string(),type:Js.optional(),status:ei.optional(),displayOption:Xs.optional(),autoClose:os.number().optional(),redirectUrl:os.string().url().optional(),recontactDays:os.number().optional(),welcomeCard:ms.optional(),questions:Ks.optional(),thankYouCard:us.optional(),hiddenFields:hs,delay:os.number().optional(),autoComplete:os.number().optional(),closeOnDate:os.date().optional(),surveyClosedMessage:vs.optional(),verifyEmail:ys.optional(),attributeFilters:os.array(Ys).optional(),triggers:os.array(os.string()).optional()}),os.union([os.literal("fileUpload"),os.literal("openText"),os.literal("multipleChoiceSingle"),os.literal("multipleChoiceMulti"),os.literal("nps"),os.literal("cta"),os.literal("rating"),os.literal("consent"),os.literal("pictureSelection"),os.literal("cal"),os.literal("date")]);const ai=()=>dt("div",{className:"mr-1",children:dt("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",fill:"currentColor",class:"bi bi-stopwatch",viewBox:"0 0 16 16",children:[dt("path",{d:"M8.5 5.6a.5.5 0 1 0-1 0v2.9h-3a.5.5 0 0 0 0 1H8a.5.5 0 0 0 .5-.5V5.6z"}),dt("path",{d:"M6.5 1A.5.5 0 0 1 7 .5h2a.5.5 0 0 1 0 1v.57c1.36.196 2.594.78 3.584 1.64a.715.715 0 0 1 .012-.013l.354-.354-.354-.353a.5.5 0 0 1 .707-.708l1.414 1.415a.5.5 0 1 1-.707.707l-.353-.354-.354.354a.512.512 0 0 1-.013.012A7 7 0 1 1 7 2.071V1.5a.5.5 0 0 1-.5-.5zM8 3a6 6 0 1 0 .001 12A6 6 0 0 0 8 3z"})]})}),si=()=>dt("div",{className:"mr-1",children:dt("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor",class:"h-4 w-4",children:dt("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 19.128a9.38 9.38 0 002.625.372 9.337 9.337 0 004.121-.952 4.125 4.125 0 00-7.533-2.493M15 19.128v-.003c0-1.113-.285-2.16-.786-3.07M15 19.128v.106A12.318 12.318 0 018.624 21c-2.331 0-4.512-.645-6.374-1.766l-.001-.109a6.375 6.375 0 0111.964-3.07M12 6.375a3.375 3.375 0 11-6.75 0 3.375 3.375 0 016.75 0zm8.25 2.25a2.625 2.625 0 11-5.25 0 2.625 2.625 0 015.25 0z"})})});function ii({headline:e,html:t,fileUrl:n,buttonLabel:r,onSubmit:a,survey:s,responseCount:i}){const o=()=>{let e=ft(s,0);.5===e&&(e=1);const t=s.questions.length/e*15;if(t>360)return"6+ minutes";const n=Math.floor(t/60);return t%60>0?0===n?"less than 1 minute":`less than ${n+1} minutes`:`${n} minutes`},l=s.welcomeCard.timeToFinish,c=s.welcomeCard.showResponseCount;return dt("div",{children:[n&&dt("img",{src:n,className:"mb-8 max-h-96 w-1/3 rounded-lg object-contain",alt:"Company Logo"}),dt(Wt,{headline:e,questionId:"welcomeCard"}),dt(Gt,{htmlString:t,questionId:"welcomeCard"}),dt("div",{className:"mt-10 flex w-full justify-between",children:dt("div",{className:"flex w-full justify-start gap-4",children:[dt(Vt,{buttonLabel:r,isLastQuestion:!1,focus:!0,onClick:()=>{a({welcomeCard:"clicked"},{})},type:"button"}),dt("div",{className:"text-subheading flex items-center text-xs",children:"Press Enter ↵"})]})}),l&&!c?dt("div",{className:"item-center mt-4 flex text-slate-500",children:[dt(ai,{}),dt("p",{className:"pt-1 text-xs",children:dt("span",{children:[" Takes ",o()," "]})})]}):c&&!l&&i&&i>3?dt("div",{className:"item-center mt-4 flex text-slate-500",children:[dt(si,{}),dt("p",{className:"pt-1 text-xs",children:dt("span",{children:`${i} people responded`})})]}):l&&c?dt("div",{className:"item-center mt-4 flex text-slate-500",children:[dt(ai,{}),dt("p",{className:"pt-1 text-xs",children:[dt("span",{children:[" Takes ",o()," "]}),dt("span",{children:i&&i>3?`⋅ ${i} people responded`:""})]})]}):null]})}function oi({survey:e,isBrandingEnabled:t,activeQuestionId:n,onDisplay:r=(()=>{}),onActiveQuestionChange:a=(()=>{}),onResponse:s=(()=>{}),onClose:i=(()=>{}),onFinished:o=(()=>{}),isRedirectDisabled:l=!1,prefillResponseData:c,onFileUpload:d,responseCount:u}){var p;const[m,h]=It(n||(e.welcomeCard.enabled?"start":null==(p=null==e?void 0:e.questions[0])?void 0:p.id)),[f,g]=It(!1),[b,v]=It([]),[_,y]=It({}),w=e.questions.findIndex((e=>e.id===m)),k=e.questions[w],x=Lt(null),[E,j]=It({});Tt((()=>{var t,r;"hidden"!==n&&("start"!==n||e.welcomeCard.enabled?h(n||(e.welcomeCard.enabled?"start":null==(r=null==e?void 0:e.questions[0])?void 0:r.id)):h(null==(t=null==e?void 0:e.questions[0])?void 0:t.id))}),[n,e.questions,e.welcomeCard.enabled]),Tt((()=>{x.current&&(x.current.scrollTop=0)}),[m]),Tt((()=>{r(),c&&I(c,{},!0)}),[]);let N=w,C=k;const S=e=>{const t={..._,...e};y(t)},I=(t,n,r=!1)=>{const i=Object.keys(t)[0];g(!0);const l=function(t,n=!1){var r,a;const s=e.questions,i=t[m];if("start"===m){if(!n)return(null==(r=s[0])?void 0:r.id)||"end";N=0,C=s[0]}if(-1===N)throw new Error("Question not found");if((null==C?void 0:C.logic)&&(null==C?void 0:C.logic.length)>0)for(let e of C.logic)if(e.destination&&$t(e,i))return e.destination;return(null==(a=s[N+1])?void 0:a.id)||"end"}(t,r),c="end"===l;s({data:t,ttc:n,finished:c}),c&&o(),h(l),v([...b,i]),g(!1),a(l)},T=()=>{var t;let n;if((null==b?void 0:b.length)>0){const t=[...b];if(n=t.pop(),c&&n===e.questions[0].id)return;v(t)}else n=null==(t=e.questions[N-1])?void 0:t.id;if(!n)throw new Error("Question not found");h(n),a(n)};return dt($e,{children:dt(zt,{survey:e,onClose:i,children:dt("div",{className:"no-scrollbar flex h-full w-full flex-col justify-between rounded-lg bg-[--fb-survey-background-color] px-6 pb-3 pt-6",children:[dt("div",{ref:x,className:pt(f?"animate-pulse opacity-60":"","my-auto"),children:0!==e.questions.length||e.welcomeCard.enabled||e.thankYouCard.enabled?function(){var t;if("start"===m&&e.welcomeCard.enabled)return dt(ii,{headline:e.welcomeCard.headline,html:e.welcomeCard.html,fileUrl:e.welcomeCard.fileUrl,buttonLabel:e.welcomeCard.buttonLabel,onSubmit:I,survey:e,responseCount:u});if("end"===m&&e.thankYouCard.enabled)return dt(ri,{headline:e.thankYouCard.headline,subheader:e.thankYouCard.subheader,redirectUrl:e.redirectUrl,isRedirectDisabled:l});{const n=e.questions.find((e=>e.id===m));return n&&dt(ti,{surveyId:e.id,question:n,value:_[n.id],onChange:S,onSubmit:I,onBack:T,ttc:E,setTtc:j,onFileUpload:d,isFirstQuestion:b&&c?b[b.length-1]===e.questions[0].id:n.id===(null==(t=null==e?void 0:e.questions[0])?void 0:t.id),isLastQuestion:n.id===e.questions[e.questions.length-1].id})}}():dt("div",{children:"No questions available."})}),dt("div",{className:"mt-8",children:[t&&dt(ut,{}),dt(Zt,{survey:e,questionId:m})]})]})})})}function li({children:e,isOpen:t,placement:n,clickOutside:r,darkOverlay:a,highlightBorderColor:s,onClose:i}){const[o,l]=It(!1),c="center"===n,d=Lt(null);Tt((()=>{l(t)}),[t]),Tt((()=>{if(c)return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)};function e(e){r&&o&&d.current&&!d.current.contains(e.target)&&i()}}),[o,r,i,c]);const u=Ot((()=>s?{borderRadius:"8px",border:"2px solid",borderColor:s}:{overflow:"visible"}),[s]);return o?dt("div",{"aria-live":"assertive",className:pt(c?"pointer-events-auto":"pointer-events-none","z-999999 fixed inset-0 flex items-end"),children:dt("div",{className:pt("relative h-full w-full",c?a?"bg-gray-700/80":"bg-white/50":"bg-none transition-all duration-500 ease-in-out"),children:dt("div",{ref:d,className:pt((e=>{switch(e){default:return"sm:bottom-3 sm:right-3";case"topRight":return"sm:top-3 sm:right-3 sm:bottom-3";case"topLeft":return"sm:top-3 sm:left-3 sm:bottom-3";case"bottomLeft":return"sm:bottom-3 sm:left-3";case"center":return"sm:top-1/2 sm:left-1/2 sm:transform sm:-translate-x-1/2 sm:-translate-y-1/2"}})(n),o?"opacity-100":"opacity-0","border-border pointer-events-auto absolute bottom-0 h-fit w-full overflow-visible rounded-lg border bg-white shadow-lg transition-all duration-500 ease-in-out sm:m-4 sm:max-w-sm"),children:[!c&&dt("div",{class:"absolute right-0 top-0 block pr-2 pt-2",children:dt("button",{type:"button",onClick:i,class:"text-close-button hover:text-close-button-focus focus:ring-close-button-focus relative h-5 w-5 rounded-md focus:outline-none focus:ring-2 focus:ring-offset-2",children:[dt("span",{class:"sr-only",children:"Close survey"}),dt("svg",{class:"h-4 w-4",fill:"none",viewBox:"0 0 24 24","stroke-width":"2",stroke:"currentColor","aria-hidden":"true",children:dt("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M4 4L20 20M4 20L20 4"})})]})}),dt("div",{style:u,children:e})]})})}):null}function ci({survey:e,isBrandingEnabled:t,activeQuestionId:n,placement:r,clickOutside:a,darkOverlay:s,highlightBorderColor:i,onDisplay:o=(()=>{}),onActiveQuestionChange:l=(()=>{}),onResponse:c=(()=>{}),onClose:d=(()=>{}),onFinished:u=(()=>{}),onFileUpload:p,isRedirectDisabled:m=!1,responseCount:h}){const[f,g]=It(!0),b=()=>{g(!1),setTimeout((()=>{d()}),1e3)};return dt("div",{id:"fbjs",className:"formbricks-form",children:dt(li,{placement:r,clickOutside:a,darkOverlay:s,highlightBorderColor:i,isOpen:f,onClose:b,children:dt(oi,{survey:e,isBrandingEnabled:t,activeQuestionId:n,onDisplay:o,onActiveQuestionChange:l,onResponse:c,onClose:b,onFinished:()=>{u(),setTimeout((()=>{e.redirectUrl||b()}),4e3)},onFileUpload:p,isRedirectDisabled:m,responseCount:h})})})}const di=e=>{(()=>{if(null===document.getElementById("formbricks__css")){const e=document.createElement("style");e.id="formbricks__css",e.innerHTML='#fbjs *,#fbjs :before,#fbjs :after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}#fbjs :before,#fbjs :after{--tw-content: ""}#fbjs html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal}#fbjs body{margin:0;line-height:inherit}#fbjs hr{height:0;color:inherit;border-top-width:1px}#fbjs abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}#fbjs h1,#fbjs h2,#fbjs h3,#fbjs h4,#fbjs h5,#fbjs h6{font-size:inherit;font-weight:inherit}#fbjs a{color:inherit;text-decoration:inherit}#fbjs b,#fbjs strong{font-weight:bolder}#fbjs code,#fbjs kbd,#fbjs samp,#fbjs pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}#fbjs small{font-size:80%}#fbjs sub,#fbjs sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}#fbjs sub{bottom:-.25em}#fbjs sup{top:-.5em}#fbjs table{text-indent:0;border-color:inherit;border-collapse:collapse}#fbjs button,#fbjs input,#fbjs optgroup,#fbjs select,#fbjs textarea{font-family:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}#fbjs button,#fbjs select{text-transform:none}#fbjs button,#fbjs [type=button],#fbjs [type=reset],#fbjs [type=submit]{-webkit-appearance:button;background-color:transparent;background-image:none}#fbjs :-moz-focusring{outline:auto}#fbjs :-moz-ui-invalid{box-shadow:none}#fbjs progress{vertical-align:baseline}#fbjs ::-webkit-inner-spin-button,#fbjs ::-webkit-outer-spin-button{height:auto}#fbjs [type=search]{-webkit-appearance:textfield;outline-offset:-2px}#fbjs ::-webkit-search-decoration{-webkit-appearance:none}#fbjs ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}#fbjs summary{display:list-item}#fbjs blockquote,#fbjs dl,#fbjs dd,#fbjs h1,#fbjs h2,#fbjs h3,#fbjs h4,#fbjs h5,#fbjs h6,#fbjs hr,#fbjs figure,#fbjs p,#fbjs pre{margin:0}#fbjs fieldset{margin:0;padding:0}#fbjs legend{padding:0}#fbjs ol,#fbjs ul,#fbjs menu{list-style:none;margin:0;padding:0}#fbjs textarea{resize:vertical}#fbjs input::-moz-placeholder,#fbjs textarea::-moz-placeholder{opacity:1;color:#9ca3af}#fbjs input::placeholder,#fbjs textarea::placeholder{opacity:1;color:#9ca3af}#fbjs button,#fbjs [role=button]{cursor:pointer}#fbjs :disabled{cursor:default}#fbjs img,#fbjs svg,#fbjs video,#fbjs canvas,#fbjs audio,#fbjs iframe,#fbjs embed,#fbjs object{display:block;vertical-align:middle}#fbjs img,#fbjs video{max-width:100%;height:auto}#fbjs [hidden]{display:none}*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }.container{width:100%}@media (min-width: 640px){.container{max-width:640px}}@media (min-width: 768px){.container{max-width:768px}}@media (min-width: 1024px){.container{max-width:1024px}}@media (min-width: 1280px){.container{max-width:1280px}}@media (min-width: 1536px){.container{max-width:1536px}}#fbjs :is(.sr-only){position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}#fbjs :is(.pointer-events-none){pointer-events:none}#fbjs :is(.pointer-events-auto){pointer-events:auto}#fbjs :is(.visible){visibility:visible}#fbjs :is(.fixed){position:fixed}#fbjs :is(.absolute){position:absolute}#fbjs :is(.relative){position:relative}#fbjs :is(.inset-0){top:0;right:0;bottom:0;left:0}#fbjs :is(.bottom-0){bottom:0}#fbjs :is(.left-0){left:0}#fbjs :is(.right-0){right:0}#fbjs :is(.right-2){right:.5em}#fbjs :is(.top-0){top:0}#fbjs :is(.top-2){top:.5em}#fbjs :is(.z-10){z-index:10}#fbjs :is(.z-20){z-index:20}#fbjs :is(.z-999999){z-index:999999}#fbjs :is(.m-2){margin:.5em}#fbjs :is(.my-4){margin-top:1em;margin-bottom:1em}#fbjs :is(.my-auto){margin-top:auto;margin-bottom:auto}#fbjs :is(.mb-1){margin-bottom:.25em}#fbjs :is(.mb-1\\.5){margin-bottom:.375em}#fbjs :is(.mb-4){margin-bottom:1em}#fbjs :is(.mb-5){margin-bottom:1.25em}#fbjs :is(.mb-8){margin-bottom:2em}#fbjs :is(.mb-\\[10px\\]){margin-bottom:10px}#fbjs :is(.ml-2){margin-left:.5em}#fbjs :is(.ml-3){margin-left:.75em}#fbjs :is(.mr-1){margin-right:.25em}#fbjs :is(.mr-4){margin-right:1em}#fbjs :is(.mt-1){margin-top:.25em}#fbjs :is(.mt-10){margin-top:2.5em}#fbjs :is(.mt-2){margin-top:.5em}#fbjs :is(.mt-3){margin-top:.75em}#fbjs :is(.mt-4){margin-top:1em}#fbjs :is(.mt-6){margin-top:1.5em}#fbjs :is(.mt-8){margin-top:2em}#fbjs :is(.box-border){box-sizing:border-box}#fbjs :is(.block){display:block}#fbjs :is(.inline-block){display:inline-block}#fbjs :is(.inline){display:inline}#fbjs :is(.flex){display:flex}#fbjs :is(.grid){display:grid}#fbjs :is(.hidden){display:none}#fbjs :is(.h-1){height:.25em}#fbjs :is(.h-10){height:2.5em}#fbjs :is(.h-12){height:3em}#fbjs :is(.h-14){height:3.5em}#fbjs :is(.h-2){height:.5em}#fbjs :is(.h-24){height:6em}#fbjs :is(.h-28){height:7em}#fbjs :is(.h-4){height:1em}#fbjs :is(.h-5){height:1.25em}#fbjs :is(.h-6){height:1.5em}#fbjs :is(.h-9){height:2.25em}#fbjs :is(.h-96){height:24em}#fbjs :is(.h-fit){height:-moz-fit-content;height:fit-content}#fbjs :is(.h-full){height:100%}#fbjs :is(.max-h-96){max-height:24em}#fbjs :is(.max-h-\\[42vh\\]){max-height:42vh}#fbjs :is(.max-h-full){max-height:100%}#fbjs :is(.w-1\\/2){width:50%}#fbjs :is(.w-1\\/3){width:33.333333%}#fbjs :is(.w-14){width:3.5em}#fbjs :is(.w-16){width:4em}#fbjs :is(.w-24){width:6em}#fbjs :is(.w-4){width:1em}#fbjs :is(.w-5){width:1.25em}#fbjs :is(.w-6){width:1.5em}#fbjs :is(.w-80){width:20em}#fbjs :is(.w-full){width:100%}#fbjs :is(.flex-1){flex:1 1 0%}@keyframes pulse{50%{opacity:.5}}#fbjs :is(.animate-pulse){animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes spin{to{transform:rotate(360deg)}}#fbjs :is(.animate-spin){animation:spin 1s linear infinite}#fbjs :is(.cursor-pointer){cursor:pointer}#fbjs :is(.appearance-none){-webkit-appearance:none;-moz-appearance:none;appearance:none}#fbjs :is(.grid-cols-2){grid-template-columns:repeat(2,minmax(0,1fr))}#fbjs :is(.flex-col){flex-direction:column}#fbjs :is(.items-end){align-items:flex-end}#fbjs :is(.items-center){align-items:center}#fbjs :is(.justify-start){justify-content:flex-start}#fbjs :is(.justify-end){justify-content:flex-end}#fbjs :is(.justify-center){justify-content:center}#fbjs :is(.justify-between){justify-content:space-between}#fbjs :is(.gap-2){gap:.5em}#fbjs :is(.gap-4){gap:1em}#fbjs :is(.gap-x-5){-moz-column-gap:1.25em;column-gap:1.25em}#fbjs :is(.gap-y-4){row-gap:1em}#fbjs :is(.space-y-2>:not([hidden])~:not([hidden])){--tw-space-y-reverse: 0;margin-top:calc(.5em * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5em * var(--tw-space-y-reverse))}#fbjs :is(.self-start){align-self:flex-start}#fbjs :is(.overflow-auto){overflow:auto}#fbjs :is(.overflow-hidden){overflow:hidden}#fbjs :is(.overflow-visible){overflow:visible}#fbjs :is(.overflow-y-auto){overflow-y:auto}#fbjs :is(.rounded){border-radius:.25em}#fbjs :is(.rounded-\\[100\\%\\]){border-radius:100%}#fbjs :is(.rounded-full){border-radius:9999px}#fbjs :is(.rounded-lg){border-radius:.5em}#fbjs :is(.rounded-md){border-radius:.375em}#fbjs :is(.rounded-xl){border-radius:.75em}#fbjs :is(.rounded-l-md){border-top-left-radius:.375em;border-bottom-left-radius:.375em}#fbjs :is(.rounded-r-md){border-top-right-radius:.375em;border-bottom-right-radius:.375em}#fbjs :is(.border){border-width:1px}#fbjs :is(.border-2){border-width:2px}#fbjs :is(.border-4){border-width:4px}#fbjs :is(.border-b-2){border-bottom-width:2px}#fbjs :is(.border-dashed){border-style:dashed}#fbjs :is(.border-\\[\\#e5e7eb\\]){--tw-border-opacity: 1;border-color:rgb(229 231 235 / var(--tw-border-opacity))}#fbjs :is(.border-back-button-border){border-color:var(--fb-back-btn-border)}#fbjs :is(.border-border){border-color:var(--fb-border-color)}#fbjs :is(.border-border-highlight){border-color:var(--fb-border-color-highlight)}#fbjs :is(.border-brand){border-color:var(--fb-brand-color)}#fbjs :is(.border-neutral-900){--tw-border-opacity: 1;border-color:rgb(23 23 23 / var(--tw-border-opacity))}#fbjs :is(.border-red-500){--tw-border-opacity: 1;border-color:rgb(239 68 68 / var(--tw-border-opacity))}#fbjs :is(.border-slate-200){--tw-border-opacity: 1;border-color:rgb(226 232 240 / var(--tw-border-opacity))}#fbjs :is(.border-slate-300){--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity))}#fbjs :is(.border-submit-button-border){border-color:var(--fb-submit-btn-border)}#fbjs :is(.\\!bg-slate-900){--tw-bg-opacity: 1 !important;background-color:rgb(15 23 42 / var(--tw-bg-opacity))!important}#fbjs :is(.bg-\\[--fb-survey-background-color\\]){background-color:var(--fb-survey-background-color)}#fbjs :is(.bg-accent-bg){background-color:var(--fb-accent-background-color)}#fbjs :is(.bg-accent-selected-bg){background-color:var(--fb-accent-background-color-selected)}#fbjs :is(.bg-brand){background-color:var(--fb-brand-color)}#fbjs :is(.bg-gray-700\\/80){background-color:#374151cc}#fbjs :is(.bg-shadow){background-color:var(--fb-shadow-color)}#fbjs :is(.bg-slate-100){--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}#fbjs :is(.bg-slate-200){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}#fbjs :is(.bg-slate-50){--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}#fbjs :is(.bg-survey-bg){background-color:var(--fb-survey-background-color)}#fbjs :is(.bg-white){--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity))}#fbjs :is(.bg-white\\/50){background-color:#ffffff80}#fbjs :is(.bg-none){background-image:none}#fbjs :is(.fill-none){fill:none}#fbjs :is(.fill-rating-fill){fill:var(--fb-rating-fill)}#fbjs :is(.stroke-heading){stroke:var(--fb-heading-color)}#fbjs :is(.stroke-rating-selected){stroke:var(--fb-rating-selected)}#fbjs :is(.object-contain){-o-object-fit:contain;object-fit:contain}#fbjs :is(.object-cover){-o-object-fit:cover;object-fit:cover}#fbjs :is(.p-0){padding:0}#fbjs :is(.p-2){padding:.5em}#fbjs :is(.p-3){padding:.75em}#fbjs :is(.p-4){padding:1em}#fbjs :is(.px-1){padding-left:.25em;padding-right:.25em}#fbjs :is(.px-1\\.5){padding-left:.375em;padding-right:.375em}#fbjs :is(.px-3){padding-left:.75em;padding-right:.75em}#fbjs :is(.px-6){padding-left:1.5em;padding-right:1.5em}#fbjs :is(.py-0){padding-top:0;padding-bottom:0}#fbjs :is(.py-0\\.5){padding-top:.125em;padding-bottom:.125em}#fbjs :is(.py-2){padding-top:.5em;padding-bottom:.5em}#fbjs :is(.py-3){padding-top:.75em;padding-bottom:.75em}#fbjs :is(.py-4){padding-top:1em;padding-bottom:1em}#fbjs :is(.py-6){padding-top:1.5em;padding-bottom:1.5em}#fbjs :is(.pb-2){padding-bottom:.5em}#fbjs :is(.pb-3){padding-bottom:.75em}#fbjs :is(.pr-2){padding-right:.5em}#fbjs :is(.pr-2\\.5){padding-right:.625em}#fbjs :is(.pt-1){padding-top:.25em}#fbjs :is(.pt-2){padding-top:.5em}#fbjs :is(.pt-6){padding-top:1.5em}#fbjs :is(.text-left){text-align:left}#fbjs :is(.text-center){text-align:center}#fbjs :is(.text-right){text-align:right}#fbjs :is(.text-base){font-size:1em;line-height:1.5em}#fbjs :is(.text-sm){font-size:.875em;line-height:1.25em}#fbjs :is(.text-xs){font-size:.75em;line-height:1em}#fbjs :is(.font-medium){font-weight:500}#fbjs :is(.font-normal){font-weight:400}#fbjs :is(.font-semibold){font-weight:600}#fbjs :is(.leading-10){line-height:2.5em}#fbjs :is(.leading-4){line-height:1em}#fbjs :is(.leading-6){line-height:1.5em}#fbjs :is(.leading-7){line-height:1.75em}#fbjs :is(.leading-\\[2\\.8rem\\]){line-height:2.8em}#fbjs :is(.\\!text-slate-100){--tw-text-opacity: 1 !important;color:rgb(241 245 249 / var(--tw-text-opacity))!important}#fbjs :is(.text-amber-400){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity))}#fbjs :is(.text-brand){color:var(--fb-brand-color)}#fbjs :is(.text-close-button){color:var(--fb-close-btn-color)}#fbjs :is(.text-heading){color:var(--fb-heading-color)}#fbjs :is(.text-info-text){color:var(--fb-info-text-color)}#fbjs :is(.text-on-brand){color:var(--fb-brand-text-color)}#fbjs :is(.text-rating-selected){color:var(--fb-rating-selected)}#fbjs :is(.text-red-500){--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity))}#fbjs :is(.text-red-600){--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity))}#fbjs :is(.text-signature){color:var(--fb-signature-text-color)}#fbjs :is(.text-slate-300){--tw-text-opacity: 1;color:rgb(203 213 225 / var(--tw-text-opacity))}#fbjs :is(.text-slate-500){--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity))}#fbjs :is(.text-slate-600){--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity))}#fbjs :is(.text-slate-700){--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity))}#fbjs :is(.text-slate-900){--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity))}#fbjs :is(.text-subheading){color:var(--fb-subheading-color)}#fbjs :is(.opacity-0){opacity:0}#fbjs :is(.opacity-100){opacity:1}#fbjs :is(.opacity-60){opacity:.6}#fbjs :is(.shadow-lg){--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#fbjs :is(.shadow-md){--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#fbjs :is(.shadow-sm){--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#fbjs :is(.shadow-xl){--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}#fbjs :is(.filter){filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}#fbjs :is(.transition-all){transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}#fbjs :is(.duration-500){transition-duration:.5s}#fbjs :is(.ease-in-out){transition-timing-function:cubic-bezier(.4,0,.2,1)}#fbjs{font-size:16px}#fbjs *{scrollbar-width:thin;scrollbar-color:#e2e8f0}#fbjs *::-webkit-scrollbar{width:8px;border-radius:99px}#fbjs *::-webkit-scrollbar-track{background:#e2e8f0;border-radius:99px}#fbjs *::-webkit-scrollbar-thumb{background-color:#cbd5e1;border:3px solid #cbd5e1;border-radius:99px}.fb-htmlbody{display:block;font-size:.875em;font-weight:400;line-height:1.5em;color:var(--fb-subheading-color)!important}p.fb-editor-paragraph{color:var(--fb-subheading-color)!important}:root{--slate-50: rgb(248 250 252);--slate-100: rgb(241 245 249);--slate-200: rgb(226 232 240);--slate-300: rgb(203 213 225);--slate-400: rgb(148 163 184);--slate-500: rgb(100 116 139);--slate-600: rgb(71 85 105);--slate-700: rgb(51 65 85);--slate-800: rgb(30 41 59);--slate-900: rgb(15 23 42);--gray-100: rgb(243 244 246);--gray-200: rgb(229 231 235);--yellow-300: rgb(253 224 71);--yellow-500: rgb(234 179 8);--fb-brand-color: rgb(255, 255, 255);--fb-brand-text-color: black;--fb-border-color: var(--slate-300);--fb-border-color-highlight: var(--slate-500);--fb-focus-color: var(--slate-500);--fb-heading-color: var(--slate-900);--fb-subheading-color: var(--slate-700);--fb-info-text-color: var(--slate-500);--fb-signature-text-color: var(--slate-400);--fb-survey-background-color: white;--fb-accent-background-color: var(--slate-200);--fb-accent-background-color-selected: var(--slate-100);--fb-placeholder-color: var(--slate-400);--fb-shadow-color: var(--slate-300);--fb-rating-fill: var(--yellow-300);--fb-rating-hover: var(--yellow-500);--fb-back-btn-border: transparent;--fb-submit-btn-border: transparent;--fb-rating-selected: black;--fb-close-btn-color: var(--slate-500);--fb-close-btn-color-hover: var(--slate-700)}#fbjs :is(.placeholder\\:text-placeholder)::-moz-placeholder{color:var(--fb-placeholder-color)}#fbjs :is(.placeholder\\:text-placeholder)::placeholder{color:var(--fb-placeholder-color)}#fbjs :is(.first\\:rounded-l-md:first-child){border-top-left-radius:.375em;border-bottom-left-radius:.375em}#fbjs :is(.last\\:rounded-r-md:last-child){border-top-right-radius:.375em;border-bottom-right-radius:.375em}#fbjs :is(.focus-within\\:border-border-highlight:focus-within){border-color:var(--fb-border-color-highlight)}#fbjs :is(.focus-within\\:bg-accent-bg:focus-within){background-color:var(--fb-accent-background-color)}#fbjs :is(.hover\\:bg-accent-bg:hover){background-color:var(--fb-accent-background-color)}#fbjs :is(.hover\\:bg-slate-100:hover){--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity))}#fbjs :is(.hover\\:bg-slate-200:hover){--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity))}#fbjs :is(.hover\\:bg-slate-50:hover){--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity))}#fbjs :is(.hover\\:text-amber-400:hover){--tw-text-opacity: 1;color:rgb(251 191 36 / var(--tw-text-opacity))}#fbjs :is(.hover\\:text-close-button-focus:hover){color:var(--fb-close-btn-hover-color)}#fbjs :is(.hover\\:text-heading:hover){color:var(--fb-heading-color)}#fbjs :is(.hover\\:text-slate-900:hover){--tw-text-opacity: 1;color:rgb(15 23 42 / var(--tw-text-opacity))}#fbjs :is(.hover\\:opacity-90:hover){opacity:.9}#fbjs :is(.focus\\:border-4:focus){border-width:4px}#fbjs :is(.focus\\:border-border-highlight:focus){border-color:var(--fb-border-color-highlight)}#fbjs :is(.focus\\:bg-accent-bg:focus){background-color:var(--fb-accent-background-color)}#fbjs :is(.focus\\:bg-accent-selected-bg:focus){background-color:var(--fb-accent-background-color-selected)}#fbjs :is(.focus\\:outline-none:focus){outline:2px solid transparent;outline-offset:2px}#fbjs :is(.focus\\:ring-0:focus){--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#fbjs :is(.focus\\:ring-2:focus){--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}#fbjs :is(.focus\\:ring-border-highlight:focus){--tw-ring-color: var(--fb-border-color-highlight)}#fbjs :is(.focus\\:ring-close-button-focus:focus){--tw-ring-color: var(--fb-close-btn-hover-color)}#fbjs :is(.focus\\:ring-focus:focus){--tw-ring-color: var(--fb-focus-color)}#fbjs :is(.focus\\:ring-neutral-900:focus){--tw-ring-opacity: 1;--tw-ring-color: rgb(23 23 23 / var(--tw-ring-opacity))}#fbjs :is(.focus\\:ring-offset-0:focus){--tw-ring-offset-width: 0px}#fbjs :is(.focus\\:ring-offset-1:focus){--tw-ring-offset-width: 1px}#fbjs :is(.focus\\:ring-offset-2:focus){--tw-ring-offset-width: 2px}#fbjs :is(.disabled\\:cursor-not-allowed:disabled){cursor:not-allowed}#fbjs :is(.disabled\\:opacity-50:disabled){opacity:.5}#fbjs :is(.aria-selected\\:opacity-100[aria-selected=true]){opacity:1}@media (min-width: 640px){#fbjs :is(.sm\\:bottom-3){bottom:.75em}#fbjs :is(.sm\\:left-1\\/2){left:50%}#fbjs :is(.sm\\:left-3){left:.75em}#fbjs :is(.sm\\:right-3){right:.75em}#fbjs :is(.sm\\:top-1\\/2){top:50%}#fbjs :is(.sm\\:top-3){top:.75em}#fbjs :is(.sm\\:m-4){margin:1em}#fbjs :is(.sm\\:max-w-sm){max-width:24em}#fbjs :is(.sm\\:-translate-x-1\\/2){--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#fbjs :is(.sm\\:-translate-y-1\\/2){--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#fbjs :is(.sm\\:transform){transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}#fbjs :is(.sm\\:text-sm){font-size:.875em;line-height:1.25em}}#fbjs :is(:where(.dark) .dark\\:border-slate-600){--tw-border-opacity: 1;border-color:rgb(71 85 105 / var(--tw-border-opacity))}#fbjs :is(:where(.dark) .dark\\:bg-slate-700){--tw-bg-opacity: 1;background-color:rgb(51 65 85 / var(--tw-bg-opacity))}#fbjs :is(:where(.dark) .dark\\:text-slate-400){--tw-text-opacity: 1;color:rgb(148 163 184 / var(--tw-text-opacity))}#fbjs :is(:where(.dark) .dark\\:hover\\:border-slate-500:hover){--tw-border-opacity: 1;border-color:rgb(100 116 139 / var(--tw-border-opacity))}#fbjs :is(:where(.dark) .dark\\:hover\\:bg-slate-800:hover){--tw-bg-opacity: 1;background-color:rgb(30 41 59 / var(--tw-bg-opacity))}.fb-editor-text-bold{font-weight:700!important}.fb-editor-text-italic{font-style:italic!important}.fb-editor-link{color:#334155!important;text-decoration:underline!important}.editor-tokenFunction{color:#dd4a68!important}.fb-editor-paragraph{margin:0!important;position:relative!important;color:#334155!important}.fb-editor-paragraph:last-child{margin-bottom:0!important}.fb-editor-heading-h1{font-size:25px!important;font-weight:400!important;margin-bottom:20px!important;font-weight:700!important}.fb-editor-heading-h2{font-size:20px!important;font-weight:700!important;margin-bottom:20px!important}.fb-editor-list-ul,.fb-editor-list-ol{margin-bottom:12px!important}.fb-editor-listitem{margin:0 32px!important}.fb-editor-nested-listitem{list-style-type:none!important}',document.head.appendChild(e)}})(),(({brandColor:e})=>{if(null===document.getElementById("formbricks__css"))return;const t=document.createElement("style");t.id="formbricks__css__custom",t.innerHTML=`\n    :root {\n      --fb-brand-color: ${e};\n      ${function(e){let t,n,r;if(4===e.length?(t=parseInt(e[1]+e[1],16),n=parseInt(e[2]+e[2],16),r=parseInt(e[3]+e[3],16)):7===e.length&&(t=parseInt(e[1]+e[2],16),n=parseInt(e[3]+e[4],16),r=parseInt(e[5]+e[6],16)),void 0===t||void 0===n||void 0===r)throw new Error("Invalid color");return.299*t+.587*n+.114*r>128}(e)?"--fb-brand-text-color: black;":"--fb-brand-text-color: white;"}\n    }\n  `,document.head.appendChild(t)})({brandColor:e.brandColor});const t=document.createElement("div");var n,r,a,s,i,o;t.id="formbricks-modal-container",document.body.appendChild(t),n=Ze(ci,e),r=t,Te.__&&Te.__(n,r),s=(a=!1)?null:r.__k,i=[],o=[],at(r,n=r.__k=Ze($e,null,[n]),s||Pe,Pe,void 0!==r.ownerSVGElement,s?null:r.firstChild?Ie.call(r.childNodes):null,i,s?s.__e:r.firstChild,a,o),st(i,n,o)},ui=(e,t)=>{const n=Math.abs(t.getTime()-e.getTime());return Math.floor(n/864e5)},pi=je.getInstance(),mi=be.getInstance();let hi=null;const fi=async e=>{try{const t=await(async({apiHost:e,environmentId:t,userId:n})=>{const r=`${e}/api/v1/client/${t}/in-app/sync/${n}`,a=`${e}/api/v1/client/${t}/in-app/sync`;if(!n){const e=await fetch(a);if(!e.ok){const t=await e.json();return _e({code:"network_error",status:e.status,message:"Error syncing with backend",url:r,responseMessage:t.message})}return ve((await e.json()).data)}const s=await fetch(r);if(!s.ok){const e=await s.json();return _e({code:"network_error",status:s.status,message:"Error syncing with backend",url:r,responseMessage:e.message})}const i=await s.json(),{data:o}=i;return ve(o)})(e);if(!0!==(null==t?void 0:t.ok))throw mi.error(`Sync failed: ${JSON.stringify(t.error)}`),t.error;let n;try{n=pi.get().state}catch(e){}let r={surveys:t.value.surveys,noCodeActionClasses:t.value.noCodeActionClasses,product:t.value.product,attributes:(null==n?void 0:n.attributes)||{}};if(e.userId){const e=r.surveys.map((e=>e.name));mi.debug("Fetched "+e.length+" surveys during sync: "+e.join(", "))}else{r={...r,displays:(null==n?void 0:n.displays)||[]},r=gi(r);const e=r.surveys.map((e=>e.name));mi.debug("Fetched "+e.length+" surveys during sync: "+e.join(", "))}pi.update({apiHost:e.apiHost,environmentId:e.environmentId,userId:e.userId,state:r})}catch(e){throw mi.error(`Error during sync: ${e}`),e}},gi=e=>{const{displays:t,product:n}=e;let{surveys:r}=e;if(!t)return e;let a=r.filter((e=>{if("respondMultiple"===e.displayOption)return!0;if("displayOnce"===e.displayOption)return 0===t.filter((t=>t.surveyId===e.id)).length;if("displayMultiple"===e.displayOption)return 0===t.filter((t=>t.surveyId===e.id&&t.responded)).length;throw Error("Invalid displayOption")}));const s=t.length>0?t[t.length-1]:void 0;return a=a.filter((e=>{if(s){if(null!==e.recontactDays){const n=t.filter((t=>t.surveyId===e.id))[0];return!n||ui(new Date,new Date(n.createdAt))>=e.recontactDays}return null===n.recontactDays||ui(new Date,new Date(s.createdAt))>=n.recontactDays}return!0})),{...e,surveys:a}},bi="formbricks-web-container",vi=je.getInstance(),_i=be.getInstance(),yi=xe.getInstance();let wi=!1;const ki=e=>{if(wi)return void _i.debug("A survey is already running. Skipping.");wi=!0,e.delay&&_i.debug(`Delaying survey by ${e.delay} seconds.`);const t=vi.get().state.product,n=new Se(e.id,null,null,vi.get().userId),r=new Ne({apiHost:vi.get().apiHost,environmentId:vi.get().environmentId,retryAttempts:2,onResponseSendingFailed:e=>{alert(`Failed to send response: ${JSON.stringify(e,null,2)}`)}},n),a=e.productOverwrites??{},s=a.brandColor??t.brandColor,i=a.highlightBorderColor??t.highlightBorderColor,o=a.clickOutsideClose??t.clickOutsideClose,l=a.darkOverlay??t.darkOverlay,c=a.placement??t.placement,d=t.inAppSurveyBranding;setTimeout((()=>{di({survey:e,brandColor:s,isBrandingEnabled:d,clickOutside:o,darkOverlay:l,highlightBorderColor:i,placement:c,onDisplay:async()=>{const{userId:t}=vi.get();if(!t){const t={createdAt:new Date,surveyId:e.id,responded:!1},n=vi.get().state.displays,r=n?[...n,t]:[t],a=vi.get();let s=gi({...a.state,displays:r});vi.update({...a,state:s})}const a=new ge({apiHost:vi.get().apiHost,environmentId:vi.get().environmentId}),s=await a.client.display.create({surveyId:e.id,userId:t});if(!s.ok)throw new Error("Could not create display");const{id:i}=s.data;n.updateDisplayId(i),r.updateSurveyState(n)},onResponse:e=>{const{userId:t}=vi.get();if(!t){const e=vi.get().state.displays,t=e&&e[e.length-1];if(!t)throw new Error("No lastDisplay found");if(!t.responded){t.responded=!0;const n=vi.get();let r=gi({...n.state,displays:e});vi.update({...n,state:r})}}t&&n.updateUserId(t),r.updateSurveyState(n),r.add({data:e.data,ttc:e.ttc,finished:e.finished})},onClose:xi,onFileUpload:async(e,t)=>{const n=new ge({apiHost:vi.get().apiHost,environmentId:vi.get().environmentId});return await n.client.storage.uploadFile(e,t)}})}),1e3*e.delay)},xi=async()=>{var e;if(null==(e=document.getElementById(bi))||e.remove(),Ei(),!vi.get().userId){const e=vi.get().state,t=gi(e);return vi.update({...vi.get(),state:t}),void(wi=!1)}try{await fi({apiHost:vi.get().apiHost,environmentId:vi.get().environmentId,userId:vi.get().userId}),wi=!1}catch(e){yi.handle(e)}},Ei=()=>{const e=document.createElement("div");e.id=bi,document.body.appendChild(e)},ji=be.getInstance(),Ni=je.getInstance(),Ci=["Exit Intent (Desktop)","50% Scroll"],Si=async(e,t={})=>{var n;const{userId:r}=Ni.get(),a={environmentId:Ni.get().environmentId,userId:r,name:e,properties:t||{}};if(r&&!Ci.includes(e)){ji.debug(`Sending action "${e}" to backend`);const t=new ge({apiHost:Ni.get().apiHost,environmentId:Ni.get().environmentId}),n=await t.client.action.create({...a,userId:r});if(!n.ok)return _e({code:"network_error",message:`Error tracking action ${e}`,status:500,url:`${Ni.get().apiHost}/api/v1/client/${Ni.get().environmentId}/actions`,responseMessage:n.error.message})}ji.debug(`Formbricks: Action "${e}" tracked`);const s=null==(n=Ni.get().state)?void 0:n.surveys;return s&&s.length>0?Ii(e,s):ji.debug("No active surveys to display"),{ok:!0,value:void 0}},Ii=(e,t)=>{for(const n of t)for(const t of n.triggers)if(t===e)return ji.debug(`Formbricks: survey ${n.id} triggered by action "${e}"`),void ki(n)};let Ti=!1,Li=async function(e){if(e.clientY<=0){const e=await Si("Exit Intent (Desktop)");if(!0!==e.ok)return _e(e.error)}};let Oi=!1,Di=!1,Ai=async()=>{const e=window.scrollY,t=window.innerHeight,n=document.documentElement.scrollHeight;if(0===e&&(Di=!1),!Di&&e/(n-t)>=.5){Di=!0;const e=await Si("50% Scroll");if(!0!==e.ok)return _e(e.error)}};const Mi=je.getInstance(),Pi=be.getInstance(),Ui=xe.getInstance(),qi=async()=>{var e;Pi.debug(`Checking page url: ${window.location.href}`);const{state:t}=Mi.get();if(void 0===(null==t?void 0:t.noCodeActionClasses))return{ok:!0,value:void 0};const n=((null==t?void 0:t.noCodeActionClasses)||[]).filter((e=>{const{innerHtml:t,cssSelector:n,pageUrl:r}=e.noCodeConfig||{};return r&&!t&&!n}));if(0===n.length)return{ok:!0,value:void 0};for(const t of n){if(!(null==(e=t.noCodeConfig)?void 0:e.pageUrl))continue;const{noCodeConfig:{pageUrl:n}}=t,r=Fi(window.location.href,n.value,n.rule);if(!0!==r.ok)return _e(r.error);if(!1===r.value)continue;const a=await Si(t.name);if(!0!==a.ok)return _e(a.error)}return{ok:!0,value:void 0}};let Ri=!1;const Bi=()=>qi();function Fi(e,t,n){switch(n){case"exactMatch":return ve(e===t);case"contains":return ve(e.includes(t));case"startsWith":return ve(e.startsWith(t));case"endsWith":return ve(e.endsWith(t));case"notMatch":return ve(e!==t);case"notContains":return ve(!e.includes(t));default:return _e({code:"invalid_match_type",message:"Invalid match type"})}}let Zi=!1;const zi=e=>(e=>{const{state:t}=Mi.get();if(!t)return;const n=e.target;((null==t?void 0:t.noCodeActionClasses)||[]).forEach((e=>{var t,r,a,s,i,o,l,c;const d=null==(r=null==(t=e.noCodeConfig)?void 0:t.innerHtml)?void 0:r.value,u=null==(s=null==(a=e.noCodeConfig)?void 0:a.cssSelector)?void 0:s.value,p=null==(o=null==(i=e.noCodeConfig)?void 0:i.pageUrl)?void 0:o.value,m=null==(c=null==(l=e.noCodeConfig)?void 0:l.pageUrl)?void 0:c.rule;if((d||u||p)&&(!d||n.innerHTML===d)){if(u){const e=u.split(/\s*(?=[.#])/);for(let t of e)if(!n.matches(t))return}if(p&&m){const e=Fi(window.location.href,p,m);if(!e.ok||!e.value)return}Si(e.name).then((e=>{var t,n;n=e=>{Ui.handle(e)},!0===(t=e).ok?t.value:n(t.error)}))}}))})(e);let $i=!1;const Hi=je.getInstance(),Vi=be.getInstance(),Wi=je.getInstance(),Qi=be.getInstance();let Gi=!1;const Ki=async e=>{if(Gi)return Qi.debug("Already initialized, skipping initialization."),{ok:!0,value:void 0};if((e=>{e.debug&&(Qi.debug("Setting log level to debug"),Qi.configure({logLevel:"debug"}))})(e),xe.getInstance().printStatus(),Qi.debug("Start initialize"),!e.environmentId)return Qi.debug("No environmentId provided"),_e({code:"missing_field",field:"environmentId"});if(!e.apiHost)return Qi.debug("No apiHost provided"),_e({code:"missing_field",field:"apiHost"});if(Qi.debug("Adding widget container to DOM"),Ei(),!e.userId&&e.attributes)return Qi.error("No userId provided but attributes. Cannot update attributes without userId."),_e({code:"missing_field",field:"userId"});let t,n=null;if(e.userId&&e.attributes){const t=await(async(e,t,n,r)=>{var a,s;if(!n)return _e({code:"missing_person",message:"Unable to update attribute. User identification deactivated. No userId set."});const i={...r};try{const e=null==(s=null==(a=Hi.get())?void 0:a.state)?void 0:s.attributes;if(e)for(const[t,n]of Object.entries(e))i[t]===n&&delete i[t]}catch(e){Vi.debug("config not set; sending all attributes to backend")}if(0===Object.keys(i).length)return Vi.debug("No attributes to update. Skipping update."),ve(i);Vi.debug("Updating attributes: "+JSON.stringify(i));const o={attributes:i},l=new ge({apiHost:e,environmentId:t}),c=await l.client.people.update(n,o);return c.ok?ve(i):_e({code:"network_error",status:500,message:`Error updating person with userId ${n}`,url:`${e}/api/v1/client/${t}/people/${n}`,responseMessage:c.error.message})})(e.apiHost,e.environmentId,e.userId,e.attributes);if(!0!==t.ok)return _e(t.error);n=t.value}try{t=Wi.get()}catch(e){Qi.debug("No existing configuration found.")}return t&&t.state&&t.environmentId===e.environmentId&&t.apiHost===e.apiHost&&t.userId===e.userId&&t.expiresAt?(Qi.debug("Found existing configuration."),t.expiresAt<new Date?(Qi.debug("Configuration expired."),await fi({apiHost:e.apiHost,environmentId:e.environmentId,userId:e.userId})):(Qi.debug("Configuration not expired. Extending expiration."),Wi.update(t))):(Qi.debug("No valid configuration found or it has been expired. Creating new config."),Qi.debug("Syncing."),await fi({apiHost:e.apiHost,environmentId:e.environmentId,userId:e.userId}),await Si("New Session")),n&&Object.keys(n).length>0&&Wi.update({environmentId:Wi.get().environmentId,apiHost:Wi.get().apiHost,userId:Wi.get().userId,state:{...Wi.get().state,attributes:{...Wi.get().state.attributes,...e.attributes}}}),Qi.debug("Adding event listeners"),"undefined"!=typeof window&&null===hi&&(hi=window.setInterval((async()=>{pi.get().expiresAt&&new Date(pi.get().expiresAt)>=new Date||(mi.debug("Config has expired. Starting sync."),await fi({apiHost:pi.get().apiHost,environmentId:pi.get().environmentId,userId:pi.get().userId}))}),6e4)),"undefined"==typeof window||Ri||(window.addEventListener("hashchange",Bi),window.addEventListener("popstate",Bi),window.addEventListener("pushstate",Bi),window.addEventListener("replacestate",Bi),window.addEventListener("load",Bi),Ri=!0),"undefined"==typeof window||Zi||(document.addEventListener("click",zi),Zi=!0),"undefined"==typeof document||Ti||(document.querySelector("body").addEventListener("mouseleave",Li),Ti=!0),"undefined"==typeof window||Oi||(window.addEventListener("load",(()=>{window.addEventListener("scroll",Ai)})),Oi=!0),$i||(window.addEventListener("beforeunload",(()=>{"undefined"!=typeof window&&null!==hi&&(window.clearInterval(hi),hi=null),"undefined"!=typeof window&&Ri&&(window.removeEventListener("hashchange",Bi),window.removeEventListener("popstate",Bi),window.removeEventListener("pushstate",Bi),window.removeEventListener("replacestate",Bi),window.removeEventListener("load",Bi),Ri=!1),Zi&&(document.removeEventListener("click",zi),Zi=!1),Ti&&(document.removeEventListener("mouseleave",Li),Ti=!1),Oi&&(window.removeEventListener("scroll",Ai),Oi=!1)})),$i=!0),Gi=!0,Qi.debug("Initialized"),qi(),{ok:!0,value:void 0}};be.getInstance().debug("Create command queue");const Yi=new class{constructor(){this.queue=[],this.running=!1,this.resolvePromise=null,this.commandPromise=null}add(e=!0,t,...n){this.queue.push({command:t,checkInitialized:e,commandArgs:n}),this.running||(this.commandPromise=new Promise((e=>{this.resolvePromise=e,this.run()})))}async wait(){this.running&&await this.commandPromise}async run(){for(this.running=!0;this.queue.length>0;){const e=xe.getInstance(),t=this.queue.shift();if(!t)continue;if(t.checkInitialized){const t=(Qi.debug("Check if initialized"),Gi&&xe.initialized?{ok:!0,value:void 0}:_e({code:"not_initialized",message:"Formbricks not initialized. Call initialize() first."}));t&&!0!==t.ok&&e.handle(t.error)}const n=await(null==t?void 0:t.command.apply(null,null==t?void 0:t.commandArgs));n&&!0!==n.ok&&e.handle(n.error)}this.running=!1,this.resolvePromise&&(this.resolvePromise(),this.resolvePromise=null,this.commandPromise=null)}};var Xi,Ji,eo,to,no,ro,ao,so;"undefined"!=typeof window&&void 0!==window.neveDash&&(async e=>{xe.init(e.errorHandler),Yi.add(!1,Ki,e),await Yi.wait()})({environmentId:"clr0ply35522h8up0bay2de4y",apiHost:"https://app.formbricks.com",userId:"neve_"+(null!==(Xi=null===(Ji=window.neveDash)||void 0===Ji||null===(eo=Ji.license)||void 0===eo?void 0:eo.key)&&void 0!==Xi?Xi:null===(to=window.neveDash)||void 0===to||null===(no=to.rootUrl)||void 0===no?void 0:no.replace(/[^\w\d]*/g,"")),attributes:{plan:null!==(ro=null===(ao=window.neveDash)||void 0===ao||null===(so=ao.license)||void 0===so?void 0:so.type)&&void 0!==ro?ro:"free",days_since_install:((e,t=1)=>{const n=Math.round(e/t);return 0===n||1===n?0:1<n&&8>n?7:8<=n&&31>n?30:30<n&&90>n?90:90>n?91:void 0})(window.neveDash.daysSinceInstall)}}),(0,a.registerStore)("neve-dashboard",{reducer:(e=se,t)=>{switch(t.type){case"SET_TAB":const{tab:n}=t.payload;return{...e,currentTab:n};case"SET_SETTINGS":const{object:r}=t.payload;return{...e,settings:r};case"SET_PLUGIN_STATE":const{pluginSlug:a,pluginState:s}=t.payload,i={...e.plugins};return i[a].cta=s,{...e,plugins:i};case"TOGGLE_MODULE":const{moduleSlug:o,value:l}=t.payload;return{...e,settings:{...e.settings,[o]:l}};case"CHANGE_MODULE_OPTION":const{optionStatus:c,optionValue:d}=t.payload;return{...e,settings:{...e.settings,[c]:d}};case"UPDATE_LICENSE":return{...e,license:t.payload.licenseData};case"UPDATE_TOAST_MESSAGE":return{...e,toast:t.payload};case"SET_LOGGER_STATUS":return{...e,settings:{...e.settings,neve_logger_flag:t.payload}}}return e},actions:{setTab:e=>({type:"SET_TAB",payload:{tab:e}}),setSettings:e=>({type:"SET_SETTINGS",payload:{object:e}}),setPluginState:(e,t)=>({type:"SET_PLUGIN_STATE",payload:{pluginSlug:e,pluginState:t}}),changeModuleStatus:(e,t)=>({type:"TOGGLE_MODULE",payload:{moduleSlug:"nv_pro_"+e+"_status",value:t}}),changeModuleOption:(e,t,n=!0)=>({type:"CHANGE_MODULE_OPTION",payload:{optionStatus:(n?"nv_pro_":"")+e,optionValue:t}}),changeLicense:e=>({type:"UPDATE_LICENSE",payload:{licenseData:e}}),setToast:e=>({type:"UPDATE_TOAST_MESSAGE",payload:e}),setLogger:e=>({type:"SET_LOGGER_STATUS",payload:e})},selectors:{getModuleStatus:(e,t)=>e.settings["nv_pro_"+t+"_status"],getOption:(e,t)=>e.settings[t],getPlugins:e=>e.plugins,getProOption:(e,t)=>e.settings["nv_pro_"+t],getLicenseTier:e=>e.license?e.license.tier:1,getLicense:e=>e.license,getToast:e=>e.toast,getTab:e=>e.currentTab}}),(0,r.render)((0,r.createElement)((()=>(0,r.createElement)(ae,null)),null),document.getElementById("neve-dashboard"))},184:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function a(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var s=typeof n;if("string"===s||"number"===s)e.push(n);else if(Array.isArray(n)){if(n.length){var i=a.apply(null,n);i&&e.push(i)}}else if("object"===s)if(n.toString===Object.prototype.toString)for(var o in n)r.call(n,o)&&n[o]&&e.push(o);else e.push(n.toString())}}return e.join(" ")}e.exports?(a.default=a,e.exports=a):void 0===(n=function(){return a}.apply(t,[]))||(e.exports=n)}()},247:function(e,t){var n,r;void 0===(r="function"==typeof(n=function(){var e=/^v?(?:\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+)(\.(?:[x*]|\d+))?(?:-[\da-z\-]+(?:\.[\da-z\-]+)*)?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i;function t(e){var t,n,r=e.replace(/^v/,"").replace(/\+.*$/,""),a=(n="-",-1===(t=r).indexOf(n)?t.length:t.indexOf(n)),s=r.substring(0,a).split(".");return s.push(r.substring(a+1)),s}function n(e){return isNaN(Number(e))?e:Number(e)}function r(t){if("string"!=typeof t)throw new TypeError("Invalid argument expected string");if(!e.test(t))throw new Error("Invalid argument not valid semver ('"+t+"' received)")}function a(e,a){[e,a].forEach(r);for(var s=t(e),i=t(a),o=0;o<Math.max(s.length-1,i.length-1);o++){var l=parseInt(s[o]||0,10),c=parseInt(i[o]||0,10);if(l>c)return 1;if(c>l)return-1}var d=s[s.length-1],u=i[i.length-1];if(d&&u){var p=d.split(".").map(n),m=u.split(".").map(n);for(o=0;o<Math.max(p.length,m.length);o++){if(void 0===p[o]||"string"==typeof m[o]&&"number"==typeof p[o])return-1;if(void 0===m[o]||"string"==typeof p[o]&&"number"==typeof m[o])return 1;if(p[o]>m[o])return 1;if(m[o]>p[o])return-1}}else if(d||u)return d?-1:1;return 0}var s=[">",">=","=","<","<="],i={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1]};return a.validate=function(t){return"string"==typeof t&&e.test(t)},a.compare=function(e,t,n){!function(e){if("string"!=typeof e)throw new TypeError("Invalid operator type, expected string but got "+typeof e);if(-1===s.indexOf(e))throw new TypeError("Invalid operator, expected one of "+s.join("|"))}(n);var r=a(e,t);return i[n].indexOf(r)>-1},a})?n.apply(t,[]):n)||(e.exports=r)}},n={};function r(e){var a=n[e];if(void 0!==a)return a.exports;var s=n[e]={exports:{}};return t[e].call(s.exports,s,s.exports,r),s.exports}r.m=t,e=[],r.O=(t,n,a,s)=>{if(!n){var i=1/0;for(d=0;d<e.length;d++){n=e[d][0],a=e[d][1],s=e[d][2];for(var o=!0,l=0;l<n.length;l++)(!1&s||i>=s)&&Object.keys(r.O).every((e=>r.O[e](n[l])))?n.splice(l--,1):(o=!1,s<i&&(i=s));if(o){e.splice(d--,1);var c=a();void 0!==c&&(t=c)}}return t}s=s||0;for(var d=e.length;d>0&&e[d-1][2]>s;d--)e[d]=e[d-1];e[d]=[n,a,s]},r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{var e={966:0,123:0};r.O.j=t=>0===e[t];var t=(t,n)=>{var a,s,i=n[0],o=n[1],l=n[2],c=0;if(i.some((t=>0!==e[t]))){for(a in o)r.o(o,a)&&(r.m[a]=o[a]);if(l)var d=l(r)}for(t&&t(n);c<i.length;c++)s=i[c],r.o(e,s)&&e[s]&&e[s][0](),e[i[c]]=0;return r.O(d)},n=self.webpackChunkneve=self.webpackChunkneve||[];n.forEach(t.bind(null,0)),n.push=t.bind(null,n.push.bind(n))})();var a=r.O(void 0,[123],(()=>r(672)));a=r.O(a)})();