1import{O as as,r as u,Q as is,R as pe,U as W,j as e,V as _e,f as ue,W as ls,X as cs,Y as le,Z as ds,$ as ms,a0 as hs,a1 as us,a2 as ps,a3 as gs,G as C,c as k,K as Xe,h as Ie,T as c,a4 as fs,p as xs,I as js,a5 as vs,a6 as ys,u as ws,t as Cs,a7 as bs,S as L,g as Pe,a8 as f,L as A,q as Re,a9 as ze,B as N,v as ce,k as De,i as Is,s as de,aa as Se,ab as Ps,ac as Ee,ad as zs,ae as Ss}from"./index-B1JCX_-d.js";import{u as _s,I as ks}from"./IconTrash-DuNqvFOg.js";import{S as Ts}from"./SEOHead-x5xN8jU_.js";import{E as Fs}from"./ErrorDisplay-DhLlAZAz.js";import{e as Ae}from"./errors-j4AVLOck.js";import{M as Ms}from"./PageSkeletons-PVczGScv.js";import{C as Ls}from"./ConfirmModal-DMhx8Iep.js";import{a as Ns}from"./settings-DW9MFVg0.js";import{C as $e,I as Be}from"./CountUp-BfOVT2M8.js";import{H as _}from"./HoverCard-CRh0mqZC.js";import{T as w}from"./Table-FcL28oTk.js";import{I as Rs}from"./IconHash-CbQIdYgV.js";import{I as Ds}from"./IconX-PlZO4ulH.js";import{u as Es}from"./use-debounced-value-9L4HsmBE.js";import{I as Oe}from"./IconDotsVertical-D0seQyWQ.js";import{I as As}from"./IconSparkles-C81NusBo.js";import{I as $s}from"./IconLink-CXeGL5Js.js";import{I as qe}from"./IconTransfer-ss5XDv3J.js";import{S as Ge}from"./Select-81cxwBve.js";import{I as Ue}from"./IconUsers-B8HJdmU4.js";import{T as me}from"./TextInput-D-E7ywd3.js";import{I as Ve}from"./IconSearch-C_afXE85.js";import{S as He}from"./SegmentedControl-Ddrz7gA9.js";import{I as Bs}from"./IconFilter-C5DCHx_x.js";import{S as Os}from"./SimpleGrid-aX7H6xu-.js";import{I as qs}from"./IconSettings-D7grxpSQ.js";import{I as Gs}from"./IconExternalLink-q3eLzfJ1.js";import{I as Us}from"./IconTable-U-GBBQPS.js";import{B as We}from"./Badge-BbXJu9l1.js";import{g as Vs}from"./get-auto-contrast-value-Da6zqqWm.js";import{L as $}from"./List-Bq6CPE7n.js";import{T as Ke}from"./Tooltip-V1HmJPbW.js";import{I as Qe}from"./IconInfoCircle-BUY0Ko0n.js";import"./Grid-CibHDB3Q.js";import"./CommentInput-D0CPnCAR.js";import"./Textarea-S6TImZwF.js";import"./get-env-uyVen0u2.js";import"./InputBase-CWPbF_yb.js";import"./get-style-object-DUJZA7T_.js";function R(o,t){const n=t-o+1;return Array.from({length:n},(r,a)=>a+o)}const he="dots";function Hs({total:o,siblings:t=1,boundaries:n=1,page:r,initialPage:a=1,onChange:l}){const i=Math.max(Math.trunc(o),0),[m,g]=as({value:r,onChange:l,defaultValue:a,finalValue:a}),h=b=>{b<=0?g(1):b>i?g(i):g(b)},d=()=>h(m+1),x=()=>h(m-1),v=()=>h(1),y=()=>h(i);return{range:u.useMemo(()=>{if(t*2+3+n*2>=i)return R(1,i);const G=Math.max(m-t,n),T=Math.min(m+t,i-n),z=G>n+2,S=T<i-(n+1);if(!z&&S){const F=t*2+n+2;return[...R(1,F),he,...R(i-(n-1),i)]}if(z&&!S){const F=n+1+2*t;return[...R(1,n),he,...R(i-F,i)]}return[...R(1,n),he,...R(G,T),he,...R(i-n+1,i)]},[i,t,m]),active:m,setPage:h,next:d,previous:x,first:v,last:y}}var K={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const[Ws,ge]=is("Pagination.Root component was not found in tree"),Ks={withPadding:!0},Q=pe((o,t)=>{const n=W("PaginationControl",Ks,o),{classNames:r,className:a,style:l,styles:i,vars:m,active:g,disabled:h,withPadding:d,mod:x,...v}=n,y=ge(),P=h||y.disabled;return e.jsx(_e,{ref:t,disabled:P,mod:[{active:g,disabled:P,"with-padding":d},x],...y.getStyles("control",{className:a,style:l,classNames:r,styles:i,active:!P}),...v})});Q.classes=K;Q.displayName="@mantine/core/PaginationControl";function Z({style:o,children:t,path:n,...r}){return e.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...o},...r,children:e.jsx("path",{d:n,fill:"currentColor"})})}const Qs=o=>e.jsx(Z,{...o,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),Zs=o=>e.jsx(Z,{...o,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),Xs=o=>e.jsx(Z,{...o,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),Ys=o=>e.jsx(Z,{...o,path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"}),Js=o=>e.jsx(Z,{...o,path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}),et={icon:Js},fe=pe((o,t)=>{const n=W("PaginationDots",et,o),{classNames:r,className:a,style:l,styles:i,vars:m,icon:g,...h}=n,d=ge();return e.jsx(ue,{ref:t,...d.getStyles("dots",{className:a,style:l,styles:i,classNames:r}),...h,children:e.jsx(g,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});fe.classes=K;fe.displayName="@mantine/core/PaginationDots";function xe({icon:o,name:t,action:n,type:r}){const a={icon:o},l=u.forwardRef((i,m)=>{const{icon:g,...h}=W(t,a,i),d=ge(),x=r==="next"?d.active===d.total:d.active===1;return e.jsx(Q,{disabled:d.disabled||x,ref:m,onClick:d[n],withPadding:!1,...h,children:e.jsx(g,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return l.displayName=`@mantine/core/${t}`,ls(l)}const Ye=xe({icon:Qs,name:"PaginationNext",action:"onNext",type:"next"}),Je=xe({icon:Zs,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),es=xe({icon:Xs,name:"PaginationFirst",action:"onFirst",type:"previous"}),ss=xe({icon:Ys,name:"PaginationLast",action:"onLast",type:"next"});function ke({dotsIcon:o}){const t=ge(),n=t.range.map((r,a)=>r==="dots"?e.jsx(fe,{icon:o},a):e.jsx(Q,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...t.getItemProps?.(r),children:t.getItemProps?.(r)?.children??r},a));return e.jsx(e.Fragment,{children:n})}ke.displayName="@mantine/core/PaginationItems";const st={siblings:1,boundaries:1},tt=ds((o,{size:t,radius:n,color:r,autoContrast:a})=>({root:{"--pagination-control-radius":n===void 0?void 0:gs(n),"--pagination-control-size":ps(t,"pagination-control-size"),"--pagination-control-fz":us(t),"--pagination-active-bg":r?hs(r,o):void 0,"--pagination-active-color":Vs(a,o)?ms({color:r,theme:o,autoContrast:a}):void 0}})),je=pe((o,t)=>{const n=W("PaginationRoot",st,o),{classNames:r,className:a,style:l,styles:i,unstyled:m,vars:g,total:h,value:d,defaultValue:x,onChange:v,disabled:y,siblings:P,boun
1daries:b,color:G,radius:T,onNextPage:z,onPreviousPage:S,onFirstPage:F,onLastPage:X,getItemProps:ve,autoContrast:B,attributes:M,...Y}=n,J=cs({name:"Pagination",classes:K,props:n,className:a,style:l,classNames:r,styles:i,unstyled:m,attributes:M,vars:g,varsResolver:tt}),{range:ee,setPage:U,next:se,previous:te,active:O,first:j,last:D}=Hs({page:d,initialPage:x,onChange:v,total:h,siblings:P,boundaries:b}),oe=le(z,se),ne=le(S,te),E=le(F,j),ye=le(X,D);return e.jsx(Ws,{value:{total:h,range:ee,active:O,disabled:y,getItemProps:ve,onChange:U,onNext:oe,onPrevious:ne,onFirst:E,onLast:ye,getStyles:J},children:e.jsx(ue,{ref:t,...J("root"),...Y})})});je.classes=K;je.displayName="@mantine/core/PaginationRoot";const ot={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},I=pe((o,t)=>{const n=W("Pagination",ot,o),{withEdges:r,withControls:a,getControlProps:l,nextIcon:i,previousIcon:m,lastIcon:g,firstIcon:h,dotsIcon:d,total:x,gap:v,hideWithOnePage:y,withPages:P,...b}=n;return x<=0||y&&x===1?null:e.jsx(je,{ref:t,total:x,...b,children:e.jsxs(C,{gap:v,children:[r&&e.jsx(es,{icon:h,...l?.("first")}),a&&e.jsx(Je,{icon:m,...l?.("previous")}),P&&e.jsx(ke,{dotsIcon:d}),a&&e.jsx(Ye,{icon:i,...l?.("next")}),r&&e.jsx(ss,{icon:g,...l?.("last")})]})})});I.classes=K;I.displayName="@mantine/core/Pagination";I.Root=je;I.Control=Q;I.Dots=fe;I.First=es;I.Last=ss;I.Next=Ye;I.Previous=Je;I.Items=ke;const nt=[["path",{d:"M13 3l0 7l6 0l-8 11l0 -7l-6 0l8 -11",key:"svg-0"}]],rt=k("outline","bolt","Bolt",nt);const at=[["path",{d:"M6.657 18c-2.572 0 -4.657 -2.007 -4.657 -4.483c0 -2.475 2.085 -4.482 4.657 -4.482c.393 -1.762 1.794 -3.2 3.675 -3.773c1.88 -.572 3.956 -.193 5.444 1c1.488 1.19 2.162 3.007 1.77 4.769h.99c1.913 0 3.464 1.56 3.464 3.486c0 1.927 -1.551 3.487 -3.465 3.487h-11.878",key:"svg-0"}]],it=k("outline","cloud","Cloud",at);const lt=[["path",{d:"M7.502 19.423c2.602 2.105 6.395 2.105 8.996 0c2.602 -2.105 3.262 -5.708 1.566 -8.546l-4.89 -7.26c-.42 -.625 -1.287 -.803 -1.936 -.397a1.376 1.376 0 0 0 -.41 .397l-4.893 7.26c-1.695 2.838 -1.035 6.441 1.567 8.546",key:"svg-0"}]],ct=k("outline","droplet","Droplet",lt);const dt=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],mt=k("outline","eye","Eye",dt);const ht=[["path",{d:"M5 21c.5 -4.5 2.5 -8 7 -10",key:"svg-0"}],["path",{d:"M9 18c6.218 0 10.5 -3.288 11 -12v-2h-4.014c-9 0 -11.986 4 -12 9c0 1 0 3 2 5h3l.014 0",key:"svg-1"}]],ut=k("outline","leaf","Leaf",ht);const pt=[["path",{d:"M5 12l14 0",key:"svg-0"}]],gt=k("outline","minus","Minus",pt);const ft=[["path",{d:"M12 17l-2 2l2 2",key:"svg-0"}],["path",{d:"M10 19h9a2 2 0 0 0 1.75 -2.75l-.55 -1",key:"svg-1"}],["path",{d:"M8.536 11l-.732 -2.732l-2.732 .732",key:"svg-2"}],["path",{d:"M7.804 8.268l-4.5 7.794a2 2 0 0 0 1.506 2.89l1.141 .024",key:"svg-3"}],["path",{d:"M15.464 11l2.732 .732l.732 -2.732",key:"svg-4"}],["path",{d:"M18.196 11.732l-4.5 -7.794a2 2 0 0 0 -3.256 -.14l-.591 .976",key:"svg-5"}]],xt=k("outline","recycle","Recycle",ft);const jt=[["path",{d:"M17 5l-10 14",key:"svg-0"}]],vt=k("outline","slash","Slash",jt);const yt=[["path",{d:"M12 13l-2 -2",key:"svg-0"}],["path",{d:"M12 12l2 -2",key:"svg-1"}],["path",{d:"M12 21v-13",key:"svg-2"}],["path",{d:"M9.824 16a3 3 0 0 1 -2.743 -3.69a3 3 0 0 1 .304 -4.833a3 3 0 0 1 4.615 -3.707a3 3 0 0 1 4.614 3.707a3 3 0 0 1 .305 4.833a3 3 0 0 1 -2.919 3.695h-4l-.176 -.005",key:"svg-3"}]],wt=k("outline","tree","Tree",yt),Ct="#e8990c",Ze="#FAFAFA",bt=[{key:"complete",label:"Complete",icon:xs,color:"#2b8a3e"},{key:"in_progress",label:"In progress",icon:js,color:"#1971c2"},{key:"declined",label:"Declined",icon:Ds,color:"#e03131"},{key:"cancelled",label:"Cancelled",icon:vt,color:"#868e96"},{key:"more_info",label:"More info requested",icon:vs,color:"#e8590c"},{key:"conditions_not_met",label:"Conditions not met",icon:gt,color:"#868e96"}],It=[{label:"trees",multiplier:.2,icon:wt},{label:"BTUs of energy",multiplier:.3,icon:rt},{label:"pounds of CO2",multiplier:180,icon:it},{label:"gallons of water",multiplier:214,icon:ct},{label:"pounds of waste",multiplier:11.8,icon:xt}];function Pt({formId:o}){const{data:t}=Xe({queryKey:["responseCounts",o],queryFn:()=>ys(o),staleTime:6e4});if(!t)return null;const n=t.in_progress+t.complete+t.declined+t.cancelled+t.more_info+t.conditions_not_met;if(n===0)return null;const r=t.in_progress>0;return e.jsxs(C,{gap:6,onClick:a=>a.stopPropagation(),children:[e.jsxs(_,{width:320,shadow:"md",position:"bottom-start",children:[e.jsx(_.Target,{children:e.jsx(ue,{px:10,py:5,style:{borderRadius:5,backgroundColor:"var(--mantine-color-brand-0)",cursor:"default",display:"inline-flex"},children:e.jsx(ut,{size:18,color:Ie})})}),e.jsxs(_.Dropdown,{children:[e.jsx(c,{size:"sm",fw:700,mb:"xs",style:{backgroundColor:Ze,borderRadius:"4px 4px 0 0",margin:"-1rem -1rem 0.5rem",padding:"0.6rem 0.75rem"},children:"Based on this form's usage, we estimate you have saved:"}),e.jsx(w,{verticalSpacing:2,horizontalSpacing:"xs",children:e.jsx(w.Tbody,{children:It.map(a=>{const l=a.icon,i=(n/1e3*a.multiplier).toFixed(1);return e.jsxs(w.Tr,{children:[e.jsx(w.Td,{w:30,children:e.jsx(l,{size:14,color:Ie})}),e.jsx(w.Td,{w:50,children:e.jsx(c,{size:"sm",fw:600,ta:"right",children:e.jsx($e,{end:parseFloat(i),decimals:1})})}),e.jsx(w.Td,{children:e.jsx(c,{size:"sm",fw:600,children:a.label})})]},a.label)})})})]})]}),e.jsxs(_,{width:320,shadow:"md",position:"bottom-start",children:[e.jsx(_.Target,{children:e.jsx(ue,{px:10,py:5,style:{borderRadius:5,backgroundColor:r?fs:"var(--mantine-color-brand-0)",cursor:"default",display:"inline-flex"},children:e.jsx(Rs,{size:18,color:r?"#b06000":Ie})})}),e.jsxs(_.Dropdown,{children:[e.jsx(c,{size:"sm",fw:700,mb:"xs",style:{backgroundColor:Ze,borderRadius:"4px 4px 0 0",margin:"-1rem -1rem 0.5rem",padding:"0.6rem 0.75rem"},children:"Below is a status summary for requests on this form:"}),e.jsx(w,{verticalSpacing:2,horizontalSpacing:"xs",children:e.jsx(w.Tbody,{children:bt.map(a=>{const l=a.icon,i=t[a.key]??0;return e.jsxs(w.Tr,{children:[e.jsx(w.Td,{w:30,children:e.jsx(l,{size:14,color:Ct})}),e.jsx(w.Td,{children:e.jsx(c,{size:"sm",fw:600,children:a.label})}),e.jsx(w.Td,{w:40,children:e.jsx(c,{size:"sm",fw:600,ta:"right",children:e.jsx($e,{end:i})})})]},a.key)})})})]})]})]})}function uo(){const o=ws(),[t,n]=Cs(),r=t.get("show")||"all",a=t.get("q")||"",[l,i]=u.useState(a),[m]=Es(l,500),[g,h]=u.useState(1),[d,x]=u.useState(null),[v,y]=u.useState(null),[P,b]=u.useState(!1),[G,T]=u.useState(!1),[z,S]=u.useState(""),[F,X]=u.useState(!1),[ve,B]=u.useState(""),[M,Y]=u.useState(null),[J,ee]=u.useState(!1),[U,se]=u.useState(""),[te,O]=u.useState(""),[j,D]=u.useState(null),oe=bs();u.useEffect(()=>{const s=new URLSearchParams(t);m?s.set("q",m):s.delete("q"),n(s,{replace:!0})},[m]);const ne=u.useCallback(s=>{const p=new URLSearchParams(t);
1s==="all"?p.delete("show"):p.set("show",s),n(p,{replace:!0})},[t,n]),{data:E,isLoading:ye,error:Te,refetch:Fe}=Xe({queryKey:["myForms",r,m,g,d],queryFn:()=>Ss(r!=="all"?r:void 0,m||void 0,g,d??void 0)}),ts=E?.forms??[],V=E?.total_count??0,H=r!=="all"||!!m,Me=Math.ceil(V/6),q=!!d,os=E?.team_users??[],re=E?.subscription_admin??null,Le=E?.subscription_type??"",we=Le==="Team"||Le==="Trial"?[...re?[{value:re,label:re}]:[],...os.filter(s=>s!==re).map(s=>({value:s,label:s}))]:[],Ce=we.length>0;u.useEffect(()=>{h(1)},[m,r,d]);const ns=async()=>{if(z.trim()){X(!0),B("");try{const s=await Ns(z.trim());T(!1),S(""),oe.invalidateQueries({queryKey:["myForms"]}),o(`/my-forms/${s.form_id}/settings/`)}catch(s){const p=Ae(s,"Failed to connect form.");B(p.error)}finally{X(!1)}}},rs=async()=>{if(v){b(!0);try{await Ps(v.form_id),y(null),((await Fe()).data?.forms??[]).length===0&&window.location.reload()}finally{b(!1)}}},ae=()=>{Y(null),ee(!1),se(""),O("")},ie=_s({mutationFn:({email:s,formIds:p,confirm:be})=>zs(s,p,be),onSuccess:(s,p)=>{if(s.confirmation_required){ae(),D({formCount:s.form_count,activeCount:s.active_count,formTitles:s.form_titles,hasMore:s.has_more_forms,email:p.email,formIds:p.formIds});return}D(null),Ee.show({title:"Forms transferred",message:`${s.transferred_count} form(s) transferred to ${p.email}.`,color:"green"}),oe.invalidateQueries({queryKey:["myForms"]})},onError:s=>{const be=(s?.response?.data?.error||"Transfer failed. Please try again.").replace(/^Problem description:\s*/i,"");ae(),D(null),Ee.show({title:"Transfer failed",message:be,color:"red"})}}),Ne=()=>{const s=U.trim().toLowerCase();if(O(""),!s||!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(s)){O("Please enter a valid email address.");return}const p=M?[M.form_id]:void 0;ie.mutate({email:s,formIds:p})};if(ye)return e.jsx(Ms,{});if(Te){const s=Ae(Te,"Failed to load forms.");return e.jsx(Fs,{message:s.error,errorCode:s.error_code,context:s.context,onRetry:()=>Fe()})}return e.jsxs(e.Fragment,{children:[e.jsx(Ts,{title:"My Forms",description:"Manage your Google Forms approval workflows.",noIndex:!0}),e.jsxs(L,{gap:"lg",children:[e.jsxs(C,{justify:"space-between",align:"flex-start",children:[e.jsxs("div",{children:[e.jsxs(C,{gap:"sm",align:"center",children:[e.jsx(Pe,{order:1,children:"My Forms"}),e.jsxs(f,{shadow:"md",width:280,position:"bottom-start",children:[e.jsx(f.Target,{children:e.jsx(_e,{px:6,py:2,style:{borderRadius:"var(--mantine-radius-sm)"},className:"hover-highlight",children:e.jsxs(C,{gap:4,children:[e.jsx(Oe,{size:20,color:"var(--mantine-color-dimmed)"}),e.jsx(c,{size:"sm",c:"dimmed",children:"Actions"})]})})}),e.jsxs(f.Dropdown,{children:[e.jsx(f.Item,{leftSection:e.jsx(As,{size:16}),component:A,to:"/my-forms/builder/",children:"Create new form with AI"}),e.jsx(f.Item,{leftSection:e.jsx($s,{size:16}),onClick:()=>T(!0),children:"Connect existing form"}),!q&&V>0&&e.jsxs(e.Fragment,{children:[e.jsx(f.Divider,{}),e.jsx(f.Item,{leftSection:e.jsx(qe,{size:16}),onClick:()=>ee(!0),children:"Transfer all forms"})]})]})]})]}),e.jsxs(c,{size:"md",c:"dimmed",mt:4,children:["Below is information about ",q?"their":"your"," forms"]})]}),e.jsxs(L,{gap:"xs",align:"flex-end",visibleFrom:"md",children:[Ce&&e.jsx(Ge,{placeholder:"View a team member's forms",data:we,value:d,onChange:x,clearable:!0,searchable:!0,leftSection:e.jsx(Ue,{size:16}),size:"md",w:360}),(V>0||H)&&e.jsxs(C,{gap:"md",children:[e.jsx(me,{placeholder:"Search by form name...",leftSection:e.jsx(Ve,{size:14}),rightSection:l?e.jsx(Re,{size:"sm",onClick:()=>i("")}):void 0,value:l,onChange:s=>i(s.currentTarget.value),size:"md",w:300}),e.jsx(He,{value:r,onChange:ne,data:[{label:"All",value:"all"},{label:"Active",value:"active"}],size:"md"})]})]}),(Ce||V>0||H)&&e.jsxs(ze,{position:"bottom-end",shadow:"md",width:300,children:[e.jsx(ze.Target,{children:e.jsx(N,{variant:H||q?"light":"default",leftSection:e.jsx(Bs,{size:16}),hiddenFrom:"md",children:"Filters"})}),e.jsx(ze.Dropdown,{children:e.jsxs(L,{gap:"sm",children:[Ce&&e.jsx(Ge,{placeholder:"View a team member's forms",data:we,value:d,onChange:x,clearable:!0,searchable:!0,leftSection:e.jsx(Ue,{size:16}),size:"sm"}),e.jsx(me,{placeholder:"Search by form name...",leftSection:e.jsx(Ve,{size:14}),rightSection:l?e.jsx(Re,{size:"sm",onClick:()=>i("")}
1):void 0,value:l,onChange:s=>i(s.currentTarget.value),size:"sm"}),e.jsx(He,{value:r,onChange:ne,data:[{label:"All",value:"all"},{label:"Active",value:"active"}],size:"sm",fullWidth:!0})]})})]})]}),V===0?q&&!H?e.jsx(ce,{py:60,children:e.jsxs(L,{align:"center",gap:"md",maw:400,children:[e.jsx(De,{size:64,radius:"xl",variant:"light",color:"gray",children:e.jsx(Be,{size:32})}),e.jsx(Pe,{order:3,ta:"center",children:"No forms found"}),e.jsxs(c,{size:"sm",c:"dimmed",ta:"center",children:[d," has not connected any forms yet."]})]})}):H?e.jsx(ce,{py:40,children:e.jsxs(c,{c:"dimmed",children:["No forms matching",l?e.jsxs(e.Fragment,{children:[" â",l,"â"]}):" your filters"]})}):e.jsx(ce,{py:60,children:e.jsxs(L,{align:"center",gap:"md",maw:500,children:[e.jsx(De,{size:64,radius:"xl",variant:"light",children:e.jsx(Be,{size:32})}),e.jsx(Pe,{order:2,ta:"center",children:"No forms connected yet"}),e.jsx(c,{size:"md",c:"dimmed",ta:"center",children:"Connect a Google Form with the Form Approvals add-on to start tracking approval workflows here."}),e.jsx(N,{component:A,to:"/support/",variant:"light",size:"md",children:"Get started today"})]})}):e.jsxs(e.Fragment,{children:[e.jsx(Os,{cols:{base:1,sm:2,lg:3},spacing:"md",className:"animated zoomEffect",children:ts.map(s=>e.jsxs(Is,{withBorder:!0,shadow:"sm",padding:"lg",radius:"md",className:"card-hover",style:{cursor:"pointer",borderColor:"var(--mantine-color-gray-2)"},onClick:()=>o(`/my-forms/${s.form_id}/requests/`),children:[e.jsxs(C,{justify:"space-between",align:"flex-start",wrap:"nowrap",mb:"sm",style:{minHeight:28},children:[e.jsx(Pt,{formId:s.form_id}),e.jsx("div",{onClick:p=>p.stopPropagation(),style:{marginLeft:"auto"},children:e.jsxs(f,{shadow:"md",width:200,children:[e.jsx(f.Target,{children:e.jsx(_e,{children:e.jsxs(C,{gap:4,children:[e.jsx(c,{size:"sm",c:"dimmed",children:"Actions"}),e.jsx(Oe,{size:20,color:"var(--mantine-color-dimmed)"})]})})}),e.jsxs(f.Dropdown,{children:[e.jsx(f.Item,{leftSection:e.jsx(mt,{size:14}),component:A,to:`/my-forms/${s.form_id}/requests/`,children:"Track Requests"}),!q&&e.jsx(f.Item,{leftSection:e.jsx(qs,{size:14}),component:A,to:`/my-forms/${s.form_id}/settings/`,children:"Form Settings"}),e.jsx(f.Item,{leftSection:e.jsx(Gs,{size:14}),component:"a",href:`https://docs.google.com/forms/d/${s.form_id}/edit`,target:"_blank",children:"Open Form"}),e.jsx(f.Item,{leftSection:e.jsx(Us,{size:14}),component:"a",href:`https://docs.google.com/spreadsheets/d/${s.spreadsheet_id}/edit`,target:"_blank",children:"Open Spreadsheet"}),!q&&e.jsxs(e.Fragment,{children:[e.jsx(f.Divider,{}),e.jsx(f.Item,{leftSection:e.jsx(qe,{size:14}),onClick:()=>Y(s),children:"Transfer Form"}),e.jsx(f.Item,{leftSection:e.jsx(ks,{size:14}),color:"red",onClick:()=>y(s),children:"Remove Form"})]})]})]})})]}),e.jsx(c,{fw:700,fz:"lg",style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:s.form_title||"Untitled Form"}),e.jsxs(C,{justify:"space-between",align:"center",mt:"md",children:[e.jsx(c,{size:"sm",c:"dimmed",children:s.last_processed_ms?`Last used ${new Date(s.last_processed_ms).toLocaleDateString()}`:"Â "}),s.is_active?e.jsx(We,{size:"md",variant:"light",color:"brand",children:"Active"}):e.jsxs(_,{width:220,shadow:"md",withArrow:!0,openDelay:200,children:[e.jsx(_.Target,{children:e.jsx(We,{size:"md",variant:"light",color:"gray",style:{cursor:"help"},children:"Inactive"})}),e.jsxs(_.Dropdown,{onClick:p=>p.stopPropagation(),children:[e.jsxs(c,{size:"xs",mb:4,children:["To activate, open the"," ",e.jsx(de,{href:`https://docs.google.com/forms/d/${s.form_id}/edit`,target:"_blank",size:"xs",children:"Google Form"})," ","and turn on the add-on from the sidebar."]}),e.jsx(de,{component:A,to:"/support/faq/#activate-addon",size:"xs",children:"Learn more"})]})]})]})]},s.form_id))}),Me>1&&e.jsx(ce,{children:e.jsx(I,{total:Me,value:g,onChange:h,size:"md"})})]})]}),e.jsx(Se,{opened:G,onClose:()=>{T(!1),S(""),B("")},title:"Connect Existing Google Form",centered:!0,size:"lg",children:e.jsxs(L,{gap:"md",children:[e.jsx(c,{size:"sm",c:"dimmed",children:"Paste the URL of a Google Form you have edit access to."}),e.jsx(me,{label:"Google Form URL",placeholder:"https://docs.google.com/forms/d/.../edit",value:z,onChange:s=>{S(s.currentTarget.value),B("")},error:ve||void 0}),e.jsx(c,{size:"xs",c:"dimmed",children:"Only new submissions after activation will be processed. Existing responses will not be tracked."}),e.jsxs(C,{justify:"flex-end",children:[e.jsx(N,{variant:"subtle",color:"gray",onClick:()=>{T(!1),S(""),B("")},disabled:F,children:"Cancel"}),e.jsx(N,{onClick:ns,loading:F,disabled:!z.trim(),children:"Connect"})]})]})}),e.jsx(Ls,{opened:!!v,onClose:()=>y(null),onConfirm:rs,title:"Remove Form",message:`Are you sure you want to remove "${v?.form_title||"this form"}"? This action cannot be undone.`,confirmLabel:"Remove",confirmColor:"red",loading:P}),e.jsx(Se,{opened:!!M||J,onClose:ae,title:M?"Transfer Form":"Transfer All Forms",centered:!0,children:e.jsxs(L,{gap:"md",children:[e.jsx(c,{size:"sm",fw:600,children:M?`This will transfer "${M.form_title||"Untitled Form"}" to another user.`:"This will transfer all your forms to another user."}),e.jsx(c,{size:"sm",fw:600,children:"Before transferring:"}),e.jsxs($,{size:"sm",withPadding:!0,children:[e.jsxs($.Item,{children:["The new owner must have the"," ",e.jsx(de,{component:A,to:"/support/#installing-the-addon",size:"sm",children:"Form Approvals add-on"}
1)," ","installed"]}),e.jsxs($.Item,{children:["Share the Google Form(s) and linked Google Sheet(s) with the new owner"," ",e.jsx(Ke,{label:"We recommend owner-level access. Editor access can be problematic if the owner's account is ever closed.",multiline:!0,w:260,fz:"xs",children:e.jsx(Qe,{size:14,style:{verticalAlign:"middle",cursor:"help",color:"var(--mantine-color-brand-5)"}})})]}),e.jsxs($.Item,{children:["Share any file upload folders or attachment templates used by the form(s)"," ",e.jsx(Ke,{label:"We recommend owner-level access. Editor access can be problematic if the owner's account is ever closed.",multiline:!0,w:260,fz:"xs",children:e.jsx(Qe,{size:14,style:{verticalAlign:"middle",cursor:"help",color:"var(--mantine-color-brand-5)"}})})]})]}),e.jsxs(c,{size:"sm",c:"dimmed",children:["All workflows will be deactivated. The new owner will receive an email with steps to activate the workflow on their account."," ",e.jsx(de,{component:A,to:"/support/faq/#change-administrator",size:"xs",children:"See the full guide"})]}),e.jsx(me,{label:"New owner's email address",placeholder:"[email protected]",value:U,onChange:s=>{se(s.currentTarget.value),te&&O("")},error:te,onKeyDown:s=>{s.key==="Enter"&&Ne()}}),e.jsxs(C,{justify:"space-between",children:[e.jsx(N,{variant:"subtle",color:"gray",onClick:ae,children:"Cancel"}),e.jsx(N,{color:"brand",loading:ie.isPending,onClick:Ne,disabled:!U.trim(),children:"Transfer"})]})]})}),e.jsx(Se,{opened:!!j,onClose:()=>D(null),title:"Confirm Transfer",centered:!0,children:j&&e.jsxs(L,{gap:"md",children:[e.jsxs(c,{size:"sm",children:["You are about to transfer"," ",e.jsxs(c,{component:"span",fw:600,children:[j.formCount," form",j.formCount!==1?"s":""]})," ","to ",e.jsx(c,{component:"span",fw:600,children:j.email}),"."]}),j.activeCount>0&&e.jsxs(c,{size:"sm",c:"orange",fw:500,children:[j.activeCount," active form",j.activeCount!==1?"s":""," will be deactivated."]}),e.jsxs($,{size:"sm",withPadding:!0,children:[j.formTitles.map(s=>e.jsx($.Item,{children:s},s)),j.hasMore&&e.jsx($.Item,{c:"dimmed",children:"...and more"})]}),e.jsxs(C,{justify:"space-between",children:[e.jsx(N,{variant:"subtle",color:"gray",onClick:()=>D(null),children:"Cancel"}),e.jsx(N,{color:"red",loading:ie.isPending,onClick:()=>{ie.mutate({email:j.email,formIds:j.formIds,confirm:!0})},children:"Confirm Transfer"})]})]})})]})}export{uo as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.