@inploi/plugin-chatbot 14.7.0 → 14.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cdn/index.js +5 -5
- package/cdn/style.css +1 -1
- package/dist/accessible-labels.test.d.ts +1 -0
- package/dist/{chatbot-body-8d36637a.js → chatbot-body-45ccac19.js} +1765 -1613
- package/dist/chatbot-body-b6a4eef8.cjs +5 -0
- package/dist/chatbot.state.d.ts +2 -0
- package/dist/chatbot.utils.d.ts +2 -0
- package/dist/components/chat-input/chat-input.text.d.ts +2 -0
- package/dist/components/chat-input/chat-input.text.test.d.ts +1 -0
- package/dist/components/useChatService.d.ts +3 -0
- package/dist/i18n.d.ts +78 -0
- package/dist/index-47f31542.cjs +5 -0
- package/dist/{index-8090d2e3.js → index-75330fed.js} +766 -706
- package/dist/interpreter.d.ts +9 -14
- package/dist/plugin-chatbot.cjs +1 -1
- package/dist/plugin-chatbot.js +1 -1
- package/dist/style/tokens.d.ts +3 -1
- package/dist/style.css +1 -1
- package/package.json +9 -9
- package/dist/chatbot-body-95e99884.cjs +0 -5
- package/dist/index-51cb9a4f.cjs +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-47f31542.cjs"),At=require("@inploi/sdk"),Ft=(e,r,t)=>{var n;return e.log({event:t,properties:{flow_id:r.id,flow_version:r.version,flow_session_id:r.data.flowSessionId,flow_build:r.build,flow_type:"CHATBOT_DRAWER",job:r.job},customProperties:(n=r.analytics)==null?void 0:n.customProperties})};var Lr="9.6.0",rr=`https://sdk.inploi.com/@inploi/flows@${Lr}/cdn/captcha/index.html`,Dr=new URL(rr).origin,Vt=3e4,Or=5*6e4,Rr=e=>typeof e=="object"&&e!==null&&e.source==="inploi-captcha",at=new WeakMap,Pr=e=>{let r=at.get(e);return r||(r=e.fetch("/flow/captcha").then(t=>{let n=t==null?void 0:t.site_key;return typeof n=="string"&&n!==""?n:void 0}).catch(t=>{throw at.delete(e),t}),at.set(e,r)),r},jr=(e,r={})=>new Promise((t,n)=>{let{signal:a,container:o=null,theme:i,onInteractive:l}=r instanceof AbortSignal?{signal:r}:r,c=!1,h=()=>{},v=F=>{c||(c=!0,clearTimeout(y),a==null||a.removeEventListener("abort",p),h(),F())},g=F=>v(()=>n(new Error(F))),p=()=>g("Captcha aborted"),y,w=F=>{clearTimeout(y),y=setTimeout(()=>g("Captcha timed out"),F)};if(w(Vt),a==null?void 0:a.aborted)return p();a==null||a.addEventListener("abort",p),(async()=>{let F=await Pr(e);if(F===void 0)return v(()=>t(void 0));if(c)return;let _=document.createElement("iframe");_.src=`${rr}?${new URLSearchParams({sitekey:F,origin:window.location.origin,...i&&{theme:i}}).toString()}`,_.title="Cloudflare security check",_.style.cssText=`display:block;border:0;width:${o?"100%":"300px"};height:0;color-scheme:normal`,o?o.appendChild(_):(_.style.cssText+=";position:fixed;bottom:16px;right:16px;z-index:2147483647",document.body.appendChild(_));let S=!1,m=C=>{if(!_.contentWindow||C.source!==_.contentWindow||C.origin!==Dr||!Rr(C.data))return;let A=C.data;switch(A.type){case"token":return v(()=>t(A.token));case"resize":_.style.height=`${Math.max(0,Math.ceil(A.height))}px`;return;case"before-interactive":return S=!0,w(Or),l==null?void 0:l();case"after-interactive":return S=!1,w(Vt);case"error":!S&&!A.interactive&&g("Captcha failed");return;case"expired":return g("Captcha expired");case"timeout":return g("Captcha timed out")}};window.addEventListener("message",m),h=()=>{window.removeEventListener("message",m),_.remove()}})().catch(F=>v(()=>n(F)))}),Et=({condition:e,context:r,submissions:t,ifBlock:n})=>{let[a,...o]=e.compareKey.split(".");if(!a)return!1;let i=s.ee({context:r,key:a,path:o,submissions:t});if(!i)return!1;switch(i.type){case"address":{let l=s.I(i.value,o);switch(e.compare){case"equals":return l===e.compareValue;case"contains":return typeof l!="string"?!1:l.includes(e.compareValue);case"notEquals":return l!==e.compareValue;case"notContains":return typeof l!="string"?!0:!l.includes(e.compareValue)}break}case"integration":{if(typeof i.value!="object"||Array.isArray(i.value))return!1;let l=s.I(i.value,o),c={...n,data:{compareKey:"_temp",compare:e.compare,compareValue:e.compareValue}};switch(typeof l){case"boolean":return $e(c,{submissions:{_temp:{value:l,type:"boolean"}},context:r});case"string":return $e(c,{submissions:{_temp:{value:l,type:"string"}},context:r});case"number":return $e(c,{submissions:{_temp:{value:l,type:"number"}},context:r});case"object":return Array.isArray(l)&&l.every(h=>typeof h=="string")?$e(c,{submissions:{_temp:{value:l,type:"enum"}},context:r}):!1}break}case"boolean":{let l=e.compareValue==="true";switch(e.compare){case"equals":return i.value===l;case"notEquals":return i.value!==l}break}case"phone":case"string":{let l=i.type==="phone"?s.oe(i.value):i.value;switch(e.compare){case"equals":return l===e.compareValue;case"contains":return l?l.includes(e.compareValue):!1;case"notEquals":return l!==e.compareValue;case"notContains":return l?!l.includes(e.compareValue):!0}break}case"number":{try{let l=Number(e.compareValue);switch(e.compare){case"equals":return i.value===l;case"notEquals":return i.value!==l;case"greaterThan":return i.value>l;case"greaterThanOrEqualTo":return i.value>=l;case"lessThan":return i.value<l;case"lessThanOrEqualTo":return i.value<=l}}catch{return console.error(`Failed to parse number in if-block ${n.id}`,i.value),!1}break}case"enum":switch(e.compare){case"equals":return i.value.length===1&&i.value[0]===e.compareValue;case"notEquals":return i.value.length===1&&i.value[0]!==e.compareValue;case"contains":return i.value.includes(e.compareValue);case"notContains":return!i.value.includes(e.compareValue)}break}},$e=(e,{context:r,submissions:t})=>{let n="combinator"in e.data?e.data.conditions:[e.data];if(("combinator"in e.data?e.data.combinator:"and")==="or"){for(let a of n)if(Et({condition:a,context:r,submissions:t,ifBlock:e}))return!0;return!1}else{for(let a of n)if(!Et({condition:a,context:r,submissions:t,ifBlock:e}))return!1;return!0}},Br=/{{\s*([^}]+?)\s*(?:\|\s*([^}]+?)\s*)?}}/g,$r=(e,{context:r,submissions:t})=>e.replace(Br,(n,a,o="")=>{let[i,...l]=a.trim().split("."),c=s.ee({key:i,path:l,submissions:t,context:r});if(!c)return o;switch(c.type){case"boolean":return c.value===!0?"true":"false";case"file":return c.value.map(h=>`${h.name} (${s.ne(h.sizeKb)})`).join(", ");case"enum":return c.value.join(", ");case"address":return Object.values(c.value).filter(h=>h&&h.trim().length>0).join(", ");case"number":case"string":return c.value?c.value.toString():o;case"phone":return s.oe(c.value);case"integration":{if(typeof c.value!="object"||Array.isArray(c.value))break;let h=s.I(c.value,l);switch(typeof h){case"boolean":return h===!0?"true":"false";case"string":return h;case"number":return h.toString();case"object":if(Array.isArray(h)&&h.every(v=>typeof v=="string"))return h.join(", ")}break}}return o});const nr=({context:e,submissions:r})=>({context:e,submissions:r??{}}),oe=(e,r)=>$r(e,nr(r)),qr=(e,r)=>$e(e,nr(r)),sr=({node:e,nodes:r,stopWhen:t})=>{if((t==null?void 0:t(e))===!0)return e;const n=e.nextId?r.find(a=>a.id===e.nextId):void 0;if(n)return sr({node:n,nodes:r,stopWhen:t})},Ur=({childNode:e,nodes:r})=>{const n=r.filter(a=>a.type==="if-block").find(a=>{if(!a.branchId)return!1;const o=r.find(l=>l.id===a.branchId);if(!o)return!1;const i=sr({node:o,nodes:r,stopWhen:l=>l.id===e.id});return!(!i||i.id!==e.id)});if(n!=null&&n.nextId)return r.find(a=>a.id===n.nextId)},zr=3,Kr=({flow:e,analytics:r,logger:t,talentBankClient:n,context:a,apiClient:o,getSubmissions:i,getApplicationRecovery:l,setApplicationRecovery:c,chatService:h,persistWriteBarrier:v,onFlowEnd:g,onInterpret:p,t:y})=>{var S;let w=new AbortController;(S=e.data).startedWriteNodeIds??(S.startedWriteNodeIds=e.nodes.flatMap(m=>{var E,R;if(m.type!=="integration-application-submit"||!e.data.nodeHistory.includes(m.id))return[];const C=m.data.key?(E=i())==null?void 0:E[m.data.key]:void 0;return(C==null?void 0:C.type)==="integration"&&((R=s.se(C.value))==null?void 0:R.verdict)==="not_submitted"?[]:[m.id]}));const F={...r.service,log:m=>r.service.log({...m,customProperties:{...m.customProperties,...r.customProperties}})},_=async(m,C)=>{const A=w.signal;if(A.aborted)return;const E=i(),R=l(),z=(R==null?void 0:R.submitNodeId)===m.id?e.nodes.find(D=>{var $;return D.id===R.fileQuestionNodeId&&D.type==="question-file"&&(($=E==null?void 0:E[D.data.key])==null?void 0:$.type)!=="file"}):void 0;if(z)return _(z,C);p==null||p(m,C);try{await Wr({flow:e,analytics:F,logger:t,talentBankClient:n,apiClient:o,context:a,node:m,submissions:E,applicationRecovery:R,setApplicationRecovery:async D=>{if(!A.aborted)try{await c(D)}catch($){t.error("Failed to persist application recovery",$)}},forceSubmitConfirmation:(R==null?void 0:R.submitNodeId)===m.id,persistWriteBarrier:v,signal:A,t:y,chat:{sendMessage:async D=>h.send({groupId:m.id,message:D,signal:A}),userInput:async D=>h.input({input:D,signal:A}),setSubmission:(D,$)=>{A.aborted||h.setSubmission(D,$)},captcha:h.captcha},next:D=>{if(A.aborted)return;const $=(R==null?void 0:R.fileQuestionNodeId)===m.id?R.submitNodeId:D,O=$?e.nodes.find(H=>H.id===$):Ur({childNode:m,nodes:e.nodes});return O?_(O,m):g==null?void 0:g(m)},end:()=>{A.aborted||g==null||g(m)}})}catch(D){if(D instanceof s.AbortedError)return;throw D}};return{interpret:async m=>{const C=e.nodes.find(A=>A.id===m)??s.getHeadOrThrow(e.nodes);return _(C)},undo:m=>{var $;if(($=e.data.startedWriteNodeIds)!=null&&$.length||e.data.isFinished)return{removed:0};const C=s.getCorrectionNodeId(e),A=C?m.lastIndexOf(C):-1,E=e.nodes.find(O=>O.id===C);if(A===-1||!E)return{removed:0};const R=e.nodes.find(O=>O.id===m[m.length-1]);w.abort();const z=m.splice(A);e.data.messages=e.data.messages.filter(O=>!O.groupId||!z.includes(O.groupId)),e.data.currentInput=null;const D=i();for(const O of z.slice(1)){const H=e.nodes.find(M=>M.id===O);if(!(!H||!D||H.id===C)&&("key"in H.data&&H.data.key&&delete D[H.data.key],"keys"in H.data))for(const M of Object.values(H.data.keys))typeof M=="string"&&delete D[M]}return w=new AbortController,_(E,R),{removed:z.length}},abort:()=>{w.abort()}}};async function Wr(e){const r=e.node;switch(r.type){case"flow-section":return await e.chat.sendMessage({type:"system",variant:"info",text:r.data.title}),e.next(r.nextId);case"pre-apply-result":return hn({...e,node:r});case"text":return rn({...e,node:r});case"image":return nn({...e,node:r});case"question-text":return sn({...e,node:r});case"question-enum":return ln({...e,node:r});case"question-number":return an({...e,node:r});case"question-phone":return on({...e,node:r});case"question-boolean":return un({...e,node:r});case"question-file":return dn({...e,node:r});case"question-address":return cn({...e,node:r});case"end-flow":return fn({...e,node:r});case"if-block":return tn({...e,node:r});case"jump":return Jr({...e,node:r});case"link":return en({...e,node:r});case"integration-application-submit":return Qr({...e,node:r});case"add-submission":return Zr({...e,node:r});case"integration-workflow-get":throw Error("Workflow should be unreachable");case"check-duplicate":return Hr({...e,node:r});case"feedback":return Gr({...e,node:r});default:throw new Error(`Unknown node: ${JSON.stringify(r)}`)}}async function Gr({next:e,node:r}){e(r.nextId)}async function Hr({next:e,node:r,talentBankClient:t,submissions:n,flow:a,logger:o,chat:i}){var c;let l={isDuplicate:!1};if(n&&t){const h=r.data.scope==="job"?(c=a.job)==null?void 0:c.id:void 0;if(r.data.scope==="company"||h!=null)try{l=await t.checkDuplicate({email:s.Z({key:r.data.email,submissions:n}).toString(),jobId:h,scope:r.data.scope})}catch(v){o.error("[check-duplicate]",v)}}i.setSubmission(r.data.key,{type:"integration",value:l}),e(r.nextId)}async function Jr({next:e,node:r}){e(r.data.targetId)}async function Zr({next:e,node:r,logger:t,submissions:n,context:a}){if(!n){t.error("Submissions not found");return}n[r.data.key]={type:"string",value:oe(r.data.value,{submissions:n,context:a})},e(r.nextId)}const Xr=5e3,Yr=(e,r,t)=>{const{waitMs:n,throttles:a}=s.ae(r==null?void 0:r.throttles,t);return{key:e,until:Date.now()+n,...a!==void 0&&{throttles:a}}};async function Qr({chat:e,next:r,end:t,node:n,logger:a,apiClient:o,submissions:i,analytics:l,flow:c,applicationRecovery:h,setApplicationRecovery:v,forceSubmitConfirmation:g,persistWriteBarrier:p,signal:y,t:w}){var m;if((m=c.data.startedWriteNodeIds)!=null&&m.includes(n.id)&&(h==null?void 0:h.submitNodeId)!==n.id)return await e.sendMessage({type:"system",variant:"warning",text:w("submission_unknown")}),t();const F=c.job?`${n.id}@${c.job.id_type}:${c.job.id}`:n.id;let _=0;const S=async C=>{var Oe,Ge,Re,He,Ie,Pe,Ae;const A=((Oe=c.data.submitCooldown)==null?void 0:Oe.key)===F?c.data.submitCooldown:void 0;A&&(A.until=Math.min(A.until,Date.now()+(A.throttles?s.B:s.q)));const E=A==null?void 0:A.until;(C!==!0||E!==void 0&&E>Date.now())&&await e.userInput({type:"submit",key:void 0,config:{label:n.data.submitLabel,...E!==void 0&&{availableAt:E}}});let R;if(n.data.captcha){const L=e.captcha;let Fe=!0;try{R=await jr(o,{signal:y,container:(L==null?void 0:L.container())??null,theme:L==null?void 0:L.theme,onInteractive:()=>{e.sendMessage({type:"text",author:"bot",text:w("captcha_check")}).catch(()=>{}).then(()=>{Fe&&(L==null||L.reveal(!0))})}})}catch(Ve){if(a.error("Captcha check failed",Ve),y.aborted)return}finally{Fe=!1,L==null||L.reveal(!1)}}await e.sendMessage({type:"loading",text:w("submitting")});const{anonymous_id:z,session_id:D}=l.getSessionInfo();if(y.aborted)return;const $=((Ge=c.data.startedWriteNodeIds)==null?void 0:Ge.includes(n.id))===!0;if((h==null?void 0:h.submitNodeId)===n.id&&await v(void 0),$||(c.data.startedWriteNodeIds=[...c.data.startedWriteNodeIds??[],n.id]),await p().catch(L=>a.error("Failed to persist application write barrier",L)),y.aborted)return;let O;const H=setTimeout(()=>{O=(async()=>{await e.sendMessage({type:"text",author:"bot",text:w("submission_still_working")}),await e.sendMessage({type:"loading",text:w("submitting")})})().catch(L=>a.error("Failed to send submission progress message",L))},Xr);let M;const N=await o.fetch("/flow/submit",{method:"POST",body:JSON.stringify({log_submit:!1,integration_id:n.data.integrationId,anonymous_id:z,session_id:D,job:c.job,flow_build:c.build,...R!==void 0&&{captcha_token:R},submissions:s.j(c.nodes,s.Y(i||{},n.data.submitKeys)),pre_apply:s.A(c.nodes,i||{},c.data.flowSessionId)})}).catch(L=>(M=L,At.isApiErrorWithData(L)?L.data:L));if(clearTimeout(H),await O,y.aborted)return;n.data.key&&e.setSubmission(n.data.key,{type:"integration",value:N});const T=s.se(N,M instanceof At.ApiError?M.status:void 0),U=c.data.failedAttemptAt;let J=U==null?void 0:U[F];U&&J!==void 0&&J>Date.now()&&(J=U[F]=Date.now());const Z=J!==void 0&&Date.now()-J<s.ie||((Re=c.data.unconfirmedAttemptKeys)==null?void 0:Re.includes(F))===!0,ne=s.fe(N);if(ne&&l.log({event:"FLOW_SUBMIT",properties:{flow_id:c.id,flow_version:c.version,flow_session_id:c.data.flowSessionId,flow_build:c.build,service:ne.service,response:ne.response,flow_type:"CHATBOT_DRAWER",job:c.job,...(T==null?void 0:T.outcome)==="duplicate"&&{outcome:Z?"duplicate_after_own_attempt":"duplicate"},...ne.outcome&&{outcome:ne.outcome}}}),(s.N(N)||(N==null?void 0:N.success)===!0)&&((He=c.data.submitCooldown)==null?void 0:He.throttles)!==void 0&&(delete c.data.submitCooldown.throttles,await p().catch(L=>a.error("Failed to persist submit cooldown reset",L))),s.N(N)){const{redirect_url:L,message:Fe,button_text:Ve}=N.integration_response.data;await e.sendMessage({type:"text",author:"bot",text:Fe??w("submission_redirect_message")});try{const pe=new URL(L);z&&!pe.searchParams.has("anonymous_id")&&pe.searchParams.set("anonymous_id",z),await e.sendMessage({type:"link",href:pe.toString(),text:Ve??w("complete_submission"),onClick:()=>{if(!D){a.error("session_id not set, cannot log FLOW_REDIRECT event");return}l.log({event:"FLOW_REDIRECT",properties:{flow_build:c.build,flow_id:c.id,flow_session_id:D,flow_version:c.version,href:pe.toString(),job:c.job}})}})}catch(pe){a.error(`Invalid redirect URL: ${L}`,pe),e.sendMessage({type:"system",variant:"error",text:w("redirect_url_error")})}return r(n.nextId)}const he=s.D(N);if(he)return await e.sendMessage({type:"system",variant:"success",text:he.message??w("submission_pending")}),r(n.nextId);if((N==null?void 0:N.success)===!0)return n.data.skipConfirmation!==!0&&await e.sendMessage({type:"system",variant:"success",text:w("submission_completed")}),r(n.nextId);const Ce=s.de(T),ve=Ce!==void 0&&((Ie=i==null?void 0:i[Ce])==null?void 0:Ie.type)==="file"?Ce:void 0,Se=ve===void 0?void 0:c.nodes.find(L=>L.type==="question-file"&&L.data.key===ve);return!Se&&!s.ue(T)&&(c.data.submitCooldown=Yr(F,A,T)),(T==null?void 0:T.outcome)!=="duplicate"&&(c.data.failedAttemptAt={...c.data.failedAttemptAt,[F]:Date.now()},(Pe=c.data.unconfirmedAttemptKeys)!=null&&Pe.includes(F)&&(c.data.unconfirmedAttemptKeys=c.data.unconfirmedAttemptKeys.filter(L=>L!==F))),(T==null?void 0:T.verdict)==="not_submitted"||(T==null?void 0:T.outcome)==="duplicate"||(T==null?void 0:T.outcome)==="closed"?($||(c.data.startedWriteNodeIds=(Ae=c.data.startedWriteNodeIds)==null?void 0:Ae.filter(L=>L!==n.id)),(h==null?void 0:h.submitNodeId)===n.id&&await v(h),await p().catch(L=>a.error("Failed to persist application write barrier release",L))):await p().catch(L=>a.error("Failed to persist submit cooldown",L)),T?(a.error(M??T.message),Se&&ve!==void 0?(e.setSubmission(ve,null),await v({fileQuestionNodeId:Se.id,submitNodeId:n.id}),await e.sendMessage({type:"system",variant:"error",text:w("submission_unreadable_document")}),r(Se.id)):T.outcome==="duplicate"?(await e.sendMessage({type:"system",variant:"info",text:w(Z?"submission_duplicate_earlier_attempt":"submission_duplicate")}),S(!1)):T.outcome==="closed"?(await e.sendMessage({type:"system",variant:"info",text:w("submission_closed")}),S(!1)):T.outcome==="unknown"?(await e.sendMessage({type:"system",variant:"warning",text:w(s.le(T)?"submission_unknown_do_not_resubmit":"submission_unknown")}),S(!1)):s.ue(T)?s.pe(N)?(await e.sendMessage({type:"text",author:"bot",text:T.message}),S(!1)):(_===0&&await e.sendMessage({type:"system",variant:"warning",text:w("captcha_failed")}),_++,S(_<=zr)):s.ce(T)?(await e.sendMessage({type:"system",variant:"error",text:w("submission_retryable")}),S(!1)):(await e.sendMessage({type:"system",variant:"error",text:w("submission_failed")}),t())):(a.error(M??N),await e.sendMessage({type:"system",variant:"error",text:w("submission_failed")}),t())};await S(g===!0?!1:n.data.skipConfirmation)}async function en({chat:e,next:r,node:t,submissions:n,context:a}){await e.sendMessage({type:"link",href:oe(t.data.href,{submissions:n,context:a}),text:oe(t.data.cta,{submissions:n,context:a})}),r(t.nextId)}async function tn({submissions:e,next:r,node:t,context:n}){r(qr(t,{submissions:e,context:n})?t.branchId:t.nextId)}async function rn({chat:e,next:r,node:t,submissions:n,context:a}){await e.sendMessage({author:"bot",type:"text",text:oe(t.data.text,{submissions:n,context:a})}),r(t.nextId)}async function nn({chat:e,next:r,node:t}){await e.sendMessage({author:"bot",type:"image",url:t.data.url,height:t.data.height,width:t.data.width}),r(t.nextId)}async function sn({chat:e,next:r,node:t,submissions:n,context:a,t:o}){await e.sendMessage({author:"bot",type:"text",text:oe(t.data.question,{submissions:n,context:a})});const i=t.data.format==="phone"?await e.userInput({key:t.data.key,type:"phone",config:{optional:t.data.optional,placeholder:t.data.placeholder,minChars:t.data.minChars,maxChars:t.data.maxChars,submissionFormat:"text",defaultValue:{}}}):await e.userInput({key:t.data.key,type:"text",config:{optional:t.data.optional,placeholder:t.data.placeholder,format:t.data.format,maxChars:t.data.maxChars,minChars:t.data.minChars,multiline:t.data.format==="text"&&t.data.multiline===!0}});i===null?await e.sendMessage({type:"system",variant:"info",text:o("skipped")}):await e.sendMessage({author:"user",type:"text",text:i.type==="phone"?s.oe(i.value):i.value}),r(t.nextId)}async function an({chat:e,next:r,node:t,submissions:n,context:a,t:o}){await e.sendMessage({author:"bot",type:"text",text:oe(t.data.question,{submissions:n,context:a})});const i=await e.userInput({key:t.data.key,type:"number",config:{max:t.data.max,min:t.data.min,optional:t.data.optional,placeholder:t.data.placeholder,decimalCases:t.data.decimalCases}});i===null?await e.sendMessage({type:"system",variant:"info",text:o("skipped")}):await e.sendMessage({author:"user",type:"text",text:i.value.toString()}),r(t.nextId)}async function on({chat:e,next:r,node:t,submissions:n,context:a,t:o}){await e.sendMessage({author:"bot",type:"text",text:oe(t.data.question,{submissions:n,context:a})});const i=await e.userInput({key:t.data.key,type:"phone",config:{minChars:t.data.minChars,defaultValue:{countryCode:t.data.defaultCountryCode},placeholder:t.data.placeholder,submissionFormat:"phone",optional:t.data.optional}});i===null?await e.sendMessage({type:"system",variant:"info",text:o("skipped")}):await e.sendMessage({author:"user",type:"text",text:i.type==="phone"?s.oe(i.value):i.value}),r(t.nextId)}async function ln({chat:e,next:r,node:t,submissions:n,context:a,t:o}){await e.sendMessage({author:"bot",type:"text",text:oe(t.data.question,{submissions:n,context:a})});const i=await e.userInput({key:t.data.key,type:"multiple-choice",config:t.data});i.value.length===0?await e.sendMessage({type:"system",variant:"info",text:o("skipped")}):await e.sendMessage({author:"user",type:"text",text:t.data.options.filter(l=>i.value.includes(l.value)).map(l=>l.label).join(", ")}),r(t.nextId)}async function un({chat:e,next:r,node:t,submissions:n,context:a,t:o}){await e.sendMessage({author:"bot",type:"text",text:oe(t.data.question,{submissions:n,context:a})});const i=await e.userInput({key:t.data.key,type:"boolean",config:{optional:t.data.optional,labels:{true:t.data.trueLabel,false:t.data.falseLabel}}});i===null?await e.sendMessage({type:"system",variant:"info",text:o("skipped")}):await e.sendMessage({author:"user",type:"text",text:i.value===!0?t.data.trueLabel:t.data.falseLabel}),r(t.nextId)}async function cn({chat:e,next:r,node:t,t:n}){await e.sendMessage({author:"bot",type:"text",text:t.data.question});const a=await e.userInput({type:"address",key:t.data.key,config:{optional:t.data.optional,keys:t.data.keys,line2Required:t.data.line2Required,placeholder:t.data.placeholder}});if(a===null)await e.sendMessage({type:"system",variant:"info",text:n("skipped")});else{const o=Object.values(a.value).filter(i=>i&&i.trim().length>0).join(", ");await e.sendMessage({author:"user",type:"text",text:o})}return r(t.nextId)}async function dn({node:e,chat:r,next:t,submissions:n,context:a,t:o}){await r.sendMessage({author:"bot",type:"text",text:oe(e.data.question,{submissions:n,context:a})});const i=await r.userInput({key:e.data.key,type:"file",config:{optional:e.data.optional,extensions:e.data.extensions,fileSizeLimitKib:e.data.maxSizeKb??10*1024,allowMultiple:e.data.multiple===!0}});if(i===null)await r.sendMessage({type:"system",variant:"info",text:o("skipped")});else for(const l of i.value)await r.sendMessage({author:"user",type:"file",fileName:l.name,fileSizeKb:l.sizeKb});return t(e.nextId)}async function fn({chat:e,end:r,node:t}){await e.sendMessage({type:"system",variant:"info",text:t.data.systemMessage}),r()}async function hn({node:e,flow:r,submissions:t,chat:n,next:a,apiClient:o,analytics:i}){const l=s.T(r.nodes,t||{}),{answers:c,...h}=l;n.setSubmission(e.data.key,{type:"integration",value:h});const v=new AbortController,g=setTimeout(()=>v.abort(),5e3);if(o.fetch("/flow/pre-apply",{method:"POST",signal:v.signal,body:JSON.stringify({...i.getSessionInfo(),job:r.job,flow_build:r.build,pre_apply:s.A(r.nodes,t||{},r.data.flowSessionId)})}).catch(()=>{}).finally(()=>clearTimeout(g)),l.status!=="skipped"){const y=[l.status==="unavailable"?"We could not prepare your pre-apply summary. You can still continue to your application.":l.hasHardConcerns?e.data.messages.hard:l.hasAdvisoryConcerns?e.data.messages.advisory:e.data.messages.matched];for(const w of["hard","advisory"]){const F=c.filter(_=>!_.matched&&_.severity===w);F.length&&y.push((w==="hard"?"Role requirements":"Other things to consider")+`
|
|
2
|
+
`+F.map(_=>`• ${_.message}`).join(`
|
|
3
|
+
`))}await n.sendMessage({type:"text",author:"bot",text:y.join(`
|
|
4
|
+
|
|
5
|
+
`)}),l.hasHardConcerns&&e.data.alternativeLink&&await n.sendMessage({type:"link",href:e.data.alternativeLink.href,text:e.data.alternativeLink.label}),await n.userInput({type:"submit",key:void 0,config:{label:e.data.continueLabel}})}return a(e.nextId)}const _e=({class:e,...r})=>{const{t}=s.useTranslation();return s.o("button",{class:s.clsx("bg-accent-9 active:bg-accent-10 pointer-coarse:touch-hitbox fr flex-shrink-0 rounded-full p-2 text-white transition-all disabled:cursor-not-allowed disabled:opacity-50",e),type:"submit",...r,children:s.o("svg",{class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"2",children:[s.o("title",{children:t("send")}),s.o("path",{d:"M3.5 7.5L8 3L12.5 7.5"}),s.o("path",{d:"M8 4V13"})]})})};var ue;function Ye(e){return{lang:(e==null?void 0:e.lang)??(ue==null?void 0:ue.lang),message:e==null?void 0:e.message,abortEarly:(e==null?void 0:e.abortEarly)??(ue==null?void 0:ue.abortEarly),abortPipeEarly:(e==null?void 0:e.abortPipeEarly)??(ue==null?void 0:ue.abortPipeEarly)}}var it;function pn(e){return it==null?void 0:it.get(e)}var ot;function yn(e){return ot==null?void 0:ot.get(e)}var lt;function mn(e,r){var t;return(t=lt==null?void 0:lt.get(e))==null?void 0:t.get(r)}function Ne(e){var t,n;const r=typeof e;return r==="string"?`"${e}"`:r==="number"||r==="bigint"||r==="boolean"?`${e}`:r==="object"||r==="function"?(e&&((n=(t=Object.getPrototypeOf(e))==null?void 0:t.constructor)==null?void 0:n.name))??"null":r}function X(e,r,t,n,a){const o=a&&"input"in a?a.input:t.value,i=(a==null?void 0:a.expected)??e.expects??null,l=(a==null?void 0:a.received)??Ne(o),c={kind:e.kind,type:e.type,input:o,expected:i,received:l,message:`Invalid ${r}: ${i?`Expected ${i} but r`:"R"}eceived ${l}`,requirement:e.requirement,path:a==null?void 0:a.path,issues:a==null?void 0:a.issues,lang:n.lang,abortEarly:n.abortEarly,abortPipeEarly:n.abortPipeEarly},h=e.kind==="schema",v=(a==null?void 0:a.message)??e.message??mn(e.reference,c.lang)??(h?yn(c.lang):null)??n.message??pn(c.lang);v!==void 0&&(c.message=typeof v=="function"?v(c):v),h&&(t.typed=!1),t.issues?t.issues.push(c):t.issues=[c]}function le(e){return{version:1,vendor:"valibot",validate(r){return e["~run"]({value:r},Ye())}}}function gn(e,r){return Object.hasOwn(e,r)&&r!=="__proto__"&&r!=="prototype"&&r!=="constructor"}function bn(e,r){const t=[...new Set(e)];return t.length>1?`(${t.join(` ${r} `)})`:t[0]??"never"}function vn(e){if(e.path){let r="";for(const t of e.path)if(typeof t.key=="string"||typeof t.key=="number")r?r+=`.${t.key}`:r+=t.key;else return null;return r}return null}var xn=class extends Error{constructor(e){super(e[0].message),this.name="ValiError",this.issues=e}},wn=/^[\w+-]+(?:\.[\w+-]+)*@[\da-z]+(?:[.-][\da-z]+)*\.[a-z]{2,}$/iu;function ar(e,r){return{kind:"validation",type:"check",reference:ar,async:!1,expects:null,requirement:e,message:r,"~run"(t,n){return t.typed&&!this.requirement(t.value)&&X(this,"input",t,n),t}}}function ir(e){return{kind:"validation",type:"email",reference:ir,expects:null,async:!1,requirement:wn,message:e,"~run"(r,t){return r.typed&&!this.requirement.test(r.value)&&X(this,"email",r,t),r}}}function qe(e,r){return{kind:"validation",type:"max_length",reference:qe,async:!1,expects:`<=${e}`,requirement:e,message:r,"~run"(t,n){return t.typed&&t.value.length>this.requirement&&X(this,"length",t,n,{received:`${t.value.length}`}),t}}}function or(e,r){return{kind:"validation",type:"max_value",reference:or,async:!1,expects:`<=${e instanceof Date?e.toJSON():Ne(e)}`,requirement:e,message:r,"~run"(t,n){return t.typed&&!(t.value<=this.requirement)&&X(this,"value",t,n,{received:t.value instanceof Date?t.value.toJSON():Ne(t.value)}),t}}}function Te(e,r){return{kind:"validation",type:"min_length",reference:Te,async:!1,expects:`>=${e}`,requirement:e,message:r,"~run"(t,n){return t.typed&&t.value.length<this.requirement&&X(this,"length",t,n,{received:`${t.value.length}`}),t}}}function lr(e,r){return{kind:"validation",type:"min_value",reference:lr,async:!1,expects:`>=${e instanceof Date?e.toJSON():Ne(e)}`,requirement:e,message:r,"~run"(t,n){return t.typed&&!(t.value>=this.requirement)&&X(this,"value",t,n,{received:t.value instanceof Date?t.value.toJSON():Ne(t.value)}),t}}}function ht(e,r){return{kind:"validation",type:"regex",reference:ht,async:!1,expects:`${e}`,requirement:e,message:r,"~run"(t,n){return t.typed&&!this.requirement.test(t.value)&&X(this,"format",t,n),t}}}function pt(e){return{kind:"transformation",type:"transform",reference:pt,async:!1,operation:e,"~run"(r){return r.value=this.operation(r.value),r}}}function ur(e){return{kind:"validation",type:"url",reference:ur,async:!1,expects:null,requirement(r){try{return new URL(r),!0}catch{return!1}},message:e,"~run"(r,t){return r.typed&&!this.requirement(r.value)&&X(this,"URL",r,t),r}}}function _n(e,r,t){return typeof e.fallback=="function"?e.fallback(r,t):e.fallback}function cr(e,r,t){return typeof e.default=="function"?e.default(r,t):e.default}function dr(e,r){return{kind:"schema",type:"array",reference:dr,expects:"Array",async:!1,item:e,message:r,get"~standard"(){return le(this)},"~run"(t,n){var o;const a=t.value;if(Array.isArray(a)){t.typed=!0,t.value=[];for(let i=0;i<a.length;i++){const l=a[i],c=this.item["~run"]({value:l},n);if(c.issues){const h={type:"array",origin:"value",input:a,key:i,value:l};for(const v of c.issues)v.path?v.path.unshift(h):v.path=[h],(o=t.issues)==null||o.push(v);if(t.issues||(t.issues=c.issues),n.abortEarly){t.typed=!1;break}}c.typed||(t.typed=!1),t.value.push(c.value)}}else X(this,"type",t,n);return t}}}function fr(e){return{kind:"schema",type:"boolean",reference:fr,expects:"boolean",async:!1,message:e,get"~standard"(){return le(this)},"~run"(r,t){return typeof r.value=="boolean"?r.typed=!0:X(this,"type",r,t),r}}}function hr(e){return{kind:"schema",type:"number",reference:hr,expects:"number",async:!1,message:e,get"~standard"(){return le(this)},"~run"(r,t){return typeof r.value=="number"&&!isNaN(r.value)?r.typed=!0:X(this,"type",r,t),r}}}function fe(e,r){return{kind:"schema",type:"object",reference:fe,expects:"Object",async:!1,entries:e,message:r,get"~standard"(){return le(this)},"~run"(t,n){var o;const a=t.value;if(a&&typeof a=="object"){t.typed=!0,t.value={};for(const i in this.entries){const l=this.entries[i];if(i in a||(l.type==="exact_optional"||l.type==="optional"||l.type==="nullish")&&l.default!==void 0){const c=i in a?a[i]:cr(l),h=l["~run"]({value:c},n);if(h.issues){const v={type:"object",origin:"value",input:a,key:i,value:c};for(const g of h.issues)g.path?g.path.unshift(v):g.path=[v],(o=t.issues)==null||o.push(g);if(t.issues||(t.issues=h.issues),n.abortEarly){t.typed=!1;break}}h.typed||(t.typed=!1),t.value[i]=h.value}else if(l.fallback!==void 0)t.value[i]=_n(l);else if(l.type!=="exact_optional"&&l.type!=="optional"&&l.type!=="nullish"&&(X(this,"key",t,n,{input:void 0,expected:`"${i}"`,path:[{type:"object",origin:"key",input:a,key:i,value:a[i]}]}),n.abortEarly))break}}else X(this,"type",t,n);return t}}}function Ue(e,r){return{kind:"schema",type:"optional",reference:Ue,expects:`(${e.expects} | undefined)`,async:!1,wrapped:e,default:r,get"~standard"(){return le(this)},"~run"(t,n){return t.value===void 0&&(this.default!==void 0&&(t.value=cr(this,t,n)),t.value===void 0)?(t.typed=!0,t):this.wrapped["~run"](t,n)}}}function pr(e,r){return{kind:"schema",type:"picklist",reference:pr,expects:bn(e.map(Ne),"|"),async:!1,options:e,message:r,get"~standard"(){return le(this)},"~run"(t,n){return this.options.includes(t.value)?t.typed=!0:X(this,"type",t,n),t}}}function yr(e,r,t){return{kind:"schema",type:"record",reference:yr,expects:"Object",async:!1,key:e,value:r,message:t,get"~standard"(){return le(this)},"~run"(n,a){var i,l;const o=n.value;if(o&&typeof o=="object"){n.typed=!0,n.value={};for(const c in o)if(gn(o,c)){const h=o[c],v=this.key["~run"]({value:c},a);if(v.issues){const p={type:"object",origin:"key",input:o,key:c,value:h};for(const y of v.issues)y.path=[p],(i=n.issues)==null||i.push(y);if(n.issues||(n.issues=v.issues),a.abortEarly){n.typed=!1;break}}const g=this.value["~run"]({value:h},a);if(g.issues){const p={type:"object",origin:"value",input:o,key:c,value:h};for(const y of g.issues)y.path?y.path.unshift(p):y.path=[p],(l=n.issues)==null||l.push(y);if(n.issues||(n.issues=g.issues),a.abortEarly){n.typed=!1;break}}(!v.typed||!g.typed)&&(n.typed=!1),v.typed&&(n.value[v.value]=g.value)}}else X(this,"type",n,a);return n}}}function re(e){return{kind:"schema",type:"string",reference:re,expects:"string",async:!1,message:e,get"~standard"(){return le(this)},"~run"(r,t){return typeof r.value=="string"?r.typed=!0:X(this,"type",r,t),r}}}function kn(e,r,t){const n=e["~run"]({value:r},Ye(t));if(n.issues)throw new xn(n.issues);return n.value}function Cn(e,r){const t={};for(const n in e.entries)t[n]=!r||r.includes(n)?Ue(e.entries[n]):e.entries[n];return{...e,entries:t,get"~standard"(){return le(this)}}}function ge(...e){return{...e[0],pipe:e,get"~standard"(){return le(this)},"~run"(r,t){for(const n of e)if(n.kind!=="metadata"){if(r.issues&&(n.kind==="schema"||n.kind==="transformation")){r.typed=!1;break}(!r.issues||!t.abortEarly&&!t.abortPipeEarly)&&(r=n["~run"](r,t))}return r}}}function Sn(e,r,t){const n=e["~run"]({value:r},Ye(t));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}async function In(e,r,t){const n=await e["~run"]({value:r},Ye(t));return{typed:n.typed,success:!n.issues,output:n.value,issues:n.issues}}const De=({error:e})=>!e||!e.message?null:s.o("div",{role:"alert",class:"text-error-11 flex max-w-full items-start gap-1 overflow-hidden rounded-2xl px-2 py-2",children:[s.o("svg",{class:"text-error-9 mt-0.5 h-4 w-4 shrink-0",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.o("circle",{cx:"8",cy:"8",r:"6.3",stroke:"currentColor","stroke-width":"1.4"}),s.o("rect",{x:"7",y:"4",width:"2",height:"5",fill:"currentColor"}),s.o("rect",{x:"7",y:"10",width:"2",height:"2",fill:"currentColor"})]}),s.o("p",{class:"break-words pr-1 text-sm",children:e.message})]}),be=({class:e,...r})=>{const{t}=s.useTranslation();return s.o("button",{type:"button",class:s.clsx("fr touch-hitbox text-neutral-11 bg-neutral-1 ring-divider hover:ring-divider active:ring-interactive-bg-hover hover:text-neutral-12 active:text-neutral-12 hover:bg-divider active:bg-interactive-bg-hover flex flex-shrink-0 items-center justify-center gap-1 self-center rounded-full py-1 pl-2 pr-2.5 text-sm ring-1 transition-all",e),...r,children:[s.o("svg",{"aria-hidden":!0,class:"block",width:"16",height:"16",viewBox:"0 0 16 16",fill:"transparent",stroke:"currentColor","stroke-linecap":"round","stroke-width":"1.5",children:[s.o("title",{children:t("skip")}),s.o("path",{d:"M3.25 11.25A5 5 0 0 1 12 7"}),s.o("path",{d:"M13.25 4.5V8.25H9.5"})]}),t("skip")]})};var yt={Afghanistan:"93",Albania:"355",Algeria:"213","American Samoa":"1 684",Andorra:"376",Angola:"244",Anguilla:"1 264",Antarctica:"672","Antigua and Barbuda":"1 268",Argentina:"54",Armenia:"374",Aruba:"297",Australia:"61",Austria:"43",Azerbaijan:"994",Bahrain:"973",Bangladesh:"880",Barbados:"1 246",Belarus:"375",Belgium:"32",Belize:"501",Benin:"229",Bermuda:"1 441",Bhutan:"975",Bolivia:"591","Bosnia and Herzegovina":"387",Botswana:"267","Bouvet Island":"47",Brazil:"55","British Indian Ocean Territory":"246","British Virgin Islands":"1 284",Brunei:"673",Bulgaria:"359","Burkina Faso":"226",Burundi:"257","Cabo Verde":"238",Cambodia:"855",Cameroon:"237",Canada:"1","Caribbean Netherlands":"599","Cayman Islands":"1 345","Central African Republic":"236",Chad:"235",Chile:"56",China:"86","Christmas Island":"61","Cocos (Keeling) Islands":"61",Colombia:"57",Comoros:"269","Cook Islands":"682","Costa Rica":"506",Croatia:"385",Cuba:"53",Curaçao:"599",Cyprus:"357",Czechia:"420","Côte d'Ivoire":"225","Democratic Republic of the Congo":"243",Denmark:"45",Djibouti:"253","Dominican Republic":"1 809",Ecuador:"593",Egypt:"20","El Salvador":"503","Equatorial Guinea":"240",Eritrea:"291",Estonia:"372",Eswatini:"268",Ethiopia:"251","Falkland Islands (Islas Malvinas)":"500","Faroe Islands":"298",Fiji:"679",Finland:"358",France:"33","French Guiana":"594","French Polynesia":"689","French Southern and Antarctic Lands":"262",Gabon:"241",Georgia:"995",Germany:"49",Ghana:"233",Gibraltar:"350",Greece:"30",Greenland:"299",Grenada:"1 473",Guadeloupe:"590",Guam:"1 671",Guatemala:"502",Guernsey:"44",Guinea:"224","Guinea-Bissau":"245",Guyana:"592",Haiti:"509",Honduras:"504","Hong Kong":"852",Hungary:"36",Iceland:"354",India:"91",Indonesia:"62",Iran:"98",Iraq:"964",Ireland:"353","Isle of Man":"44",Israel:"972",Italy:"39",Jamaica:"1 876",Japan:"81",Jersey:"44",Jordan:"962",Kazakhstan:"7",Kenya:"254",Kiribati:"686",Kosovo:"383",Kuwait:"965",Kyrgyzstan:"996",Laos:"856",Latvia:"371",Lebanon:"961",Lesotho:"266",Liberia:"231",Libya:"218",Liechtenstein:"423",Lithuania:"370",Luxembourg:"352",Macao:"853",Madagascar:"261",Malawi:"265",Malaysia:"60",Maldives:"960",Mali:"223",Malta:"356","Marshall Islands":"692",Martinique:"596",Mauritania:"222",Mauritius:"230",Mayotte:"262",Mexico:"52",Micronesia:"691",Moldova:"373",Monaco:"377",Mongolia:"976",Montenegro:"382",Montserrat:"1 664",Morocco:"212",Mozambique:"258","Myanmar (Burma)":"95",Namibia:"264",Nauru:"674",Nepal:"977",Netherlands:"31","New Caledonia":"687","New Zealand":"64",Nicaragua:"505",Niger:"227",Nigeria:"234",Niue:"683","Norfolk Island":"672","North Korea":"850","North Macedonia":"389","Northern Mariana Islands":"1 670",Norway:"47",Oman:"968",Pakistan:"92",Palau:"680",Palestine:"970",Panama:"507","Papua New Guinea":"675",Paraguay:"595",Peru:"51",Philippines:"63","Pitcairn Islands":"64",Poland:"48",Portugal:"351","Puerto Rico":"1 787",Qatar:"974",Romania:"40",Russia:"7",Rwanda:"250",Réunion:"262","Saint Barthélemy":"590","Saint Helena, Ascension and Tristan da Cunha":"290","Saint Kitts and Nevis":"1 869","Saint Lucia":"1 758","Saint Martin":"590","Saint Pierre and Miquelon":"508","Saint Vincent and the Grenadines":"1 784",Samoa:"685","San Marino":"378","Saudi Arabia":"966",Senegal:"221",Serbia:"381",Seychelles:"248","Sierra Leone":"232",Singapore:"65","Sint Maarten":"1 721",Slovakia:"421",Slovenia:"386","Solomon Islands":"677",Somalia:"252","South Africa":"27","South Georgia and the South Sandwich Islands":"500","South Korea":"82","South Sudan":"211",Spain:"34","Sri Lanka":"94",Sudan:"249",Suriname:"597","Svalbard and Jan Mayen":"47",Sweden:"46",Switzerland:"41",Syria:"963","São Tomé and Príncipe":"239",Taiwan:"886",Tajikistan:"992",Tanzania:"255",Thailand:"66","The Bahamas":"1 242","The Gambia":"220","Timor-Leste":"670",Togo:"228",Tokelau:"690",Tonga:"676","Trinidad and Tobago":"1 868",Tunisia:"216",Turkmenistan:"993","Turks and Caicos Islands":"1 649",Tuvalu:"688",Türkiye:"90","U.S. Virgin Islands":"1 340",Uganda:"256",Ukraine:"380","United Arab Emirates":"971","United Kingdom":"44","United States":"1","United States Minor Outlying Islands":"1",Uruguay:"598",Uzbekistan:"998",Vanuatu:"678","Vatican City":"379",Venezuela:"58",Vietnam:"84","Wallis and Futuna":"681","Western Sahara":"212",Yemen:"967",Zambia:"260",Zimbabwe:"263","Åland Islands":"358"};const Le=s.cva("outline-divider ease-expo-out placeholder:text-neutral-10 text-neutral-12 focus-visible:outline-accent-7 caret-accent-9 bg-lowest py-1 text-base outline outline-2 transition-all",{variants:{optional:{true:"pr-16 pl-3",false:"pl-3 pr-3"}},defaultVariants:{optional:!1}}),An="https://api.mapbox.com/search/searchbox/v1/suggest",Fn="ZzRDWFU0dTZ3SF9aWk9RNGl6QzZaWS5RZmlFak13a0hPbGxXZXlNSGN5RUhObUJ6TXpSV08yUW5OdE5tSTZJU1lpd2lJb1JYYXRObmJ2Tm5iaGhHZWx4V1lpb2pJMUp5ZS5rcA==",Vn=e=>atob(e).split("").reverse().join(""),ce=fe({name:re()}),En=fe({suggestions:dr(fe({full_address:Ue(re()),place_formatted:Ue(re()),name:Ue(re()),mapbox_id:re(),context:Cn(fe({address:ce,street:ce,neighborhood:ce,locality:ce,district:ce,place:ce,region:ce,postcode:ce,country:ce}))}))}),Mn=({logger:e,t:r})=>s.F(()=>{var n;const t=(n=s.store.current$.peek().flow)==null?void 0:n.data.flowSessionId;return t?{enabled:!0,getPredictions:async a=>{var g;const o=new URL(An);o.searchParams.set("q",a),o.searchParams.set("session_token",t);const i=(g=s.store.current$.peek().flow)==null?void 0:g.locationOrigin;i&&i.lat!==void 0&&i.lng!==void 0&&i.lat>=-90&&i.lat<=90&&i.lng>=-180&&i.lng<=180&&o.searchParams.set("proximity",`${i.lng},${i.lat}`),o.searchParams.set("access_token",Vn(Fn));const c=await fetch(o);if(!c.ok)return e.error("Failed to get address details",c),{ok:!1,error:r("address_error")};const h=Sn(En,await c.json());if(h.success===!1)return e.error("Failed to parse address details",h.issues),{ok:!1,error:r("address_error")};const{suggestions:v}=h.output;return{ok:!0,data:v.map(p=>{var y,w,F,_,S,m,C,A,E;return{label:p.full_address??p.place_formatted??p.name??p.mapbox_id,id:p.mapbox_id,address:{line1:((y=p.context.address)==null?void 0:y.name)??((w=p.context.street)==null?void 0:w.name),line2:void 0,line3:((F=p.context.neighborhood)==null?void 0:F.name)??((_=p.context.locality)==null?void 0:_.name),city:((S=p.context.place)==null?void 0:S.name)??((m=p.context.district)==null?void 0:m.name),state:(C=p.context.region)==null?void 0:C.name,postcode:(A=p.context.postcode)==null?void 0:A.name,country:(E=p.context.country)==null?void 0:E.name}}})}}}:{enabled:!1}},[e,r]),Mt=e=>{const{t:r}=s.useTranslation();return s.o("button",{type:"button",class:"touch-hitbox text-neutral-11 hover:bg-neutral-4 hover:text-neutral-12 hover:border-neutral-5 relative flex items-center gap-1 rounded-[18px] border border-solid border-transparent px-3 py-1 pl-1.5 text-sm transition-colors",...e,children:[s.o("svg",{width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.o("path",{d:"M10 3L5 8L10 13"})}),s.o("span",{children:r("back")})]})},Tn=({input:e,onSubmitSuccess:r,logger:t})=>{const{t:n}=s.useTranslation(),[a,o]=s.h(),{enabled:i,getPredictions:l}=Mn({logger:t,t:n}),[c,h]=s.h(i?"query":"manual"),[v,g]=s.h(""),[p,y]=s.h(),w=s._(),F=s._(),_=m=>{var A;if(s.invariant(i,"Query state should not be enabled"),m=m.trim(),m===((A=w.current)==null?void 0:A.query)||m===(p==null?void 0:p.query)&&p.status==="done")return;if(g(m),m===""){w.current=void 0,y(void 0);return}const C=w.current={query:m};y({query:m,status:"pending"}),l(m).then(E=>{w.current===C&&(w.current=void 0,y(E.ok?{query:m,status:"done",items:E.data}:{query:m,status:"failed",error:E.error}))},E=>{w.current===C&&(w.current=void 0,t.error("Failed to get address details",E),y({query:m,status:"failed",error:n("address_error")}))})},S=(m,C)=>{o(A=>({...A,[m]:C}))};switch(c){case"query":return s.invariant(i,"Query state should not be enabled"),s.o(Nn,{input:e,onSkip:()=>r(null),onAddressSelect:m=>{if(m===""){w.current&&(w.current=void 0,y(void 0)),h("manual");return}const C=(p==null?void 0:p.status)==="done"?p.items.find(A=>A.id===m):void 0;C&&(F.current!==m&&o(C.address),F.current=m,h("details"))},onAddressSearch:_,lookup:p,query:v});case"details":return s.invariant(a!==void 0),s.o(Tt,{input:e,logger:t,onSubmitSuccess:r,addressFields:a,onFieldChange:S,actions:s.o(Mt,{onClick:()=>{h("query")}})});case"manual":return s.o(Tt,{logger:t,input:e,onSubmitSuccess:r,addressFields:a??{},onFieldChange:S,actions:i?s.o(Mt,{onClick:()=>{h("query")}}):e.config.optional?s.o(be,{onClick:()=>r(null)}):void 0})}},Nn=({input:e,onSkip:r,lookup:t,onAddressSelect:n,query:a,onAddressSearch:o})=>{const{t:i}=s.useTranslation(),l=s._(null);return s.y(()=>{l.current&&(l.current.focus(),l.current.select())},[]),s.o(s.k,{children:[s.o("form",{noValidate:!0,onSubmit:c=>{c.preventDefault();const v=new FormData(c.currentTarget).get("address");typeof v=="string"&&o(v)},class:"flex gap-2 p-2.5",children:[s.o("div",{class:"group relative flex-1",children:[s.o("input",{ref:l,name:"address",id:"chat-address",autocomplete:"address-line1",autoFocus:!0,placeholder:e.config.placeholder||i("address_search"),defaultValue:a,class:Le({optional:!!e.config.optional,className:"w-full rounded-full"})}),s.o("button",{type:"submit",class:"touch-hitbox text-neutral-12 hover:bg-neutral-3 fr absolute bottom-0 right-0 top-0 flex cursor-pointer items-center gap-1 rounded-full px-3 transition-all",children:[s.o("svg",{"aria-hidden":"true",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.o("g",{id:"inploi",stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round",strokeWidth:"1.5",children:[s.o("circle",{cx:"7",cy:"7",r:"4"}),s.o("path",{d:"M10 10L13 13"})]})}),s.o("span",{class:"sr-only",children:i("search")})]})]}),e.config.optional&&s.o(be,{class:"relative",onClick:r})]}),(t==null?void 0:t.status)==="failed"?s.o(De,{error:{message:t.error}}):null,s.o("p",{role:"status",class:(t==null?void 0:t.status)==="pending"||(t==null?void 0:t.status)==="done"&&t.items.length===0?"text-neutral-11 flex items-center gap-2 px-4 py-2 text-sm":"sr-only",children:(t==null?void 0:t.status)==="pending"?s.o(s.k,{children:[s.o(s.LoadingIndicator,{"aria-hidden":"true",class:"h-4 w-4 shrink-0"}),i("address_searching")]}):(t==null?void 0:t.status)==="done"&&t.items.length===0?i("address_no_results"):null}),s.o("ul",{children:[((t==null?void 0:t.status)==="done"?t.items:[]).map(c=>s.o("li",{children:s.o("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{n(c.id)},children:[s.o("span",{class:"flex-grow",children:c.label}),s.o("svg",{class:"flex-none",width:"16",height:"16",viewBox:"0 0 16 16",stroke:"currentColor","stroke-width":"1.5",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.o("path",{d:"M6 3L11 8L6 13"})})]})},c.id)),s.o("li",{children:s.o("button",{class:"text-neutral-11 fr hover:bg-neutral-3 focus-visible:bg-neutral-3 hover:text-neutral-12 border-b-neutral-3 flex w-full items-center border border-b border-solid border-transparent px-4 py-3 text-sm transition-colors duration-100",onClick:()=>{n("")},children:s.o("span",{class:"flex-grow",children:i("address_manual")})})},"")]})]})},ut=["line1","line2","line3","city","state","postcode","country"],Tt=({addressFields:e,onFieldChange:r,onSubmitSuccess:t,actions:n,input:a})=>{const o=s._(null);s.y(()=>{if(o.current){const c=o.current.querySelector("input");c&&(c.focus(),c.select())}},[]);const i=Object.keys(yt),{t:l}=s.useTranslation();return s.o("form",{class:"flex flex-col px-2 pt-2",onSubmit:c=>{const h=c.currentTarget,v=[...h.querySelectorAll("input")].filter(y=>y.value!==""&&!y.value.trim());for(const y of v){y.value="";const w=ut.find(F=>a.config.keys[F]===y.name);w&&r(w,"")}if(v.length>0&&!h.checkValidity()){c.preventDefault(),h.reportValidity();return}const g=new FormData(h),p=Object.fromEntries(g.entries());t({type:"address",value:p})},children:[s.o("div",{class:"bg-neutral-3 border-neutral-5 grid items-center gap-1.5 rounded-2xl border pb-2 pl-4 pr-3 pt-3 [grid-template-columns:min-content_1fr]",ref:o,children:ut.map((c,h)=>{const v=`isdk_${c}`,g=a.config.keys[c];return g?s.o(s.k,{children:[s.o("label",{for:v,class:"text-neutral-11 [&:has(+*>input:focus)]:text-neutral-12 w-24 pb-2 text-xs uppercase leading-3 tracking-widest transition-colors",children:l(c)}),s.o("div",{class:"flex flex-col items-stretch gap-1.5",children:[c==="country"?s.o("div",{class:"relative",children:[s.o("select",{class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 w-full flex-1 appearance-none rounded-lg border-solid bg-transparent bg-none px-3 py-1.5 text-base transition-colors focus:outline-none",name:g,id:v,defaultValue:e[c],onChange:p=>r(c,p.currentTarget.value),required:!0,children:[e.country&&!i.includes(e.country)?s.o("option",{value:e[c],children:e[c]}):s.o("option",{value:"",children:l("select_country")}),i.map(p=>s.o("option",{value:p,children:p},p))]}),s.o("svg",{class:"text-neutral-12 absolute bottom-2.5 right-2 flex items-center justify-center",width:"16",height:"16",stroke:"currentColor","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.o("path",{d:"M4 6.5L8 10.5L12 6.5"})})]}):s.o("input",{autoFocus:h===0?!0:void 0,class:"text-neutral-12 hover:bg-neutral-4 placeholder:text-neutral-8 focus:bg-neutral-5 flex-1 rounded-lg border-solid bg-transparent px-3 py-1.5 text-base transition-colors autofill:shadow-[inset_0_0_0_1000px_hsl(210_16.7%_97.6%)] focus:outline-none",name:g,id:v,defaultValue:e[c],onInput:p=>r(c,p.currentTarget.value),required:c!=="line2"||a.config.line2Required===!0}),h===ut.length-1?s.o("hr",{class:"m-0 w-full border-b border-b-transparent"}):s.o("hr",{class:"border-b-neutral-5 m-0 w-full border-b border-solid"})]})]}):null})}),s.o("div",{class:"bg-neutral-1 sticky bottom-0 flex items-center py-2",children:[n,s.o(_e,{class:"ml-auto"})]})]})},mt=()=>{const e=s._(null);return s.p(()=>{var r;(r=e.current)==null||r.focus()},[]),e},mr=["true","false"],Ln=pr(mr),Dn="answer",gr="flex items-center flex-wrap gap-2 p-2.5",br="min-w-0 max-w-full flex-auto",vr=s.k$1(({label:e,...r},t)=>s.o("button",{class:"bg-lowest ease-expo-out ring-divider text-neutral-12 active:ring-accent-7 active:bg-accent-2 active:text-accent-11 fr block w-full overflow-hidden rounded-2xl px-2 py-2.5 ring-2 transition-all selection:bg-transparent",...r,ref:t,children:s.o("p",{class:"text-center text-base",children:e})})),On=({input:e,onSubmitSuccess:r})=>{const t=mt();return s.o("form",{noValidate:!0,class:"",onSubmit:n=>{n.preventDefault();const a=s.getFormSubmitter(n).value,o=kn(Ln,a);r({type:"boolean",value:o==="true"})},children:[s.o("ul",{class:gr,children:mr.map((n,a)=>s.o("li",{class:br,children:s.o(vr,{ref:a===0?t:null,type:"submit",name:Dn,value:n,label:e.config.labels[n]},n)}))}),e.config.optional&&s.o("div",{class:"px-2 pb-2",children:s.o(be,{class:"relative w-full",type:"button",onClick:()=>r(null)})})]})},Rn=e=>new Promise((r,t)=>{const n=new FileReader;n.onload=()=>{if(typeof n.result!="string"||!n.result)return t(new Error("Invalid file"));r(n.result)},n.onerror=t,n.readAsDataURL(e)}),Nt=e=>e.reduce((r,t)=>r+t.sizeKb,0),Pn=s.isSubmissionOfType("file"),Lt=3,Qe=e=>{const r=e.lastIndexOf(".");return r===-1?[e,""]:[e.slice(0,r),e.slice(r)]},jn=({file:e,class:r,...t})=>{const{t:n}=s.useTranslation(),[a,o]=Qe(e.name);return s.o("div",{class:s.clsx("bg-accent-1 outline-accent-4 flex max-w-full gap-2 overflow-hidden rounded-lg px-3 py-2 text-sm outline",r),...t,children:[s.o("p",{class:"text-accent-12 flex flex-grow overflow-hidden",children:[s.o("span",{class:"sr-only",children:[n("file_name"),": "]}),s.o("span",{class:"block truncate",children:a}),s.o("span",{children:o})]}),s.o("p",{class:"text-accent-11",children:[s.o("span",{class:"sr-only",children:[n("file_size"),": "]}),s.ne(e.sizeKb)]})]})},Dt=({class:e,...r})=>s.o("li",{class:s.clsx("outline-neutral-6 text-neutral-11 bg-neutral-1 block rounded-md px-1 py-0.5 text-xs outline outline-1",e),...r}),Bn=(e,r)=>{const[t,n]=Qe(e);return`${t.slice(0,r)}${n}`},Ot=e=>({name:Bn(e.name,42),sizeKb:e.size/1e3}),$n=[".heic",".heif",".jpg",".jpeg",".png",".gif",".webp",".txt",".rtf",".odt",".pages",".zip"],qn=(e,r,t)=>{const n=Qe(r.name)[1].toLowerCase(),a=[...t.map(i=>i.toLowerCase()),...$n],o=n===""?"none":a.includes(n)?n:"other";return`chatbot-file-refused:${e}:${o}`},Un=({input:e,onSubmitSuccess:r,analytics:t})=>{var _;const n=(_=s.store.current$.value.flow)==null?void 0:_.data.submissions[e.key],[a,o]=s.h(Pn(n)&&n.value.length?{status:"ready",files:n.value}:{status:"empty"}),i=s._(0),l=a.status==="ready"?a.files:[],c=a.status==="ready"||a.status==="pending"?a.files:[],h=a.status==="error"?a.error:void 0,v=c.length-Lt,g=Nt(c),p=mt(),{t:y}=s.useTranslation(),w=S=>{if(!S.length)return{reason:"required",error:{type:"required",message:y("validation_file")}};if(!s.te(S,e.config.extensions))return{reason:"type",file:S.find(m=>!s.te([m],e.config.extensions)),error:{type:"validate",message:y("validation_file_ext",{ext:e.config.extensions.join(", ")})}};if(e.config.fileSizeLimitKib&&Nt(S)>e.config.fileSizeLimitKib)return{reason:"size",error:{type:"max",message:y("validation_file_size",{size:s.ne(e.config.fileSizeLimitKib)})}};if(!e.config.allowMultiple&&S.length>1)return{reason:"count",error:{type:"invalid",message:y("validation_file_max",{count:1})}}},F=(S,m)=>{var C,A;return t.log({event:"INTERACTION",properties:{tag:qn(S,m,e.config.extensions)},customProperties:(A=(C=s.store.current$.peek().flow)==null?void 0:C.analytics)==null?void 0:A.customProperties})};return s.o("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:S=>{if(S.preventDefault(),a.status==="pending"||a.status==="error")return;const m=w(l);m?o({status:"error",error:m.error}):r({type:"file",value:l})},children:[s.o("div",{class:"flex items-center gap-2",children:[s.o("label",{ref:p,for:"dropzone-file",class:"border-neutral-8 bg-neutral-2 flex h-48 w-full cursor-pointer flex-col items-center justify-center overflow-hidden rounded-2xl border border-dashed p-4",children:[c.length>0?s.o("ul",{class:"flex max-w-full flex-wrap justify-center gap-1 overflow-hidden p-1",children:[c.slice(0,Lt).map(S=>{const[m,C]=Qe(S.name);return s.o(Dt,{class:"flex overflow-hidden",children:[s.o("span",{class:"block truncate",children:m}),s.o("span",{children:C})]})}),v>0?s.o(Dt,{children:y("file_more",{count:v})}):null]}):s.o("div",{class:"flex flex-col justify-center gap-4 pb-6 pt-5",children:[s.o("header",{class:"flex flex-col items-center gap-0",children:[s.o("svg",{class:"text-neutral-11 mb-1 h-8 w-8","aria-hidden":"true",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 20 16",children:s.o("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"1.5",d:"M13 13h3a3 3 0 0 0 0-6h-.025A5.56 5.56 0 0 0 16 6.5 5.5 5.5 0 0 0 5.207 5.021C5.137 5.017 5.071 5 5 5a4 4 0 0 0 0 8h2.167M10 15V6m0 0L8 8m2-2 2 2"})}),s.o("p",{class:"text-neutral-12 tracking-[-0.01em]",children:y("upload_file",{count:e.config.allowMultiple?2:1})}),e.config.fileSizeLimitKib?s.o("p",{class:"text-neutral-11 text-xs",children:["(",y("file_max_size",{size:s.ne(e.config.fileSizeLimitKib)}),")"]}):null]}),s.o("aside",{class:"flex flex-col items-center gap-2",children:[s.o("p",{id:"accepted-filetypes",class:"sr-only",children:y("file_extensions")}),s.o("ul",{"aria-describedby":"accepted-filetypes",class:"flex flex-wrap justify-center gap-2",children:e.config.extensions.map(S=>s.o("li",{class:"ring-lowest outline-neutral-6 text-neutral-11 bg-neutral-1 rounded-md px-1 py-0.5 text-[11px] uppercase tracking-wide outline outline-1 ring-2",children:S.replace(".","")}))})]})]}),s.o("p",{role:"status",class:s.clsx("text-neutral-11 flex items-center gap-1.5 text-xs",c.length===0&&"sr-only"),children:a.status==="pending"?s.o(s.k,{children:[s.o(s.LoadingIndicator,{"aria-hidden":"true",class:"h-4 w-4"}),y("file_preparing",{count:c.length})]}):a.status==="ready"?s.o(s.k,{children:[l.length>1?y("file_total_size",{size:s.ne(g)}):s.ne(g),s.o("span",{class:"sr-only",children:[". ",y("file_ready",{count:l.length})]})]}):null}),s.o("input",{id:"dropzone-file","aria-label":y("upload_file",{count:e.config.allowMultiple?2:1}),onInput:async S=>{s.invariant(S.target instanceof HTMLInputElement);const m=S.target.files?Array.from(S.target.files):[];S.target.value="";const[C]=m;if(!C)return;const A=++i.current,E=a.status==="ready",R=m.map(Ot),z=w(R);if(z)return F(z.reason,z.file??C),o({status:"error",error:z.error});o({status:"pending",files:R});let D;try{const $=await Promise.all(m.map(async O=>{try{return{...Ot(O),data:await Rn(O)}}catch(H){throw D??(D=O),H}}));i.current===A&&o({status:"ready",files:$})}catch{if(i.current!==A)return;F("unreadable",D??C),o({status:"error",error:{type:"invalid",message:y(E?"file_read_error_replacement":"file_read_error")}})}},multiple:e.config.allowMultiple,accept:e.config.extensions.join(","),type:"file",class:"sr-only"})]}),s.o("div",{class:"flex h-full flex-col items-center gap-2",children:[s.o(_e,{disabled:l.length===0}),e.config.optional&&s.o(be,{class:"relative",onClick:()=>r(null)})]})]}),s.o(De,{error:h})]})};var We=e=>e.type==="checkbox",we=e=>e instanceof Date,ee=e=>e==null;const xr=e=>typeof e=="object";var W=e=>!ee(e)&&!Array.isArray(e)&&xr(e)&&!we(e),zn=e=>W(e)&&e.target?We(e.target)?e.target.checked:e.target.value:e,Kn=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,Wn=(e,r)=>e.has(Kn(r)),Gn=e=>{const r=e.constructor&&e.constructor.prototype;return W(r)&&r.hasOwnProperty("isPrototypeOf")},gt=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function G(e){if(e instanceof Date)return new Date(e);const r=typeof FileList<"u"&&e instanceof FileList;if(gt&&(e instanceof Blob||r))return e;const t=Array.isArray(e);if(!t&&!(W(e)&&Gn(e)))return e;const n=t?[]:Object.create(Object.getPrototypeOf(e));for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&(n[a]=G(e[a]));return n}var et=e=>/^\w*$/.test(e),q=e=>e===void 0,bt=e=>Array.isArray(e)?e.filter(Boolean):[],vt=e=>bt(e.replace(/["|']|\]/g,"").split(/\.|\[/)),I=(e,r,t)=>{if(!r||!W(e))return t;const n=(et(r)?[r]:vt(r)).reduce((a,o)=>ee(a)?a:a[o],e);return q(n)||n===e?q(e[r])?t:e[r]:n},ie=e=>typeof e=="boolean",se=e=>typeof e=="function",B=(e,r,t)=>{let n=-1;const a=et(r)?[r]:vt(r),o=a.length,i=o-1;for(;++n<o;){const l=a[n];let c=t;if(n!==i){const h=e[l];c=W(h)||Array.isArray(h)?h:isNaN(+a[n+1])?{}:[]}if(l==="__proto__"||l==="constructor"||l==="prototype")return;e[l]=c,e=e[l]}};const Rt={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},ae={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},de={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Hn=s.Cn.createContext(null);Hn.displayName="HookFormControlContext";var Jn=(e,r,t,n=!0)=>{const a={defaultValues:r._defaultValues};for(const o in e)Object.defineProperty(a,o,{get:()=>{const i=o;return r._proxyFormState[i]!==ae.all&&(r._proxyFormState[i]=!n||ae.all),t&&(t[i]=!0),e[i]}});return a};const Zn=typeof window<"u"?s.Cn.useLayoutEffect:s.Cn.useEffect;var te=e=>typeof e=="string",Xn=(e,r,t,n,a)=>te(e)?(n&&r.watch.add(e),I(t,e,a)):Array.isArray(e)?e.map(o=>(n&&r.watch.add(o),I(t,o))):(n&&(r.watchAll=!0),t),dt=e=>ee(e)||!xr(e);function me(e,r,t=new WeakSet){if(dt(e)||dt(r))return Object.is(e,r);if(we(e)&&we(r))return Object.is(e.getTime(),r.getTime());const n=Object.keys(e),a=Object.keys(r);if(n.length!==a.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const o of n){const i=e[o];if(!a.includes(o))return!1;if(o!=="ref"){const l=r[o];if(we(i)&&we(l)||W(i)&&W(l)||Array.isArray(i)&&Array.isArray(l)?!me(i,l,t):!Object.is(i,l))return!1}}return!0}const Yn=s.Cn.createContext(null);Yn.displayName="HookFormContext";var wr=(e,r,t,n,a)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[n]:a||!0}}:{},ze=e=>Array.isArray(e)?e:[e],Pt=()=>{let e=[];return{get observers(){return e},next:a=>{for(const o of e)o.next&&o.next(a)},subscribe:a=>(e.push(a),{unsubscribe:()=>{e=e.filter(o=>o!==a)}}),unsubscribe:()=>{e=[]}}};function _r(e,r){const t={};for(const n in e)if(e.hasOwnProperty(n)){const a=e[n],o=r[n];if(a&&W(a)&&o){const i=_r(a,o);W(i)&&(t[n]=i)}else e[n]&&(t[n]=o)}return t}var Q=e=>W(e)&&!Object.keys(e).length,xt=e=>e.type==="file",Ze=e=>{if(!gt)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},kr=e=>e.type==="select-multiple",wt=e=>e.type==="radio",Qn=e=>wt(e)||We(e),ct=e=>Ze(e)&&e.isConnected;function es(e,r){const t=r.slice(0,-1).length;let n=0;for(;n<t;)e=q(e)?n++:e[r[n++]];return e}function ts(e){for(const r in e)if(e.hasOwnProperty(r)&&!q(e[r]))return!1;return!0}function K(e,r){const t=Array.isArray(r)?r:et(r)?[r]:vt(r),n=t.length===1?e:es(e,t),a=t.length-1,o=t[a];return n&&delete n[o],a!==0&&(W(n)&&Q(n)||Array.isArray(n)&&ts(n))&&K(e,t.slice(0,-1)),e}var rs=e=>{for(const r in e)if(se(e[r]))return!0;return!1};function Cr(e){return Array.isArray(e)||W(e)&&!rs(e)}function ft(e,r={}){for(const t in e){const n=e[t];Cr(n)?(r[t]=Array.isArray(n)?[]:{},ft(n,r[t])):q(n)||(r[t]=!0)}return r}function Me(e,r,t){t||(t=ft(r));for(const n in e){const a=e[n];if(Cr(a))q(r)||dt(t[n])?t[n]=ft(a,Array.isArray(a)?[]:{}):Me(a,ee(r)?{}:r[n],t[n]);else{const o=r[n];t[n]=!me(a,o)}}return t}const jt={value:!1,isValid:!1},Bt={value:!0,isValid:!0};var Sr=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!q(e[0].attributes.value)?q(e[0].value)||e[0].value===""?Bt:{value:e[0].value,isValid:!0}:Bt:jt}return jt},Ir=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:n})=>q(e)?e:r?e===""?NaN:e&&+e:t&&te(e)?new Date(e):n?n(e):e;const $t={isValid:!1,value:null};var Ar=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,$t):$t;function qt(e){const r=e.ref;return xt(r)?r.files:wt(r)?Ar(e.refs).value:kr(r)?[...r.selectedOptions].map(({value:t})=>t):We(r)?Sr(e.refs).value:Ir(q(r.value)?e.ref.value:r.value,e)}var ns=(e,r,t,n)=>{const a={};for(const o of e){const i=I(r,o);i&&B(a,o,i._f)}return{criteriaMode:t,names:[...e],fields:a,shouldUseNativeValidation:n}},Xe=e=>e instanceof RegExp,je=e=>q(e)?e:Xe(e)?e.source:W(e)?Xe(e.value)?e.value.source:e.value:e,Ut=e=>({isOnSubmit:!e||e===ae.onSubmit,isOnBlur:e===ae.onBlur,isOnChange:e===ae.onChange,isOnAll:e===ae.all,isOnTouch:e===ae.onTouched});const zt="AsyncFunction";var ss=e=>!!e&&!!e.validate&&!!(se(e.validate)&&e.validate.constructor.name===zt||W(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===zt)),as=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),Kt=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(n=>e.startsWith(n)&&/^\.\w+/.test(e.slice(n.length))));const Ke=(e,r,t,n)=>{for(const a of t||Object.keys(e)){const o=I(e,a);if(o){const{_f:i,...l}=o;if(i){if(i.refs&&i.refs[0]&&r(i.refs[0],a)&&!n)return!0;if(i.ref&&r(i.ref,i.name)&&!n)return!0;if(Ke(l,r))break}else if(W(l)&&Ke(l,r))break}}};function Wt(e,r,t){const n=I(e,t);if(n||et(t))return{error:n,name:t};const a=t.split(".");for(;a.length;){const o=a.join("."),i=I(r,o),l=I(e,o);if(i&&!Array.isArray(i)&&t!==o)return{name:t};if(l&&l.type)return{name:o,error:l};if(l&&l.root&&l.root.type)return{name:`${o}.root`,error:l.root};a.pop()}return{name:t}}var is=(e,r,t,n)=>{t(e);const{name:a,...o}=e;return Q(o)||Object.keys(o).length>=Object.keys(r).length||Object.keys(o).find(i=>r[i]===(!n||ae.all))},os=(e,r,t)=>!e||!r||e===r||ze(e).some(n=>n&&(t?n===r:n.startsWith(r)||r.startsWith(n))),ls=(e,r,t,n,a)=>a.isOnAll?!1:!t&&a.isOnTouch?!(r||e):(t?n.isOnBlur:a.isOnBlur)?!e:(t?n.isOnChange:a.isOnChange)?e:!0,us=(e,r)=>!bt(I(e,r)).length&&K(e,r),cs=(e,r,t)=>{const n=ze(I(e,t));return B(n,"root",r[t]),B(e,t,n),e};function Gt(e,r,t="validate"){if(te(e)||Array.isArray(e)&&e.every(te)||ie(e)&&!e)return{type:t,message:te(e)?e:"",ref:r}}var Ee=e=>W(e)&&!Xe(e)?e:{value:e,message:""},Ht=async(e,r,t,n,a,o)=>{const{ref:i,refs:l,required:c,maxLength:h,minLength:v,min:g,max:p,pattern:y,validate:w,name:F,valueAsNumber:_,mount:S}=e._f,m=I(t,F);if(!S||r.has(F))return{};const C=l?l[0]:i,A=M=>{a&&C.reportValidity&&(C.setCustomValidity(ie(M)?"":M||""),C.reportValidity())},E={},R=wt(i),z=We(i),D=R||z,$=(_||xt(i))&&q(i.value)&&q(m)||Ze(i)&&i.value===""||m===""||Array.isArray(m)&&!m.length,O=wr.bind(null,F,n,E),H=(M,N,T,U=de.maxLength,J=de.minLength)=>{const Z=M?N:T;E[F]={type:M?U:J,message:Z,ref:i,...O(M?U:J,Z)}};if(o?!Array.isArray(m)||!m.length:c&&(!D&&($||ee(m))||ie(m)&&!m||z&&!Sr(l).isValid||R&&!Ar(l).isValid)){const{value:M,message:N}=te(c)?{value:!!c,message:c}:Ee(c);if(M&&(E[F]={type:de.required,message:N,ref:C,...O(de.required,N)},!n))return A(N),E}if(!$&&(!ee(g)||!ee(p))){let M,N;const T=Ee(p),U=Ee(g);if(!ee(m)&&!isNaN(m)){const J=i.valueAsNumber||m&&+m;ee(T.value)||(M=J>T.value),ee(U.value)||(N=J<U.value)}else{const J=i.valueAsDate||new Date(m),Z=he=>new Date(new Date().toDateString()+" "+he),ne=i.type=="time",ke=i.type=="week";te(T.value)&&m&&(M=ne?Z(m)>Z(T.value):ke?m>T.value:J>new Date(T.value)),te(U.value)&&m&&(N=ne?Z(m)<Z(U.value):ke?m<U.value:J<new Date(U.value))}if((M||N)&&(H(!!M,T.message,U.message,de.max,de.min),!n))return A(E[F].message),E}if((h||v)&&!$&&(te(m)||o&&Array.isArray(m))){const M=Ee(h),N=Ee(v),T=!ee(M.value)&&m.length>+M.value,U=!ee(N.value)&&m.length<+N.value;if((T||U)&&(H(T,M.message,N.message),!n))return A(E[F].message),E}if(y&&!$&&te(m)){const{value:M,message:N}=Ee(y);if(Xe(M)&&!m.match(M)&&(E[F]={type:de.pattern,message:N,ref:i,...O(de.pattern,N)},!n))return A(N),E}if(w){if(se(w)){const M=await w(m,t),N=Gt(M,C);if(N&&(E[F]={...N,...O(de.validate,N.message)},!n))return A(N.message),E}else if(W(w)){let M={};for(const N in w){if(!Q(M)&&!n)break;const T=Gt(await w[N](m,t),C,N);T&&(M={...T,...O(N,T.message)},A(T.message),n&&(E[F]=M))}if(!Q(M)&&(E[F]={ref:C,...M},!n))return E}}return A(!0),E};const ds={mode:ae.onSubmit,reValidateMode:ae.onChange,shouldFocusError:!0};function fs(e={}){let r={...ds,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:se(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},n={},a=W(r.defaultValues)||W(r.values)?G(r.defaultValues||r.values)||{}:{},o=r.shouldUnregister?{}:G(a),i={action:!1,mount:!1,watch:!1,keepIsValid:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,h=0;const v={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},g={...v};let p={...g};const y={array:Pt(),state:Pt()},w=r.criteriaMode===ae.all,F=u=>d=>{clearTimeout(h),h=setTimeout(u,d)},_=async u=>{if(!i.keepIsValid&&!r.disabled&&(g.isValid||p.isValid||u)){let d;r.resolver?(d=Q((await D()).errors),S()):d=await O(n,!0),d!==t.isValid&&y.state.next({isValid:d})}},S=(u,d)=>{!r.disabled&&(g.isValidating||g.validatingFields||p.isValidating||p.validatingFields)&&((u||Array.from(l.mount)).forEach(f=>{f&&(d?B(t.validatingFields,f,d):K(t.validatingFields,f))}),y.state.next({validatingFields:t.validatingFields,isValidating:!Q(t.validatingFields)}))},m=(u,d=[],f,k,x=!0,b=!0)=>{if(k&&f&&!r.disabled){if(i.action=!0,b&&Array.isArray(I(n,u))){const V=f(I(n,u),k.argA,k.argB);x&&B(n,u,V)}if(b&&Array.isArray(I(t.errors,u))){const V=f(I(t.errors,u),k.argA,k.argB);x&&B(t.errors,u,V),us(t.errors,u)}if((g.touchedFields||p.touchedFields)&&b&&Array.isArray(I(t.touchedFields,u))){const V=f(I(t.touchedFields,u),k.argA,k.argB);x&&B(t.touchedFields,u,V)}(g.dirtyFields||p.dirtyFields)&&(t.dirtyFields=Me(a,o)),y.state.next({name:u,isDirty:M(u,d),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else B(o,u,d)},C=(u,d)=>{B(t.errors,u,d),y.state.next({errors:t.errors})},A=u=>{t.errors=u,y.state.next({errors:t.errors,isValid:!1})},E=(u,d,f,k)=>{const x=I(n,u);if(x){const b=I(o,u,q(f)?I(a,u):f);q(b)||k&&k.defaultChecked||d?B(o,u,d?b:qt(x._f)):U(u,b),i.mount&&!i.action&&_()}},R=(u,d,f,k,x)=>{let b=!1,V=!1;const P={name:u};if(!r.disabled){if(!f||k){(g.isDirty||p.isDirty)&&(V=t.isDirty,t.isDirty=P.isDirty=M(),b=V!==P.isDirty);const j=me(I(a,u),d);V=!!I(t.dirtyFields,u),j?K(t.dirtyFields,u):B(t.dirtyFields,u,!0),P.dirtyFields=t.dirtyFields,b=b||(g.dirtyFields||p.dirtyFields)&&V!==!j}if(f){const j=I(t.touchedFields,u);j||(B(t.touchedFields,u,f),P.touchedFields=t.touchedFields,b=b||(g.touchedFields||p.touchedFields)&&j!==f)}b&&x&&y.state.next(P)}return b?P:{}},z=(u,d,f,k)=>{const x=I(t.errors,u),b=(g.isValid||p.isValid)&&ie(d)&&t.isValid!==d;if(r.delayError&&f?(c=F(()=>C(u,f)),c(r.delayError)):(clearTimeout(h),c=null,f?B(t.errors,u,f):K(t.errors,u)),(f?!me(x,f):x)||!Q(k)||b){const V={...k,...b&&ie(d)?{isValid:d}:{},errors:t.errors,name:u};t={...t,...V},y.state.next(V)}},D=async u=>(S(u,!0),await r.resolver(o,r.context,ns(u||l.mount,n,r.criteriaMode,r.shouldUseNativeValidation))),$=async u=>{const{errors:d}=await D(u);if(S(u),u)for(const f of u){const k=I(d,f);k?B(t.errors,f,k):K(t.errors,f)}else t.errors=d;return d},O=async(u,d,f={valid:!0})=>{for(const k in u){const x=u[k];if(x){const{_f:b,...V}=x;if(b){const P=l.array.has(b.name),j=x._f&&ss(x._f);j&&g.validatingFields&&S([b.name],!0);const Y=await Ht(x,l.disabled,o,w,r.shouldUseNativeValidation&&!d,P);if(j&&g.validatingFields&&S([b.name]),Y[b.name]&&(f.valid=!1,d||e.shouldUseNativeValidation))break;!d&&(I(Y,b.name)?P?cs(t.errors,Y,b.name):B(t.errors,b.name,Y[b.name]):K(t.errors,b.name))}!Q(V)&&await O(V,d,f)}}return f.valid},H=()=>{for(const u of l.unMount){const d=I(n,u);d&&(d._f.refs?d._f.refs.every(f=>!ct(f)):!ct(d._f.ref))&&Ie(u)}l.unMount=new Set},M=(u,d)=>!r.disabled&&(u&&d&&B(o,u,d),!me(Ce(),a)),N=(u,d,f)=>Xn(u,l,{...i.mount?o:q(d)?a:te(u)?{[u]:d}:d},f,d),T=u=>bt(I(i.mount?o:a,u,r.shouldUnregister?I(a,u,[]):[])),U=(u,d,f={})=>{const k=I(n,u);let x=d;if(k){const b=k._f;b&&(!b.disabled&&B(o,u,Ir(d,b)),x=Ze(b.ref)&&ee(d)?"":d,kr(b.ref)?[...b.ref.options].forEach(V=>V.selected=x.includes(V.value)):b.refs?We(b.ref)?b.refs.forEach(V=>{(!V.defaultChecked||!V.disabled)&&(Array.isArray(x)?V.checked=!!x.find(P=>P===V.value):V.checked=x===V.value||!!x)}):b.refs.forEach(V=>V.checked=V.value===x):xt(b.ref)?b.ref.value="":(b.ref.value=x,b.ref.type||y.state.next({name:u,values:G(o)})))}(f.shouldDirty||f.shouldTouch)&&R(u,x,f.shouldTouch,f.shouldDirty,!0),f.shouldValidate&&he(u)},J=(u,d,f)=>{for(const k in d){if(!d.hasOwnProperty(k))return;const x=d[k],b=u+"."+k,V=I(n,b);(l.array.has(u)||W(x)||V&&!V._f)&&!we(x)?J(b,x,f):U(b,x,f)}},Z=(u,d,f={})=>{const k=I(n,u),x=l.array.has(u),b=G(d);B(o,u,b),x?(y.array.next({name:u,values:G(o)}),(g.isDirty||g.dirtyFields||p.isDirty||p.dirtyFields)&&f.shouldDirty&&y.state.next({name:u,dirtyFields:Me(a,o),isDirty:M(u,b)})):k&&!k._f&&!ee(b)?J(u,b,f):U(u,b,f),Kt(u,l)?y.state.next({...t,name:u,values:G(o)}):y.state.next({name:i.mount?u:void 0,values:G(o)})},ne=async u=>{i.mount=!0;const d=u.target;let f=d.name,k=!0;const x=I(n,f),b=j=>{k=Number.isNaN(j)||we(j)&&isNaN(j.getTime())||me(j,I(o,f,j))},V=Ut(r.mode),P=Ut(r.reValidateMode);if(x){let j,Y;const xe=d.type?qt(x._f):zn(u),ye=u.type===Rt.BLUR||u.type===Rt.FOCUS_OUT,Mr=!as(x._f)&&!r.resolver&&!I(t.errors,f)&&!x._f.deps||ls(ye,I(t.touchedFields,f),t.isSubmitted,P,V),nt=Kt(f,l,ye);B(o,f,xe),ye?(!d||!d.readOnly)&&(x._f.onBlur&&x._f.onBlur(u),c&&c(0)):x._f.onChange&&x._f.onChange(u);const st=R(f,xe,ye),Tr=!Q(st)||nt;if(!ye&&y.state.next({name:f,type:u.type,values:G(o)}),Mr)return(g.isValid||p.isValid)&&(r.mode==="onBlur"?ye&&_():ye||_()),Tr&&y.state.next({name:f,...nt?{}:st});if(!ye&&nt&&y.state.next({...t}),r.resolver){const{errors:St}=await D([f]);if(S([f]),b(xe),k){const Nr=Wt(t.errors,n,f),It=Wt(St,n,Nr.name||f);j=It.error,f=It.name,Y=Q(St)}}else S([f],!0),j=(await Ht(x,l.disabled,o,w,r.shouldUseNativeValidation))[f],S([f]),b(xe),k&&(j?Y=!1:(g.isValid||p.isValid)&&(Y=await O(n,!0)));k&&(x._f.deps&&(!Array.isArray(x._f.deps)||x._f.deps.length>0)&&he(x._f.deps),z(f,Y,j,st))}},ke=(u,d)=>{if(I(t.errors,d)&&u.focus)return u.focus(),1},he=async(u,d={})=>{let f,k;const x=ze(u);if(r.resolver){const b=await $(q(u)?u:x);f=Q(b),k=u?!x.some(V=>I(b,V)):f}else u?(k=(await Promise.all(x.map(async b=>{const V=I(n,b);return await O(V&&V._f?{[b]:V}:V)}))).every(Boolean),!(!k&&!t.isValid)&&_()):k=f=await O(n);return y.state.next({...!te(u)||(g.isValid||p.isValid)&&f!==t.isValid?{}:{name:u},...r.resolver||!u?{isValid:f}:{},errors:t.errors}),d.shouldFocus&&!k&&Ke(n,ke,u?x:l.mount),k},Ce=(u,d)=>{let f={...i.mount?o:a};return d&&(f=_r(d.dirtyFields?t.dirtyFields:t.touchedFields,f)),q(u)?f:te(u)?I(f,u):u.map(k=>I(f,k))},ve=(u,d)=>({invalid:!!I((d||t).errors,u),isDirty:!!I((d||t).dirtyFields,u),error:I((d||t).errors,u),isValidating:!!I(t.validatingFields,u),isTouched:!!I((d||t).touchedFields,u)}),Se=u=>{const d=u?ze(u):void 0;d==null||d.forEach(f=>K(t.errors,f)),d?d.forEach(f=>{y.state.next({name:f,errors:t.errors})}):y.state.next({errors:{}})},Oe=(u,d,f)=>{const k=(I(n,u,{_f:{}})._f||{}).ref,x=I(t.errors,u)||{},{ref:b,message:V,type:P,...j}=x;B(t.errors,u,{...j,...d,ref:k}),y.state.next({name:u,errors:t.errors,isValid:!1}),f&&f.shouldFocus&&k&&k.focus&&k.focus()},Ge=(u,d)=>se(u)?y.state.subscribe({next:f=>"values"in f&&u(N(void 0,d),f)}):N(u,d,!0),Re=u=>y.state.subscribe({next:d=>{os(u.name,d.name,u.exact)&&is(d,u.formState||g,Er,u.reRenderRoot)&&u.callback({values:{...o},...t,...d,defaultValues:a})}}).unsubscribe,He=u=>(i.mount=!0,p={...p,...u.formState},Re({...u,formState:{...v,...u.formState}})),Ie=(u,d={})=>{for(const f of u?ze(u):l.mount)l.mount.delete(f),l.array.delete(f),d.keepValue||(K(n,f),K(o,f)),!d.keepError&&K(t.errors,f),!d.keepDirty&&K(t.dirtyFields,f),!d.keepTouched&&K(t.touchedFields,f),!d.keepIsValidating&&K(t.validatingFields,f),!r.shouldUnregister&&!d.keepDefaultValue&&K(a,f);y.state.next({values:G(o)}),y.state.next({...t,...d.keepDirty?{isDirty:M()}:{}}),!d.keepIsValid&&_()},Pe=({disabled:u,name:d})=>{if(ie(u)&&i.mount||u||l.disabled.has(d)){const x=l.disabled.has(d)!==!!u;u?l.disabled.add(d):l.disabled.delete(d),x&&i.mount&&!i.action&&_()}},Ae=(u,d={})=>{let f=I(n,u);const k=ie(d.disabled)||ie(r.disabled);return B(n,u,{...f||{},_f:{...f&&f._f?f._f:{ref:{name:u}},name:u,mount:!0,...d}}),l.mount.add(u),f?Pe({disabled:ie(d.disabled)?d.disabled:r.disabled,name:u}):E(u,!0,d.value),{...k?{disabled:d.disabled||r.disabled}:{},...r.progressive?{required:!!d.required,min:je(d.min),max:je(d.max),minLength:je(d.minLength),maxLength:je(d.maxLength),pattern:je(d.pattern)}:{},name:u,onChange:ne,onBlur:ne,ref:x=>{if(x){Ae(u,d),f=I(n,u);const b=q(x.value)&&x.querySelectorAll&&x.querySelectorAll("input,select,textarea")[0]||x,V=Qn(b),P=f._f.refs||[];if(V?P.find(j=>j===b):b===f._f.ref)return;B(n,u,{_f:{...f._f,...V?{refs:[...P.filter(ct),b,...Array.isArray(I(a,u))?[{}]:[]],ref:{type:b.type,name:u}}:{ref:b}}}),E(u,!1,void 0,b)}else f=I(n,u,{}),f._f&&(f._f.mount=!1),(r.shouldUnregister||d.shouldUnregister)&&!(Wn(l.array,u)&&i.action)&&l.unMount.add(u)}}},L=()=>r.shouldFocusError&&Ke(n,ke,l.mount),Fe=u=>{ie(u)&&(y.state.next({disabled:u}),Ke(n,(d,f)=>{const k=I(n,f);k&&(d.disabled=k._f.disabled||u,Array.isArray(k._f.refs)&&k._f.refs.forEach(x=>{x.disabled=k._f.disabled||u}))},0,!1))},Ve=(u,d)=>async f=>{let k;f&&(f.preventDefault&&f.preventDefault(),f.persist&&f.persist());let x=G(o);if(y.state.next({isSubmitting:!0}),r.resolver){const{errors:b,values:V}=await D();S(),t.errors=b,x=G(V)}else await O(n);if(l.disabled.size)for(const b of l.disabled)K(x,b);if(K(t.errors,"root"),Q(t.errors)){y.state.next({errors:{}});try{await u(x,f)}catch(b){k=b}}else d&&await d({...t.errors},f),L(),setTimeout(L);if(y.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Q(t.errors)&&!k,submitCount:t.submitCount+1,errors:t.errors}),k)throw k},pe=(u,d={})=>{I(n,u)&&(q(d.defaultValue)?Z(u,G(I(a,u))):(Z(u,d.defaultValue),B(a,u,G(d.defaultValue))),d.keepTouched||K(t.touchedFields,u),d.keepDirty||(K(t.dirtyFields,u),t.isDirty=d.defaultValue?M(u,G(I(a,u))):M()),d.keepError||(K(t.errors,u),g.isValid&&_()),y.state.next({...t}))},_t=(u,d={})=>{const f=u?G(u):a,k=G(f),x=Q(u),b=x?a:k;if(d.keepDefaultValues||(a=f),!d.keepValues){if(d.keepDirtyValues){const V=new Set([...l.mount,...Object.keys(Me(a,o))]);for(const P of Array.from(V)){const j=I(t.dirtyFields,P),Y=I(o,P),xe=I(b,P);j&&!q(Y)?B(b,P,Y):!j&&!q(xe)&&Z(P,xe)}}else{if(gt&&q(u))for(const V of l.mount){const P=I(n,V);if(P&&P._f){const j=Array.isArray(P._f.refs)?P._f.refs[0]:P._f.ref;if(Ze(j)){const Y=j.closest("form");if(Y){Y.reset();break}}}}if(d.keepFieldsRef)for(const V of l.mount)Z(V,I(b,V));else n={}}o=r.shouldUnregister?d.keepDefaultValues?G(a):{}:G(b),y.array.next({values:{...b}}),y.state.next({values:{...b}})}l={mount:d.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!g.isValid||!!d.keepIsValid||!!d.keepDirtyValues||!r.shouldUnregister&&!Q(b),i.watch=!!r.shouldUnregister,i.keepIsValid=!!d.keepIsValid,i.action=!1,d.keepErrors||(t.errors={}),y.state.next({submitCount:d.keepSubmitCount?t.submitCount:0,isDirty:x?!1:d.keepDirty?t.isDirty:!!(d.keepDefaultValues&&!me(u,a)),isSubmitted:d.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:x?{}:d.keepDirtyValues?d.keepDefaultValues&&o?Me(a,o):t.dirtyFields:d.keepDefaultValues&&u?Me(a,u):d.keepDirty?t.dirtyFields:{},touchedFields:d.keepTouched?t.touchedFields:{},errors:d.keepErrors?t.errors:{},isSubmitSuccessful:d.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:a})},kt=(u,d)=>_t(se(u)?u(o):u,{...r.resetOptions,...d}),Vr=(u,d={})=>{const f=I(n,u),k=f&&f._f;if(k){const x=k.refs?k.refs[0]:k.ref;x.focus&&setTimeout(()=>{x.focus(),d.shouldSelect&&se(x.select)&&x.select()})}},Er=u=>{t={...t,...u}},Ct={control:{register:Ae,unregister:Ie,getFieldState:ve,handleSubmit:Ve,setError:Oe,_subscribe:Re,_runSchema:D,_updateIsValidating:S,_focusError:L,_getWatch:N,_getDirty:M,_setValid:_,_setFieldArray:m,_setDisabledField:Pe,_setErrors:A,_getFieldArray:T,_reset:_t,_resetDefaultValues:()=>se(r.defaultValues)&&r.defaultValues().then(u=>{kt(u,r.resetOptions),y.state.next({isLoading:!1})}),_removeUnmounted:H,_disableForm:Fe,_subjects:y,_proxyFormState:g,get _fields(){return n},get _formValues(){return o},get _state(){return i},set _state(u){i=u},get _defaultValues(){return a},get _names(){return l},set _names(u){l=u},get _formState(){return t},get _options(){return r},set _options(u){r={...r,...u}}},subscribe:He,trigger:he,register:Ae,handleSubmit:Ve,watch:Ge,setValue:Z,getValues:Ce,reset:kt,resetField:pe,clearErrors:Se,unregister:Ie,setError:Oe,setFocus:Vr,getFieldState:ve};return{...Ct,formControl:Ct}}function tt(e={}){const r=s.Cn.useRef(void 0),t=s.Cn.useRef(void 0),[n,a]=s.Cn.useState({isDirty:!1,isValidating:!1,isLoading:se(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:se(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:n},e.defaultValues&&!se(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:i,...l}=fs(e);r.current={...l,formState:n}}const o=r.current.control;return o._options=e,Zn(()=>{const i=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState}),reRenderRoot:!0});return a(l=>({...l,isReady:!0})),o._formState.isReady=!0,i},[o]),s.Cn.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),s.Cn.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),s.Cn.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),s.Cn.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),s.Cn.useEffect(()=>{if(o._proxyFormState.isDirty){const i=o._getDirty();i!==n.isDirty&&o._subjects.state.next({isDirty:i})}},[o,n.isDirty]),s.Cn.useEffect(()=>{var i;e.values&&!me(e.values,t.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),!((i=o._options.resetOptions)===null||i===void 0)&&i.keepIsValid||o._setValid(),t.current=e.values,a(l=>({...l}))):o._resetDefaultValues()},[o,e.values]),s.Cn.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),r.current.formState=s.Cn.useMemo(()=>Jn(n,o),[o,n]),r.current}const Jt=(e,r,t)=>{if(e&&"reportValidity"in e){const n=I(t,r);e.setCustomValidity(n&&n.message||""),e.reportValidity()}},hs=(e,r)=>{for(const t in r.fields){const n=r.fields[t];n&&n.ref&&"reportValidity"in n.ref?Jt(n.ref,t,e):n.refs&&n.refs.forEach(a=>Jt(a,t,e))}},ps=(e,r)=>{r.shouldUseNativeValidation&&hs(e,r);const t={};for(const n in e){const a=I(r.fields,n),o=Object.assign(e[n]||{},{ref:a&&a.ref});if(ys(r.names||Object.keys(e),n)){const i=Object.assign({},I(t,n));B(i,"root",o),B(t,n,i)}else B(t,n,o)}return t},ys=(e,r)=>e.some(t=>t.startsWith(r+"."));var rt=function(e,r,t){return t===void 0&&(t={}),function(n,a,o){try{var i=!o.shouldUseNativeValidation&&o.criteriaMode==="all";return Promise.resolve(In(e,n,Object.assign({},r,{abortPipeEarly:!i}))).then(function(l){if(l.issues){for(var c={};l.issues.length;){var h=l.issues[0],v=vn(h);if(v&&(c[v]||(c[v]={message:h.message,type:h.type}),i)){var g=c[v].types,p=g&&g[h.type];c[v]=wr(v,i,c,h.type,p?[].concat(p,h.message):h.message)}l.issues.shift()}return{values:{},errors:ps(c,o)}}return{values:t.raw?n:l.output,errors:{}}})}catch(l){return Promise.reject(l)}}};const Zt=27,Xt=12,Yt=10,ms=s.isSubmissionOfType("enum"),gs=(e,r)=>{const t={min:e.minSelected??0,max:e.maxSelected??e.options.length};return rt(fe({checked:ge(yr(re(),fr()),pt(n=>Object.entries(n).filter(([a,o])=>o).map(([a,o])=>a)),qe(t.max,r("validation_multiple_choice_max",{count:t.max})),Te(t.min,r("validation_multiple_choice_min",{count:t.min})))}))},bs=s.k$1(({option:e,...r},t)=>s.o(s.k,{children:[s.o("input",{class:"peer sr-only h-full",type:"checkbox",...r,ref:t}),s.o("label",{class:"bg-lowest hover:bg-neutral-2 active:outline-neutral-8 ease-expo-out outline-divider text-neutral-11 peer-checked:outline-accent-7 peer-checked:bg-accent-2 peer-checked:text-accent-9 peer-focus-visible:ring-accent-9 peer-focus-visible:ring-offset-accent-7 block cursor-pointer select-none rounded-2xl px-3 py-1.5 outline outline-1 ring-0 ring-transparent transition-all selection:bg-transparent peer-focus-visible:ring-4",htmlFor:r.id,children:e.label})]})),Qt=s.cva("gutter-stable flex w-full flex-1 flex-wrap gap-2 overflow-y-auto rounded-xl p-2.5 pr-4",{variants:{variant:{singleOption:"justify-center",booleanLike:gr}}}),vs=({input:e,onSubmitSuccess:r})=>{var v,g;const t=e.key?(v=s.store.current$.value.flow)==null?void 0:v.data.submissions[e.key]:void 0,n=(e.config.minSelected===1||e.config.minSelected===void 0)&&e.config.maxSelected===1,a=n&&e.config.options.length===2,{t:o}=s.useTranslation(),{register:i,handleSubmit:l,formState:{errors:c}}=tt({defaultValues:{checked:n?{}:ms(t)?Object.fromEntries(t.value.map(p=>[p,!0])):{}},resolver:gs(e.config,o)}),h=mt();return a?s.o("ul",{style:{maxHeight:6.5*Zt+5*Xt+2*Yt},class:Qt({variant:"booleanLike"}),children:e.config.options.map((p,y)=>s.o("li",{class:br,children:s.o(vr,{type:"submit",ref:w=>{w&&y===0&&(h.current=w)},label:p.label,value:"true",onClick:()=>r({type:"enum",value:[p.value]})})},p.value))}):s.o("form",{noValidate:!0,onSubmit:p=>l(y=>{const w=y.checked;r({type:"enum",value:w})})(p),children:[s.o("div",{class:"flex items-center gap-1",children:[s.o("ul",{style:{maxHeight:6.5*Zt+5*Xt+2*Yt},class:Qt({variant:e.config.options.length===1?"singleOption":void 0}),children:e.config.options.map((p,y)=>{const w=`checked.${p.value}`,{ref:F,..._}=i(w);return s.o("li",{class:"relative",children:s.o(bs,{option:p,autoFocus:y===0,ref:S=>{S&&y===0&&(h.current=S),F(S)},id:w,..._,onClick:n?()=>r({type:"enum",value:[p.value]}):void 0})},p.value)})}),s.o("div",{class:"flex flex-col items-center gap-2 pr-2.5 pt-2.5",children:[n?null:s.o(_e,{}),e.config.minSelected===0&&s.o(be,{class:"relative",type:"button",onClick:()=>r({type:"enum",value:[]})})]})]}),s.o("div",{class:"px-1",children:s.o(De,{error:(g=c.checked)==null?void 0:g.root})})]})},xs=s.isSubmissionOfType("number"),ws=(e,r)=>{const t=e.min??Number.MIN_SAFE_INTEGER,n=e.max??Number.MAX_SAFE_INTEGER,a=e.decimalCases??0;return rt(fe({number:ge(hr(r("validation_number")),lr(t,r("validation_number_min",{min:t})),or(n,r("validation_number_max",{max:n})),ar(o=>o===Number(o.toFixed(a)),r("validation_number_decimal_cases",{count:a})))}))},_s=({input:e,onSubmitSuccess:r})=>{var g;const t=e.config.defaultValue,n=e.key?(g=s.store.current$.value.flow)==null?void 0:g.data.submissions[e.key]:void 0,{t:a}=s.useTranslation(),{register:o,handleSubmit:i,formState:{errors:l}}=tt({defaultValues:{number:xs(n)?n.value:t?Number(t):void 0},resolver:ws(e.config,a)}),{ref:c,...h}=o("number",{required:!e.config.optional,valueAsNumber:!0}),v=s._();return s.y(()=>{v.current&&(v.current.focus(),v.current.select())},[]),s.o("form",{class:"flex flex-col gap-1 p-2.5",onSubmit:i(p=>{p.number!==void 0&&r({type:"number",value:p.number})}),children:[s.o("div",{class:"flex items-center gap-2",children:[s.o("div",{class:"relative min-w-0 flex-grow",children:[s.o("input",{...h,id:"chat-input",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:p=>{p&&(v.current=p),c(p)},type:"text",min:e.config.min,max:e.config.max,class:Le({optional:e.config.optional,className:"[type=number:-webkit-inner-spin-button] w-full rounded-full [-webkit-outer-spin-button:none]"}),placeholder:e.config.placeholder}),e.config.optional&&s.o(be,{class:"absolute bottom-0 right-0.5 top-0",onClick:()=>r(null)})]}),s.o(_e,{})]}),s.o(De,{error:l.number})]})},ks=e=>{if(e==="")return{countryCode:"",phoneNumber:""};const r=Object.entries(yt).find(a=>e.startsWith(a[1])),t=r?r[1]:"",n=e.replace(t,"");return/^\d+$/.test(n)?{countryCode:t,phoneNumber:n}:{countryCode:"",phoneNumber:""}},Cs="44",Ss=/^[0-9 ]+$/,Is=s.isSubmissionOfType("string"),As=s.isSubmissionOfType("phone"),Fs=e=>{const r=ge(re(e("validation_country_code")),ht(Ss,e("validation_country_code"))),t=ge(re(e("validation_phone")),Te(1,e("validation_phone")),pt(n=>n.replace(/[^0-9]/g,"")));return rt(fe({countryCode:r,phoneNumber:t}))},Vs=({input:e,onSubmitSuccess:r})=>{var F;const t=e.key?(F=s.store.current$.value.flow)==null?void 0:F.data.submissions[e.key]:void 0,{t:n}=s.useTranslation(),[a,o]=s.h(),i=Is(t)?ks(t.value):As(t)?t.value:void 0,{register:l,handleSubmit:c,formState:{errors:h},watch:v}=tt({defaultValues:{countryCode:(i==null?void 0:i.countryCode)??e.config.defaultValue.countryCode??Cs,phoneNumber:(i==null?void 0:i.phoneNumber)??e.config.defaultValue.phoneNumber??""},resolver:Fs(n)}),{ref:g,...p}=l("phoneNumber",{required:!e.config.optional}),y=s._(),w=v("countryCode");return s.y(()=>{y.current&&(y.current.focus(),y.current.select())},[]),s.o("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:c(_=>{const S=_.phoneNumber.replace(/[^0-9]/g,""),m=_.countryCode.replace(/[^0-9]/g,"");o(void 0);const C=e.config.minChars??7,A=S.length+m.length;if(A<C)return o(n("validation_phone_min_chars",{count:C}));const E=e.config.maxChars;if(E!=null&&A>E)return o(n("validation_max_chars",{count:E}));e.config.submissionFormat==="phone"?r({type:"phone",value:{countryCode:m,phoneNumber:S}}):r({type:"string",value:w+_.phoneNumber})}),children:[s.o("div",{class:"flex items-center gap-2",children:[s.o("div",{class:"relative flex min-w-0 flex-1 flex-grow gap-2",children:[s.o("label",{class:"text-neutral-12 bg-lowest hover:bg-neutral-5 placeholder:text-neutral-8 focus-visible:outline-accent-7 focus-within:bg-neutral-5 focus-within:outline-accent-7 outline-divider relative flex h-full cursor-pointer appearance-none items-center justify-center overflow-hidden text-ellipsis whitespace-nowrap rounded-l-full border-solid px-3 py-1.5 text-center text-base outline outline-2 transition-all focus-within:outline-none",htmlFor:`isdk_phone_${e.key}`,children:[s.o("span",{children:["+",w]}),s.o("select",{...l("countryCode",{}),id:`isdk_phone_${e.key}`,class:"absolute inset-0 opacity-0",children:Object.entries(yt).map(([_,S])=>s.o("option",{value:S,children:[_," (+",S,")"]},_))})]}),s.o("input",{...p,id:"chat-input",type:"tel",inputMode:"tel",autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:_=>{_&&(y.current=_),g(_)},class:Le({optional:e.config.optional,className:"min-w-0 flex-1 rounded-r-full"}),placeholder:e.config.placeholder}),e.config.optional&&s.o(be,{class:"absolute bottom-0 right-1 top-0",onClick:()=>r(null)})]}),s.o(_e,{})]}),s.o(De,{error:h.countryCode||h.phoneNumber||{message:a}})]})},Je=e=>e===void 0?0:Math.max(0,Math.ceil((e-Date.now())/1e3)),Es=({input:e,onSubmitSuccess:r})=>{const{t}=s.useTranslation(),{availableAt:n}=e.config,[a,o]=s.h(()=>Je(n)),[i,l]=s.h("");s.p(()=>{const h=Je(n);if(o(h),h===0)return;l(t("submission_cooldown",{count:h}));const v=setInterval(()=>{const g=Je(n);o(g),!(g>0)&&(clearInterval(v),l(t("submission_cooldown_ready")))},250);return()=>clearInterval(v)},[n,t]);const c=a>0;return s.o("div",{class:"flex flex-col items-center gap-2 py-3",children:[s.o("button",{class:"bg-accent-9 hover:bg-accent-10 active:bg-submit-bg-active hover:border-accent-10 active:border-submit-bg-active border-accent-9 ring-accent-6 focus-visible:outline-accent-8 ring-offset-neutral-1 aria-disabled:hover:bg-accent-9 aria-disabled:hover:border-accent-9 flex cursor-pointer rounded-full border border-solid px-5 py-3 pr-4 text-white outline-none ring-1 ring-offset-[1.5px] transition-all duration-300 focus-visible:outline-2 active:ring-2 active:ring-offset-2 aria-disabled:cursor-not-allowed aria-disabled:opacity-50 aria-disabled:active:ring-1 aria-disabled:active:ring-offset-[1.5px]",name:e.key,"aria-disabled":c,"aria-describedby":c?"submit-cooldown":void 0,onClick:()=>{Je(n)>0||r(null)},children:s.o("span",{class:"flex items-center gap-1.5",children:[s.o("span",{class:"inline-flex items-center text-sm font-medium",children:e.config.label||"Submit"}),s.o("svg",{stroke:"currentColor","stroke-width":"1.5",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[s.o("path",{d:"M4 8L8 4L12 8"}),s.o("path",{d:"M8 4V13"})]})]})}),c&&s.o("p",{id:"submit-cooldown","aria-hidden":"true",class:"text-neutral-11 text-xs",children:t("submission_cooldown",{count:a})}),s.o("p",{role:"status",class:"sr-only",children:i})]})},Ms=160,er=e=>{e.style.height="auto",e.style.height=`${Math.min(e.scrollHeight,Ms)}px`},Ts={date:{type:"date",inputMode:"text"},email:{type:"email",inputMode:"email",formNoValidate:!0},text:{type:"text",inputMode:"text"},url:{type:"url",inputMode:"url",formNoValidate:!0}},Ns=s.isSubmissionOfType("string"),Ls=(e,r)=>{const t={maxLength:r("validation_max_chars",{count:e.maxChars??999}),minLength:r("validation_min_chars",{count:e.minChars??1})};return rt(fe({text:{date:ge(re(r("validation_date")),ht(/^\d{4}-\d{2}-\d{2}$/,r("validation_date"))),email:ge(re(r("validation_email")),ir(r("validation_email")),Te(e.minChars??1,t.minLength),qe(e.maxChars??1/0,t.maxLength)),text:ge(re(),Te(e.minChars??1,t.minLength),qe(e.maxChars??1/0,t.maxLength)),url:ge(re(r("validation_url")),ur(r("validation_url")),Te(e.minChars??1,t.minLength),qe(e.maxChars??1/0,t.maxLength))}[e.format]}))},Ds=({input:e,onSubmitSuccess:r})=>{var F;const{t}=s.useTranslation(),n=e.key?(F=s.store.current$.value.flow)==null?void 0:F.data.submissions[e.key]:void 0,a=e.config.defaultValue,o=e.config.multiline===!0&&e.config.format==="text",{register:i,handleSubmit:l,watch:c,formState:{errors:h}}=tt({defaultValues:{text:Ns(n)?n.value:a??""},resolver:Ls(e.config,t)}),{ref:v,...g}=i("text",{required:!e.config.optional}),p=s._();s.y(()=>{p.current&&(p.current instanceof HTMLTextAreaElement&&er(p.current),p.current.focus(),p.current.select())},[]);const y=e.config.maxChars,w=o&&y!==void 0?c("text").length:void 0;return s.o("form",{noValidate:!0,class:"flex flex-col gap-1 p-2.5",onSubmit:l(_=>{r({type:"string",value:_.text})}),children:[s.o("div",{class:o?"flex items-end gap-2":"flex items-center gap-2",children:[s.o("div",{class:"relative min-w-0 flex-1",children:[o?s.o("textarea",{id:"chat-input",...g,rows:2,maxLength:y,autoFocus:!0,"aria-describedby":w!==void 0?"chat-input-count":void 0,onInput:_=>er(_.currentTarget),onKeyDown:_=>{var S;_.key==="Enter"&&(_.ctrlKey||_.metaKey)&&(_.preventDefault(),(S=_.currentTarget.form)==null||S.requestSubmit())},ref:_=>{_&&(p.current=_),v(_)},placeholder:e.config.placeholder,class:Le({optional:!!e.config.optional,className:"block w-full resize-none overflow-y-auto rounded-2xl"})}):s.o("input",{id:"chat-input",...g,...Ts[e.config.format],autocomplete:"off",autoCapitalize:"off",autoCorrect:"off",autoFocus:!0,ref:_=>{_&&(p.current=_),v(_)},placeholder:e.config.placeholder,class:Le({optional:!!e.config.optional,className:"w-full rounded-full"})}),e.config.optional&&s.o(be,{class:o?"absolute bottom-1 right-0.5":"absolute bottom-0 right-0.5 top-0",onClick:()=>r(null)})]}),s.o(_e,{})]}),w!==void 0&&y!==void 0&&s.o("p",{id:"chat-input-count",class:"text-neutral-10 px-3 text-right text-xs",children:[w,"/",y]}),s.o(De,{error:h.text})]})},Os={text:Ds,phone:Vs,"multiple-choice":vs,boolean:On,file:Un,submit:Es,address:Tn,number:_s},Rs=({logger:e,analytics:r})=>{var o;const t=(o=s.store.current$.value.flow)==null?void 0:o.data.currentInput,n=s._(null),a=()=>s.chatStore.onInteractionFn$.value();return s.y(()=>{var i;(i=n.current)==null||i.scrollTo({top:0})},[t]),s.o("div",{ref:n,class:"border-divider max-h-[calc(100%-var(--header-height)-4rem)] w-full shrink-0 scroll-pb-12 overflow-y-auto overscroll-contain border-t",children:s.o("div",{class:"flex flex-col",onPointerDownCapture:t?a:void 0,onKeyDownCapture:t?a:void 0,children:t?(()=>{const i=Os[t.type];return s.o(i,{logger:e,analytics:r,onSubmitSuccess:s.chatStore.onSubmitSuccessFn$.value,input:t})})():s.o("div",{class:"flex items-center gap-2 p-2.5",children:[s.o("input",{"aria-hidden":"true",id:"chat-input",class:Le({optional:!1,className:"flex-grow rounded-full"}),disabled:!0}),s.o(_e,{disabled:!0,"aria-hidden":"true",tabIndex:-1})]})})})};function Ps(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var js=function(e){return e instanceof RegExp},Bs=function(r){var t=/[\\^$.*+?()[\]{}|]/g,n=RegExp(t.source);return r&&n.test(r)?r.replace(t,"\\$&"):r},Fr=function(e){return typeof e=="string"},$s=function(e){var r=[];return e.forEach(function(t){Array.isArray(t)?r=r.concat(t):r.push(t)}),r};function qs(e,r,t){var n=0,a=0;if(e==="")return e;if(!e||!Fr(e))throw new TypeError("First argument to react-string-replace#replaceString must be a string");var o=r;js(o)||(o=new RegExp("("+Bs(o)+")","gi"));for(var i=e.split(o),l=1,c=i.length;l<c;l+=2){if(i[l]===void 0||i[l-1]===void 0){console.warn("reactStringReplace: Encountered undefined value during string replacement. Your RegExp may not be working the way you expect.");continue}a=i[l].length,n+=i[l-1].length,i[l]=t(i[l],l,n),n+=a}return i}var Us=function(r,t,n){return Array.isArray(r)||(r=[r]),$s(r.map(function(a){return Fr(a)?qs(a,t,n):a}))};const Be=Ps(Us),zs=/(\[[^\]]+\]\([^)]+\))/g,Ks=/\[([^\]]+)\]\(([^)]+)\)/,Ws=/(https?:\/\/[^\s]+)/g,Gs=/_(.*?)_/g,Hs=/\*\*(.*?)\*\*/g,Js=/\\n|\n/g,tr="text-accent-10 hover:text-accent-11 no-underline underline-offset-2 hover:underline",Zs=e=>{const r=Be(e,zs,(i,l)=>{const[,c,h]=i.match(Ks)??[];return h?s.o("a",{class:tr,href:h,children:c??h},h+l):s.o("span",{children:"INVALID LINK"})}),t=Be(r,Ws,(i,l)=>s.o("a",{class:tr,href:i,children:i},i+l)),n=Be(t,Gs,(i,l)=>s.o("em",{children:i},i+l)),a=Be(n,Hs,(i,l)=>s.o("strong",{children:i},i+l));return Be(a,Js,(i,l)=>s.o("br",{},`br-${l}`))},Xs=s.cva("select-text max-w-[min(100%,24rem)] [text-wrap:pretty] leading-snug flex-shrink min-w-[2rem] py-2 px-3 rounded-[18px] min-h-[36px] break-words relative",{variants:{side:{left:"bg-bubble-weak-bg text-neutral-12 shadow-surface-sm outline outline-1 outline-bubble-weak rounded-bl-md",right:"ml-auto bg-accent-9 text-white rounded-br-md shadow-surface-sm shadow-bubble-strong-shadow"},animate:{true:"animate-bubble-in",false:""}},defaultVariants:{side:"left"}}),Ys=({children:e,className:r,animate:t,side:n,...a})=>s.o("p",{style:{transformOrigin:n==="left"?"0% 50%":"100% 50%"},class:Xs({className:r,side:n,animate:t}),...a,children:e}),Qs=({message:e})=>s.o("div",{class:"bg-accent-3 flex w-full items-center justify-center overflow-hidden rounded-xl px-2 py-2",children:s.o("a",{onClick:e.onClick,class:"bg-lowest shadow-surface-sm ring-accent-6 hover:ring-accent-8 active:bg-accent-2 active:text-accent-10 text-accent-9 focus-visible:ring-accent-7/50 text-wrap-balance flex items-center gap-1.5 rounded-full py-2 pl-4 pr-2.5 text-center no-underline ring-1 transition-all focus:outline-none focus-visible:ring-4 focus-visible:ring-offset-2",target:"_blank",href:e.href,children:[e.text,s.o("svg",{class:"flex-none",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.o("path",{d:"M3.64645 11.3536C3.45118 11.1583 3.45118 10.8417 3.64645 10.6465L10.2929 4L6 4C5.72386 4 5.5 3.77614 5.5 3.5C5.5 3.22386 5.72386 3 6 3L11.5 3C11.6326 3 11.7598 3.05268 11.8536 3.14645C11.9473 3.24022 12 3.36739 12 3.5L12 9.00001C12 9.27615 11.7761 9.50001 11.5 9.50001C11.2239 9.50001 11 9.27615 11 9.00001V4.70711L4.35355 11.3536C4.15829 11.5488 3.84171 11.5488 3.64645 11.3536Z",fill:"currentColor","fill-rule":"evenodd","clip-rule":"evenodd"})})]})}),ea=({className:e,...r})=>s.o("div",{"aria-hidden":!0,children:s.chatStore.isBotTyping$.value===!0?s.o("div",{"data-testid":"typing-indicator",class:s.clsx("flex gap-1 p-4",e),...r,children:Array.from({length:3},(t,n)=>s.o("div",{class:"bg-accent-9 h-1.5 w-1.5 animate-bounce rounded-full",style:{animationDelay:`${-n*200}ms`}}))}):void 0}),ta={bot:"left",user:"right"},ra=s.cva("w-full select-none py-2 text-wrap-balance text-center text-[10px] uppercase tracking-widest drop-shadow-[0_1.5px_var(--i-color-n-1)]",{variants:{variant:{info:"text-neutral-11",warning:"text-system-warning",error:"text-error-11",success:"text-system-success"}}}),na=({lastSentMessageFooter:e})=>{const{t:r}=s.useTranslation(),t=s.store.current$.value.flow,n=(t==null?void 0:t.data.messages)??[],a=t?s.getCorrectionNodeId(t):void 0;return s.o("ol",{"aria-label":r("chat_messages"),"aria-live":"polite",class:"mt-auto flex flex-col justify-end gap-2 p-2 pt-[calc(var(--header-height)+1rem)]",children:[n.map((o,i)=>s.o(s.k,{children:s.o("li",{class:"flex",tabIndex:i===n.length-1?-1:void 0,children:[a&&o.groupId===a&&!n.slice(i+1).some(l=>l.groupId===a)?e:null,s.M(o).with({type:"system"},l=>s.o("p",{class:ra({variant:l.variant}),children:l.text})).with({type:"text",author:s.z.union("bot","user")},l=>{const c=i===n.length-1,h=l.author==="bot"?Zs(l.text):l.text;return s.o(s.k,{children:s.o(Ys,{animate:c,side:ta[l.author],children:h},i)})}).with({type:"link"},l=>s.o(Qs,{message:l})).with({type:"image"},l=>s.o("img",{class:"shadow-surface-md w-full max-w-[min(100%,24rem)] rounded-2xl",src:l.url,style:{aspectRatio:l.width/l.height}})).with({type:"file"},l=>s.o(jn,{class:l.author==="bot"?void 0:"ml-auto",file:{name:l.fileName,sizeKb:l.fileSizeKb}})).with({type:"loading"},l=>{const c=n[n.length-1];return!(l===c)||s.chatStore.isBotTyping$.value?null:s.o("div",{class:"flex flex-grow flex-col items-center justify-center gap-2",children:[s.o(s.LoadingIndicator,{"aria-hidden":l.text?"true":void 0,class:"text-neutral-6 h-8 w-8"}),l.text?s.o("p",{role:"status",class:"text-neutral-11 text-sm",children:l.text}):null]})}).exhaustive()]})},i)),s.o("li",{class:s.chatStore.captchaVisible$.value?"flex":"hidden",children:s.o("div",{"data-captcha-slot":!0,tabIndex:-1,role:"group","aria-label":r("captcha_check"),class:"w-full max-w-[min(100%,24rem)] rounded-md"})},"captcha"),s.o(ea,{},"typing")]})},sa=({logger:e,apiClient:r,analytics:t,talentBankClient:n})=>{const{flow:a}=s.store.current$.value;s.invariant(a,"Flow is required to exist to show chatbot body");const o=s.store.viewState$.value,{chatRef:i,chatService:l}=s.useChatService(),{t:c}=s.useTranslation(),[h,v]=s.h();return s.y(()=>{o==="maximised"&&s.chatStore.scrollToEnd()},[o]),s.y(()=>{var m;const{state:g,flow:p}=s.store.current$.peek();if(g!=="loaded")throw new Error(c("invalid_state"));let y=p.data.nodeHistory.at(-1);if(s.chatStore.scrollToEnd(),s.store.setInput(void 0),p.data.isFinished)return;const w=()=>{const C=s.store.current$.peek().flow;!C||C.data.hasInteracted||(s.store.markAsInteracted(),Ft(t,C,"FLOW_INTERACT"))};s.chatStore.onInteractionFn$.value=w,y===void 0?(y=s.getHeadOrThrow(a.nodes).id,s.store.setCurrentNodeId(y),Ft(t,p,"FLOW_START")):s.store.removeMessagesSentByNodeIds([y]);const{interpret:F,abort:_,undo:S}=Kr({context:a.context,analytics:{service:t,customProperties:(m=a.analytics)==null?void 0:m.customProperties},apiClient:r,logger:e,talentBankClient:n,flow:a,chatService:l,t:c,getApplicationRecovery:()=>{var C;return(C=s.store.current$.peek().flow)==null?void 0:C.data.applicationRecovery},setApplicationRecovery:s.store.setApplicationRecovery,persistWriteBarrier:()=>s.store.persistWriteBarrier(p),getSubmissions:()=>{var C;return(C=s.store.current$.peek().flow)==null?void 0:C.data.submissions},onInterpret:C=>s.store.setCurrentNodeId(C.id),onFlowEnd:async()=>{var A;s.store.markAsFinished();const C=s.store.current$.peek().flow;s.invariant(C),t.log({event:"FLOW_END",properties:{flow_id:a.id,flow_version:a.version,flow_session_id:C.data.flowSessionId,flow_build:a.build,job:a.job},customProperties:(A=a.analytics)==null?void 0:A.customProperties})}});return v(()=>S),F(y),()=>{s.chatStore.onInteractionFn$.value===w&&(s.chatStore.onInteractionFn$.value=()=>{}),_()}},[t,r,l,e,a,n,c]),s.o(s.k,{children:[s.o("div",{class:"relative flex min-h-0 w-full max-w-full flex-grow flex-col",children:[s.o("div",{ref:i,role:"region","aria-label":c("conversation_history"),tabIndex:0,className:"hide-scrollbars fr flex min-h-0 w-full max-w-full flex-grow flex-col overflow-y-auto ring-inset",style:{WebkitOverflowScrolling:"touch"},children:s.o(na,{lastSentMessageFooter:!s.getCorrectionNodeId(a)||!h?null:s.o(aa,{undoFn:h})})}),s.chatStore.isReadingHistory$.value&&!a.data.isFinished&&!s.chatStore.isBotTyping$.value&&s.o("div",{class:"absolute bottom-2 left-1/2 -translate-x-1/2",children:s.o(s.SvgIconButton,{class:"bg-neutral-1 ring-divider shadow-surface-md ring-1","aria-label":c("jump_to_current"),onClick:()=>{var p,y;s.chatStore.scrollToEnd(),(y=((p=i.current)==null?void 0:p.querySelector('li[tabindex="-1"]'))??i.current)==null||y.focus({preventScroll:!0})},children:s.o(s.ChevronDown,{})})})]}),s.o(Rs,{logger:e,analytics:t})]})},aa=({undoFn:e})=>{const{t:r}=s.useTranslation();return s.o("div",{class:"flex flex-1 items-center justify-end px-1",children:s.o(s.SvgIconButton,{"aria-label":r("undo"),onClick:async()=>{const{flow:t}=s.store.current$.peek();s.invariant(t),e(t.data.nodeHistory)},children:s.o("path",{d:"M3 13h2.67l6.66-6.67a1.9 1.9 0 0 0 0-2.66 1.91 1.91 0 0 0-2.66 0L3 10.33V13Zm4.6-7.25 2.67 2.67"})})})};exports.ChatbotBody=sa;
|
package/dist/chatbot.state.d.ts
CHANGED
|
@@ -96,6 +96,7 @@ export declare const store: {
|
|
|
96
96
|
submitKeys: "all" | string[];
|
|
97
97
|
key?: string | undefined;
|
|
98
98
|
successMessage?: string | undefined;
|
|
99
|
+
captcha?: boolean | undefined;
|
|
99
100
|
};
|
|
100
101
|
isHead?: boolean | undefined;
|
|
101
102
|
nextId?: string | undefined;
|
|
@@ -154,6 +155,7 @@ export declare const store: {
|
|
|
154
155
|
placeholder?: string | undefined;
|
|
155
156
|
maxChars?: number | undefined;
|
|
156
157
|
minChars?: number | undefined;
|
|
158
|
+
multiline?: boolean | undefined;
|
|
157
159
|
};
|
|
158
160
|
isHead?: boolean | undefined;
|
|
159
161
|
nextId?: string | undefined;
|
package/dist/chatbot.utils.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
|
55
55
|
submitKeys: "all" | string[];
|
|
56
56
|
key?: string | undefined;
|
|
57
57
|
successMessage?: string | undefined;
|
|
58
|
+
captcha?: boolean | undefined;
|
|
58
59
|
};
|
|
59
60
|
isHead?: boolean | undefined;
|
|
60
61
|
nextId?: string | undefined;
|
|
@@ -113,6 +114,7 @@ export declare const getHeadOrThrow: (nodes: FlowNode[]) => {
|
|
|
113
114
|
placeholder?: string | undefined;
|
|
114
115
|
maxChars?: number | undefined;
|
|
115
116
|
minChars?: number | undefined;
|
|
117
|
+
multiline?: boolean | undefined;
|
|
116
118
|
};
|
|
117
119
|
isHead?: boolean | undefined;
|
|
118
120
|
nextId?: string | undefined;
|
|
@@ -12,6 +12,8 @@ export type TextPayload = {
|
|
|
12
12
|
defaultValue?: string;
|
|
13
13
|
maxChars: number | undefined;
|
|
14
14
|
minChars: number | undefined;
|
|
15
|
+
/** Long answer: a box that grows with its content. Only honoured for `format: 'text'`. */
|
|
16
|
+
multiline?: boolean;
|
|
15
17
|
};
|
|
16
18
|
submission: FlowSubmissionString | null;
|
|
17
19
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -5,6 +5,9 @@ export declare const chatStore: {
|
|
|
5
5
|
onSubmitSuccessFn$: import('@preact/signals').Signal<SubmitSuccessFn>;
|
|
6
6
|
onInteractionFn$: import('@preact/signals').Signal<() => void>;
|
|
7
7
|
isBotTyping$: import('@preact/signals').Signal<boolean>;
|
|
8
|
+
/** A Turnstile challenge is waiting for the candidate in the conversation (PROD-7320). */
|
|
9
|
+
captchaVisible$: import('@preact/signals').Signal<boolean>;
|
|
10
|
+
themeMode$: import('@preact/signals').Signal<"light" | "dark">;
|
|
8
11
|
isReadingHistory$: import('@preact/signals').Signal<boolean>;
|
|
9
12
|
scrollToEnd: () => void;
|
|
10
13
|
};
|
package/dist/i18n.d.ts
CHANGED
|
@@ -14,12 +14,14 @@ export declare const TranslationProvider: (props: {
|
|
|
14
14
|
readonly submission_retryable: "We couldn't submit your application. Please try again.";
|
|
15
15
|
readonly submission_failed: "We couldn't submit your application. Choose Restart to try again.";
|
|
16
16
|
readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
|
|
17
|
+
readonly submission_unknown_do_not_resubmit: "We couldn't confirm whether your application went through, and submitting it again won't help. Please don't keep resubmitting — check your email for a confirmation, or contact the employer if nothing arrives.";
|
|
17
18
|
readonly submission_unreadable_document: "We couldn't read that file. Please upload a different one.";
|
|
18
19
|
readonly submission_cooldown: {
|
|
19
20
|
readonly one: "Submit will be available again in {{count}} second.";
|
|
20
21
|
readonly other: "Submit will be available again in {{count}} seconds.";
|
|
21
22
|
};
|
|
22
23
|
readonly submission_cooldown_ready: "Submit is available again.";
|
|
24
|
+
readonly captcha_check: "One quick check before we send your application";
|
|
23
25
|
readonly submission_still_working: "Still working — the employer's application system is taking a little longer than usual. Please keep this window open.";
|
|
24
26
|
readonly file_preparing: {
|
|
25
27
|
readonly one: "Preparing your file…";
|
|
@@ -35,11 +37,22 @@ export declare const TranslationProvider: (props: {
|
|
|
35
37
|
readonly address_searching: "Searching addresses…";
|
|
36
38
|
readonly address_no_results: "We couldn't find that address. Check the spelling or postcode, or fill it in manually.";
|
|
37
39
|
readonly maximize: "Maximise";
|
|
40
|
+
readonly restart: "Restart";
|
|
41
|
+
readonly chat_messages: "Chat messages";
|
|
42
|
+
readonly file_name: "File name";
|
|
43
|
+
readonly file_size: "File size";
|
|
44
|
+
readonly file_total_size: "{{size}} total";
|
|
45
|
+
readonly file_more: {
|
|
46
|
+
readonly one: "+{{count}} file";
|
|
47
|
+
readonly other: "+{{count}} files";
|
|
48
|
+
};
|
|
49
|
+
readonly loading: "Loading";
|
|
38
50
|
readonly minimize: "Minimise";
|
|
39
51
|
readonly submission_redirect_message: "Almost there! Please complete your submission here:";
|
|
40
52
|
readonly complete_submission: "Complete submission";
|
|
41
53
|
readonly submission_completed: "Submission completed!";
|
|
42
54
|
readonly submission_pending: "Thanks, we've received your application and are processing it.";
|
|
55
|
+
readonly captcha_failed: "Cloudflare seems to think you're a robot. If that's not the case, please try again in a moment.";
|
|
43
56
|
readonly close_application: "Close application";
|
|
44
57
|
readonly invalid_state: "Invalid application state";
|
|
45
58
|
readonly redirect_url_error: "Couldn\u2019t get the redirect URL.";
|
|
@@ -114,12 +127,14 @@ export declare const TranslationProvider: (props: {
|
|
|
114
127
|
readonly submission_retryable: "We couldn't submit your application. Please try again.";
|
|
115
128
|
readonly submission_failed: "We couldn't submit your application. Choose Restart to try again.";
|
|
116
129
|
readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
|
|
130
|
+
readonly submission_unknown_do_not_resubmit: "We couldn't confirm whether your application went through, and submitting it again won't help. Please don't keep resubmitting — check your email for a confirmation, or contact the employer if nothing arrives.";
|
|
117
131
|
readonly submission_unreadable_document: "We couldn't read that file. Please upload a different one.";
|
|
118
132
|
readonly submission_cooldown: {
|
|
119
133
|
readonly one: "Submit will be available again in {{count}} second.";
|
|
120
134
|
readonly other: "Submit will be available again in {{count}} seconds.";
|
|
121
135
|
};
|
|
122
136
|
readonly submission_cooldown_ready: "Submit is available again.";
|
|
137
|
+
readonly captcha_check: "One quick check before we send your application";
|
|
123
138
|
readonly submission_still_working: "Still working — the employer's application system is taking a little longer than usual. Please keep this window open.";
|
|
124
139
|
readonly file_preparing: {
|
|
125
140
|
readonly one: "Preparing your file…";
|
|
@@ -135,11 +150,22 @@ export declare const TranslationProvider: (props: {
|
|
|
135
150
|
readonly address_searching: "Searching addresses…";
|
|
136
151
|
readonly address_no_results: "We couldn't find that address. Check the spelling or postcode, or fill it in manually.";
|
|
137
152
|
readonly maximize: "Maximise";
|
|
153
|
+
readonly restart: "Restart";
|
|
154
|
+
readonly chat_messages: "Chat messages";
|
|
155
|
+
readonly file_name: "File name";
|
|
156
|
+
readonly file_size: "File size";
|
|
157
|
+
readonly file_total_size: "{{size}} total";
|
|
158
|
+
readonly file_more: {
|
|
159
|
+
readonly one: "+{{count}} file";
|
|
160
|
+
readonly other: "+{{count}} files";
|
|
161
|
+
};
|
|
162
|
+
readonly loading: "Loading";
|
|
138
163
|
readonly minimize: "Minimise";
|
|
139
164
|
readonly submission_redirect_message: "Almost there! Please complete your submission here:";
|
|
140
165
|
readonly complete_submission: "Complete submission";
|
|
141
166
|
readonly submission_completed: "Submission completed!";
|
|
142
167
|
readonly submission_pending: "Thanks, we've received your application and are processing it.";
|
|
168
|
+
readonly captcha_failed: "Cloudflare seems to think you're a robot. If that's not the case, please try again in a moment.";
|
|
143
169
|
readonly close_application: "Close application";
|
|
144
170
|
readonly invalid_state: "Invalid application state";
|
|
145
171
|
readonly redirect_url_error: "Couldn\u2019t get the redirect URL.";
|
|
@@ -211,12 +237,14 @@ export declare const TranslationProvider: (props: {
|
|
|
211
237
|
readonly submission_retryable: "We couldn't submit your application. Please try again.";
|
|
212
238
|
readonly submission_failed: "We couldn't submit your application. Choose Restart to try again.";
|
|
213
239
|
readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
|
|
240
|
+
readonly submission_unknown_do_not_resubmit: "We couldn't confirm whether your application went through, and submitting it again won't help. Please don't keep resubmitting — check your email for a confirmation, or contact the employer if nothing arrives.";
|
|
214
241
|
readonly submission_unreadable_document: "We couldn't read that file. Please upload a different one.";
|
|
215
242
|
readonly submission_cooldown: {
|
|
216
243
|
readonly one: "Submit will be available again in {{count}} second.";
|
|
217
244
|
readonly other: "Submit will be available again in {{count}} seconds.";
|
|
218
245
|
};
|
|
219
246
|
readonly submission_cooldown_ready: "Submit is available again.";
|
|
247
|
+
readonly captcha_check: "One quick check before we send your application";
|
|
220
248
|
readonly submission_still_working: "Still working — the employer's application system is taking a little longer than usual. Please keep this window open.";
|
|
221
249
|
readonly file_preparing: {
|
|
222
250
|
readonly one: "Preparing your file…";
|
|
@@ -232,11 +260,22 @@ export declare const TranslationProvider: (props: {
|
|
|
232
260
|
readonly address_searching: "Searching addresses…";
|
|
233
261
|
readonly address_no_results: "We couldn't find that address. Check the spelling or postcode, or fill it in manually.";
|
|
234
262
|
readonly maximize: "Maximise";
|
|
263
|
+
readonly restart: "Restart";
|
|
264
|
+
readonly chat_messages: "Chat messages";
|
|
265
|
+
readonly file_name: "File name";
|
|
266
|
+
readonly file_size: "File size";
|
|
267
|
+
readonly file_total_size: "{{size}} total";
|
|
268
|
+
readonly file_more: {
|
|
269
|
+
readonly one: "+{{count}} file";
|
|
270
|
+
readonly other: "+{{count}} files";
|
|
271
|
+
};
|
|
272
|
+
readonly loading: "Loading";
|
|
235
273
|
readonly minimize: "Minimise";
|
|
236
274
|
readonly submission_redirect_message: "Almost there! Please complete your submission here:";
|
|
237
275
|
readonly complete_submission: "Complete submission";
|
|
238
276
|
readonly submission_completed: "Submission completed!";
|
|
239
277
|
readonly submission_pending: "Thanks, we've received your application and are processing it.";
|
|
278
|
+
readonly captcha_failed: "Cloudflare seems to think you're a robot. If that's not the case, please try again in a moment.";
|
|
240
279
|
readonly close_application: "Close application";
|
|
241
280
|
readonly invalid_state: "Invalid application state";
|
|
242
281
|
readonly redirect_url_error: "Couldn\u2019t get the redirect URL.";
|
|
@@ -311,12 +350,14 @@ export declare const TranslationProvider: (props: {
|
|
|
311
350
|
readonly submission_retryable: "We couldn't submit your application. Please try again.";
|
|
312
351
|
readonly submission_failed: "We couldn't submit your application. Choose Restart to try again.";
|
|
313
352
|
readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
|
|
353
|
+
readonly submission_unknown_do_not_resubmit: "We couldn't confirm whether your application went through, and submitting it again won't help. Please don't keep resubmitting — check your email for a confirmation, or contact the employer if nothing arrives.";
|
|
314
354
|
readonly submission_unreadable_document: "We couldn't read that file. Please upload a different one.";
|
|
315
355
|
readonly submission_cooldown: {
|
|
316
356
|
readonly one: "Submit will be available again in {{count}} second.";
|
|
317
357
|
readonly other: "Submit will be available again in {{count}} seconds.";
|
|
318
358
|
};
|
|
319
359
|
readonly submission_cooldown_ready: "Submit is available again.";
|
|
360
|
+
readonly captcha_check: "One quick check before we send your application";
|
|
320
361
|
readonly submission_still_working: "Still working — the employer's application system is taking a little longer than usual. Please keep this window open.";
|
|
321
362
|
readonly file_preparing: {
|
|
322
363
|
readonly one: "Preparing your file…";
|
|
@@ -332,11 +373,22 @@ export declare const TranslationProvider: (props: {
|
|
|
332
373
|
readonly address_searching: "Searching addresses…";
|
|
333
374
|
readonly address_no_results: "We couldn't find that address. Check the spelling or postcode, or fill it in manually.";
|
|
334
375
|
readonly maximize: "Maximise";
|
|
376
|
+
readonly restart: "Restart";
|
|
377
|
+
readonly chat_messages: "Chat messages";
|
|
378
|
+
readonly file_name: "File name";
|
|
379
|
+
readonly file_size: "File size";
|
|
380
|
+
readonly file_total_size: "{{size}} total";
|
|
381
|
+
readonly file_more: {
|
|
382
|
+
readonly one: "+{{count}} file";
|
|
383
|
+
readonly other: "+{{count}} files";
|
|
384
|
+
};
|
|
385
|
+
readonly loading: "Loading";
|
|
335
386
|
readonly minimize: "Minimise";
|
|
336
387
|
readonly submission_redirect_message: "Almost there! Please complete your submission here:";
|
|
337
388
|
readonly complete_submission: "Complete submission";
|
|
338
389
|
readonly submission_completed: "Submission completed!";
|
|
339
390
|
readonly submission_pending: "Thanks, we've received your application and are processing it.";
|
|
391
|
+
readonly captcha_failed: "Cloudflare seems to think you're a robot. If that's not the case, please try again in a moment.";
|
|
340
392
|
readonly close_application: "Close application";
|
|
341
393
|
readonly invalid_state: "Invalid application state";
|
|
342
394
|
readonly redirect_url_error: "Couldn\u2019t get the redirect URL.";
|
|
@@ -408,12 +460,14 @@ export declare const TranslationProvider: (props: {
|
|
|
408
460
|
readonly submission_retryable: "We couldn't submit your application. Please try again.";
|
|
409
461
|
readonly submission_failed: "We couldn't submit your application. Choose Restart to try again.";
|
|
410
462
|
readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
|
|
463
|
+
readonly submission_unknown_do_not_resubmit: "We couldn't confirm whether your application went through, and submitting it again won't help. Please don't keep resubmitting — check your email for a confirmation, or contact the employer if nothing arrives.";
|
|
411
464
|
readonly submission_unreadable_document: "We couldn't read that file. Please upload a different one.";
|
|
412
465
|
readonly submission_cooldown: {
|
|
413
466
|
readonly one: "Submit will be available again in {{count}} second.";
|
|
414
467
|
readonly other: "Submit will be available again in {{count}} seconds.";
|
|
415
468
|
};
|
|
416
469
|
readonly submission_cooldown_ready: "Submit is available again.";
|
|
470
|
+
readonly captcha_check: "One quick check before we send your application";
|
|
417
471
|
readonly submission_still_working: "Still working — the employer's application system is taking a little longer than usual. Please keep this window open.";
|
|
418
472
|
readonly file_preparing: {
|
|
419
473
|
readonly one: "Preparing your file…";
|
|
@@ -429,11 +483,22 @@ export declare const TranslationProvider: (props: {
|
|
|
429
483
|
readonly address_searching: "Searching addresses…";
|
|
430
484
|
readonly address_no_results: "We couldn't find that address. Check the spelling or postcode, or fill it in manually.";
|
|
431
485
|
readonly maximize: "Maximise";
|
|
486
|
+
readonly restart: "Restart";
|
|
487
|
+
readonly chat_messages: "Chat messages";
|
|
488
|
+
readonly file_name: "File name";
|
|
489
|
+
readonly file_size: "File size";
|
|
490
|
+
readonly file_total_size: "{{size}} total";
|
|
491
|
+
readonly file_more: {
|
|
492
|
+
readonly one: "+{{count}} file";
|
|
493
|
+
readonly other: "+{{count}} files";
|
|
494
|
+
};
|
|
495
|
+
readonly loading: "Loading";
|
|
432
496
|
readonly minimize: "Minimise";
|
|
433
497
|
readonly submission_redirect_message: "Almost there! Please complete your submission here:";
|
|
434
498
|
readonly complete_submission: "Complete submission";
|
|
435
499
|
readonly submission_completed: "Submission completed!";
|
|
436
500
|
readonly submission_pending: "Thanks, we've received your application and are processing it.";
|
|
501
|
+
readonly captcha_failed: "Cloudflare seems to think you're a robot. If that's not the case, please try again in a moment.";
|
|
437
502
|
readonly close_application: "Close application";
|
|
438
503
|
readonly invalid_state: "Invalid application state";
|
|
439
504
|
readonly redirect_url_error: "Couldn\u2019t get the redirect URL.";
|
|
@@ -506,12 +571,14 @@ export declare const TranslationProvider: (props: {
|
|
|
506
571
|
readonly submission_retryable: "We couldn't submit your application. Please try again.";
|
|
507
572
|
readonly submission_failed: "We couldn't submit your application. Choose Restart to try again.";
|
|
508
573
|
readonly submission_unknown: "We couldn't confirm whether your application was sent. Please check your email for a confirmation. If nothing arrives, choose Restart to apply again.";
|
|
574
|
+
readonly submission_unknown_do_not_resubmit: "We couldn't confirm whether your application went through, and submitting it again won't help. Please don't keep resubmitting — check your email for a confirmation, or contact the employer if nothing arrives.";
|
|
509
575
|
readonly submission_unreadable_document: "We couldn't read that file. Please upload a different one.";
|
|
510
576
|
readonly submission_cooldown: {
|
|
511
577
|
readonly one: "Submit will be available again in {{count}} second.";
|
|
512
578
|
readonly other: "Submit will be available again in {{count}} seconds.";
|
|
513
579
|
};
|
|
514
580
|
readonly submission_cooldown_ready: "Submit is available again.";
|
|
581
|
+
readonly captcha_check: "One quick check before we send your application";
|
|
515
582
|
readonly submission_still_working: "Still working — the employer's application system is taking a little longer than usual. Please keep this window open.";
|
|
516
583
|
readonly file_preparing: {
|
|
517
584
|
readonly one: "Preparing your file…";
|
|
@@ -527,11 +594,22 @@ export declare const TranslationProvider: (props: {
|
|
|
527
594
|
readonly address_searching: "Searching addresses…";
|
|
528
595
|
readonly address_no_results: "We couldn't find that address. Check the spelling or postcode, or fill it in manually.";
|
|
529
596
|
readonly maximize: "Maximise";
|
|
597
|
+
readonly restart: "Restart";
|
|
598
|
+
readonly chat_messages: "Chat messages";
|
|
599
|
+
readonly file_name: "File name";
|
|
600
|
+
readonly file_size: "File size";
|
|
601
|
+
readonly file_total_size: "{{size}} total";
|
|
602
|
+
readonly file_more: {
|
|
603
|
+
readonly one: "+{{count}} file";
|
|
604
|
+
readonly other: "+{{count}} files";
|
|
605
|
+
};
|
|
606
|
+
readonly loading: "Loading";
|
|
530
607
|
readonly minimize: "Minimise";
|
|
531
608
|
readonly submission_redirect_message: "Almost there! Please complete your submission here:";
|
|
532
609
|
readonly complete_submission: "Complete submission";
|
|
533
610
|
readonly submission_completed: "Submission completed!";
|
|
534
611
|
readonly submission_pending: "Thanks, we've received your application and are processing it.";
|
|
612
|
+
readonly captcha_failed: "Cloudflare seems to think you're a robot. If that's not the case, please try again in a moment.";
|
|
535
613
|
readonly close_application: "Close application";
|
|
536
614
|
readonly invalid_state: "Invalid application state";
|
|
537
615
|
readonly redirect_url_error: "Couldn\u2019t get the redirect URL.";
|