1try{!function(){var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="a16e50b1-f429-4797-849a-e75f695dd1dc",e._sentryDebugIdIdentifier="sentry-dbid-a16e50b1-f429-4797-849a-e75f695dd1dc")}()}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2149],{10777:(e,t,n)=>{"use strict";n.d(t,{n:()=>h});var i=n(37876),r=n(24973),s=n(26730),l=n(50869),a=n(89028),o=n(79455),d=n(23347),u=n(58090),c=n(66618);let h=(0,n(14232).memo)(function(e){let{hideEditIcon:t,hideOverflowMenu:n,disableTooltips:h,resourceName:g,onEditClick:p,onArchiveClick:m,onUnarchiveClick:f,filterTransactionsLink:A,onAddSubResourceClick:v,viewAnalyticsLink:x}=e;return(0,i.jsxs)(s.A,{spacing:1,children:[(0,i.jsx)(c.A,{children:!t&&(0,i.jsx)(l.A,{onPress:p,tooltip:h?void 0:"Edit ".concat(g),"aria-label":"Edit ".concat(g),children:(0,i.jsx)(a.A,{path:r.KsW})})}),!n&&(0,i.jsxs)(u.Ay,{tooltip:h?null:void 0,children:[!t&&(0,i.jsx)(o.A,{title:"Edit ".concat(g),onClick:p}),!!v&&(0,i.jsx)(o.A,{title:"Add sub-".concat(g),onClick:v}),!!(A||x)&&(0,i.jsx)(d.A,{}),!!A&&(0,i.jsx)(o.A,{title:"Filter transactions",href:A}),!!x&&(0,i.jsx)(o.A,{title:"View analytics",href:x}),!!m&&(0,i.jsx)(d.A,{}),!!m&&(0,i.jsx)(o.A,{title:"Archive",onClick:m,color:"red"}),!!f&&(0,i.jsx)(o.A,{title:"Un-Archive",onClick:f})]})]})})},49925:(e,t,n)=>{"use strict";n.r(t),n.d(t,{__N_SSP:()=>D,default:()=>W});var i=n(37876),r=n(72341),s=n(24973),l=n(98939),a=n(88275),o=n(79686),d=n(50869),u=n(56264),c=n(89028),h=n(31231),g=n(66618),p=n(55989),m=n(14232),f=n(84324),A=n(78235),v=n(10777),x=n(26730),j=n(46256),w=n(28842),b=n(55565),y=n(49535),C=n(82077),k=n(20104),F=n(96427),P=n(27630),S=n(20578),I=n(64177);function R(){let e=(0,F._)(["\n mutation ArchiveFundingTag($input: RemoveCashflowFundingProgramInput!) {\n removeOrganizationCashflowFundingProgram(input: $input) {\n id\n cashflowFundingPrograms {\n ...AllCashflowFundingProgramFields\n }\n }\n}\n ",""]);return R=function(){return e},e}let E={},M=(0,P.J1)(R(),S.b9),_=e=>{let{open:t,onClose:n,fundingProgram:r}=e,{archiveFundingTag:s,archiving:l}=(e=>{let{fundingProgram:t,onClose:n}=e,{queueSnackbar:i}=(0,k.xt)(),[r,{loading:s}]=function(e){let t={...E,...void 0};return I.n(M,t)}(),l=(0,m.useCallback)(async()=>{await r({onCompleted:()=>{i({message:"".concat(t.name," was archived. Your books are being updated.")}),n()},refetchQueries:[C.czN.Query.GetCashflowFundingPrograms],variables:{input:{fundingProgramId:t.id}}})},[r,t.id,t.name,n,i]);return(0,m.useMemo)(()=>({archiveFundingTag:l,archiving:s}),[l,s])})({fundingProgram:r,onClose:n});return(0,i.jsxs)(b.A,{title:"Archive Funding Tag",open:t,onClose:n,isDestructive:!0,loading:l,onAction:s,actionLabel:"Archive",highlightedRowId:r.id,children:[(0,i.jsxs)(y.A,{variant:"body",children:["Are you sure you want to archive ",r.name," and hide it from your tagger?"]}),(0,i.jsx)(y.A,{variant:"body",children:"Existing tags on transactions and other records won't be affected, and you can still find archived funding tags in analytics, accounting, and exports."})]})},N=e=>{let{program:t,onAddSubFundingTagClick:n}=e,r=(0,w.A)(),[s,l]=(0,m.useState)(!1);return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(v.n,{resourceName:"funding tag",onEditClick:()=>{r({editFundingId:t.id})},onArchiveClick:()=>l(!0),filterTransactionsLink:"/app/transactions?fundingTagIds=".concat(t.id),onAddSubResourceClick:()=>n(t.id)}),(0,i.jsx)(x.A,{children:(0,i.jsx)(_,{open:s,onClose:()=>{l(!1)},fundingProgram:t})})]})},T=e=>{let{loading:t,items:n,searchQuery:r,onClearSearch:s,onAddSubFundingTagClick:l}=e,a=(0,w.A)(),o=(0,m.useMemo)(()=>({editRouterParam:"editFundingId",getRowClickBehavior:e=>({onClick:()=>{a({editFundingId:e.id})}}),renderActions:e=>(0,i.jsx)(N,{program:e,onAddSubFundingTagClick:l}),resourceName:"funding tag",searchFields:["name"],tableId:j.z}),[a,l]);return(0,i.jsx)(A.A,{items:n,loading:t,searchQuery:r,onClearSearch:s,config:o})},O=()=>{let{fundingPrograms:e,loading:t}=(0,l.A)(),[n,r]=(0,m.useState)(""),{open:A,parentId:v,onAddClick:x,onAddSubResourceClick:j,onClose:w}
1=(0,a.P)("/app/settings/funding");return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(a.A,{title:"Funding",hasItems:e.length>0,loading:t,search:n,onChangeSearch:r,onAddClick:x,headerActions:(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g.A,{children:(0,i.jsx)(o.A,{color:"brown",light:!0,href:"/app/funding",size:"medium",startIcon:(0,i.jsx)(c.A,{path:s.bAr}),children:"Recommendations"})}),(0,i.jsx)(p.A,{children:(0,i.jsx)(d.A,{href:"/app/funding",children:(0,i.jsx)(c.A,{path:s.cVf})})})]}),emptyState:(0,i.jsx)(u.A,{graphic:(0,i.jsx)(h.A,{src:"/img/graphics/funding.png",width:240,height:180,alt:"Illustration of a funding award with a dollar sign",multiply:!0,priority:!0,nativeStyle:{height:100,resizeMode:"contain",width:240}}),heading:"Organize funding and reporting requirements",description:"Track awards and expenses related to grants, loans, and other funding programs for easy reporting and reimbursements.",cta:(0,i.jsx)(o.A,{onClick:x,children:"New Funding Tag"})}),children:(0,i.jsx)(T,{loading:t,items:e,searchQuery:n,onClearSearch:()=>r(""),onAddSubFundingTagClick:j})}),(0,i.jsx)(f.A,{open:A,onClose:w,parentFundingTagId:v})]})};var z=n(62867),D=!0;let W=()=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(z.bV,{title:"Funding"}),(0,i.jsx)(r.A,{active:"account",children:(0,i.jsx)(O,{})})]})},65349:(e,t,n)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/app/settings/funding",function(){return n(49925)}])},78235:(e,t,n)=>{"use strict";n.d(t,{A:()=>B});var i=n(37876),r=n(3838),s=n(52200),l=n(94211),a=n(78332),o=n(37507),d=n(80733),u=n(49535),c=n(14232);class h{static fromQuantity(e){var t;return{displayName:e.cashflowMetric.displayName,id:e.id,isPrimary:e.isPrimary,quantityAmountThousandths:e.quantityAmountThousandths,unitOfMeasureId:null==(t=e.cashflowMetric.unitsOfMeasure)?void 0:t.id}}}var g=n(93657),p=n(77269);let m=e=>{let{quantities:t,catalogUnitsById:n}=e,r=[...null!=t?t:[]].sort((e,t)=>e.isPrimary&&!t.isPrimary?-1:!e.isPrimary&&t.isPrimary?1:e.cashflowMetric.displayName.localeCompare(t.cashflowMetric.displayName));return(0,i.jsx)(p.A,{maskGradient:!0,children:(0,i.jsx)(l.A,{spacing:[.25,.5],children:r.map(e=>(0,i.jsx)(g.A,{variant:"chip",catalogUnitsById:n,quantity:h.fromQuantity(e)},e.id))})})};var f=n(88069),A=n(60575),v=n(79065),x=n(75965);let j=e=>{var t;let{tableId:n,columns:r,items:s,getRowClickBehavior:l,searchQuery:a,searchFields:o,loading:d,bgColor:u}=e,h=(0,c.useMemo)(()=>{let e=A.A.toNestedStructure({idField:"id",items:s}),t=e;a&&o&&(t=new v.A({idField:"id",searchFn:(e,t)=>o.some(n=>{let i=e[n];return!!(0,f.A)(i)&&i.toLowerCase().includes(t.toLowerCase().trim())})}).search(e,a));let n=e=>({...e,subRows:e.children.map(n)});return t.map(n)}
1,[s,o,a]),g={backgroundColor:u,dividerPosition:"both",height:null!=(t=e.rowHeight)?t:2.75},p=(0,c.useCallback)(e=>{var t;return null!=(t=null==e?void 0:e.subRows)?t:[]},[]),m=(0,c.useCallback)(e=>({depthOverride:0===e.subRows.length&&0!==e.depth?e.depth+1:void 0}),[]),j=(0,c.useMemo)(()=>({}),[]);return(0,i.jsx)(x.Ay,{columns:r,data:h,extractSubRows:p,getRowStyle:m,getRowClickBehavior:l,getRowHighlightId:e=>e.id,styleSpec:g,tableId:n,enableRowExpansion:!0,loading:d,printableDocumentProps:j})};var w=n(27459),b=n(32653),y=n(89928),C=n(52885),k=n(13677),F=n(17507),P=n(57620),S=n(52244);let I=e=>{let t,{items:n,getRowClickBehavior:r,searchQuery:s,searchFields:l,renderActions:a,loading:o}=e,d=(0,c.useMemo)(()=>[{cell:e=>(0,i.jsx)(u.A,{variant:"body",children:e.cell.row.original.name}),id:"name"}],[]),h=(0,c.useMemo)(()=>{let e=A.A.toNestedStructure({idField:"id",items:n}),t=e;s&&l&&(t=new v.A({idField:"id",searchFn:(e,t)=>l.some(n=>{let i=e[n];return!!(0,f.A)(i)&&i.toLowerCase().includes(t.toLowerCase().trim())})}).search(e,s));let i=e=>({...e,subRows:e.children.map(i)});return t.map(i)},[n,l,s]),[g,p]=(0,c.useState)({}),m=(0,c.useCallback)(e=>{var t;return null!=(t=null==e?void 0:e.subRows)?t:[]},[]),x=(0,w.N4)({columns:d,data:o?(t=20,Array.from({length:20},()=>({}))):h,getCoreRowModel:(0,b.HT)(),getExpandedRowModel:(0,b.D0)(),getSubRows:m,onExpandedChange:p,state:{expanded:g}}),j=x.getRowModel().rows;(0,c.useEffect)(()=>{x.toggleAllRowsExpanded(!0)},[x]);let I=(0,c.useCallback)(e=>{var t;let{item:n}=e;if(o)return(0,i.jsx)(k.A,{top:.5,bottom:.5,gutter:"responsive",children:(0,i.jsx)(F.A,{show:!0,width:"100%",height:32})});let s=null!=(t=null==r?void 0:r(n.original))?t:void 0,l=(0,i.jsx)(u.A,{variant:["small","body"],children:n.original.name});return(0,i.jsx)(C.A,{depth:n.depth,rowOnPress:e=>{var t;null==s||null==(t=s.onClick)||t.call(s,n.original),null==e||e.stopPropagation()},formControl:l,endEl:a?a(n.original):void 0,size:["small","medium"]})},[o,a,r]);return(0,i.jsx)(P.A,{data:j,renderItem:I,scrollEnabled:"web"!==S.A.OS,style:{marginTop:(0,y.A)(1)},contentContainerStyle:"web"===S.A.OS?{}:{paddingVertical:16}})};var R=n(71763),E=n(96427),M=n(27630),_=n(44331),N=n(27250);function T(){let e=(0,E._)(["\n query TagResourceGetCatalogUnits($orgId: ID!) {\n organization(orgId: $orgId) {\n id\n catalogUnits {\n ...AllCatalogUnitFields\n }\n }\n}\n ",""]);return T=function(){return e},e}let O={},z=(0,M.J1)(T(),_.EM),D=e=>{let{items:t,searchQuery:n,config:r}=e;return(0,i.jsx)(I,{renderActions:e=>r.renderActions(e),searchFields:r.searchFields,items:t,searchQuery:n,getRowClickBehavior:r.getRowClickBehavior?e=>r.getRowClickBehavior(e):void 0})},W=e=>"archived"in e&&!!e.archived,Q=e=>{let{items:t,searchQuery:n,config:r}=e,a=(()=>{let{data:e}=function(e){let t={...O,...e};return N.IT(z,t)}({variables:{orgId:(0,R.A)()}}),t=(0,c.useMemo)(()=>{var t,n;return null!=(n=null==e||null==(t=e.organization)?void 0:t.catalogUnits)?n:[]},[e]);return(0,c.useMemo)(()=>Object.fromEntries(t.map(e=>[e.id,e])),[t])})(),o=(0,c.useMemo)(()=>{var e,t,n,s,l,o,c;let h=[],g={cellSpec:{basis:20,justify:"flex-start",minWidth:5,widthForPrinting:15,...null==(e=r.columnOverrides)?void 0:e.name},headerSpec:{sort:"desc",sortLabel:"Sorted alphabetically",title:"Name"},id:"name",renderCell:(e,t)=>(0,i.jsx)(d.A,{gutterProps:{align:"center",gutter:(null==t?void 0:t.gutter)||"none",justify:null==t?void 0:t.justify},renderCellWithWrapper:t.renderCellWithWrapper,children:(0,i.jsxs)(u.A,{variant:"small",light:W(e),children:[e.name,W(e)?" (Archived)":""]})})};for(let e of(h.push(g),null!=(l=null==(t=r.extraDesktopColumns)?void 0:t.filter(e=>"after-name"===e.position))?l:[]))h.push(e.column);let p={cellSpec:{basis:20,justify:"flex-start",minWidth:5,widthForPrinting:20,...null==(n=r.columnOverrides)?void 0:n.metrics},headerSpec:{title:"Metrics"},id:"metrics",renderCell:(e,t)=>(0,i.jsx)(d.A,{gutterProps:{align:"center",gutter:(null==t?void 0:t.gutter)||"none",justify:null==t?void 0:t.justify},disablePointerEvents:!0,children:(0,i.jsx)(m,{quantities:e.cashflowMetricQuantities,catalogUnitsById:a})})};if(h.push(p),r.showDescription){let e={cellSpec:{basis:5,maxWidth:15,widthForPrinting:30,...null==(o=r.columnOverrides)?void 0:o.description},headerSpec:{title:"Description"},id:"description",renderCell:(e,t)=>
1{var n;return(0,i.jsx)(d.A,{gutterProps:{align:"center",gutter:(null==t?void 0:t.gutter)||"none",justify:null==t?void 0:t.justify},children:(0,i.jsx)(u.A,{variant:"small",fullWidth:!0,truncate:!0,light:W(e),children:null!=(n=e.description)?n:""})})}};h.push(e)}for(let e of null!=(c=null==(s=r.extraDesktopColumns)?void 0:s.filter(e=>"before-actions"===e.position))?c:[])h.push(e.column);return h.push({cellSpec:{basis:1,justify:"flex-end",maxWidth:5.5,minWidth:5.5,widthForPrinting:0},headerSpec:{title:""},id:"actions",renderCell:(e,t)=>(0,i.jsx)(d.A,{gutterProps:{align:"center",gutter:(null==t?void 0:t.gutter)||"none",justify:null==t?void 0:t.justify},disablePointerEvents:!0,children:r.renderActions(e)})}),h},[a,r]);return(0,i.jsxs)(l.A,{column:!0,children:[(0,i.jsx)(j,{tableId:r.tableId,searchFields:r.searchFields,columns:o,items:t,searchQuery:n,rowHeight:r.rowHeight,getRowClickBehavior:r.getRowClickBehavior}),(0,i.jsx)(s.A,{gutter:"responsive"})]})},B=e=>{let{items:t,loading:n,searchQuery:s,onClearSearch:d,config:u}=e,c=(0,a.A)();return(0,i.jsx)(l.A,{column:!0,children:n?(0,i.jsx)(o.A,{count:8,gutter:"responsive",top:.75}):0===t.length?(0,i.jsx)(r.A,{wrapperGutter:"responsive",message:"No results.",cta:"Clear Filters",onClick:d}):c?(0,i.jsx)(D,{items:t,searchQuery:s,config:u}):(0,i.jsx)(Q,{items:t,searchQuery:s,config:u})})}},88275:(e,t,n)=>{"use strict";n.d(t,{A:()=>p,P:()=>m});var i=n(37876),r=n(24973),s=n(79686),l=n(89028),a=n(2834),o=n(94211),d=n(78332),u=n(55361),c=n(2506),h=n(55126),g=n(14232);let p=e=>{let{title:t,hasItems:n,loading:h,search:g,onChangeSearch:p,onAddClick:m,headerActions:f,searchBottom:A,emptyState:v,children:x}=e,j=(0,d.A)(),w=h||n||!!g;return(0,i.jsxs)(a.A,{size:"stretch",children:[(0,i.jsx)(u.A,{gutter:"responsive",title:t,stickyProps:{withShadow:j},parentHref:"/app/settings",endActions:(0,i.jsxs)(o.A,{align:"center",spacing:1,children:[f,(0,i.jsx)(s.A,{size:"medium",startIcon:(0,i.jsx)(l.A,{path:r.biz}),onClick:m,children:"Add"})]}),bottomPadding:w?1:void 0,bottom:w?(0,i.jsxs)(o.A,{align:"center",spacing:1,flex:1,children:[(0,i.jsx)(c.A,{fullWidth:!0,placeholder:"Search",size:"medium",autoFocus:!0,initialRefinement:g,refine:p}),A]}):""}),w?x:v]})},m=e=>{let t=(0,h.A)(),n=void 0!==t.query.add,[i,r]=(0,g.useState)(n),[s,l]=(0,g.useState)(null),a=(0,g.useRef)(!1);(0,g.useEffect)(()=>{n&&!a.current&&(a.current=!0,r(!0),t.replace(e,void 0,{shallow:!0}))},[n,t,e]);let o=(0,g.useCallback)(()=>{r(!0)},[]);return{onAddClick:o,onAddSubResourceClick:(0,g.useCallback)(e=>{l(e),r(!0)},[]),onClose:(0,g.useCallback)(()=>{r(!1),l(null)},[]),open:i,parentId:s}}}},e=>{e.O(0,[8992,16,4337,3737,8798,6371,4285,8185,3600,815,2455,3246,9117,7620,8681,9479,1792,3736,9973,551,1651,2260,2762,1144,404,4274,7588,9843,5519,9560,636,6593,8792],()=>e(e.s=65349)),_N_E=e.O()}]);
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.