policyengine-household-wizard 0.1.0 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +50 -5
  2. package/dist/WizardReviewList-DhLx8Bla.cjs +1 -0
  3. package/dist/WizardReviewList-oY1HqmLw.js +354 -0
  4. package/dist/index-B_OXaS4a.cjs +1 -0
  5. package/dist/index-CIL8FXNR.cjs +1 -0
  6. package/dist/index-DWM0giHt.js +220 -0
  7. package/dist/index-fgLnXugs.js +225 -0
  8. package/dist/index.cjs +1 -1
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.js +34 -28
  11. package/dist/primitives/WizardReviewList.d.ts +3 -2
  12. package/dist/primitives/WizardReviewList.d.ts.map +1 -1
  13. package/dist/primitives/index.d.ts +12 -10
  14. package/dist/primitives/index.d.ts.map +1 -1
  15. package/dist/primitives/types.d.ts +18 -0
  16. package/dist/primitives/types.d.ts.map +1 -1
  17. package/dist/primitives/useWizardStepFocus.d.ts +13 -0
  18. package/dist/primitives/useWizardStepFocus.d.ts.map +1 -0
  19. package/dist/primitives/useWizardSteps.d.ts +2 -2
  20. package/dist/primitives/useWizardSteps.d.ts.map +1 -1
  21. package/dist/primitives.cjs +1 -1
  22. package/dist/primitives.d.ts +1 -1
  23. package/dist/primitives.js +5 -4
  24. package/dist/uk-household/adapters/householdImpactRequest.d.ts +91 -0
  25. package/dist/uk-household/adapters/householdImpactRequest.d.ts.map +1 -0
  26. package/dist/uk-household/adapters/index.d.ts +2 -0
  27. package/dist/uk-household/adapters/index.d.ts.map +1 -0
  28. package/dist/uk-household/children.d.ts +18 -0
  29. package/dist/uk-household/children.d.ts.map +1 -0
  30. package/dist/uk-household/codes.d.ts +22 -0
  31. package/dist/uk-household/codes.d.ts.map +1 -0
  32. package/dist/uk-household/defaults.d.ts +56 -0
  33. package/dist/uk-household/defaults.d.ts.map +1 -0
  34. package/dist/uk-household/draft.d.ts +37 -0
  35. package/dist/uk-household/draft.d.ts.map +1 -0
  36. package/dist/uk-household/index.d.ts +10 -0
  37. package/dist/uk-household/index.d.ts.map +1 -0
  38. package/dist/uk-household/serialize.d.ts +4 -0
  39. package/dist/uk-household/serialize.d.ts.map +1 -0
  40. package/dist/uk-household/statePension.d.ts +42 -0
  41. package/dist/uk-household/statePension.d.ts.map +1 -0
  42. package/dist/uk-household/types.d.ts +134 -0
  43. package/dist/uk-household/types.d.ts.map +1 -0
  44. package/dist/uk-household/validate.d.ts +59 -0
  45. package/dist/uk-household/validate.d.ts.map +1 -0
  46. package/dist/uk-household-adapters.cjs +1 -0
  47. package/dist/uk-household-adapters.d.ts +1 -0
  48. package/dist/uk-household-adapters.js +5 -0
  49. package/dist/uk-household.cjs +1 -0
  50. package/dist/uk-household.d.ts +1 -0
  51. package/dist/uk-household.js +220 -0
  52. package/dist/us-household/adapters/index.d.ts +1 -1
  53. package/dist/us-household/adapters/v1Payload.d.ts +119 -3
  54. package/dist/us-household/adapters/v1Payload.d.ts.map +1 -1
  55. package/dist/us-household/amount.d.ts +8 -0
  56. package/dist/us-household/amount.d.ts.map +1 -0
  57. package/dist/us-household/draft.d.ts +1 -1
  58. package/dist/us-household/index.d.ts +9 -8
  59. package/dist/us-household/index.d.ts.map +1 -1
  60. package/dist/us-household/normalize.d.ts +1 -1
  61. package/dist/us-household/normalize.d.ts.map +1 -1
  62. package/dist/us-household/serialize.d.ts +1 -1
  63. package/dist/us-household/serialize.d.ts.map +1 -1
  64. package/dist/us-household/tippedOccupations.d.ts +40 -0
  65. package/dist/us-household/tippedOccupations.d.ts.map +1 -0
  66. package/dist/us-household/types.d.ts +138 -18
  67. package/dist/us-household/types.d.ts.map +1 -1
  68. package/dist/us-household/validate.d.ts +1 -1
  69. package/dist/us-household/validate.d.ts.map +1 -1
  70. package/dist/us-household-adapters.cjs +1 -1
  71. package/dist/us-household-adapters.d.ts +1 -1
  72. package/dist/us-household-adapters.js +3 -90
  73. package/dist/us-household.cjs +1 -1
  74. package/dist/us-household.d.ts +1 -1
  75. package/dist/us-household.js +346 -246
  76. package/dist/validation.d.ts +16 -0
  77. package/dist/validation.d.ts.map +1 -0
  78. package/package.json +16 -2
  79. package/src/primitives/WizardReviewList.tsx +35 -18
  80. package/src/primitives/index.ts +3 -0
  81. package/src/primitives/types.ts +20 -0
  82. package/src/primitives/useWizardStepFocus.ts +42 -0
  83. package/src/primitives/useWizardSteps.ts +181 -84
  84. package/src/styles.css +9 -0
  85. package/src/uk-household/adapters/householdImpactRequest.ts +164 -0
  86. package/src/uk-household/adapters/index.ts +9 -0
  87. package/src/uk-household/children.ts +23 -0
  88. package/src/uk-household/codes.ts +67 -0
  89. package/src/uk-household/defaults.ts +101 -0
  90. package/src/uk-household/draft.ts +138 -0
  91. package/src/uk-household/index.ts +75 -0
  92. package/src/uk-household/serialize.ts +189 -0
  93. package/src/uk-household/statePension.ts +69 -0
  94. package/src/uk-household/types.ts +159 -0
  95. package/src/uk-household/validate.ts +190 -0
  96. package/src/us-household/adapters/v1Payload.ts +211 -18
  97. package/src/us-household/amount.ts +10 -0
  98. package/src/us-household/index.ts +11 -0
  99. package/src/us-household/normalize.ts +79 -4
  100. package/src/us-household/serialize.ts +5 -1
  101. package/src/us-household/tippedOccupations.ts +145 -0
  102. package/src/us-household/types.ts +144 -15
  103. package/src/us-household/validate.ts +101 -4
  104. package/src/validation.ts +12 -0
  105. package/dist/WizardReviewList-De9RTK_4.js +0 -245
  106. package/dist/WizardReviewList-tfP9LcqU.cjs +0 -1
