1import{d as F,a as b,au as I,j as e,B as T,b as c,A as m,a3 as D,br as x,bf as S,G as y,aT as p,$ as g,gH as k,t as w,aZ as j,aU as u,P as C}from"./index-ZWP6Dbbj.js";import{F as i,b8 as P,r as v,ed as z,b2 as B,b3 as E,b9 as U,bK as R}from"./vendor-DKtCm5W2.js";import{S as V}from"./Section-9c2B7Hiq.js";import{T as $}from"./Timestamp-DDhRNjca.js";import{D as L,p as _}from"./datatable-Cfbt26lj.js";import{c as O}from"./datatable.filter.simple-CsLbGwLW.js";import{c as N}from"./datatable.filter.singleSelect-BQCKTyqL.js";import{p as K,a as G}from"./datatable.filters-Dwsbh5Gb.js";import{e6 as Q}from"./app-BUG-_G7c.js";import{B as Y}from"./Badge-BSVpQSIn.js";import"./dayjs-timezone-iana-plugin-CmU3ItL3.js";import"./index-CSsIgRT9.js";import"./Table-D-cltB6O.js";import"./use-local-storage-B6mdnEJH.js";import"./Flex-BW4uY8y1.js";import"./Pagination-VWWeEXnf.js";import"./use-timeout-CYZOc6rN.js";import"./useQueryState-DlBYWQmz.js";import"./useStableSearchParams-Cxlr7cJY.js";import"./Alert-QeeEGDQH.js";import"./Switch-B4YEvjka.js";import"./index.module-DtN7QIjo.js";import"./NumberInput-CO5lUDai.js";try{let n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="cd9195ce-8c48-4f57-b55b-c4af653e450f",n._sentryDebugIdIdentifier="sentry-dbid-cd9195ce-8c48-4f57-b55b-c4af653e450f")}catch{}const J={en:"Add Form",nl:"Vragenlijst aanmaken"},M={en:"Responses",nl:"Antwoorden"},W={en:"Are you sure you want to cancel the %{g:deed}?",nl:"Ben je zeker dat je %{g:theDeed} %{g:deed} wilt annuleren?"},H={en:"Actions",nl:"Acties"},Z={en:"%{g:deeds | capitalize}",nl:"%{g:deeds | capitalize}"},q={en:"ID",nl:"ID"}
1,X={en:"Last submission",nl:"Laatste inzending"},ee={en:"Form",nl:"Vragenlijst"},te={en:"Pages",nl:"Pagina's"},ne={en:"Responses",nl:"Antwoorden"},se={en:"Status",nl:"Status"},oe={en:"Yes, cancel",nl:"Ja, annuleer"},ae={en:"Could not delete the form",nl:"Kon de vragenlijst niet verwijderen"},re={en:"Delete",nl:"Verwijder"},ie={en:"Back",nl:"Terug"},le={en:"Delete",nl:"Verwijderen"},ce={en:'Are you sure you want to delete "%{form}"? If this form is attached to %{g:aDeed} %{g:deed} or has responses issues may occur.',nl:'Weet je zeker dat je de vragenlijst "%{form}" wilt verwijderen? %{g:deeds | capitalize} of antwoorden verbonden aan de vragenlijst kunnen hierdoor mogelijk niet meer werken'},de={en:"Form deleted",nl:"Vragenlijst verwijderd"},ue={en:"No",nl:"Nee"},me={en:"Duplicate",nl:"Dupliceren"},pe={en:"Edit",nl:"Bewerk"},fe={en:"Forms",nl:"Vragenlijsten"},ge={en:"You haven't made any forms yet, create your first! Forms can be attached to %{g:deeds} to collect specific information from volunteers when they apply, and is visible to you when reviewing a volunteer's application. Forms can also be used standalone to create and send surveys to either your volunteers or any other audience.",nl:"Je hebt nog geen vragenlijsten gemaakt, maak je eerste!"},be={en:"Search forms",nl:"Vragenlijsten zoeken"},he={en:"Active",nl:"Actief"},je={en:"Inactive",nl:"Inactief"},ve={en:"attached to at least one live %{g:deed} (open, upcoming or full) or a published page",nl:"gekoppeld aan minstens één live %{g:deed} (open, aankomend of vol) of een gepubliceerde pagina"},xe={en:"has %{g:deeds} or pages, but none are live or published",nl:"heeft %{g:deeds} of pagina's, maar geen enkele is live of gepubliceerd"},ye={en:"Reflects the %{g:deeds} and pages this form is attached to:",nl:"Weerspiegelt de %{g:deeds} en pagina's waaraan deze vragenlijst is gekoppeld:"},we={en:"not attached to any %{g:deed} or page",nl:"niet gekoppeld aan een %{g:deed} of pagina"},Ae={en:"Unused",nl:"Ongebruikt"},h={addForm:J,applications:M,cancelConfirm:W,columnActions:H,columnDeeds:Z,columnId:q,columnLastSubmission:X,columnName:ee,columnPages:te,columnReplies:ne,columnStatus:se,confirmCancel:oe,deleteError:ae,deleteForm:re,deleteFormCancel:ie,deleteFormConfirm:le,deleteFormTitle:ce,deleteSuccess:de,denyCancel:ue,duplicate:me,edit:pe,forms:fe,noForms:ge,searchPlaceholder:be,statusActive:he,statusInactive:je,statusTooltipActiveDesc:ve,statusTooltipInactiveDesc:xe,statusTooltipIntro:ye,statusTooltipUnusedDesc:we,statusUnused:Ae},Fe={active:"green",inactive:"gray",unused:"yellow"},Ie={active:"statusActive",inactive:"statusInactive",unused:"statusUnused"},Te=({form:n,organizationSlug:a,onDeleted:t})=>{const o=b(h),d=x()(n.name),l=w.forms.delete.useMutation({onSuccess:()=>{j.success({message:o("deleteSuccess")}),t()},onError:()=>{j.error({message:o("deleteError")})}});return e.jsxs(y,{gap:"xs",wrap:"nowrap",children:[e.jsx(p,{label:o("edit"),children:e.jsx(u,{variant:"subtle",component:c,to:`/o/${a}/forms/${n.id}/edit`,"aria-label":o("edit"),children:e.jsx(i,{icon:B})})}),e.jsx(p,{label:o("duplicate"),children:e.jsx(u,{variant:"subtle",component:c,to:`/o/${a}/forms/new?duplicateFrom=${n.id}`,"aria-label":o("duplicate"),children:e.jsx(i,{icon:E})})}),e.jsx(p,{label:o("applications"),children:e.jsx(u,{...m("forms-button-form-responses"),variant:"subtle",component:c,to:`/o/${a}/forms/responses?${G([{column:"form_id",value:n.id}])}`,"aria-label":o("applications"),children:e.jsx(i,{icon:U})})}),e.jsx(C,{onConfirm:async()=>{await l.mutateAsync({formId:n.id})},okText:o("deleteFormConfirm"),cancelText:o("deleteFormCancel"),title:o("deleteFormTitle",{form:d}),okButtonProps:{...m("forms-button-delete-form-popconfirm-button-confirm"),color:"danger"},children:e.jsx(u,{...m("forms-button-delete-form"),variant:"subtle",color:"danger","aria-label":o("deleteForm"),loading:l.isPending,children:e.jsx(i,{icon:R})})})]})},De=({organizationSlug:n,organizationId:a})=>{const t=b(h),[o]=D(),f=x(),d=v.useRef(null),l=o.get(S.filter),A=v.useMemo(()=>{const r=K(l);return[{accessor:"id",title:t("columnId"),width:80,render:s=>s.id},{accessor:"name",title:t("columnName"),render:s=>e.jsx(c,{to:`/o/${n}/forms/${s.id}`,children:f(s.name)}),...O(r,"name",{placeholder:t("searchPlaceholder")})},{accessor:"responseCount",title:t("columnReplies"),sortable:!0,textAlign:"right",render:s=>s.responseCount},{accessor:"lastSubmissionAt",title:t("columnLastSubmission"),sortable:!0,render:s=>s.lastSubmissionAt?e.jsx($,{dateOnly:!0,skipFromNow:!0,children:s.lastSubmissionAt}):"â"},{accessor:"deedCount",title:t("columnDeeds"),sortable:!0,textAlign:"right",render:s=>s.deedCount},{accessor:"pageCount",title:t("columnPages"),sortable:!0,textAlign:"right",render:s=>s.pageCount},{accessor:"status",title:e.jsxs(y,{gap:4,wrap:"nowrap",children:[t("columnStatus"),e.jsx(p,{multiline:!0,w:300,withArrow:!0,label:e.jsxs(g,{children:[t("statusTooltipIntro"),e.jsxs(g,{component:"ul",m:0,mt:4,pl:"md",children:[e.jsxs("li",{children:[e.jsx("strong",{children:t("statusActive")}
1)," â"," ",t("statusTooltipActiveDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:t("statusInactive")})," â"," ",t("statusTooltipInactiveDesc")]}),e.jsxs("li",{children:[e.jsx("strong",{children:t("statusUnused")})," â"," ",t("statusTooltipUnusedDesc")]})]})]}),children:e.jsx(g,{component:"span",c:"dimmed",style:{cursor:"help",display:"inline-flex"},children:e.jsx(i,{icon:z})})})]}),render:s=>e.jsx(Y,{color:Fe[s.status],variant:"light",children:t(Ie[s.status])}),...N(r,"status",{options:[{value:"active",label:t("statusActive")},{value:"inactive",label:t("statusInactive")},{value:"unused",label:t("statusUnused")}]})},{accessor:"actions",title:t("columnActions"),render:s=>e.jsx(Te,{form:s,organizationSlug:n,onDeleted:()=>d.current?.()})}]},[l,n,f,t]);return e.jsx(L,{isColumnsLoaded:!0,storeColumnsKey:"o.forms.list",idAccessor:"id",columns:A,defaultSort:{column:"lastSubmissionAt",order:k.desc},refs:{refetch:d},useDataQuery:r=>w.forms.list.useQuery({...r,organizationId:a}),extractData:r=>({results:r?.results??[],pageInfo:_(r?.pagination)})})},Ze=()=>{const{organizationSlug:n}=F();if(!n)throw new Error("organizationSlug not found in route");const a=b(h),t=I()?.id;return e.jsx(V,{heading:a("forms"),buttons:e.jsx(T,{...m("forms-button-add-form"),size:"sm",component:c,to:`/o/${n}/forms/new`,className:Q.addFormButton,leftSection:e.jsx(i,{icon:P}),children:a("addForm")}),children:t!==void 0&&e.jsx(De,{organizationSlug:n,organizationId:t})})};export{Ze as default}; 2//# sourceMappingURL=index-D4mPvd0b.js.map
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.