Files
copenlight/assets/new-request-form-bundle.js
Ivan Carlos de Almeida 6fa41a771d
Some checks failed
Build, Push, Publish / Build & Release (push) Failing after 2s
Sync Repo / sync (push) Failing after 2s
first load
2025-12-16 04:40:00 -03:00

112 lines
60 KiB
JavaScript
Generated
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import{r as e,j as n,b as t,c as s,O as r,p as a,s as o,u as i,g as l,h as u,i as c,P as d,A as f,n as h,k as m,F as j,l as p,I as b,m as k,K as w,o as g,q,t as x,S as v,v as y,$ as _,w as C,x as F,y as I,z as S,B as T,E as $,G as P,H as R,J as E,L as z,N as L,Q as A,R as D,U as M,V as N,W as U,X as B,Y as G,Z as H,_ as O,a0 as V,a1 as X,a2 as Y}from"shared";import{g as K,I as W,D as J,T as Z,R as Q}from"ticket-fields";const ee="return-focus-to-ticket-form-field";function ne({field:a,newRequestPath:o}){const i=e.createRef();return e.useEffect((()=>{sessionStorage.getItem(ee)&&(sessionStorage.removeItem(ee),i.current?.firstChild?.focus())}),[]),n.jsxs(n.Fragment,{children:[n.jsx("input",{type:"hidden",name:a.name,value:a.value}),a.options.length>1&&n.jsxs(t,{children:[n.jsx(t.Label,{children:a.label}),n.jsx(s,{isEditable:!1,onChange:({selectionValue:e})=>{if(e&&"number"==typeof e){const n=new URL(window.location.href);n.searchParams.set("ticket_form_id",e),sessionStorage.setItem(ee,"true"),window.location.assign(`${o}${n.search}`)}},ref:i,children:a.options.map((e=>n.jsx(r,{value:e.value,label:e.name,isSelected:a.value===e.value,children:e.name},e.value)))})]})]})}function te({field:e}){const{value:t,name:s}=e;return n.jsx("input",{type:"hidden",name:s,value:t})}async function se(){const e=await fetch("/api/v2/help_center/sessions.json"),{current_session:n}=await e.json();return n.csrf_token}const re=2048,ae="tf_",oe=/^\d{4}-\d{2}-\d{2}$/,ie=["true","false"],le=["pre","strong","b","p","blockquote","ul","ol","li","h2","h3","h4","i","em","br"];function ue(e,n){if(!Number.isNaN(Number(e))){const t=`request[custom_fields][${e}]`;return n.ticketFields.find((e=>e.name===t))}switch(e){case"anonymous_requester_email":return n.emailField;case"due_at":return n.dueDateField;case"collaborators":return n.ccField;case"organization_id":return n.organizationField;default:return n.ticketFields.find((n=>n.name===`request[${e}]`))}}function ce(e){if(!oe.test(e))return!1;const n=new Date(e),[t,s,r]=e.split("-").map(Number);return n.getUTCFullYear()===t&&n.getUTCMonth()+1===s&&n.getUTCDate()===r}function de({ticketFields:n,ccField:t,dueDateField:s,emailField:r,organizationField:o}){return e.useMemo((()=>function(e){const{href:n}=location,t=new URL(n).searchParams,s={...e,ticketFields:[...e.ticketFields]};if(n.length>re)return e;if(t.get("parent_id"))return e;for(const[e,n]of t){if(!e.startsWith(ae))continue;const t=ue(e.substring(ae.length),s);if(!t)continue;const r=a.sanitize(n,{ALLOWED_TAGS:le});switch(t.type){case"partialcreditcard":continue;case"multiselect":t.value=r.split(",").filter((e=>t.options.some((n=>n.value===e))));break;case"checkbox":ie.includes(r)&&(t.value="true"===r?"on":"false"===r?"off":"");break;case"due_at":case"date":ce(r)&&(t.value=r);break;default:t.value=r}}return s}({ticketFields:n,ccField:t,dueDateField:s,emailField:r,organizationField:o})),[n,t,s,r,o])}const fe=o.div`
flex: 1;
`;function he({file:e,onRemove:t}){const{t:s}=i(),r=e=>{"Enter"!==e.code&&"Space"!==e.code&&"Delete"!==e.code&&"Backspace"!==e.code||(e.preventDefault(),t())},a="pending"===e.status?e.file_name:e.value.file_name,o=s("new-request-form.attachments.stop-upload","Stop upload"),h=s("new-request-form.attachments.remove-file","Remove file");return n.jsx(l.Item,{children:n.jsx(u,{type:"generic",tabIndex:0,"aria-label":s("new-request-form.attachments.file","File: {{fileName}}, press delete to remove",{fileName:a}),onKeyDown:e=>{"Delete"!==e.code&&"Backspace"!==e.code&&"Enter"!==e.code||(e.preventDefault(),t())},onKeyUp:e=>{"Space"===e.code&&(e.preventDefault(),t())},children:"pending"===e.status?n.jsxs(n.Fragment,{children:[n.jsx(fe,{children:a}),n.jsx(c,{content:o,children:n.jsx(u.Close,{"aria-label":s("new-request-form.attachments.stop-upload-aria-label","Stop uploading {{fileName}}",{fileName:a}),"aria-describedby":void 0,onClick:()=>{t()},onKeyDown:r})}),n.jsx(d,{value:e.progress,"aria-label":s("new-request-form.attachments.uploading","Uploading {{fileName}}",{fileName:a})})]}):n.jsxs(n.Fragment,{children:[n.jsx(fe,{children:n.jsx(f,{isExternal:!0,href:e.value.url,target:"_blank",children:a})}),n.jsx(c,{content:h,children:n.jsx(u.Delete,{"aria-label":s("new-request-form.attachments.remove-file-aria-label","Remove file: {{fileName}}",{fileName:a}),"aria-describedby":void 0,onClick:()=>{t()},onKeyDown:r})}),n.jsx(d,{value:100,"aria-hidden":"true"})]})})})}async function me(){const e=await fetch("/api/v2/users/me.json"),{user:{authenticity_token:n}}=await e.json();return n}function je({field:t,baseLocale:s}){const{label:r,error:a,name:o,attachments:u}=t,{files:c,addPendingFile:d,setPendingFileProgress:f,setUploaded:k,removePendingFile:w,removeUploadedFile:g}=function(n){const[t,s]=e.useState(n);return{files:t,addPendingFile:e.useCallback(((e,n,t)=>{s((s=>[...s,{status:"pending",id:e,file_name:n,progress:0,xhr:t}]))}),[]),setPendingFileProgress:e.useCallback(((e,n)=>{s((t=>t.map((t=>"pending"===t.status&&t.id===e?{...t,progress:n}:t))))}),[]),removePendingFile:e.useCallback((e=>{s((n=>n.filter((n=>"pending"!==n.status||n.id!==e))))}),[]),removeUploadedFile:e.useCallback((e=>{s((n=>n.filter((n=>"uploaded"!==n.status||n.value.id!==e))))}),[]),setUploaded:e.useCallback(((e,n)=>{s((t=>t.map((t=>"pending"===t.status&&t.id===e?{status:"uploaded",value:n}:t))))}),[])}}(u.map((e=>({status:"uploaded",value:e})))??[]),{t:q}=i(),x=e.useCallback((e=>q("new-request-form.attachments.upload-failed-title","Upload failed",{fileName:e.name})),[q]),v=e.useCallback(((e,n)=>{if("RecordInvalid"==n.response?.error&&n.response?.details?.base){const t=n.response?.details?.base?.map((e=>e?.description)).join(q("new-request-form.attachments.error-separator","; "));return{title:x(e),errorMessage:t}}return"AttachmentFilenameTooLong"==n.response?.error||"AttachmentTooLarge"==n.response?.error?{title:x(e),errorMessage:n.response?.description}:{title:q("new-request-form.attachments.upload-error-title","Upload error"),errorMessage:q("new-request-form.attachments.upload-error-description","There was an error uploading {{fileName}}. Try again or upload another file.",{fileName:e.name})}}),[q,x]),y=e.useCallback(((e,n)=>{h({title:e,message:n,type:"error"})}),[]),_=e.useCallback((async e=>{const n=await me();for(const t of e){const e=new XMLHttpRequest,r=new URL(`${window.location.origin}/api/v2/uploads.json`);r.searchParams.append("filename",t.name),r.searchParams.append("locale",s),e.open("POST",r),t.type?e.setRequestHeader("Content-Type",t.type):e.setRequestHeader("Content-Type","application/octet-stream"),e.setRequestHeader("X-CSRF-Token",n),e.responseType="json";const a=crypto.randomUUID();d(a,t.name,e),e.upload.addEventListener("progress",(({loaded:e,total:n})=>{const t=Math.round(e/n*100);t<=90&&f(a,t)})),e.addEventListener("load",(()=>{if(e.status>=200&&e.status<300){const{upload:{attachment:{file_name:n,content_url:t},token:s}}=e.response;k(a,{id:s,file_name:n,url:t})}else{const{title:n,errorMessage:s}=v(t,e);y(n,s),w(a)}})),e.addEventListener("error",(()=>{const{title:n,errorMessage:s}=v(t,e);y(n,s),w(a)})),e.send(t)}}),[d,w,f,k,y,v,s]),{getRootProps:C,getInputProps:F,isDragActive:I}=m({onDrop:_});return n.jsxs(j,{children:[n.jsx(j.Label,{children:r}),a&&n.jsx(j.Message,{validation:"error",children:a}),n.jsxs(p,{...C(),isDragging:I,children:[I?n.jsx("span",{children:q("new-request-form.attachments.drop-files-label","Drop files here")}):n.jsx("span",{children:q("new-request-form.attachments.choose-file-label","Choose a file or drag and drop here")}),n.jsx(b,{...F()})]}),n.jsx(l,{children:c.map((e=>n.jsx(he,{file:e,onRemove:()=>{(async e=>{if("pending"===e.status)e.xhr.abort(),w(e.id);else{const n=await me(),t=e.value.id;g(e.value.id),await fetch(`/api/v2/uploads/${t}.json`,{method:"DELETE",headers:{"X-CSRF-Token":n}})}})(e)}},"pending"===e.status?e.id:e.value.id)))}),c.map((e=>"uploaded"===e.status&&n.jsx("input",{type:"hidden",name:o,value:JSON.stringify(e.value)},e.value.id)))]})}const pe=/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,be=o(q)`
padding: ${e=>`${e.theme.space.xxs} ${e.theme.space.sm}`};
// Removes white spaces for inline elements
font-size: 0;
// Same as height of Tag size="large" + base space (4px)
// to give some vertical space between tags
--line-height: ${e=>8*e.theme.space.base+e.theme.space.base}px;
line-height: var(--line-height);
`,ke=o.span`
display: inline-block;
margin-inline-end: ${e=>e.theme.space.sm};
`,we=o(x)`
${e=>g({theme:e.theme,shadowWidth:"sm",selector:"&:focus"})}
`,ge=o.div`
display: inline-block;
position: relative;
`,qe=o(q)`
display: inline-block;
min-width: 200px;
opacity: 0;
user-select: none;
height: var(--line-height);
line-height: var(--line-height);
`,xe=o(b)`
position: absolute;
top: 0;
left: 0;
height: var(--line-height);
line-height: var(--line-height);
`;function ve({field:t}){const{label:s,value:r,name:a,error:o,description:l}=t,{t:u}=i(),d=r?r.split(",").map((e=>e.trim())):[],[f,h]=e.useState(d),[m,p]=e.useState(""),b=e.useRef(null),g=e.useRef(null),{getContainerProps:q,getGridProps:_,getGridRowProps:C,getGridCellProps:F,getTagCloseProps:I,getInputProps:S,getAnnouncementProps:T,announcement:$}=function({tags:n,onTagsChange:t,inputValue:s,onInputValueChange:r,inputRef:a,gridRowRef:o,i18n:i}){const[l,u]=e.useState(0),[c,d]=e.useState(""),f=e.useCallback(((e,n)=>{u(n)}),[u]),{getGridProps:h,getGridCellProps:m}=k({matrix:[n],rowIndex:0,colIndex:l,onChange:f}),j=e=>n.includes(e),p=e=>{t([...n,e]),d(i.addedTag(e))},b=e=>{const s=n[e];t(n.filter(((n,t)=>t!==e))),d(i.removedTag(s)),u(0),setTimeout((()=>{const e=o.current?.querySelector('[tabindex="0"]');e?.focus()}),100)},g=e=>{e.target===e.currentTarget&&a.current?.focus()},q=()=>{u(0)},x=e=>{const n=e.target.value;!n||e.key!==w.SPACE&&e.key!==w.ENTER&&e.key!==w.TAB&&e.key!==w.COMMA||(e.preventDefault(),j(n)||p(n),r(""))},v=e=>{const n=e.target.value,[t,s]=[n.slice(0,-1),n.slice(-1)];" "===s||","===s?(t.length>0&&!j(t)&&p(t),r("")):r(n)},y=e=>{e.preventDefault();const s=e.clipboardData.getData("text"),r=new Set(s.split(/[\s,;]+/).filter((e=>!n.includes(e))));t([...n,...r]),d(i.addedTags([...r]))},_=e=>{const n=e.target.value;n&&(j(n)||p(n),r(""))},C=e=>n=>{"Backspace"===n.code&&(n.preventDefault(),b(e))},F=e=>()=>{b(e)};return{getContainerProps:()=>({onClick:g,onBlur:q,tabIndex:-1}),getGridProps:h,getGridRowProps:()=>({role:"row"}),getGridCellProps:e=>m({rowIndex:0,colIndex:e,onKeyDown:C(e)}),getTagCloseProps:e=>({onClick:F(e)}),getInputProps:()=>({value:s,onChange:v,onKeyDown:x,onPaste:y,onBlur:_}),announcement:c,getAnnouncementProps:()=>({"aria-live":"polite","aria-relevant":"text"})}}({tags:f,onTagsChange:h,inputValue:m,onInputValueChange:p,inputRef:b,gridRowRef:g,i18n:{addedTag:e=>u("new-request-form.cc-field.email-added","{{email}} has been added",{email:e}),removedTag:e=>u("new-request-form.cc-field.email-removed","{{email}} has been removed",{email:e}),addedTags:e=>u("new-request-form.cc-field.emails-added","{{emails}} have been added",{emails:e})}}),P=(e,t,s)=>n.jsxs(we,{size:"large","aria-label":u("new-request-form.cc-field.email-label","{{email}} - Press Backspace to remove",{email:s}),hue:t?void 0:"red",children:[!t&&n.jsx(x.Avatar,{children:n.jsx(y,{})}),n.jsx("span",{children:s}),n.jsx(x.Close,{...I(e)})]});return n.jsxs(j,{children:[n.jsx(j.Label,{children:s}),l&&n.jsx(j.Hint,{children:l}),n.jsxs(be,{...q(),children:[f.length>0&&n.jsx("span",{..._({"aria-label":u("new-request-form.cc-field.container-label","Selected CC emails")}),children:n.jsx("span",{ref:g,...C(),children:f.map(((e,t)=>{const s=pe.test(e);return s?n.jsx(ke,{...F(t),children:P(t,s,e)},t):n.jsx(c,{content:u("new-request-form.cc-field.invalid-email","Invalid email address"),children:n.jsx(ke,{...F(t),children:P(t,s,e)})},t)}))})}),n.jsxs(ge,{children:[n.jsx(qe,{isBare:!0,"aria-hidden":"true",tabIndex:-1,children:m}),n.jsx(xe,{ref:b,isBare:!0,...S()})]})]}),o&&n.jsx(j.Message,{validation:"error",children:o}),f.map((e=>n.jsx("input",{type:"hidden",name:a,value:e},e))),n.jsx(v,{hidden:!0,...T(),children:$})]})}const ye=_`
from {
grid-template-rows: 0fr;
}
to {
grid-template-rows: 1fr;
}
`,_e=o.div`
display: grid;
animation: ${ye} 200ms forwards;
`,Ce=o.div`
overflow: hidden;
`,Fe=o.ul`
list-style: none;
padding: 0;
margin: 0;
`,Ie=o.li`
margin: ${e=>e.theme.space.sm} 0;
`;function Se({query:t,locale:s}){const r=function(n,t){const[s,r]=e.useState(n);return e.useEffect((()=>{const e=setTimeout((()=>r(n)),t);return()=>{clearTimeout(e)}}),[n,t]),s}(t,500),[a,o]=e.useState([]),l=e.useRef({}),{t:u}=i();return e.useEffect((()=>{const e=r?.trim().toLocaleLowerCase();if(!e||!function(e){const n=e.charCodeAt(0);return n>=19968&&n<=195103?e.length>=2:e.length>=3}(e))return void o([]);const n=new URL(`${window.location.origin}/api/v2/help_center/deflection/suggestions.json`);n.searchParams.append("locale",s),n.searchParams.append("query",e);const t=l.current[n.toString()];t?o(t):fetch(n).then((e=>e.json())).then((({results:e})=>{l.current[n.toString()]=e,o(e)}))}),[r,s]),a.length>0?n.jsx(_e,{"data-test-id":"suggested-articles",children:n.jsxs(Ce,{children:[n.jsx("h2",{children:u("new-request-form.suggested-articles","Suggested articles")}),n.jsx(Fe,{children:a.map((e=>n.jsx(Ie,{children:n.jsx(f,{href:e.html_url,children:e.name})},e.html_url)))})]})}):null}const Te=o.h3`
font-size: ${e=>e.theme.fontSizes.md};
font-weight: ${e=>e.theme.fontWeights.bold};
`,$e=o(C.Header)`
color: ${({theme:e})=>F({theme:e,hue:"successHue",shade:700})};
`,Pe=o(I)`
position: absolute;
top: ${e=>5.5*e.theme.space.base}px;
inset-inline-start: ${e=>4*e.theme.space.base+"px"};
`,Re=o(f)`
display: inline-block;
margin-top: ${e=>e.theme.space.sm};
`;function Ee({authToken:t,interactionAccessToken:s,articles:r,requestId:a,hasRequestManagement:o,isSignedIn:l,helpCenterPath:u,requestsPath:c,requestPath:d}){const[f,h]=e.useState(0),m=S(),{t:j}=i(),p=()=>String(r[f]?.article_id),b=()=>{R({type:"success",message:j("new-request-form.answer-bot-modal.request-submitted","Your request was successfully submitted")}),window.location.assign((()=>{if(l)return o?d:u;{const e=new URLSearchParams;return e.set("return_to",c),`${u}?${e.toString()}`}})())};return n.jsxs(C,{appendToNode:m,onClose:()=>{b()},children:[n.jsxs($e,{tag:"h2",children:[n.jsx(Pe,{}),j("new-request-form.answer-bot-modal.request-submitted","Your request was successfully submitted")]}),n.jsxs(C.Body,{children:[n.jsx(Te,{children:j("new-request-form.answer-bot-modal.title","While you wait, do any of these articles answer your question?")}),n.jsx("p",{children:j("new-request-form.answer-bot-modal.footer-content","If it does, we can close your recent request {{requestId}}",{requestId:`#${a}`})}),n.jsx(T,{level:4,expandedSections:[f],onChange:e=>{h(e)},children:r.map((({article_id:e,html_url:s,snippet:r,title:a})=>n.jsxs(T.Section,{children:[n.jsx(T.Header,{children:n.jsx(T.Label,{children:a})}),n.jsxs(T.Panel,{children:[n.jsx($,{dangerouslySetInnerHTML:{__html:r}}),n.jsx(Re,{isExternal:!0,href:`${s}?auth_token=${t}`,target:"_blank",children:j("new-request-form.answer-bot-modal.view-article","View article")})]})]},e)))})]}),n.jsxs(C.Footer,{children:[n.jsx(C.FooterItem,{children:n.jsx(P,{onClick:()=>{(async()=>{await fetch("/api/v2/answer_bot/rejection",{method:"POST",body:JSON.stringify({article_id:p(),interaction_access_token:s,reason_id:0}),headers:{"Content-Type":"application/json"}}),b()})()},children:j("new-request-form.answer-bot-modal.mark-irrelevant","No, I need help")})}),n.jsx(C.FooterItem,{children:n.jsx(P,{isPrimary:!0,onClick:()=>{(async()=>{(await fetch("/api/v2/answer_bot/resolution",{method:"POST",body:JSON.stringify({article_id:p(),interaction_access_token:s}),headers:{"Content-Type":"application/json"}})).ok?R({type:"success",message:j("new-request-form.answer-bot-modal.request-closed","Nice. Your request has been closed.")}):R({type:"error",message:j("new-request-form.answer-bot-modal.solve-error","There was an error closing your request")}),window.location.href=u})()},children:j("new-request-form.answer-bot-modal.solve-request","Yes, close my request")})})]}),n.jsx(C.Close,{"aria-label":j("new-request-form.close-label","Close")})]})}var ze;!function(e){e.POSITIVE="resolution",e.NEGATIVE="rejection"}(ze||(ze={}));const Le=o.div`
border-top: 1px solid ${e=>E("neutralHue",300,e.theme)};
padding: ${e=>e.theme.space.sm}
calc(2 * ${e=>e.theme.space.sm});
font-size: ${e=>e.theme.fontSizes.sm};
`,Ae=o.div`
margin-top: ${e=>e.theme.space.sm};
`,De=o.div`
margin-top: ${e=>e.theme.space.sm};
padding-bottom: ${e=>e.theme.space.sm};
`,Me=o(v)`
color: ${e=>E("blue",600,e.theme)};
a {
text-decoration: underline;
}
`,Ne=o.div`
display: flex;
align-items: center;
justify-content: space-between;
`;function Ue({citations:t,testId:s}){const{t:r}=i(),[a,o]=e.useState(!1);return n.jsx(Le,{children:a?n.jsxs(Ae,{children:[n.jsx($,{size:"small",children:r("new-request-form.answer-bot-generative-modal.sources_description","This message was automatically generated using AI and the following article sources:")}),n.jsx(De,{children:t.map(((e,r)=>n.jsxs(Me,{children:[n.jsx(f,{id:`${s}-source-link-${r}`,href:e.html_url,target:"_blank",children:e.title}),r<t.length-1&&", "]},e.article_id)))})]}):n.jsxs(Ne,{children:[n.jsxs(v,{children:[n.jsx(v.StartIcon,{children:n.jsx(z,{})}),r("new-request-form.answer-bot-generative-modal.generated_by_ai","Generated by AI")]}),n.jsx(P,{size:"small",isBasic:!0,onClick:()=>o(!0),id:`${s}-show-sources-button`,children:r("new-request-form.answer-bot-generative-modal.view_sources","View Sources")})]})})}const Be=o.div`
background-color: #f4f6f8;
border-radius: 10px;
`,Ge=o.div`
margin-top: ${e=>e.theme.space.xs};
padding: calc(2 * ${e=>e.theme.space.sm});
white-space: break-spaces;
`;function He({generatedAnswer:e,citations:t,testId:s}){return n.jsxs(Be,{children:[n.jsx(Ge,{id:`${s}-generated-answer-content`,children:e}),n.jsx(Ue,{citations:t,testId:s})]})}const Oe=o.div`
display: flex;
gap: ${e=>e.theme.space.xs};
margin-top: ${e=>e.theme.space.md};
align-items: end;
`,Ve=o.div`
max-height: 40px; /* specific height, avatar size plus a small difference */
display: flex;
padding: ${e=>e.theme.space.sm};
border-radius: ${e=>e.theme.rtl?"16px 16px 0px 16px":"16px 16px 16px 0px"};
gap: ${e=>e.theme.space.sm};
align-items: center;
background-color: #f4f6f8;
`;function Xe({isLoading:e,isError:t,generatedAnswer:s,citations:r,testId:a}){const{t:o}=i();return t?n.jsx(v,{children:o("new-request-form.answer-bot-generative-modal.error.subtitle","The AI wasnt able to find an answer this time. Don't worry, a human agent will get back to you by email shortly.")}):n.jsxs(n.Fragment,{children:[n.jsx(v,{children:e?o("new-request-form.answer-bot-generative-modal.loading.subtitle","While you wait, an AI agent will try to find an answer to your request. If you close this window, you'll receive an email follow-up."):o("new-request-form.answer-bot-generative-modal.default.subtitle","If the following information resolves your request and you no longer require assistance, you can inform us by clicking 'This helped, solve my request'.")}),n.jsxs(Oe,{children:[n.jsx(L,{size:"small",isSystem:!0,children:n.jsx("img",{src:"https://accounts.zendesk.com/flow_director/assets/default_avatar.png",alt:o("new-request-form.answer-bot-generative-modal.ai_agent_avatar_alt","AI Agent Avatar")})}),n.jsxs(Ve,{children:[n.jsx(v,{children:e?o("new-request-form.answer-bot-generative-modal.loading.start","Thinking"):o("new-request-form.answer-bot-generative-modal.loading.finished","I found something that might help...")}),e&&n.jsx(A,{size:16})]})]}),s&&n.jsx(He,{generatedAnswer:s,citations:r,testId:a})]})}function Ye({isLoading:e,isError:t,isSubmittingFeedback:s,testId:r,onClose:a,onReject:o,onResolve:l}){const{t:u}=i();return t?n.jsx(P,{isPrimary:!0,onClick:a,children:u("new-request-form.answer-bot-generative-modal.buttons.ok","Ok")}):e?n.jsxs(n.Fragment,{children:[n.jsx(D,{children:n.jsx(P,{onClick:a,id:`${r}-discard-button`,isBasic:!0,children:u("new-request-form.answer-bot-generative-modal.buttons.close","Close")})}),n.jsx(D,{children:n.jsx(P,{isPrimary:!0,disabled:!0,children:n.jsx(A,{size:24,color:"white"})})})]}):n.jsxs(n.Fragment,{children:[n.jsx(D,{children:n.jsx(P,{onClick:o,id:`${r}-reject-button`,isBasic:!0,disabled:s,children:u("new-request-form.answer-bot-generative-modal.buttons.still_need_help","I still need help")})}),n.jsx(D,{children:n.jsx(P,{isPrimary:!0,onClick:l,id:`${r}-resolve-button`,disabled:s,children:u("new-request-form.answer-bot-generative-modal.buttons.this_helped","This helped, solve my request")})})]})}const Ke="ab-generative-modal",We=e=>`/hc/answer_bot/generate_reply/${e}`,Je=(e,n)=>`/api/v2/answer_bot/generative_deflection/${e}?auth_token=${n}`;function Ze({requestId:t,redirectTo:s}){const r=S(),{t:a}=i(),[o,l]=e.useState({generatedAnswer:"",citations:[],authToken:"",isLoading:!0,isError:!1,isSubmittingFeedback:!1});e.useEffect((()=>{!async function(){try{const e=await fetch(We(t),{credentials:"same-origin"}),n=await e.json(),{generated_answer:s,citations:r,ticket_deflection:a}=n;l((e=>({...e,generatedAnswer:s,citations:r,authToken:a.auth_token,isLoading:!1,isError:!s})))}catch(e){l((e=>({...e,isLoading:!1,isError:!0})))}}()}),[t]);const u=()=>window.location.href=s,c=()=>{R({type:"success",message:a("new-request-form.answer-bot-generative-modal.request-submitted","Your request was successfully submitted")}),u()},d=()=>{h({type:"error",message:a("new-request-form.answer-bot-generative-modal.feedback-error","There was an error submitting your feedback")}),l((e=>({...e,isSubmittingFeedback:!1})))},f=async e=>{const{authToken:n}=o;if(!n)return d(),void console.error("[GenerativeAnswerBotModal][sendFeedback]: Auth token is missing");l((e=>({...e,isSubmittingFeedback:!0})));try{const t=await se();(await fetch(Je(e,n),{headers:{...t&&{"X-CSRF-Token":t}}})).ok?(R({type:"success",message:e===ze.POSITIVE?a("new-request-form.answer-bot-generative-modal.request-closed","Your request has been solved"):a("new-request-form.answer-bot-generative-modal.request-submitted","Your request was successfully submitted")}),u()):d()}catch(e){d()}};return n.jsxs(C,{appendToNode:r,onClose:c,isLarge:!0,children:[n.jsx(M,{children:o.isError?a("new-request-form.answer-bot-generative-modal.error.title","An agent will be in touch soon"):a("new-request-form.answer-bot-generative-modal.default.title","Your request was submitted successfully")}),n.jsx(N,{children:n.jsx(Xe,{isLoading:o.isLoading,isError:o.isError,generatedAnswer:o.generatedAnswer,citations:o.citations,testId:Ke})}),n.jsx(U,{children:n.jsx(Ye,{isLoading:o.isLoading,isError:o.isError,isSubmittingFeedback:o.isSubmittingFeedback,testId:Ke,onClose:c,onReject:async()=>await f(ze.NEGATIVE),onResolve:async()=>await f(ze.POSITIVE)})}),n.jsx(B,{"aria-label":a("new-request-form.answer-bot-generative-modal.close_modal_aria_label","Close modal")})]})}const Qe=o($)`
margin: ${e=>e.theme.space.md} 0;
`,en=o.form`
display: flex;
flex-direction: column;
gap: ${e=>e.theme.space.md};
`,nn=o.div`
margin-top: ${e=>e.theme.space.md};
`;function tn({requestForm:t,wysiwyg:s,newRequestPath:r,parentId:a,parentIdPath:o,locale:l,baseLocale:u,hasAtMentions:c,userRole:d,userId:h,brandId:m,organizations:j,answerBotModal:p}){const{ticket_fields:b,action:k,http_method:w,accept_charset:g,errors:q,parent_id_field:x,ticket_form_field:v,email_field:y,cc_field:_,organization_field:C,due_date_field:F,end_user_conditions:I,attachments_field:S,inline_attachments_fields:T,description_mimetype_field:$}=t,{answerBot:R}=p,{ticketFields:E,emailField:z,ccField:L,organizationField:A,dueDateField:D}=de({ticketFields:b,emailField:y,ccField:_,organizationField:C,dueDateField:F}),[M,N]=e.useState(E),[U,B]=e.useState(A),[H,O]=e.useState(D),V=K(M,I),{formRefCallback:X,handleSubmit:Y}=function(n){const t=e.useRef(!1),s=e.useRef(!1);return{formRefCallback:e.useCallback((e=>{e&&!t.current&&(t.current=!0,e.submit=async()=>{if(!1===s.current){s.current=!0;const t=await se(),r=document.createElement("input");r.type="hidden",r.name="authenticity_token",r.value=t,e.appendChild(r);const a=n.filter((e=>"partialcreditcard"===e.type));for(const n of a){const t=e.querySelector(`input[name="${n.name}"]`);t&&t instanceof HTMLInputElement&&4===t.value.length&&(t.value=`XXXXXXXXX${t.value}`)}HTMLFormElement.prototype.submit.call(e)}})}),[n]),handleSubmit:e=>{e.preventDefault(),e.target.submit()}}}(M),{t:ee}=i(),re=j.length>0&&j[0]?.id?j[0]?.id?.toString():null,ae=e.useCallback(((e,n)=>{N(M.map((t=>t.name===e.name?{...t,value:n}:t)))}),[M]);const oe=e.useCallback((e=>{null!==H&&O({...H,value:e})}),[H]),ie=!!(R?.auth_token&&R?.interaction_access_token&&R?.articles?.length&&R?.request_id),le=!ie&&R.request_id;return n.jsxs(n.Fragment,{children:[a&&n.jsx(Qe,{children:n.jsx(f,{href:o,children:ee("new-request-form.parent-request-link","Follow-up to request {{parentId}}",{parentId:`#${a}`})})}),n.jsx(Qe,{"aria-hidden":"true",children:ee("new-request-form.required-fields-info","Fields marked with an asterisk (*) are required.")}),n.jsxs(en,{ref:X,action:k,method:w,acceptCharset:g,noValidate:!0,onSubmit:Y,children:[q&&n.jsx(G,{type:"error",children:q}),x&&n.jsx(te,{field:x}),v.options.length>0&&n.jsx(ne,{field:v,newRequestPath:r}),z&&n.jsx(W,{field:z},z.name),L&&n.jsx(ve,{field:L}),U&&n.jsx(J,{field:U,onChange:e=>{!function(e){null!==U&&B({...U,value:e})}(e)}},U.name),V.map((t=>"subject"===t.type?n.jsxs(e.Fragment,{children:[n.jsx(W,{field:t,onChange:e=>ae(t,e)}),n.jsx(Se,{query:t.value,locale:l})]},t.name):"description"===t.type?n.jsxs(e.Fragment,{children:[n.jsx(Z,{field:t,hasWysiwyg:s,baseLocale:u,hasAtMentions:c,userRole:d,brandId:m,onChange:e=>ae(t,e)}),n.jsx("input",{type:"hidden",name:$.name,value:s?"text/html":"text/plain"})]},t.name):n.jsx(Q,{field:t,baseLocale:u,hasAtMentions:c,userRole:d,userId:h,brandId:m,dueDateField:H,handleDueDateChange:oe,organizationField:U,defaultOrganizationId:re,visibleFields:V,handleChange:ae},t.name))),S&&n.jsx(je,{field:S,baseLocale:u}),T.map((({type:e,name:t,value:s},r)=>n.jsx("input",{type:e,name:t,value:s},r))),n.jsx(nn,{children:(0===v.options.length||v.value)&&n.jsx(P,{isPrimary:!0,type:"submit",children:ee("new-request-form.submit","Submit")})})]}),ie&&n.jsx(Ee,{authToken:R.auth_token,interactionAccessToken:R.interaction_access_token,articles:R.articles,requestId:R.request_id,...p}),le&&n.jsx(Ze,{requestId:Number(R.request_id),redirectTo:p.helpCenterPath})]})}async function sn(e,t,s){const{baseLocale:r}=t;H(r),await O(r,[()=>function(e){switch(e){case"./translations/locales/af.json":return import("new-request-form-translations").then((function(e){return e.a}));case"./translations/locales/ar-x-pseudo.json":return import("new-request-form-translations").then((function(e){return e.b}));case"./translations/locales/ar.json":return import("new-request-form-translations").then((function(e){return e.c}));case"./translations/locales/az.json":return import("new-request-form-translations").then((function(e){return e.d}));case"./translations/locales/be.json":return import("new-request-form-translations").then((function(e){return e.e}));case"./translations/locales/bg.json":return import("new-request-form-translations").then((function(e){return e.f}));case"./translations/locales/bn.json":return import("new-request-form-translations").then((function(e){return e.g}));case"./translations/locales/bs.json":return import("new-request-form-translations").then((function(e){return e.h}));case"./translations/locales/ca.json":return import("new-request-form-translations").then((function(e){return e.i}));case"./translations/locales/cs.json":return import("new-request-form-translations").then((function(e){return e.j}));case"./translations/locales/cy.json":return import("new-request-form-translations").then((function(e){return e.k}));case"./translations/locales/da.json":return import("new-request-form-translations").then((function(e){return e.l}));case"./translations/locales/de-de.json":return import("new-request-form-translations").then((function(e){return e.m}));case"./translations/locales/de-x-informal.json":return import("new-request-form-translations").then((function(e){return e.n}));case"./translations/locales/de.json":return import("new-request-form-translations").then((function(e){return e.o}));case"./translations/locales/el.json":return import("new-request-form-translations").then((function(e){return e.p}));case"./translations/locales/en-001.json":return import("new-request-form-translations").then((function(e){return e.q}));case"./translations/locales/en-150.json":return import("new-request-form-translations").then((function(e){return e.r}));case"./translations/locales/en-au.json":return import("new-request-form-translations").then((function(e){return e.s}));case"./translations/locales/en-ca.json":return import("new-request-form-translations").then((function(e){return e.t}));case"./translations/locales/en-gb.json":return import("new-request-form-translations").then((function(e){return e.u}));case"./translations/locales/en-my.json":return import("new-request-form-translations").then((function(e){return e.v}));case"./translations/locales/en-ph.json":return import("new-request-form-translations").then((function(e){return e.w}));case"./translations/locales/en-se.json":return import("new-request-form-translations").then((function(e){return e.x}));case"./translations/locales/en-us.json":return import("new-request-form-translations").then((function(e){return e.y}));case"./translations/locales/en-x-dev.json":return import("new-request-form-translations").then((function(e){return e.z}));case"./translations/locales/en-x-keys.json":return import("new-request-form-translations").then((function(e){return e.A}));case"./translations/locales/en-x-obsolete.json":return import("new-request-form-translations").then((function(e){return e.B}));case"./translations/locales/en-x-pseudo.json":return import("new-request-form-translations").then((function(e){return e.C}));case"./translations/locales/en-x-test.json":return import("new-request-form-translations").then((function(e){return e.D}));case"./translations/locales/es-419.json":return import("new-request-form-translations").then((function(e){return e.E}));case"./translations/locales/es-ar.json":return import("new-request-form-translations").then((function(e){return e.F}));case"./translations/locales/es-cl.json":return import("new-request-form-translations").then((function(e){return e.G}));case"./translations/locales/es-es.json":return import("new-request-form-translations").then((function(e){return e.H}));case"./translations/locales/es-mx.json":return import("new-request-form-translations").then((function(e){return e.I}));case"./translations/locales/es-pe.json":return import("new-request-form-translations").then((function(e){return e.J}));case"./translations/locales/es.json":return import("new-request-form-translations").then((function(e){return e.K}));case"./translations/locales/et.json":return import("new-request-form-translations").then((function(e){return e.L}));case"./translations/locales/eu.json":return import("new-request-form-translations").then((function(e){return e.M}));case"./translations/locales/fa-af.json":return import("new-request-form-translations").then((function(e){return e.N}));case"./translations/locales/fa.json":return import("new-request-form-translations").then((function(e){return e.O}));case"./translations/locales/fi.json":return import("new-request-form-translations").then((function(e){return e.P}));case"./translations/locales/fil.json":return import("new-request-form-translations").then((function(e){return e.Q}));case"./translations/locales/fo.json":return import("new-request-form-translations").then((function(e){return e.R}));case"./translations/locales/fr-ca.json":return import("new-request-form-translations").then((function(e){return e.S}));case"./translations/locales/fr-dz.json":return import("new-request-form-translations").then((function(e){return e.T}));case"./translations/locales/fr-mu.json":return import("new-request-form-translations").then((function(e){return e.U}));case"./translations/locales/fr.json":return import("new-request-form-translations").then((function(e){return e.V}));case"./translations/locales/ga.json":return import("new-request-form-translations").then((function(e){return e.W}));case"./translations/locales/he.json":return import("new-request-form-translations").then((function(e){return e.X}));case"./translations/locales/hi.json":return import("new-request-form-translations").then((function(e){return e.Y}));case"./translations/locales/hr.json":return import("new-request-form-translations").then((function(e){return e.Z}));case"./translations/locales/hu.json":return import("new-request-form-translations").then((function(e){return e._}));case"./translations/locales/hy.json":return import("new-request-form-translations").then((function(e){return e.$}));case"./translations/locales/id.json":return import("new-request-form-translations").then((function(e){return e.a0}));case"./translations/locales/is.json":return import("new-request-form-translations").then((function(e){return e.a1}));case"./translations/locales/it-ch.json":return import("new-request-form-translations").then((function(e){return e.a2}));case"./translations/locales/it.json":return import("new-request-form-translations").then((function(e){return e.a3}));case"./translations/locales/ja.json":return import("new-request-form-translations").then((function(e){return e.a4}));case"./translations/locales/ka.json":return import("new-request-form-translations").then((function(e){return e.a5}));case"./translations/locales/kk.json":return import("new-request-form-translations").then((function(e){return e.a6}));case"./translations/locales/kl-dk.json":return import("new-request-form-translations").then((function(e){return e.a7}));case"./translations/locales/km.json":return import("new-request-form-translations").then((function(e){return e.a8}));case"./translations/locales/ko.json":return import("new-request-form-translations").then((function(e){return e.a9}));case"./translations/locales/ku.json":return import("new-request-form-translations").then((function(e){return e.aa}));case"./translations/locales/ky.json":return import("new-request-form-translations").then((function(e){return e.ab}));case"./translations/locales/lt.json":return import("new-request-form-translations").then((function(e){return e.ac}));case"./translations/locales/lv.json":return import("new-request-form-translations").then((function(e){return e.ad}));case"./translations/locales/mk.json":return import("new-request-form-translations").then((function(e){return e.ae}));case"./translations/locales/mn.json":return import("new-request-form-translations").then((function(e){return e.af}));case"./translations/locales/ms.json":return import("new-request-form-translations").then((function(e){return e.ag}));case"./translations/locales/mt.json":return import("new-request-form-translations").then((function(e){return e.ah}));case"./translations/locales/my.json":return import("new-request-form-translations").then((function(e){return e.ai}));case"./translations/locales/ne.json":return import("new-request-form-translations").then((function(e){return e.aj}));case"./translations/locales/nl-be.json":return import("new-request-form-translations").then((function(e){return e.ak}));case"./translations/locales/nl.json":return import("new-request-form-translations").then((function(e){return e.al}));case"./translations/locales/no.json":return import("new-request-form-translations").then((function(e){return e.am}));case"./translations/locales/pl.json":return import("new-request-form-translations").then((function(e){return e.an}));case"./translations/locales/pt-br.json":return import("new-request-form-translations").then((function(e){return e.ao}));case"./translations/locales/pt.json":return import("new-request-form-translations").then((function(e){return e.ap}));case"./translations/locales/ro-md.json":return import("new-request-form-translations").then((function(e){return e.aq}));case"./translations/locales/ro.json":return import("new-request-form-translations").then((function(e){return e.ar}));case"./translations/locales/ru.json":return import("new-request-form-translations").then((function(e){return e.as}));case"./translations/locales/si.json":return import("new-request-form-translations").then((function(e){return e.at}));case"./translations/locales/sk.json":return import("new-request-form-translations").then((function(e){return e.au}));case"./translations/locales/sl.json":return import("new-request-form-translations").then((function(e){return e.av}));case"./translations/locales/sq.json":return import("new-request-form-translations").then((function(e){return e.aw}));case"./translations/locales/sr-me.json":return import("new-request-form-translations").then((function(e){return e.ax}));case"./translations/locales/sr.json":return import("new-request-form-translations").then((function(e){return e.ay}));case"./translations/locales/sv.json":return import("new-request-form-translations").then((function(e){return e.az}));case"./translations/locales/sw-ke.json":return import("new-request-form-translations").then((function(e){return e.aA}));case"./translations/locales/ta.json":return import("new-request-form-translations").then((function(e){return e.aB}));case"./translations/locales/th.json":return import("new-request-form-translations").then((function(e){return e.aC}));case"./translations/locales/tr.json":return import("new-request-form-translations").then((function(e){return e.aD}));case"./translations/locales/uk.json":return import("new-request-form-translations").then((function(e){return e.aE}));case"./translations/locales/ur-pk.json":return import("new-request-form-translations").then((function(e){return e.aF}));case"./translations/locales/ur.json":return import("new-request-form-translations").then((function(e){return e.aG}));case"./translations/locales/uz.json":return import("new-request-form-translations").then((function(e){return e.aH}));case"./translations/locales/vi.json":return import("new-request-form-translations").then((function(e){return e.aI}));case"./translations/locales/zh-cn.json":return import("new-request-form-translations").then((function(e){return e.aJ}));case"./translations/locales/zh-tw.json":return import("new-request-form-translations").then((function(e){return e.aK}));default:return new Promise((function(n,t){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+e)))}))}}(`./translations/locales/${r}.json`),()=>function(e){switch(e){case"../ticket-fields/translations/locales/af.json":return import("ticket-fields").then((function(e){return e.b}));case"../ticket-fields/translations/locales/ar-x-pseudo.json":return import("ticket-fields").then((function(e){return e.c}));case"../ticket-fields/translations/locales/ar.json":return import("ticket-fields").then((function(e){return e.d}));case"../ticket-fields/translations/locales/az.json":return import("ticket-fields").then((function(e){return e.e}));case"../ticket-fields/translations/locales/be.json":return import("ticket-fields").then((function(e){return e.f}));case"../ticket-fields/translations/locales/bg.json":return import("ticket-fields").then((function(e){return e.h}));case"../ticket-fields/translations/locales/bn.json":return import("ticket-fields").then((function(e){return e.i}));case"../ticket-fields/translations/locales/bs.json":return import("ticket-fields").then((function(e){return e.j}));case"../ticket-fields/translations/locales/ca.json":return import("ticket-fields").then((function(e){return e.k}));case"../ticket-fields/translations/locales/cs.json":return import("ticket-fields").then((function(e){return e.l}));case"../ticket-fields/translations/locales/cy.json":return import("ticket-fields").then((function(e){return e.m}));case"../ticket-fields/translations/locales/da.json":return import("ticket-fields").then((function(e){return e.n}));case"../ticket-fields/translations/locales/de-de.json":return import("ticket-fields").then((function(e){return e.o}));case"../ticket-fields/translations/locales/de-x-informal.json":return import("ticket-fields").then((function(e){return e.p}));case"../ticket-fields/translations/locales/de.json":return import("ticket-fields").then((function(e){return e.q}));case"../ticket-fields/translations/locales/el.json":return import("ticket-fields").then((function(e){return e.r}));case"../ticket-fields/translations/locales/en-001.json":return import("ticket-fields").then((function(e){return e.s}));case"../ticket-fields/translations/locales/en-150.json":return import("ticket-fields").then((function(e){return e.t}));case"../ticket-fields/translations/locales/en-au.json":return import("ticket-fields").then((function(e){return e.u}));case"../ticket-fields/translations/locales/en-ca.json":return import("ticket-fields").then((function(e){return e.v}));case"../ticket-fields/translations/locales/en-gb.json":return import("ticket-fields").then((function(e){return e.w}));case"../ticket-fields/translations/locales/en-my.json":return import("ticket-fields").then((function(e){return e.x}));case"../ticket-fields/translations/locales/en-ph.json":return import("ticket-fields").then((function(e){return e.y}));case"../ticket-fields/translations/locales/en-se.json":return import("ticket-fields").then((function(e){return e.z}));case"../ticket-fields/translations/locales/en-us.json":return import("ticket-fields").then((function(e){return e.A}));case"../ticket-fields/translations/locales/en-x-dev.json":return import("ticket-fields").then((function(e){return e.B}));case"../ticket-fields/translations/locales/en-x-keys.json":return import("ticket-fields").then((function(e){return e.C}));case"../ticket-fields/translations/locales/en-x-obsolete.json":return import("ticket-fields").then((function(e){return e.E}));case"../ticket-fields/translations/locales/en-x-pseudo.json":return import("ticket-fields").then((function(e){return e.F}));case"../ticket-fields/translations/locales/en-x-test.json":return import("ticket-fields").then((function(e){return e.G}));case"../ticket-fields/translations/locales/es-419.json":return import("ticket-fields").then((function(e){return e.H}));case"../ticket-fields/translations/locales/es-ar.json":return import("ticket-fields").then((function(e){return e.J}));case"../ticket-fields/translations/locales/es-cl.json":return import("ticket-fields").then((function(e){return e.K}));case"../ticket-fields/translations/locales/es-es.json":return import("ticket-fields").then((function(e){return e.L}));case"../ticket-fields/translations/locales/es-mx.json":return import("ticket-fields").then((function(e){return e.M}));case"../ticket-fields/translations/locales/es-pe.json":return import("ticket-fields").then((function(e){return e.N}));case"../ticket-fields/translations/locales/es.json":return import("ticket-fields").then((function(e){return e.O}));case"../ticket-fields/translations/locales/et.json":return import("ticket-fields").then((function(e){return e.P}));case"../ticket-fields/translations/locales/eu.json":return import("ticket-fields").then((function(e){return e.Q}));case"../ticket-fields/translations/locales/fa-af.json":return import("ticket-fields").then((function(e){return e.S}));case"../ticket-fields/translations/locales/fa.json":return import("ticket-fields").then((function(e){return e.U}));case"../ticket-fields/translations/locales/fi.json":return import("ticket-fields").then((function(e){return e.V}));case"../ticket-fields/translations/locales/fil.json":return import("ticket-fields").then((function(e){return e.W}));case"../ticket-fields/translations/locales/fo.json":return import("ticket-fields").then((function(e){return e.X}));case"../ticket-fields/translations/locales/fr-ca.json":return import("ticket-fields").then((function(e){return e.Y}));case"../ticket-fields/translations/locales/fr-dz.json":return import("ticket-fields").then((function(e){return e.Z}));case"../ticket-fields/translations/locales/fr-mu.json":return import("ticket-fields").then((function(e){return e._}));case"../ticket-fields/translations/locales/fr.json":return import("ticket-fields").then((function(e){return e.$}));case"../ticket-fields/translations/locales/ga.json":return import("ticket-fields").then((function(e){return e.a0}));case"../ticket-fields/translations/locales/he.json":return import("ticket-fields").then((function(e){return e.a1}));case"../ticket-fields/translations/locales/hi.json":return import("ticket-fields").then((function(e){return e.a2}));case"../ticket-fields/translations/locales/hr.json":return import("ticket-fields").then((function(e){return e.a3}));case"../ticket-fields/translations/locales/hu.json":return import("ticket-fields").then((function(e){return e.a4}));case"../ticket-fields/translations/locales/hy.json":return import("ticket-fields").then((function(e){return e.a5}));case"../ticket-fields/translations/locales/id.json":return import("ticket-fields").then((function(e){return e.a6}));case"../ticket-fields/translations/locales/is.json":return import("ticket-fields").then((function(e){return e.a7}));case"../ticket-fields/translations/locales/it-ch.json":return import("ticket-fields").then((function(e){return e.a8}));case"../ticket-fields/translations/locales/it.json":return import("ticket-fields").then((function(e){return e.a9}));case"../ticket-fields/translations/locales/ja.json":return import("ticket-fields").then((function(e){return e.aa}));case"../ticket-fields/translations/locales/ka.json":return import("ticket-fields").then((function(e){return e.ab}));case"../ticket-fields/translations/locales/kk.json":return import("ticket-fields").then((function(e){return e.ac}));case"../ticket-fields/translations/locales/kl-dk.json":return import("ticket-fields").then((function(e){return e.ad}));case"../ticket-fields/translations/locales/km.json":return import("ticket-fields").then((function(e){return e.ae}));case"../ticket-fields/translations/locales/ko.json":return import("ticket-fields").then((function(e){return e.af}));case"../ticket-fields/translations/locales/ku.json":return import("ticket-fields").then((function(e){return e.ag}));case"../ticket-fields/translations/locales/ky.json":return import("ticket-fields").then((function(e){return e.ah}));case"../ticket-fields/translations/locales/lt.json":return import("ticket-fields").then((function(e){return e.ai}));case"../ticket-fields/translations/locales/lv.json":return import("ticket-fields").then((function(e){return e.aj}));case"../ticket-fields/translations/locales/mk.json":return import("ticket-fields").then((function(e){return e.ak}));case"../ticket-fields/translations/locales/mn.json":return import("ticket-fields").then((function(e){return e.al}));case"../ticket-fields/translations/locales/ms.json":return import("ticket-fields").then((function(e){return e.am}));case"../ticket-fields/translations/locales/mt.json":return import("ticket-fields").then((function(e){return e.an}));case"../ticket-fields/translations/locales/my.json":return import("ticket-fields").then((function(e){return e.ao}));case"../ticket-fields/translations/locales/ne.json":return import("ticket-fields").then((function(e){return e.ap}));case"../ticket-fields/translations/locales/nl-be.json":return import("ticket-fields").then((function(e){return e.aq}));case"../ticket-fields/translations/locales/nl.json":return import("ticket-fields").then((function(e){return e.ar}));case"../ticket-fields/translations/locales/no.json":return import("ticket-fields").then((function(e){return e.as}));case"../ticket-fields/translations/locales/pl.json":return import("ticket-fields").then((function(e){return e.at}));case"../ticket-fields/translations/locales/pt-br.json":return import("ticket-fields").then((function(e){return e.au}));case"../ticket-fields/translations/locales/pt.json":return import("ticket-fields").then((function(e){return e.av}));case"../ticket-fields/translations/locales/ro-md.json":return import("ticket-fields").then((function(e){return e.aw}));case"../ticket-fields/translations/locales/ro.json":return import("ticket-fields").then((function(e){return e.ax}));case"../ticket-fields/translations/locales/ru.json":return import("ticket-fields").then((function(e){return e.ay}));case"../ticket-fields/translations/locales/si.json":return import("ticket-fields").then((function(e){return e.az}));case"../ticket-fields/translations/locales/sk.json":return import("ticket-fields").then((function(e){return e.aA}));case"../ticket-fields/translations/locales/sl.json":return import("ticket-fields").then((function(e){return e.aB}));case"../ticket-fields/translations/locales/sq.json":return import("ticket-fields").then((function(e){return e.aC}));case"../ticket-fields/translations/locales/sr-me.json":return import("ticket-fields").then((function(e){return e.aD}));case"../ticket-fields/translations/locales/sr.json":return import("ticket-fields").then((function(e){return e.aE}));case"../ticket-fields/translations/locales/sv.json":return import("ticket-fields").then((function(e){return e.aF}));case"../ticket-fields/translations/locales/sw-ke.json":return import("ticket-fields").then((function(e){return e.aG}));case"../ticket-fields/translations/locales/ta.json":return import("ticket-fields").then((function(e){return e.aH}));case"../ticket-fields/translations/locales/th.json":return import("ticket-fields").then((function(e){return e.aI}));case"../ticket-fields/translations/locales/tr.json":return import("ticket-fields").then((function(e){return e.aJ}));case"../ticket-fields/translations/locales/uk.json":return import("ticket-fields").then((function(e){return e.aK}));case"../ticket-fields/translations/locales/ur-pk.json":return import("ticket-fields").then((function(e){return e.aL}));case"../ticket-fields/translations/locales/ur.json":return import("ticket-fields").then((function(e){return e.aM}));case"../ticket-fields/translations/locales/uz.json":return import("ticket-fields").then((function(e){return e.aN}));case"../ticket-fields/translations/locales/vi.json":return import("ticket-fields").then((function(e){return e.aO}));case"../ticket-fields/translations/locales/zh-cn.json":return import("ticket-fields").then((function(e){return e.aP}));case"../ticket-fields/translations/locales/zh-tw.json":return import("ticket-fields").then((function(e){return e.aQ}));default:return new Promise((function(n,t){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+e)))}))}}(`../ticket-fields/translations/locales/${r}.json`),()=>function(e){switch(e){case"../shared/translations/locales/af.json":return import("shared").then((function(e){return e.aB}));case"../shared/translations/locales/ar-x-pseudo.json":return import("shared").then((function(e){return e.aC}));case"../shared/translations/locales/ar.json":return import("shared").then((function(e){return e.aD}));case"../shared/translations/locales/az.json":return import("shared").then((function(e){return e.aE}));case"../shared/translations/locales/be.json":return import("shared").then((function(e){return e.aF}));case"../shared/translations/locales/bg.json":return import("shared").then((function(e){return e.aG}));case"../shared/translations/locales/bn.json":return import("shared").then((function(e){return e.aH}));case"../shared/translations/locales/bs.json":return import("shared").then((function(e){return e.aI}));case"../shared/translations/locales/ca.json":return import("shared").then((function(e){return e.aJ}));case"../shared/translations/locales/cs.json":return import("shared").then((function(e){return e.aK}));case"../shared/translations/locales/cy.json":return import("shared").then((function(e){return e.aL}));case"../shared/translations/locales/da.json":return import("shared").then((function(e){return e.aM}));case"../shared/translations/locales/de-de.json":return import("shared").then((function(e){return e.aN}));case"../shared/translations/locales/de-x-informal.json":return import("shared").then((function(e){return e.aO}));case"../shared/translations/locales/de.json":return import("shared").then((function(e){return e.aP}));case"../shared/translations/locales/el.json":return import("shared").then((function(e){return e.aQ}));case"../shared/translations/locales/en-001.json":return import("shared").then((function(e){return e.aR}));case"../shared/translations/locales/en-150.json":return import("shared").then((function(e){return e.aS}));case"../shared/translations/locales/en-au.json":return import("shared").then((function(e){return e.aT}));case"../shared/translations/locales/en-ca.json":return import("shared").then((function(e){return e.aU}));case"../shared/translations/locales/en-gb.json":return import("shared").then((function(e){return e.aV}));case"../shared/translations/locales/en-my.json":return import("shared").then((function(e){return e.aW}));case"../shared/translations/locales/en-ph.json":return import("shared").then((function(e){return e.aX}));case"../shared/translations/locales/en-se.json":return import("shared").then((function(e){return e.aY}));case"../shared/translations/locales/en-us.json":return import("shared").then((function(e){return e.aZ}));case"../shared/translations/locales/en-x-dev.json":return import("shared").then((function(e){return e.a_}));case"../shared/translations/locales/en-x-keys.json":return import("shared").then((function(e){return e.a$}));case"../shared/translations/locales/en-x-obsolete.json":return import("shared").then((function(e){return e.b0}));case"../shared/translations/locales/en-x-pseudo.json":return import("shared").then((function(e){return e.b1}));case"../shared/translations/locales/en-x-test.json":return import("shared").then((function(e){return e.b2}));case"../shared/translations/locales/es-419.json":return import("shared").then((function(e){return e.b3}));case"../shared/translations/locales/es-ar.json":return import("shared").then((function(e){return e.b4}));case"../shared/translations/locales/es-cl.json":return import("shared").then((function(e){return e.b5}));case"../shared/translations/locales/es-es.json":return import("shared").then((function(e){return e.b6}));case"../shared/translations/locales/es-mx.json":return import("shared").then((function(e){return e.b7}));case"../shared/translations/locales/es-pe.json":return import("shared").then((function(e){return e.b8}));case"../shared/translations/locales/es.json":return import("shared").then((function(e){return e.b9}));case"../shared/translations/locales/et.json":return import("shared").then((function(e){return e.ba}));case"../shared/translations/locales/eu.json":return import("shared").then((function(e){return e.bb}));case"../shared/translations/locales/fa-af.json":return import("shared").then((function(e){return e.bc}));case"../shared/translations/locales/fa.json":return import("shared").then((function(e){return e.bd}));case"../shared/translations/locales/fi.json":return import("shared").then((function(e){return e.be}));case"../shared/translations/locales/fil.json":return import("shared").then((function(e){return e.bf}));case"../shared/translations/locales/fo.json":return import("shared").then((function(e){return e.bg}));case"../shared/translations/locales/fr-ca.json":return import("shared").then((function(e){return e.bh}));case"../shared/translations/locales/fr-dz.json":return import("shared").then((function(e){return e.bi}));case"../shared/translations/locales/fr-mu.json":return import("shared").then((function(e){return e.bj}));case"../shared/translations/locales/fr.json":return import("shared").then((function(e){return e.bk}));case"../shared/translations/locales/ga.json":return import("shared").then((function(e){return e.bl}));case"../shared/translations/locales/he.json":return import("shared").then((function(e){return e.bm}));case"../shared/translations/locales/hi.json":return import("shared").then((function(e){return e.bn}));case"../shared/translations/locales/hr.json":return import("shared").then((function(e){return e.bo}));case"../shared/translations/locales/hu.json":return import("shared").then((function(e){return e.bp}));case"../shared/translations/locales/hy.json":return import("shared").then((function(e){return e.bq}));case"../shared/translations/locales/id.json":return import("shared").then((function(e){return e.br}));case"../shared/translations/locales/is.json":return import("shared").then((function(e){return e.bs}));case"../shared/translations/locales/it-ch.json":return import("shared").then((function(e){return e.bt}));case"../shared/translations/locales/it.json":return import("shared").then((function(e){return e.bu}));case"../shared/translations/locales/ja.json":return import("shared").then((function(e){return e.bv}));case"../shared/translations/locales/ka.json":return import("shared").then((function(e){return e.bw}));case"../shared/translations/locales/kk.json":return import("shared").then((function(e){return e.bx}));case"../shared/translations/locales/kl-dk.json":return import("shared").then((function(e){return e.by}));case"../shared/translations/locales/km.json":return import("shared").then((function(e){return e.bz}));case"../shared/translations/locales/ko.json":return import("shared").then((function(e){return e.bA}));case"../shared/translations/locales/ku.json":return import("shared").then((function(e){return e.bB}));case"../shared/translations/locales/ky.json":return import("shared").then((function(e){return e.bC}));case"../shared/translations/locales/lt.json":return import("shared").then((function(e){return e.bD}));case"../shared/translations/locales/lv.json":return import("shared").then((function(e){return e.bE}));case"../shared/translations/locales/mk.json":return import("shared").then((function(e){return e.bF}));case"../shared/translations/locales/mn.json":return import("shared").then((function(e){return e.bG}));case"../shared/translations/locales/ms.json":return import("shared").then((function(e){return e.bH}));case"../shared/translations/locales/mt.json":return import("shared").then((function(e){return e.bI}));case"../shared/translations/locales/my.json":return import("shared").then((function(e){return e.bJ}));case"../shared/translations/locales/ne.json":return import("shared").then((function(e){return e.bK}));case"../shared/translations/locales/nl-be.json":return import("shared").then((function(e){return e.bL}));case"../shared/translations/locales/nl.json":return import("shared").then((function(e){return e.bM}));case"../shared/translations/locales/no.json":return import("shared").then((function(e){return e.bN}));case"../shared/translations/locales/pl.json":return import("shared").then((function(e){return e.bO}));case"../shared/translations/locales/pt-br.json":return import("shared").then((function(e){return e.bP}));case"../shared/translations/locales/pt.json":return import("shared").then((function(e){return e.bQ}));case"../shared/translations/locales/ro-md.json":return import("shared").then((function(e){return e.bR}));case"../shared/translations/locales/ro.json":return import("shared").then((function(e){return e.bS}));case"../shared/translations/locales/ru.json":return import("shared").then((function(e){return e.bT}));case"../shared/translations/locales/si.json":return import("shared").then((function(e){return e.bU}));case"../shared/translations/locales/sk.json":return import("shared").then((function(e){return e.bV}));case"../shared/translations/locales/sl.json":return import("shared").then((function(e){return e.bW}));case"../shared/translations/locales/sq.json":return import("shared").then((function(e){return e.bX}));case"../shared/translations/locales/sr-me.json":return import("shared").then((function(e){return e.bY}));case"../shared/translations/locales/sr.json":return import("shared").then((function(e){return e.bZ}));case"../shared/translations/locales/sv.json":return import("shared").then((function(e){return e.b_}));case"../shared/translations/locales/sw-ke.json":return import("shared").then((function(e){return e.b$}));case"../shared/translations/locales/ta.json":return import("shared").then((function(e){return e.c0}));case"../shared/translations/locales/th.json":return import("shared").then((function(e){return e.c1}));case"../shared/translations/locales/tr.json":return import("shared").then((function(e){return e.c2}));case"../shared/translations/locales/uk.json":return import("shared").then((function(e){return e.c3}));case"../shared/translations/locales/ur-pk.json":return import("shared").then((function(e){return e.c4}));case"../shared/translations/locales/ur.json":return import("shared").then((function(e){return e.c5}));case"../shared/translations/locales/uz.json":return import("shared").then((function(e){return e.c6}));case"../shared/translations/locales/vi.json":return import("shared").then((function(e){return e.c7}));case"../shared/translations/locales/zh-cn.json":return import("shared").then((function(e){return e.c8}));case"../shared/translations/locales/zh-tw.json":return import("shared").then((function(e){return e.c9}));default:return new Promise((function(n,t){("function"==typeof queueMicrotask?queueMicrotask:setTimeout)(t.bind(null,new Error("Unknown variable dynamic import: "+e)))}))}}(`../shared/translations/locales/${r}.json`)]),V.render(n.jsx(X,{theme:Y(e),children:n.jsx(tn,{...t})}),s)}export{sn as renderNewRequestForm};