@@ -1,33 +1,166 @@
1
1
  export type USMaritalStatus = 'single' | 'married';
2
+ /**
3
+ * `'dependent'` means claimed as a tax dependent by someone in the household;
4
+ * `'adult'` means not claimed. Choose it from the user's answer, not from age.
5
+ * The V1 adapter sends it for every person as `is_tax_unit_dependent`. It puts
6
+ * everyone in one tax unit, where PolicyEngine US makes the two oldest adults
7
+ * head and spouse. Any other adult is then neither head, spouse nor
8
+ * dependent, and their income counts in the unit's gross income.
9
+ */
2
10
  export type USPersonKind = 'adult' | 'dependent';
3
11
  /**
4
12
  * Person-level fields that the wizard surfaces uniformly across apps. Apps that
5
- * do not collect a flag should leave it `undefined`; the adapters treat
6
- * `undefined` differently from `false` (omitted vs. explicitly set).
13
+ * do not collect a flag should leave it `undefined`. The V1 adapter sends only
14
+ * `true` and `false`; for these flags `false` and `undefined` give the same
15
+ * model results, and the difference matters to review screens and links.
7
16
  */
8
17
  export interface USPersonFlags {
9
18
  isDisabled?: boolean;
10
19
  isBlind?: boolean;
20
+ /**
21
+ * Full-time student at any level. PolicyEngine US counts everyone aged 5 to
22
+ * 17 as a K-12 student by age, so the V1 adapter sends this only from age 18,
23
+ * as full-time college enrollment ("is_full_time_college_student"). Rules
24
+ * for college students (for example SNAP's student rule and New Jersey's
25
+ * exemption for dependents attending college) then count that person.
26
+ */
11
27
  isFullTimeStudent?: boolean;
12
28
  isPregnant?: boolean;
13
29
  needsCare?: boolean;
14
30
  }
31
+ /**
32
+ * Annual amounts in dollars. Fields are additive, so an amount belongs in
33
+ * exactly one field. Each field sets its own PolicyEngine US variable, except
34
+ * that `pensionIncome` and `privatePensionIncome` share one and are summed,
35
+ * and `tipIncome` is also added to wages.
36
+ */
15
37
  export interface USPersonIncomes {
16
- /** Wages and salaries; "employment_income" in PolicyEngine US. */
38
+ /**
39
+ * Wages and salaries, not counting tips entered in `tipIncome`;
40
+ * "employment_income" in PolicyEngine US.
41
+ */
17
42
  employmentIncome?: number;
43
+ /**
44
+ * Tips received as an employee; "tip_income" in PolicyEngine US.
45
+ * PolicyEngine US counts tips as part of wages (`employment_income` is
46
+ * wages "including tips and commissions"), and income and payroll taxes
47
+ * read `employment_income`. A few rules read `tip_income` on its own, such
48
+ * as the federal deduction for qualified tips (2025-2028) and Georgia's cash
49
+ * tip exclusion. So the V1 adapter sends these tips both as `tip_income` and
50
+ * added to `employment_income`. Tips can count for the deduction only with a
51
+ * listed `tippedOccupationCode`. A self-employed worker's tips belong in
52
+ * `selfEmploymentIncome`, which the adapter does not send as `tip_income`.
53
+ */
54
+ tipIncome?: number;
55
+ /** "self_employment_income" in PolicyEngine US. */
18
56
  selfEmploymentIncome?: number;
57
+ /**
58
+ * Social Security retirement benefits; "social_security_retirement" in
59
+ * PolicyEngine US. Put SSDI in `ssdiAmount`, not here: the model adds the two
60
+ * to get total Social Security. Survivors or dependents benefits entered here
61
+ * count as retirement benefits.
62
+ */
19
63
  socialSecurityIncome?: number;
64
+ /**
65
+ * Reported Supplemental Security Income; "ssi" in PolicyEngine US. It
66
+ * replaces the model's own SSI calculation, and that works for a whole
67
+ * household only: an `ssi` input for one person would stop the model from
68
+ * computing everyone else's. So the V1 adapter sends amounts only when every
69
+ * person has one, and `validate()` asks for the missing ones. Enter 0 for a
70
+ * person who receives none; a 0 is always sent, as
71
+ * "takes_up_ssi_if_eligible" false. Leave it blank to let the model compute
72
+ * a person's SSI.
73
+ */
20
74
  ssiAmount?: number;
75
+ /** Social Security Disability Insurance; "social_security_disability" in PolicyEngine US. */
21
76
  ssdiAmount?: number;
77
+ /**
78
+ * Taxable pension income whose source the user did not give. The V1 adapter
79
+ * adds it to `privatePensionIncome`. Some states' rules in PolicyEngine US
80
+ * apply only to government pensions (for example, Arizona's public pension
81
+ * exclusion and Minnesota's public pension subtraction), so ask for
82
+ * `publicPensionIncome` when the app can. The adapter never sets the
83
+ * `taxable_pension_income` total: that would leave both components at zero,
84
+ * so rules that read either component would see nothing.
85
+ */
22
86
  pensionIncome?: number;
87
+ /**
88
+ * Taxable pension income from a government employer;
89
+ * "taxable_public_pension_income" in PolicyEngine US. PolicyEngine US also
90
+ * has a separate `taxable_federal_pension_income` input, read by West
91
+ * Virginia's public pension subtraction and (from 2.6.14) Indiana's civil
92
+ * service annuity deduction; the adapter does not set it.
93
+ */
94
+ publicPensionIncome?: number;
95
+ /**
96
+ * Taxable pension income from a non-government employer;
97
+ * "taxable_private_pension_income" in PolicyEngine US.
98
+ */
99
+ privatePensionIncome?: number;
100
+ /** Qualified dividends; "qualified_dividend_income" in PolicyEngine US. */
23
101
  dividendIncome?: number;
102
+ /**
103
+ * Ordinary dividends that are not qualified;
104
+ * "non_qualified_dividend_income" in PolicyEngine US. Form 1099-DIV's
105
+ * ordinary dividends (box 1a) are the sum of this and `dividendIncome`
106
+ * (box 1b).
107
+ */
108
+ nonQualifiedDividendIncome?: number;
109
+ /**
110
+ * Net gains on assets held one year or less, negative for a net loss;
111
+ * "short_term_capital_gains" in PolicyEngine US.
112
+ */
113
+ shortTermCapitalGains?: number;
114
+ /**
115
+ * Net gains on assets held more than one year, negative for a net loss;
116
+ * "long_term_capital_gains" in PolicyEngine US. That variable is computed as
117
+ * gains before behavioral responses plus the response, and PolicyEngine US's
118
+ * Simulation moves an input on it onto
119
+ * `long_term_capital_gains_before_response`, as it does for wages.
120
+ */
121
+ longTermCapitalGains?: number;
24
122
  taxableInterestIncome?: number;
25
123
  rentalIncome?: number;
26
124
  unemploymentCompensation?: number;
27
125
  childSupportReceived?: number;
28
126
  miscellaneousIncome?: number;
29
127
  }
30
- export interface USPersonDraft extends USPersonFlags, USPersonIncomes {
128
+ /**
129
+ * Annual amounts paid, in dollars, that PolicyEngine US deducts or credits.
130
+ * Each field sets one PolicyEngine US input variable. Federal deductions sum
131
+ * the tax unit's amounts, so an app that asks about a shared expense once can
132
+ * put it on one adult, ideally the one who pays it or owns the home. Some
133
+ * state rules read a person's own amount: Montana caps real estate taxes per
134
+ * person, and homestead or elderly property tax reductions in Kentucky, Ohio,
135
+ * South Carolina, Mississippi and Tennessee read the owner's (Kentucky) or the
136
+ * head's or spouse's real estate taxes.
137
+ */
138
+ export interface USPersonExpenses {
139
+ /** Gifts of cash to charity; "charitable_cash_donations" in PolicyEngine US. */
140
+ charitableCashDonations?: number;
141
+ /**
142
+ * Interest paid on a home mortgage; "home_mortgage_interest" in PolicyEngine
143
+ * US. Not "mortgage_interest": that is a computed total of deductible and
144
+ * non-deductible interest, and the federal interest deduction ignores an
145
+ * input on it.
146
+ */
147
+ mortgageInterest?: number;
148
+ /** Real estate (property) taxes paid; "real_estate_taxes" in PolicyEngine US. */
149
+ realEstateTaxes?: number;
150
+ }
151
+ /** Work details that rules read alongside income. */
152
+ export interface USPersonOccupation {
153
+ /**
154
+ * Treasury Tipped Occupation Code for the occupation in which the person
155
+ * received `tipIncome` (see `TIPPED_OCCUPATIONS`), or 0 if it is not a
156
+ * listed occupation; "treasury_tipped_occupation_code" in PolicyEngine US.
157
+ * Only tips from a listed occupation qualify for the federal deduction for
158
+ * qualified tips. Leave it unset if the user was not asked: PolicyEngine US
159
+ * then reads 0, so tips get no deduction.
160
+ */
161
+ tippedOccupationCode?: number;
162
+ }
163
+ export interface USPersonDraft extends USPersonFlags, USPersonIncomes, USPersonExpenses, USPersonOccupation {
31
164
  /** Stable identifier — used as the person key in the API payload. */
32
165
  id: string;
33
166
  kind: USPersonKind;
@@ -63,18 +196,5 @@ export interface USHouseholdDraft {
63
196
  /** App-controlled household-level fields ignored by the shared adapters. */
64
197
  extras?: Record<string, unknown>;
65
198
  }
66
- export interface ValidationIssue {
67
- /** Stable identifier for the rule (e.g. "state.required"). */
68
- code: string;
69
- /** Path into the draft (dotted), e.g. "state" or "people[1].age". */
70
- path: string;
71
- message: string;
72
- }
73
- export type ValidationResult = {
74
- ok: true;
75
- issues: never[];
76
- } | {
77
- ok: false;
78
- issues: ValidationIssue[];
79
- };
199
+ export type { ValidationIssue, ValidationResult } from '../validation.js';
80
200
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/us-household/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,eAAe,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEnD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,WAAW,CAAC;AAEjD;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,iBA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EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,MAAM,WAAW,gBAAgB;IAC/B,+EAA+E;IAC/E,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,gEAAgE;IAChE,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,6EAA6E;IAC7E,GAAG,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB;;;OAGG;IACH,aAAa,EAAE,eAAe,GAAG,IAAI,CAAC;IACtC;;;OAGG;IACH,MAAM,EAAE,aAAa,EAAE,CAAC;IACxB,+CAA+C;IAC/C,IAAI,EAAE,MAAM,CAAC;IACb,4EAA4E;IAC5E,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { USHouseholdDraft, ValidationResult } from './types';
1
+ import type { USHouseholdDraft, ValidationResult } from './types.js';
2
2
  export interface ValidateOptions {
3
3
  /**
4
4
  * If true, require a county selection in addition to state. Apps where the
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/us-household/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAmB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEnF,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,QAAQ,CACtB,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CA2GlB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAE1F"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../src/us-household/validate.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,gBAAgB,EAIhB,gBAAgB,EACjB,MAAM,SAAS,CAAC;AAsBjB,MAAM,WAAW,eAAe;IAC9B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,0EAA0E;IAC1E,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,wBAAgB,QAAQ,CACtB,KAAK,EAAE,gBAAgB,EACvB,OAAO,GAAE,eAAoB,GAC5B,gBAAgB,CAgLlB;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,OAAO,GAAE,eAAoB,GAAG,OAAO,CAE1F"}
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v={household:"household",family:"family",taxUnit:"tax_unit",spmUnit:"spm_unit",maritalUnit:"marital_unit"},I={household:"your household",family:"your family",taxUnit:"your tax unit",spmUnit:"your household",maritalUnit:"your marital unit"},S={isDisabled:"is_disabled",isBlind:"is_blind",isFullTimeStudent:"is_full_time_student",isPregnant:"is_pregnant",needsCare:"is_incapable_of_self_care"},U={employmentIncome:"employment_income",selfEmploymentIncome:"self_employment_income",socialSecurityIncome:"social_security",ssiAmount:"ssi",ssdiAmount:"social_security_disability",pensionIncome:"taxable_pension_income",dividendIncome:"qualified_dividend_income",taxableInterestIncome:"taxable_interest_income",rentalIncome:"rental_income",unemploymentCompensation:"unemployment_compensation",childSupportReceived:"child_support_received",miscellaneousIncome:"miscellaneous_income"};function s(e,i){return{[e]:i}}function x(e,i){const n={};e.age!==null&&e.age!==void 0&&(n.age=s(i,e.age)),e.kind==="dependent"&&(n.is_tax_unit_dependent=s(i,!0));for(const[l,a]of Object.entries(S)){const t=e[l];t!==void 0&&(n[a]=s(i,t))}for(const[l,a]of Object.entries(U)){const t=e[l];t!=null&&(n[a]=s(i,t))}return n}function p(e,i={}){const{groupKeyStyle:n="short",includeMaritalUnit:l=!1,label:a=null}=i,t=n==="verbose"?I:v,m=String(e.year),u=e.people.map(o=>o.id),d={};for(const o of e.people)d[o.id]=x(o,m);const c={members:[...u]};e.state&&(c.state_name=s(m,e.state)),e.county&&(c.county=s(m,e.county));const y={[t.family]:{members:[...u]}},f={[t.taxUnit]:{members:[...u]}},b={[t.spmUnit]:{members:[...u]}},h={[t.household]:c},_={};if(l){const o=e.people.filter(r=>r.kind==="adult");_[t.maritalUnit]={members:o.slice(0,2).map(r=>r.id)}}return{country_id:"us",label:a,data:{people:d,families:y,marital_units:_,tax_units:f,spm_units:b,households:h}}}function g(e,i={}){return p(e,i).data}exports.toV1HouseholdPayload=p;exports.toV1HouseholdSituation=g;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-B_OXaS4a.cjs");exports.toV1HouseholdPayload=o.toV1HouseholdPayload;exports.toV1HouseholdSituation=o.toV1HouseholdSituation;
@@ -1 +1 @@
1
- export * from './us-household/adapters/index';
1
+ export * from './us-household/adapters/index.js';
@@ -1,92 +1,5 @@
1
- const h = {
2
- household: "household",
3
- family: "family",
4
- taxUnit: "tax_unit",
5
- spmUnit: "spm_unit",
6
- maritalUnit: "marital_unit"
7
- }, I = {
8
- household: "your household",
9
- family: "your family",
10
- taxUnit: "your tax unit",
11
- spmUnit: "your household",
12
- // app-v2 uses the same label for SPM unit
13
- maritalUnit: "your marital unit"
14
- }, U = {
15
- isDisabled: "is_disabled",
16
- isBlind: "is_blind",
17
- isFullTimeStudent: "is_full_time_student",
18
- isPregnant: "is_pregnant",
19
- needsCare: "is_incapable_of_self_care"
20
- }, v = {
21
- employmentIncome: "employment_income",
22
- selfEmploymentIncome: "self_employment_income",
23
- socialSecurityIncome: "social_security",
24
- ssiAmount: "ssi",
25
- ssdiAmount: "social_security_disability",
26
- pensionIncome: "taxable_pension_income",
27
- dividendIncome: "qualified_dividend_income",
28
- taxableInterestIncome: "taxable_interest_income",
29
- rentalIncome: "rental_income",
30
- unemploymentCompensation: "unemployment_compensation",
31
- childSupportReceived: "child_support_received",
32
- miscellaneousIncome: "miscellaneous_income"
33
- };
34
- function s(e, n) {
35
- return { [e]: n };
36
- }
37
- function x(e, n) {
38
- const i = {};
39
- e.age !== null && e.age !== void 0 && (i.age = s(n, e.age)), e.kind === "dependent" && (i.is_tax_unit_dependent = s(n, !0));
40
- for (const [l, a] of Object.entries(U)) {
41
- const t = e[l];
42
- t !== void 0 && (i[a] = s(n, t));
43
- }
44
- for (const [l, a] of Object.entries(v)) {
45
- const t = e[l];
46
- t != null && (i[a] = s(n, t));
47
- }
48
- return i;
49
- }
50
- function S(e, n = {}) {
51
- const { groupKeyStyle: i = "short", includeMaritalUnit: l = !1, label: a = null } = n, t = i === "verbose" ? I : h, c = String(e.year), m = e.people.map((o) => o.id), d = {};
52
- for (const o of e.people)
53
- d[o.id] = x(o, c);
54
- const u = {
55
- members: [...m]
56
- };
57
- e.state && (u.state_name = s(c, e.state)), e.county && (u.county = s(c, e.county));
58
- const p = {
59
- [t.family]: { members: [...m] }
60
- }, y = {
61
- [t.taxUnit]: { members: [...m] }
62
- }, f = {
63
- [t.spmUnit]: { members: [...m] }
64
- }, b = {
65
- [t.household]: u
66
- }, _ = {};
67
- if (l) {
68
- const o = e.people.filter((r) => r.kind === "adult");
69
- _[t.maritalUnit] = {
70
- members: o.slice(0, 2).map((r) => r.id)
71
- };
72
- }
73
- return {
74
- country_id: "us",
75
- label: a,
76
- data: {
77
- people: d,
78
- families: p,
79
- marital_units: _,
80
- tax_units: y,
81
- spm_units: f,
82
- households: b
83
- }
84
- };
85
- }
86
- function g(e, n = {}) {
87
- return S(e, n).data;
88
- }
1
+ import { b as t, c as s } from "./index-DWM0giHt.js";
89
2
  export {
90
- S as toV1HouseholdPayload,
91
- g as toV1HouseholdSituation
3
+ t as toV1HouseholdPayload,
4
+ s as toV1HouseholdSituation
92
5
  };