datasette-libfec 0.0.1a4__py3-none-any.whl → 0.0.1a5__py3-none-any.whl

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 (41) hide show
  1. datasette_libfec/__init__.py +5 -1
  2. datasette_libfec/libfec_client.py +225 -11
  3. datasette_libfec/libfec_export_rpc_client.py +358 -0
  4. datasette_libfec/libfec_rpc_client.py +335 -0
  5. datasette_libfec/libfec_search_rpc_client.py +308 -0
  6. datasette_libfec/manifest.json +84 -2
  7. datasette_libfec/page_data.py +87 -0
  8. datasette_libfec/router.py +3 -0
  9. datasette_libfec/routes_export.py +125 -0
  10. datasette_libfec/routes_exports.py +220 -0
  11. datasette_libfec/routes_pages.py +336 -0
  12. datasette_libfec/routes_rss.py +411 -0
  13. datasette_libfec/routes_search.py +77 -0
  14. datasette_libfec/state.py +6 -0
  15. datasette_libfec/static/gen/candidate-BEqDafKu.css +1 -0
  16. datasette_libfec/static/gen/candidate-tqxa29G-.js +3 -0
  17. datasette_libfec/static/gen/class-C5DDKbJD.js +2 -0
  18. datasette_libfec/static/gen/committee-Bmki9iKb.css +1 -0
  19. datasette_libfec/static/gen/committee-DY1GmylW.js +2 -0
  20. datasette_libfec/static/gen/contest-BbYrzKRg.js +1 -0
  21. datasette_libfec/static/gen/contest-D4Fj7kGA.css +1 -0
  22. datasette_libfec/static/gen/each-DkfQbqzj.js +1 -0
  23. datasette_libfec/static/gen/filing_detail-Ba6_iQwV.css +1 -0
  24. datasette_libfec/static/gen/filing_detail-D2ib3OM6.js +26 -0
  25. datasette_libfec/static/gen/index-AHqus2fd.js +9 -0
  26. datasette_libfec/static/gen/index-client-CDwZ_Ixa.js +1 -0
  27. datasette_libfec/static/gen/index-jv9_YIKt.css +1 -0
  28. datasette_libfec/static/gen/load-AXKAVXVj.js +1 -0
  29. datasette_libfec/templates/libfec_base.html +12 -0
  30. {datasette_libfec-0.0.1a4.dist-info → datasette_libfec-0.0.1a5.dist-info}/METADATA +2 -2
  31. datasette_libfec-0.0.1a5.dist-info/RECORD +37 -0
  32. {datasette_libfec-0.0.1a4.dist-info → datasette_libfec-0.0.1a5.dist-info}/top_level.txt +1 -0
  33. scripts/typegen-pagedata.py +6 -0
  34. datasette_libfec/routes.py +0 -189
  35. datasette_libfec/static/gen/index-6cjSv2YC.css +0 -1
  36. datasette_libfec/static/gen/index-CaTQMY-X.js +0 -1
  37. datasette_libfec/templates/libfec.html +0 -14
  38. datasette_libfec-0.0.1a4.dist-info/RECORD +0 -14
  39. {datasette_libfec-0.0.1a4.dist-info → datasette_libfec-0.0.1a5.dist-info}/WHEEL +0 -0
  40. {datasette_libfec-0.0.1a4.dist-info → datasette_libfec-0.0.1a5.dist-info}/entry_points.txt +0 -0
  41. {datasette_libfec-0.0.1a4.dist-info → datasette_libfec-0.0.1a5.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,411 @@
1
+ from pydantic import BaseModel
2
+ from datasette import Response
3
+ from datasette_plugin_router import Body
4
+ from typing import Optional, List, Literal
5
+ import asyncio
6
+
7
+ from .router import router
8
+ from .state import libfec_client, rss_watcher_state
9
+
10
+
11
+ class RssSyncRecord(BaseModel):
12
+ sync_id: int
13
+ sync_uuid: str
14
+ created_at: str
15
+ completed_at: Optional[str] = None
16
+ since_filter: Optional[str] = None
17
+ preset_filter: Optional[str] = None
18
+ form_type_filter: Optional[str] = None
19
+ committee_filter: Optional[str] = None
20
+ state_filter: Optional[str] = None
21
+ party_filter: Optional[str] = None
22
+ total_feed_items: Optional[int] = None
23
+ filtered_items: Optional[int] = None
24
+ new_filings_count: int
25
+ exported_count: int
26
+ cover_only: bool
27
+ status: str
28
+ error_message: Optional[str] = None
29
+
30
+
31
+ class RssSyncFilingRecord(BaseModel):
32
+ filing_id: str
33
+ rss_pub_date: Optional[str] = None
34
+ rss_title: Optional[str] = None
35
+ committee_id: Optional[str] = None
36
+ form_type: Optional[str] = None
37
+ coverage_from: Optional[str] = None
38
+ coverage_through: Optional[str] = None
39
+ report_type: Optional[str] = None
40
+ export_success: bool
41
+ export_message: Optional[str] = None
42
+
43
+
44
+ class ApiRssSyncsListResponse(BaseModel):
45
+ status: Literal['success']
46
+ syncs: List[RssSyncRecord]
47
+ message: Optional[str] = None
48
+
49
+
50
+ class RssStartParams(BaseModel):
51
+ state: Optional[str] = None
52
+ cover_only: bool = True
53
+ interval: int = 60
54
+
55
+
56
+ class RssResponse(BaseModel):
57
+ status: str
58
+ message: str
59
+ running: bool
60
+ config: Optional[dict] = None
61
+
62
+
63
+ async def rss_watch_loop(
64
+ output_db: str,
65
+ state: Optional[str],
66
+ cover_only: bool,
67
+ interval: int
68
+ ):
69
+ """Background task that runs RSS watch periodically"""
70
+ import time
71
+ while rss_watcher_state.running:
72
+ try:
73
+ # Reset progress state before each sync
74
+ rss_watcher_state.phase = "idle"
75
+ rss_watcher_state.exported_count = 0
76
+ rss_watcher_state.total_count = 0
77
+ rss_watcher_state.current_filing_id = None
78
+ rss_watcher_state.error_message = None
79
+ rss_watcher_state.error_code = None
80
+ rss_watcher_state.error_data = None
81
+
82
+ print(f"Running RSS watch: state={state}, cover_only={cover_only}, db={output_db}")
83
+ # Use RPC-based method with progress tracking
84
+ await libfec_client.rss_watch_with_progress(
85
+ output_db, state, cover_only, rss_watcher_state
86
+ )
87
+ print(f"RSS watch completed, sleeping {interval} seconds")
88
+ except Exception as e:
89
+ print(f"RSS watch error: {e}")
90
+ rss_watcher_state.phase = "error"
91
+ rss_watcher_state.error_message = str(e)
92
+ finally:
93
+ rss_watcher_state.next_sync_time = time.time() + interval
94
+ await asyncio.sleep(interval)
95
+
96
+
97
+ @router.POST("/-/api/libfec/rss/start", output=RssResponse)
98
+ async def rss_start(datasette, params: Body[RssStartParams]):
99
+ if rss_watcher_state.running:
100
+ return Response.json({
101
+ "status": "error",
102
+ "message": "RSS watcher is already running",
103
+ "running": True
104
+ }, status=400)
105
+
106
+ # Get output database
107
+ output_db = None
108
+ for name, db in datasette.databases.items():
109
+ if not db.is_memory:
110
+ output_db = db
111
+ break
112
+ if output_db is None:
113
+ return Response.json({
114
+ "status": "error",
115
+ "message": "No writable database found.",
116
+ "running": False
117
+ }, status=500)
118
+
119
+ # Validate interval
120
+ if params.interval < 1:
121
+ return Response.json({
122
+ "status": "error",
123
+ "message": "Interval must be at least 1 second",
124
+ "running": False
125
+ }, status=400)
126
+
127
+ # Start the background task
128
+ import time
129
+ rss_watcher_state.running = True
130
+ rss_watcher_state.state = params.state
131
+ rss_watcher_state.cover_only = params.cover_only
132
+ rss_watcher_state.interval = params.interval
133
+ rss_watcher_state.output_db = output_db.path
134
+ rss_watcher_state.next_sync_time = time.time()
135
+ rss_watcher_state.currently_syncing = False
136
+ rss_watcher_state.task = asyncio.create_task(
137
+ rss_watch_loop(
138
+ output_db.path,
139
+ None if params.state == "" else params.state,
140
+ params.cover_only,
141
+ params.interval
142
+ )
143
+ )
144
+
145
+ return Response.json(
146
+ RssResponse(
147
+ status="success",
148
+ message="RSS watcher started",
149
+ running=True,
150
+ config={
151
+ "state": params.state,
152
+ "cover_only": params.cover_only,
153
+ "interval": params.interval
154
+ }
155
+ ).model_dump()
156
+ )
157
+
158
+
159
+ @router.POST("/-/api/libfec/rss/stop", output=RssResponse)
160
+ async def rss_stop(datasette):
161
+ if not rss_watcher_state.running:
162
+ return Response.json({
163
+ "status": "error",
164
+ "message": "RSS watcher is not running",
165
+ "running": False
166
+ }, status=400)
167
+
168
+ # Cancel RPC sync if in progress
169
+ if rss_watcher_state.rpc_client:
170
+ try:
171
+ await rss_watcher_state.rpc_client.sync_cancel()
172
+ except Exception as e:
173
+ print(f"Error canceling RPC sync: {e}")
174
+
175
+ # Stop the background task
176
+ rss_watcher_state.running = False
177
+ if rss_watcher_state.task:
178
+ rss_watcher_state.task.cancel()
179
+ try:
180
+ await rss_watcher_state.task
181
+ except asyncio.CancelledError:
182
+ pass
183
+ rss_watcher_state.task = None
184
+
185
+ return Response.json(
186
+ RssResponse(
187
+ status="success",
188
+ message="RSS watcher stopped",
189
+ running=False
190
+ ).model_dump()
191
+ )
192
+
193
+
194
+ @router.GET("/-/api/libfec/rss/status", output=RssResponse)
195
+ async def rss_status(datasette):
196
+ config = None
197
+ if rss_watcher_state.running:
198
+ config = {
199
+ "state": rss_watcher_state.state,
200
+ "cover_only": rss_watcher_state.cover_only,
201
+ "interval": rss_watcher_state.interval,
202
+ "output_db": rss_watcher_state.output_db,
203
+ "next_sync_time": rss_watcher_state.next_sync_time,
204
+ "currently_syncing": rss_watcher_state.currently_syncing,
205
+ # Progress tracking fields
206
+ "phase": rss_watcher_state.phase,
207
+ "exported_count": rss_watcher_state.exported_count,
208
+ "total_count": rss_watcher_state.total_count,
209
+ "current_filing_id": rss_watcher_state.current_filing_id,
210
+ "feed_title": rss_watcher_state.feed_title,
211
+ "feed_last_modified": rss_watcher_state.feed_last_modified,
212
+ "error_message": rss_watcher_state.error_message,
213
+ "error_code": rss_watcher_state.error_code,
214
+ "error_data": rss_watcher_state.error_data,
215
+ "sync_start_time": rss_watcher_state.sync_start_time
216
+ }
217
+
218
+ return Response.json(
219
+ RssResponse(
220
+ status="success",
221
+ message="RSS watcher status",
222
+ running=rss_watcher_state.running,
223
+ config=config
224
+ ).model_dump()
225
+ )
226
+
227
+
228
+ @router.GET("/-/api/libfec/rss/syncs$", output=ApiRssSyncsListResponse)
229
+ async def list_rss_syncs(datasette):
230
+ """List all RSS sync operations from the metadata tables"""
231
+ db = datasette.get_database()
232
+
233
+ # Check if the table exists
234
+ try:
235
+ tables = await db.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='libfec_rss_syncs'")
236
+ if not tables.first():
237
+ return Response.json({
238
+ "status": "success",
239
+ "syncs": [],
240
+ "message": "No RSS syncs yet"
241
+ })
242
+ except Exception as e:
243
+ return Response.json({
244
+ "status": "error",
245
+ "message": f"Database error: {str(e)}"
246
+ }, status=500)
247
+
248
+ try:
249
+ syncs_result = await db.execute("""
250
+ SELECT
251
+ sync_id,
252
+ sync_uuid,
253
+ created_at,
254
+ completed_at,
255
+ since_filter,
256
+ preset_filter,
257
+ form_type_filter,
258
+ committee_filter,
259
+ state_filter,
260
+ party_filter,
261
+ total_feed_items,
262
+ filtered_items,
263
+ new_filings_count,
264
+ exported_count,
265
+ cover_only,
266
+ status,
267
+ error_message
268
+ FROM libfec_rss_syncs
269
+ ORDER BY created_at DESC
270
+ LIMIT 50
271
+ """)
272
+
273
+ syncs = []
274
+ for row in syncs_result.rows:
275
+ syncs.append({
276
+ "sync_id": row[0],
277
+ "sync_uuid": row[1],
278
+ "created_at": row[2],
279
+ "completed_at": row[3],
280
+ "since_filter": row[4],
281
+ "preset_filter": row[5],
282
+ "form_type_filter": row[6],
283
+ "committee_filter": row[7],
284
+ "state_filter": row[8],
285
+ "party_filter": row[9],
286
+ "total_feed_items": row[10],
287
+ "filtered_items": row[11],
288
+ "new_filings_count": row[12],
289
+ "exported_count": row[13],
290
+ "cover_only": bool(row[14]),
291
+ "status": row[15],
292
+ "error_message": row[16]
293
+ })
294
+ return Response.json(ApiRssSyncsListResponse(
295
+ status="success",
296
+ syncs=syncs
297
+ ).model_dump_json())
298
+
299
+ except Exception as e:
300
+ return Response.json({
301
+ "status": "error",
302
+ "message": f"Failed to fetch RSS syncs: {str(e)}"
303
+ }, status=500)
304
+
305
+
306
+ @router.GET("/-/api/libfec/rss/syncs/(?P<sync_id>\\d+)")
307
+ async def get_rss_sync_detail(datasette, sync_id: str):
308
+ """Get detailed information about a specific RSS sync"""
309
+ db = datasette.get_database()
310
+ sync_id_int = int(sync_id)
311
+
312
+ try:
313
+ # Get sync record
314
+ sync_result = await db.execute("""
315
+ SELECT
316
+ sync_id,
317
+ sync_uuid,
318
+ created_at,
319
+ completed_at,
320
+ since_filter,
321
+ preset_filter,
322
+ form_type_filter,
323
+ committee_filter,
324
+ state_filter,
325
+ party_filter,
326
+ total_feed_items,
327
+ filtered_items,
328
+ new_filings_count,
329
+ exported_count,
330
+ cover_only,
331
+ status,
332
+ error_message
333
+ FROM libfec_rss_syncs
334
+ WHERE sync_id = ?
335
+ """, [sync_id_int])
336
+
337
+ sync_row = sync_result.first()
338
+ if not sync_row:
339
+ return Response.json({
340
+ "status": "error",
341
+ "message": "RSS sync not found"
342
+ }, status=404)
343
+
344
+ sync = {
345
+ "sync_id": sync_row[0],
346
+ "sync_uuid": sync_row[1],
347
+ "created_at": sync_row[2],
348
+ "completed_at": sync_row[3],
349
+ "since_filter": sync_row[4],
350
+ "preset_filter": sync_row[5],
351
+ "form_type_filter": sync_row[6],
352
+ "committee_filter": sync_row[7],
353
+ "state_filter": sync_row[8],
354
+ "party_filter": sync_row[9],
355
+ "total_feed_items": sync_row[10],
356
+ "filtered_items": sync_row[11],
357
+ "new_filings_count": sync_row[12],
358
+ "exported_count": sync_row[13],
359
+ "cover_only": bool(sync_row[14]),
360
+ "status": sync_row[15],
361
+ "error_message": sync_row[16]
362
+ }
363
+
364
+ # Get filings for this sync
365
+ filings = []
366
+ try:
367
+ filings_result = await db.execute("""
368
+ SELECT
369
+ filing_id,
370
+ rss_pub_date,
371
+ rss_title,
372
+ committee_id,
373
+ form_type,
374
+ coverage_from,
375
+ coverage_through,
376
+ report_type,
377
+ export_success,
378
+ export_message
379
+ FROM libfec_rss_filings
380
+ WHERE sync_id = ?
381
+ ORDER BY rss_pub_date DESC
382
+ """, [sync_id_int])
383
+
384
+ for row in filings_result.rows:
385
+ filings.append({
386
+ "filing_id": row[0],
387
+ "rss_pub_date": row[1],
388
+ "rss_title": row[2],
389
+ "committee_id": row[3],
390
+ "form_type": row[4],
391
+ "coverage_from": row[5],
392
+ "coverage_through": row[6],
393
+ "report_type": row[7],
394
+ "export_success": bool(row[8]),
395
+ "export_message": row[9]
396
+ })
397
+ except Exception:
398
+ # Table might not exist
399
+ pass
400
+
401
+ return Response.json({
402
+ "status": "success",
403
+ "sync": sync,
404
+ "filings": filings
405
+ })
406
+
407
+ except Exception as e:
408
+ return Response.json({
409
+ "status": "error",
410
+ "message": f"Failed to fetch RSS sync detail: {str(e)}"
411
+ }, status=500)
@@ -0,0 +1,77 @@
1
+ from pydantic import BaseModel
2
+ from datasette import Response
3
+ from datasette_plugin_router import Body
4
+ from typing import Optional, List
5
+
6
+ from .router import router
7
+ from .state import libfec_client
8
+
9
+ # Cache for search RPC clients (keyed by cycle)
10
+ search_clients = {}
11
+
12
+
13
+ class SearchParams(BaseModel):
14
+ query: str
15
+ cycle: Optional[int] = None
16
+ limit: int = 100
17
+
18
+
19
+ class SearchResponse(BaseModel):
20
+ status: str
21
+ cycle: int
22
+ query: str
23
+ candidate_count: int
24
+ committee_count: int
25
+ candidates: List[dict]
26
+ committees: List[dict]
27
+
28
+
29
+ @router.POST("/-/api/libfec/search", output=SearchResponse)
30
+ async def search(datasette, params: Body[SearchParams]):
31
+ """Search for candidates and committees using libfec search --rpc"""
32
+ from .libfec_search_rpc_client import LibfecSearchRpcClient, RpcError
33
+
34
+ cycle = params.cycle or 2026
35
+
36
+ # Get or create search client for this cycle
37
+ if cycle not in search_clients:
38
+ try:
39
+ client = LibfecSearchRpcClient(str(libfec_client.libfec_path), cycle)
40
+ await client.start_process()
41
+ search_clients[cycle] = client
42
+ except Exception as e:
43
+ return Response.json({
44
+ "status": "error",
45
+ "message": f"Failed to start search process: {str(e)}"
46
+ }, status=500)
47
+
48
+ client = search_clients[cycle]
49
+
50
+ try:
51
+ result = await client.search_query(
52
+ query=params.query,
53
+ cycle=cycle,
54
+ limit=params.limit
55
+ )
56
+
57
+ return Response.json({
58
+ "status": "success",
59
+ "cycle": result["cycle"],
60
+ "query": result["query"],
61
+ "candidate_count": result["candidate_count"],
62
+ "committee_count": result["committee_count"],
63
+ "candidates": result["candidates"],
64
+ "committees": result["committees"]
65
+ })
66
+
67
+ except RpcError as e:
68
+ return Response.json({
69
+ "status": "error",
70
+ "message": f"Search error: {e.message}",
71
+ "code": e.code
72
+ }, status=500)
73
+ except Exception as e:
74
+ return Response.json({
75
+ "status": "error",
76
+ "message": f"Search failed: {str(e)}"
77
+ }, status=500)
@@ -0,0 +1,6 @@
1
+ from .libfec_client import LibfecClient, RssWatcherState, ExportState
2
+
3
+ # Shared state - singleton instances
4
+ libfec_client = LibfecClient()
5
+ rss_watcher_state = RssWatcherState()
6
+ export_state = ExportState()
@@ -0,0 +1 @@
1
+ .candidate-page.svelte-18y33ic{max-width:1200px;margin:0 auto;padding:2rem}.header.svelte-18y33ic{margin-bottom:2rem}.header.svelte-18y33ic h1:where(.svelte-18y33ic){font-size:2rem;margin-bottom:.5rem}.breadcrumb.svelte-18y33ic{font-size:.9rem;color:#666}.breadcrumb.svelte-18y33ic a:where(.svelte-18y33ic){color:#06c;text-decoration:none}.breadcrumb.svelte-18y33ic a:where(.svelte-18y33ic):hover{text-decoration:underline}.error-box.svelte-18y33ic{background:#fee;border:1px solid #c00;padding:1rem;border-radius:4px;margin-bottom:1rem;color:#900}.content-grid.svelte-18y33ic{display:grid;grid-template-columns:repeat(auto-fit,minmax(350px,1fr));gap:1.5rem;margin-bottom:1.5rem}.info-section.svelte-18y33ic{background:#fff;border:1px solid #ddd;border-radius:8px;padding:1.5rem}.info-section.svelte-18y33ic h2:where(.svelte-18y33ic){font-size:1.25rem;margin-bottom:1rem}.section-box.svelte-18y33ic{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:1rem;margin-bottom:1rem}.section-box.svelte-18y33ic h3:where(.svelte-18y33ic){font-size:1rem;margin-bottom:.5rem}dl.svelte-18y33ic{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1rem}dt.svelte-18y33ic{font-weight:600;color:#666}dd.svelte-18y33ic{margin:0}dd.svelte-18y33ic a:where(.svelte-18y33ic){color:#06c;text-decoration:none}dd.svelte-18y33ic a:where(.svelte-18y33ic):hover{text-decoration:underline}.party.svelte-18y33ic{display:inline-block;padding:.2rem .5rem;border-radius:4px;font-size:.9rem}.party.dem.svelte-18y33ic{background:#cce5ff;color:#004085}.party.rep.svelte-18y33ic{background:#f8d7da;color:#721c24}.party.lib.svelte-18y33ic{background:#fff3cd;color:#856404}.party.gre.svelte-18y33ic{background:#d4edda;color:#155724}address.svelte-18y33ic{font-style:normal;line-height:1.6}.external-links.svelte-18y33ic{margin-top:1rem}.external-links.svelte-18y33ic a:where(.svelte-18y33ic){color:#06c;text-decoration:none}.external-links.svelte-18y33ic a:where(.svelte-18y33ic):hover{text-decoration:underline}.filings-section.svelte-18y33ic{background:#fff;border:1px solid #ddd;border-radius:8px;padding:1.5rem}.filings-section.svelte-18y33ic h2:where(.svelte-18y33ic){font-size:1.25rem;margin-bottom:1rem}.filings-table.svelte-18y33ic{width:100%;border-collapse:collapse}.filings-table.svelte-18y33ic th:where(.svelte-18y33ic),.filings-table.svelte-18y33ic td:where(.svelte-18y33ic){padding:.75rem;text-align:left;border-bottom:1px solid #e0e0e0}.filings-table.svelte-18y33ic th:where(.svelte-18y33ic){background:#f5f5f5;font-weight:600}.filings-table.svelte-18y33ic a:where(.svelte-18y33ic){color:#06c;text-decoration:none}.filings-table.svelte-18y33ic a:where(.svelte-18y33ic):hover{text-decoration:underline}
@@ -0,0 +1,3 @@
1
+ import{y as ue,R as Ce,T as De,A as t,I as a,z as n,B as l,F as i,G as Ie,J as _,K as c,N as P,C as B,M as W,Q as h,d as R,U as Pe}from"./load-AXKAVXVj.js";import{e as $e,i as Ee}from"./each-DkfQbqzj.js";import{s as we}from"./class-C5DDKbJD.js";var Ne=_('&rarr; <a class="svelte-18y33ic"> <!></a>',1),Se=_('<div class="error-box svelte-18y33ic"><strong>Error:</strong> </div>'),Fe=_('<dt class="svelte-18y33ic">Status:</dt> <dd class="svelte-18y33ic"><!></dd>',1),Ae=_(" <br/>",1),Re=_(" <br/>",1),ke=_('<div class="section-box svelte-18y33ic"><h3 class="svelte-18y33ic">Address</h3> <address class="svelte-18y33ic"><!> <!> <!> <!> <!></address></div>'),He=_('<dt class="svelte-18y33ic">Type:</dt> <dd class="svelte-18y33ic"> </dd>',1),Le=_('<dt class="svelte-18y33ic">Designation:</dt> <dd class="svelte-18y33ic"> </dd>',1),Ue=_('<section class="info-section svelte-18y33ic"><h2 class="svelte-18y33ic">Principal Committee</h2> <div class="section-box svelte-18y33ic"><dl class="svelte-18y33ic"><dt class="svelte-18y33ic">Committee Name:</dt> <dd class="svelte-18y33ic"><a class="svelte-18y33ic"> </a></dd> <dt class="svelte-18y33ic">Committee ID:</dt> <dd class="svelte-18y33ic"><a class="svelte-18y33ic"> </a></dd> <!> <!></dl></div></section>'),ze=_('<div class="content-grid svelte-18y33ic"><section class="info-section svelte-18y33ic"><h2 class="svelte-18y33ic">Candidate Information</h2> <div class="section-box svelte-18y33ic"><dl class="svelte-18y33ic"><dt class="svelte-18y33ic">Candidate ID:</dt> <dd class="svelte-18y33ic"> </dd> <dt class="svelte-18y33ic">Party:</dt> <dd class="svelte-18y33ic"><span> </span></dd> <dt class="svelte-18y33ic">Office:</dt> <dd class="svelte-18y33ic"><a class="svelte-18y33ic"> <!></a></dd> <!> <dt class="svelte-18y33ic">Election Cycle:</dt> <dd class="svelte-18y33ic"> </dd></dl></div> <!> <div class="external-links svelte-18y33ic"><a target="_blank" rel="noopener noreferrer" class="svelte-18y33ic">View on FEC.gov &rarr;</a></div></section> <!></div>'),Be=_('<div class="info-section svelte-18y33ic"><p>Candidate not found.</p></div>'),Ge=_('<tr><td class="svelte-18y33ic"><a class="svelte-18y33ic"> </a></td><td class="svelte-18y33ic"> </td><td class="svelte-18y33ic"><!></td></tr>'),Oe=_('<section class="filings-section svelte-18y33ic"><h2 class="svelte-18y33ic"> </h2> <table class="filings-table svelte-18y33ic"><thead><tr><th class="svelte-18y33ic">Filing ID</th><th class="svelte-18y33ic">Form</th><th class="svelte-18y33ic">Coverage Period</th></tr></thead><tbody></tbody></table></section>'),Me=_('<div class="candidate-page svelte-18y33ic"><div class="header svelte-18y33ic"><h1 class="svelte-18y33ic"> </h1> <div class="breadcrumb svelte-18y33ic"><a href="/-/libfec" class="svelte-18y33ic">FEC Data</a> <!> &rarr; Candidate</div></div> <!> <!> <!></div>');function Te(ie,de){ue(de,!1);const e=Ce(),X={H:"House",S:"Senate",P:"President"};function re(s){return s?{DEM:"Democrat",REP:"Republican",LIB:"Libertarian",GRE:"Green",IND:"Independent",NPA:"No Party Affiliation"}[s]||s:"Unknown"}function Y(s){const v=new URLSearchParams;return v.set("state",s.state),v.set("office",s.office),v.set("cycle",e.cycle.toString()),s.office==="H"&&s.district&&v.set("district",s.district.toString()),`/-/libfec/contest?${v.toString()}`}De();var Z=Me(),ee=a(Z),ae=a(ee),ce=a(ae),ve=t(ae,2),ne=t(a(ve),2);{var le=s=>{var v=Ne(),y=t(P(v)),C=a(y),D=t(C);{var $=I=>{var f=h();l(()=>c(f,`District ${e.candidate.district??""}`)),i(I,f)};n(D,I=>{e.candidate.office==="H"&&e.candidate.district&&I($)})}l(I=>{B(y,"href",I),c(C,`${e.candidate.state??""}
2
+ ${(e.candidate.office?X[e.candidate.office]||e.candidate.office:"")??""} `)},[()=>Y(e.candidate)]),i(s,v)};n(ne,s=>{e.candidate&&s(le)})}var te=t(ee,2);{var oe=s=>{var v=Se(),y=t(a(v));l(()=>c(y,` ${e.error??""}`)),i(s,v)};n(te,s=>{e.error&&s(oe)})}var se=t(te,2);{var _e=s=>{var v=ze(),y=a(v),C=t(a(y),2),D=a(C),$=t(a(D),2),I=a($),f=t($,4),G=a(f),T=a(G),O=t(f,4),J=a(O),M=a(J),Q=t(M);{var V=o=>{var m=h();l(()=>c(m,`District ${e.candidate.district??""}`)),i(o,m)};n(Q,o=>{e.candidate.office==="H"&&e.candidate.district&&o(V)})}var K=t(O,2);{var j=o=>{var m=Fe(),F=t(P(m),2),k=a(F);{var H=x=>{var b=h("Incumbent");i(x,b)},A=x=>{var b=W(),L=P(b);{var U=p=>{var w=h("Challenger");i(p,w)},z=p=>{var w=W(),r=P(w);{var d=u=>{var N=h("Open Seat");i(u,N)},g=u=>{var N=h();l(()=>c(N,e.candidate.incumbent_challenger_status)),i(u,N)};n(r,u=>{e.candidate.incumbent_challenger_status==="O"?u(d):u(g,!1)},!0)}i(p,w)};n(L,p=>{e.candidate.incumbent_challenger_status==="C"?p(U):p(z,!1)},!0)}i(x,b)};n(k,x=>{e.candidate.incumbent_challenger_status==="I"?x(H):x(A,!1)})}i(o,m)};n(K,o=>{e.candidate.incumbent_challenger_status&&o(j)})}var q=t(K,4),E=a(q),S=t(C,2);{var ge=o=>{var m=ke(),F=t(a(m),2),k=a(F);{var H=r=>{var d=Ae(),g=P(d,!0);l(()=>c(g,e.candidate.address_street1)),i(r,d)};n(k,r=>{e.candidate.address_street1&&r(H)})}var A=t(k,2);{var x=r=>{var d=Re(),g=P(d,!0);l(()=>c(g,e.candidate.address_street2)),i(r,d)};n(A,r=>{e.candidate.address_street2&&r(x)})}var b=t(A,2);{var L=r=>{var d=h();l(()=>c(d,`${e.candidate.address_city??""},`)),i(r,d)};n(b,r=>{e.candidate.address_city&&r(L)})}var U=t(b,2);{var z=r=>{var d=h();l(()=>c(d,e.candidate.address_state)),i(r,d)};n(U,r=>{e.candidate.address_state&&r(z)})}var p=t(U,2);{var w=r=>{var d=h();l(()=>c(d,e.candidate.address_zip)),i(r,d)};n(p,r=>{e.candidate.address_zip&&r(w)})}i(o,m)};n(S,o=>{(e.candidate.address_street1||e.candidate.address_city)&&o(ge)})}var he=t(S,2),xe=a(he),be=t(y,2);{var pe=o=>{var m=Ue(),F=t(a(m),2),k=a(F),H=t(a(k),2),A=a(H),x=a(A),b=t(H,4),L=a(b),U=a(L),z=t(b,2);{var p=d=>{var g=He(),u=t(P(g),2),N=a(u);l(()=>c(N,e.committee.committee_type)),i(d,g)};n(z,d=>{e.committee.committee_type&&d(p)})}var w=t(z,2);{var r=d=>{var g=Le(),u=t(P(g),2),N=a(u);l(()=>c(N,e.committee.designation)),i(d,g)};n(w,d=>{e.committee.designation&&d(r)})}l(()=>{B(A,"href",`/-/libfec/committee/${e.committee.committee_id??""}?cycle=${e.cycle??""}`),c(x,e.committee.name||"Unknown"),B(L,"href",`/-/libfec/committee/${e.committee.committee_id??""}?cycle=${e.cycle??""}`),c(U,e.committee.committee_id)}),i(o,m)};n(be,o=>{e.committee&&o(pe)})}l((o,m,F)=>{c(I,e.candidate.candidate_id),we(G,1,`party ${o??""}`,"svelte-18y33ic"),c(T,m),B(J,"href",F),c(M,`${e.candidate.state??""}
3
+ ${(e.candidate.office?X[e.candidate.office]||e.candidate.office:"")??""} `),c(E,e.cycle),B(xe,"href",`https://www.fec.gov/data/candidate/${e.candidate_id??""}/`)},[()=>e.candidate.party_affiliation?.toLowerCase(),()=>re(e.candidate.party_affiliation),()=>Y(e.candidate)]),i(s,v)},fe=s=>{var v=W(),y=P(v);{var C=D=>{var $=Be();i(D,$)};n(y,D=>{e.error||D(C)},!0)}i(s,v)};n(se,s=>{e.candidate?s(_e):s(fe,!1)})}var me=t(se,2);{var ye=s=>{var v=Oe(),y=a(v),C=a(y),D=t(y,2),$=t(a(D));$e($,5,()=>e.filings,Ee,(I,f)=>{var G=Ge(),T=a(G),O=a(T),J=a(O),M=t(T),Q=a(M),V=t(M),K=a(V);{var j=E=>{var S=h();l(()=>c(S,`${R(f).coverage_from_date??""} to ${R(f).coverage_through_date??""}`)),i(E,S)},q=E=>{var S=h("N/A");i(E,S)};n(K,E=>{R(f).coverage_from_date&&R(f).coverage_through_date?E(j):E(q,!1)})}l(()=>{B(O,"href",`/-/libfec/filing/${R(f).filing_id??""}`),c(J,`FEC-${R(f).filing_id??""}`),c(Q,R(f).cover_record_form||"N/A")}),i(I,G)}),l(()=>c(C,`Recent Filings (${e.filings.length??""})`)),i(s,v)};n(me,s=>{e.filings&&e.filings.length>0&&s(ye)})}l(()=>c(ce,e.candidate?.name||e.candidate_id)),i(ie,Z),Ie()}Pe(Te,{target:document.getElementById("app-root")});
@@ -0,0 +1,2 @@
1
+ const c=[...`
2
+ \r\f \v\uFEFF`];function e(l,g,t){var n=l==null?"":""+l;if(g&&(n=n?n+" "+g:g),t){for(var f in t)if(t[f])n=n?n+" "+f:f;else if(n.length)for(var r=f.length,i=0;(i=n.indexOf(f,i))>=0;){var u=i+r;(i===0||c.includes(n[i-1]))&&(u===n.length||c.includes(n[u]))?n=(i===0?"":n.substring(0,i))+n.substring(u+1):i=u}}return n===""?null:n}function a(l,g){return l==null?null:String(l)}function v(l,g,t,n,f,r){var i=l.__className;if(i!==t||i===void 0){var u=e(t,n,r);u==null?l.removeAttribute("class"):l.className=u,l.__className=t}else if(r&&f!==r)for(var s in r){var o=!!r[s];(f==null||o!==!!f[s])&&l.classList.toggle(s,o)}return r}export{v as s,a as t};
@@ -0,0 +1 @@
1
+ .committee-page.svelte-coklk8{max-width:1200px;margin:0 auto;padding:2rem}.header.svelte-coklk8{margin-bottom:2rem}.header.svelte-coklk8 h1:where(.svelte-coklk8){font-size:2rem;margin-bottom:.5rem}.breadcrumb.svelte-coklk8{font-size:.9rem;color:#666}.breadcrumb.svelte-coklk8 a:where(.svelte-coklk8){color:#06c;text-decoration:none}.breadcrumb.svelte-coklk8 a:where(.svelte-coklk8):hover{text-decoration:underline}.error-box.svelte-coklk8{background:#fee;border:1px solid #c00;padding:1rem;border-radius:4px;margin-bottom:1rem;color:#900}.content-grid.svelte-coklk8{display:grid;grid-template-columns:repeat(auto-fit,minmax(350px,1fr));gap:1.5rem;margin-bottom:1.5rem}.info-section.svelte-coklk8{background:#fff;border:1px solid #ddd;border-radius:8px;padding:1.5rem}.info-section.svelte-coklk8 h2:where(.svelte-coklk8){font-size:1.25rem;margin-bottom:1rem}.section-box.svelte-coklk8{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:1rem;margin-bottom:1rem}.section-box.svelte-coklk8 h3:where(.svelte-coklk8){font-size:1rem;margin-bottom:.5rem}dl.svelte-coklk8{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1rem}dt.svelte-coklk8{font-weight:600;color:#666}dd.svelte-coklk8{margin:0}dd.svelte-coklk8 a:where(.svelte-coklk8){color:#06c;text-decoration:none}dd.svelte-coklk8 a:where(.svelte-coklk8):hover{text-decoration:underline}address.svelte-coklk8{font-style:normal;line-height:1.6}.external-links.svelte-coklk8{margin-top:1rem}.external-links.svelte-coklk8 a:where(.svelte-coklk8){color:#06c;text-decoration:none}.external-links.svelte-coklk8 a:where(.svelte-coklk8):hover{text-decoration:underline}.filings-section.svelte-coklk8{background:#fff;border:1px solid #ddd;border-radius:8px;padding:1.5rem}.filings-section.svelte-coklk8 h2:where(.svelte-coklk8){font-size:1.25rem;margin-bottom:1rem}.filings-table.svelte-coklk8{width:100%;border-collapse:collapse}.filings-table.svelte-coklk8 th:where(.svelte-coklk8),.filings-table.svelte-coklk8 td:where(.svelte-coklk8){padding:.75rem;text-align:left;border-bottom:1px solid #e0e0e0}.filings-table.svelte-coklk8 th:where(.svelte-coklk8){background:#f5f5f5;font-weight:600}.filings-table.svelte-coklk8 a:where(.svelte-coklk8){color:#06c;text-decoration:none}.filings-table.svelte-coklk8 a:where(.svelte-coklk8):hover{text-decoration:underline}
@@ -0,0 +1,2 @@
1
+ import{y as Ne,R as De,T as Ee,A as t,I as a,z as c,B as o,F as i,G as Fe,J as m,K as s,N as p,C as N,M as Ie,Q as D,d as E,U as we}from"./load-AXKAVXVj.js";import{e as He,i as Ue}from"./each-DkfQbqzj.js";var qe=m('&rarr; <a class="svelte-coklk8"> <!></a>',1),Se=m('&rarr; <a class="svelte-coklk8"> </a>',1),ze=m('<div class="error-box svelte-coklk8"><strong>Error:</strong> </div>'),Le=m('<dt class="svelte-coklk8">Type:</dt> <dd class="svelte-coklk8"> </dd>',1),Qe=m('<dt class="svelte-coklk8">Designation:</dt> <dd class="svelte-coklk8"> </dd>',1),Te=m('<dt class="svelte-coklk8">Party:</dt> <dd class="svelte-coklk8"> </dd>',1),Be=m('<dt class="svelte-coklk8">Filing Frequency:</dt> <dd class="svelte-coklk8"> </dd>',1),Je=m(" <br/>",1),Re=m(" <br/>",1),Oe=m('<div class="section-box svelte-coklk8"><h3 class="svelte-coklk8">Address</h3> <address class="svelte-coklk8"><!> <!> <!> <!> <!></address></div>'),Ve=m('<div class="section-box svelte-coklk8"><h3 class="svelte-coklk8">Treasurer</h3> <p> </p></div>'),Ge=m('<dt class="svelte-coklk8">Contest:</dt> <dd class="svelte-coklk8"><a class="svelte-coklk8"> <!></a></dd>',1),Ke=m('<dt class="svelte-coklk8">Party:</dt> <dd class="svelte-coklk8"> </dd>',1),Me=m('<section class="info-section svelte-coklk8"><h2 class="svelte-coklk8">Associated Candidate</h2> <div class="section-box svelte-coklk8"><dl class="svelte-coklk8"><dt class="svelte-coklk8">Candidate Name:</dt> <dd class="svelte-coklk8"><a class="svelte-coklk8"> </a></dd> <dt class="svelte-coklk8">Candidate ID:</dt> <dd class="svelte-coklk8"><a class="svelte-coklk8"> </a></dd> <!> <!></dl></div></section>'),We=m('<div class="content-grid svelte-coklk8"><section class="info-section svelte-coklk8"><h2 class="svelte-coklk8">Committee Information</h2> <div class="section-box svelte-coklk8"><dl class="svelte-coklk8"><dt class="svelte-coklk8">Committee ID:</dt> <dd class="svelte-coklk8"> </dd> <!> <!> <!> <!> <dt class="svelte-coklk8">Election Cycle:</dt> <dd class="svelte-coklk8"> </dd></dl></div> <!> <!> <div class="external-links svelte-coklk8"><a target="_blank" rel="noopener noreferrer" class="svelte-coklk8">View on FEC.gov &rarr;</a></div></section> <!></div>'),Xe=m('<div class="info-section svelte-coklk8"><p>Committee not found.</p></div>'),Ye=m('<tr><td class="svelte-coklk8"><a class="svelte-coklk8"> </a></td><td class="svelte-coklk8"> </td><td class="svelte-coklk8"><!></td></tr>'),Ze=m('<section class="filings-section svelte-coklk8"><h2 class="svelte-coklk8"> </h2> <table class="filings-table svelte-coklk8"><thead><tr><th class="svelte-coklk8">Filing ID</th><th class="svelte-coklk8">Form</th><th class="svelte-coklk8">Coverage Period</th></tr></thead><tbody></tbody></table></section>'),je=m('<div class="committee-page svelte-coklk8"><div class="header svelte-coklk8"><h1 class="svelte-coklk8"> </h1> <div class="breadcrumb svelte-coklk8"><a href="/-/libfec" class="svelte-coklk8">FEC Data</a> <!> <!> &rarr; Committee</div></div> <!> <!> <!></div>');function et(se,ce){Ne(ce,!1);const e=De(),Y={H:"House",S:"Senate",P:"President"};function oe(d){return d?{C:"Communication Cost",D:"Delegate Committee",E:"Electioneering Communication",H:"House Campaign",I:"Independent Expenditor",N:"PAC - Nonqualified",O:"Super PAC (Independent Expenditure-Only)",P:"Presidential Campaign",Q:"PAC - Qualified",S:"Senate Campaign",U:"Single Candidate Independent Expenditure",V:"PAC with Non-Contribution Account",W:"PAC with Non-Contribution Account - Nonqualified",X:"Party - Nonqualified",Y:"Party - Qualified",Z:"National Party Nonfederal Account"}[d]||d:"Unknown"}function le(d){return d?{A:"Authorized by Candidate",B:"Lobbyist/Registrant PAC",D:"Leadership PAC",J:"Joint Fundraising Committee",P:"Principal Campaign Committee",U:"Unauthorized"}[d]||d:"Unknown"}Ee();var Z=je(),j=a(Z),ee=a(j),ve=a(ee),ne=t(ee,2),te=t(a(ne),2);{var _e=d=>{var _=qe(),f=t(p(_)),u=a(f),x=t(u);{var C=P=>{var g=D();o(()=>s(g,e.candidate.district)),i(P,g)};c(x,P=>{e.candidate.office==="H"&&e.candidate.district&&P(C)})}o(()=>{N(f,"href",`/-/libfec/contest?state=${e.candidate.state??""}&office=${e.candidate.office??""}${e.candidate.office==="H"&&e.candidate.district?"&district="+e.candidate.district:""}&cycle=${e.cycle??""}`),s(u,`${e.candidate.state??""} ${(Y[e.candidate.office]||e.candidate.office)??""} `)}),i(d,_)};c(te,d=>{e.candidate?.office&&e.candidate?.state&&d(_e)})}var me=t(te,2);{var fe=d=>{var _=Se(),f=t(p(_)),u=a(f);o(()=>{N(f,"href",`/-/libfec/candidate/${e.candidate.candidate_id??""}?cycle=${e.cycle??""}`),s(u,e.candidate.name)}),i(d,_)};c(me,d=>{e.candidate&&d(fe)})}var ae=t(j,2);{var ke=d=>{var _=ze(),f=t(a(_));o(()=>s(f,` ${e.error??""}`)),i(d,_)};c(ae,d=>{e.error&&d(ke)})}var de=t(ae,2);{var ge=d=>{var _=We(),f=a(_),u=t(a(f),2),x=a(u),C=t(a(x),2),P=a(C),g=t(C,2);{var H=r=>{var n=Le(),h=t(p(n),2),k=a(h);o($=>s(k,$),[()=>oe(e.committee.committee_type)]),i(r,n)};c(g,r=>{e.committee.committee_type&&r(H)})}var F=t(g,2);{var U=r=>{var n=Qe(),h=t(p(n),2),k=a(h);o($=>s(k,$),[()=>le(e.committee.designation)]),i(r,n)};c(F,r=>{e.committee.designation&&r(U)})}var q=t(F,2);{var S=r=>{var n=Te(),h=t(p(n),2),k=a(h);o(()=>s(k,e.committee.party_affiliation)),i(r,n)};c(q,r=>{e.committee.party_affiliation&&r(S)})}var z=t(q,2);{var R=r=>{var n=Be(),h=t(p(n),2),k=a(h);o(()=>s(k,e.committee.filing_frequency)),i(r,n)};c(z,r=>{e.committee.filing_frequency&&r(R)})}var O=t(z,4),V=a(O),L=t(u,2);{var b=r=>{var n=Oe(),h=t(a(n),2),k=a(h);{var $=v=>{var l=Je(),y=p(l,!0);o(()=>s(y,e.committee.address_street1)),i(v,l)};c(k,v=>{e.committee.address_street1&&v($)})}var I=t(k,2);{var G=v=>{var l=Re(),y=p(l,!0);o(()=>s(y,e.committee.address_street2)),i(v,l)};c(I,v=>{e.committee.address_street2&&v(G)})}var w=t(I,2);{var Q=v=>{var l=D();o(()=>s(l,`${e.committee.address_city??""},`)),i(v,l)};c(w,v=>{e.committee.address_city&&v(Q)})}var T=t(w,2);{var B=v=>{var l=D();o(()=>s(l,e.committee.address_state)),i(v,l)};c(T,v=>{e.committee.address_state&&v(B)})}var K=t(T,2);{var M=v=>{var l=D();o(()=>s(l,e.committee.address_zip)),i(v,l)};c(K,v=>{e.committee.address_zip&&v(M)})}i(r,n)};c(L,r=>{(e.committee.address_street1||e.committee.address_city)&&r(b)})}var A=t(L,2);{var xe=r=>{var n=Ve(),h=t(a(n),2),k=a(h);o(()=>s(k,e.committee.treasurer_name)),i(r,n)};c(A,r=>{e.committee.treasurer_name&&r(xe)})}var ye=t(A,2),Ce=a(ye),be=t(f,2);{var $e=r=>{var n=Me(),h=t(a(n),2),k=a(h),$=t(a(k),2),I=a($),G=a(I),w=t($,4),Q=a(w),T=a(Q),B=t(w,2);{var K=l=>{var y=Ge(),W=t(p(y),2),J=a(W),re=a(J),Pe=t(re);{var Ae=X=>{var ie=D();o(()=>s(ie,`District ${e.candidate.district??""}`)),i(X,ie)};c(Pe,X=>{e.candidate.office==="H"&&e.candidate.district&&X(Ae)})}o(()=>{N(J,"href",`/-/libfec/contest?state=${e.candidate.state??""}&office=${e.candidate.office??""}${e.candidate.office==="H"&&e.candidate.district?"&district="+e.candidate.district:""}&cycle=${e.cycle??""}`),s(re,`${e.candidate.state??""}
2
+ ${(Y[e.candidate.office]||e.candidate.office)??""} `)}),i(l,y)};c(B,l=>{e.candidate.office&&e.candidate.state&&l(K)})}var M=t(B,2);{var v=l=>{var y=Ke(),W=t(p(y),2),J=a(W);o(()=>s(J,e.candidate.party_affiliation)),i(l,y)};c(M,l=>{e.candidate.party_affiliation&&l(v)})}o(()=>{N(I,"href",`/-/libfec/candidate/${e.candidate.candidate_id??""}?cycle=${e.cycle??""}`),s(G,e.candidate.name||"Unknown"),N(Q,"href",`/-/libfec/candidate/${e.candidate.candidate_id??""}?cycle=${e.cycle??""}`),s(T,e.candidate.candidate_id)}),i(r,n)};c(be,r=>{e.candidate&&r($e)})}o(()=>{s(P,e.committee.committee_id),s(V,e.cycle),N(Ce,"href",`https://www.fec.gov/data/committee/${e.committee_id??""}/`)}),i(d,_)},he=d=>{var _=Ie(),f=p(_);{var u=x=>{var C=Xe();i(x,C)};c(f,x=>{e.error||x(u)},!0)}i(d,_)};c(de,d=>{e.committee?d(ge):d(he,!1)})}var ue=t(de,2);{var pe=d=>{var _=Ze(),f=a(_),u=a(f),x=t(f,2),C=t(a(x));He(C,5,()=>e.filings,Ue,(P,g)=>{var H=Ye(),F=a(H),U=a(F),q=a(U),S=t(F),z=a(S),R=t(S),O=a(R);{var V=b=>{var A=D();o(()=>s(A,`${E(g).coverage_from_date??""} to ${E(g).coverage_through_date??""}`)),i(b,A)},L=b=>{var A=D("N/A");i(b,A)};c(O,b=>{E(g).coverage_from_date&&E(g).coverage_through_date?b(V):b(L,!1)})}o(()=>{N(U,"href",`/-/libfec/filing/${E(g).filing_id??""}`),s(q,`FEC-${E(g).filing_id??""}`),s(z,E(g).cover_record_form||"N/A")}),i(P,H)}),o(()=>s(u,`Recent Filings (${e.filings.length??""})`)),i(d,_)};c(ue,d=>{e.filings&&e.filings.length>0&&d(pe)})}o(()=>s(ve,e.committee?.name||e.committee_id)),i(se,Z),Fe()}we(et,{target:document.getElementById("app-root")});
@@ -0,0 +1 @@
1
+ import{y as pe,R as ke,T as we,A as i,z as o,B as k,F as s,G as ge,I as e,J as _,K as c,d as t,C as D,N as y,Q as C,M as O,U as ue}from"./load-AXKAVXVj.js";import{e as he,i as xe}from"./each-DkfQbqzj.js";import{s as ye}from"./class-C5DDKbJD.js";var Ce=_('<div class="error-box svelte-e8kwbr"><strong>Error:</strong> </div>'),Ie=_('<p class="no-data svelte-e8kwbr">No candidates found for this contest.</p>'),De=_("<div> </div>"),Ee=_('<dt class="svelte-e8kwbr">Status:</dt> <dd class="svelte-e8kwbr"><!></dd>',1),Pe=_('<dt class="svelte-e8kwbr">Committee:</dt> <dd class="svelte-e8kwbr"><a class="svelte-e8kwbr"> </a></dd>',1),Ne=_('<div class="candidate-card svelte-e8kwbr"><div class="candidate-name svelte-e8kwbr"><a class="svelte-e8kwbr"> </a></div> <!> <dl class="candidate-details svelte-e8kwbr"><dt class="svelte-e8kwbr">Candidate ID:</dt> <dd class="svelte-e8kwbr"><a class="svelte-e8kwbr"> </a></dd> <!> <!></dl></div>'),Le=_('<div class="candidates-grid svelte-e8kwbr"></div>'),Re=_('<div class="contest-page svelte-e8kwbr"><div class="header svelte-e8kwbr"><h1 class="svelte-e8kwbr"> </h1> <div class="meta svelte-e8kwbr"><span class="cycle svelte-e8kwbr"> </span> <span class="office svelte-e8kwbr"> </span></div> <div class="breadcrumb svelte-e8kwbr"><a href="/-/libfec" class="svelte-e8kwbr">FEC Data</a> &rarr; Contest</div></div> <!> <section class="candidates-section svelte-e8kwbr"><h2 class="svelte-e8kwbr"> </h2> <!></section></div>');function Se(U,z){pe(z,!1);const v=ke(),J={H:"House",S:"Senate",P:"President"};function K(r){return r?{DEM:"Democrat",REP:"Republican",LIB:"Libertarian",GRE:"Green",IND:"Independent",NPA:"No Party Affiliation"}[r]||r:""}we();var E=Re(),P=e(E),N=e(P),Q=e(N),T=i(N,2),L=e(T),j=e(L),q=i(L,2),V=e(q),R=i(P,2);{var W=r=>{var d=Ce(),I=i(e(d));k(()=>c(I,` ${v.error??""}`)),s(r,d)};o(R,r=>{v.error&&r(W)})}var X=i(R,2),S=e(X),Y=e(S),Z=i(S,2);{var ee=r=>{var d=Ie();s(r,d)},ae=r=>{var d=Le();he(d,5,()=>v.candidates,xe,(I,a)=>{var A=Ne(),B=e(A),G=e(B),te=e(G),$=i(B,2);{var re=l=>{var n=De(),w=e(n);k((f,g)=>{ye(n,1,`party ${f??""}`,"svelte-e8kwbr"),c(w,g)},[()=>t(a).party_affiliation.toLowerCase(),()=>K(t(a).party_affiliation)]),s(l,n)};o($,l=>{t(a).party_affiliation&&l(re)})}var se=i($,2),F=i(e(se),2),H=e(F),ve=e(H),M=i(F,2);{var ie=l=>{var n=Ee(),w=i(y(n),2),f=e(w);{var g=b=>{var u=C("Incumbent");s(b,u)},ne=b=>{var u=O(),de=y(u);{var oe=m=>{var h=C("Challenger");s(m,h)},_e=m=>{var h=O(),fe=y(h);{var be=p=>{var x=C("Open Seat");s(p,x)},me=p=>{var x=C();k(()=>c(x,t(a).incumbent_challenger_status)),s(p,x)};o(fe,p=>{t(a).incumbent_challenger_status==="O"?p(be):p(me,!1)},!0)}s(m,h)};o(de,m=>{t(a).incumbent_challenger_status==="C"?m(oe):m(_e,!1)},!0)}s(b,u)};o(f,b=>{t(a).incumbent_challenger_status==="I"?b(g):b(ne,!1)})}s(l,n)};o(M,l=>{t(a).incumbent_challenger_status&&l(ie)})}var le=i(M,2);{var ce=l=>{var n=Pe(),w=i(y(n),2),f=e(w),g=e(f);k(()=>{D(f,"href",`/-/libfec/committee/${t(a).principal_campaign_committee??""}?cycle=${v.cycle??""}`),c(g,t(a).principal_campaign_committee)}),s(l,n)};o(le,l=>{t(a).principal_campaign_committee&&l(ce)})}k(()=>{D(G,"href",`/-/libfec/candidate/${t(a).candidate_id??""}?cycle=${v.cycle??""}`),c(te,t(a).name||"Unknown"),D(H,"href",`/-/libfec/candidate/${t(a).candidate_id??""}?cycle=${v.cycle??""}`),c(ve,t(a).candidate_id)}),s(I,A)}),s(r,d)};o(Z,r=>{!v.candidates||v.candidates.length===0?r(ee):r(ae,!1)})}k(()=>{c(Q,v.contest_description),c(j,`${v.cycle??""} Election Cycle`),c(V,J[v.office]||v.office),c(Y,`Candidates (${v.candidates?.length??0??""})`)}),s(U,E),ge()}ue(Se,{target:document.getElementById("app-root")});
@@ -0,0 +1 @@
1
+ .contest-page.svelte-e8kwbr{max-width:1200px;margin:0 auto;padding:2rem}.header.svelte-e8kwbr{margin-bottom:2rem}.header.svelte-e8kwbr h1:where(.svelte-e8kwbr){font-size:2rem;margin-bottom:.5rem}.meta.svelte-e8kwbr{display:flex;gap:1rem;margin-bottom:.5rem}.cycle.svelte-e8kwbr{background:#e0e0e0;padding:.25rem .5rem;border-radius:4px;font-size:.9rem}.office.svelte-e8kwbr{background:#d0e0f0;padding:.25rem .5rem;border-radius:4px;font-size:.9rem}.breadcrumb.svelte-e8kwbr{font-size:.9rem;color:#666}.breadcrumb.svelte-e8kwbr a:where(.svelte-e8kwbr){color:#06c;text-decoration:none}.breadcrumb.svelte-e8kwbr a:where(.svelte-e8kwbr):hover{text-decoration:underline}.error-box.svelte-e8kwbr{background:#fee;border:1px solid #c00;padding:1rem;border-radius:4px;margin-bottom:1rem;color:#900}.candidates-section.svelte-e8kwbr{background:#fff;border:1px solid #ddd;border-radius:8px;padding:1.5rem}.candidates-section.svelte-e8kwbr h2:where(.svelte-e8kwbr){font-size:1.5rem;margin-bottom:1rem}.no-data.svelte-e8kwbr{color:#666;font-style:italic}.candidates-grid.svelte-e8kwbr{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:1rem}.candidate-card.svelte-e8kwbr{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:8px;padding:1rem}.candidate-name.svelte-e8kwbr{font-size:1.2rem;font-weight:600;margin-bottom:.5rem}.candidate-name.svelte-e8kwbr a:where(.svelte-e8kwbr){color:#06c;text-decoration:none}.candidate-name.svelte-e8kwbr a:where(.svelte-e8kwbr):hover{text-decoration:underline}.party.svelte-e8kwbr{display:inline-block;padding:.25rem .5rem;border-radius:4px;font-size:.85rem;margin-bottom:.75rem}.party.dem.svelte-e8kwbr{background:#cce5ff;color:#004085}.party.rep.svelte-e8kwbr{background:#f8d7da;color:#721c24}.party.lib.svelte-e8kwbr{background:#fff3cd;color:#856404}.party.gre.svelte-e8kwbr{background:#d4edda;color:#155724}.candidate-details.svelte-e8kwbr{display:grid;grid-template-columns:max-content 1fr;gap:.25rem .75rem;font-size:.9rem}.candidate-details.svelte-e8kwbr dt:where(.svelte-e8kwbr){font-weight:600;color:#666}.candidate-details.svelte-e8kwbr dd:where(.svelte-e8kwbr){margin:0}.candidate-details.svelte-e8kwbr a:where(.svelte-e8kwbr){color:#06c;text-decoration:none}.candidate-details.svelte-e8kwbr a:where(.svelte-e8kwbr):hover{text-decoration:underline}
@@ -0,0 +1 @@
1
+ import{_ as H,$ as X,d as D,a0 as L,c as Y,a1 as k,a2 as $,v as G,i as J,a3 as F,a4 as K,a5 as O,a6 as P,a7 as Q,a8 as W,a9 as C,aa as V,ab as B,ac as U,ad as R,Y as Z,ae as j,af as y,ag as ee,ah as re}from"./load-AXKAVXVj.js";function ie(r,a){return a}function ne(r,a,i){for(var d=[],g=a.length,u,s=a.length,c=0;c<g;c++){let h=a[c];U(h,()=>{if(u){if(u.pending.delete(h),u.done.add(h),u.pending.size===0){var o=r.outrogroups;z(F(u.done)),o.delete(u),o.size===0&&(r.outrogroups=null)}}else s-=1},!1)}if(s===0){var f=d.length===0&&i!==null;if(f){var v=i,n=v.parentNode;y(n),n.append(v),r.items.clear()}z(a,!f)}else u={pending:new Set(a),done:new Set},(r.outrogroups??=new Set).add(u)}function z(r,a=!0){for(var i=0;i<r.length;i++)ee(r[i],a)}var q;function ue(r,a,i,d,g,u=null){var s=r,c=new Map,f=(a&V)!==0;if(f){var v=r;s=v.appendChild(H())}var n=null,h=G(()=>{var l=i();return J(l)?l:l==null?[]:F(l)}),o,t=!0;function S(){e.fallback=n,fe(e,o,s,a,d),n!==null&&(o.length===0?(n.f&C)===0?B(n):(n.f^=C,M(n,null,s)):U(n,()=>{n=null}))}var x=X(()=>{o=D(h);for(var l=o.length,b=new Set,m=Y,_=$(),w=0;w<l;w+=1){var T=o[w],E=d(T,w),p=t?null:c.get(E);p?(p.v&&L(p.v,T),p.i&&L(p.i,w),_&&m.skipped_effects.delete(p.e)):(p=ae(c,t?s:q??=H(),T,E,w,g,a,i),t||(p.e.f|=C),c.set(E,p)),b.add(E)}if(l===0&&u&&!n&&(t?n=k(()=>u(s)):(n=k(()=>u(q??=H())),n.f|=C)),!t)if(_){for(const[N,A]of c)b.has(N)||m.skipped_effects.add(A.e);m.oncommit(S),m.ondiscard(()=>{})}else S();D(h)}),e={effect:x,items:c,outrogroups:null,fallback:n};t=!1}function fe(r,a,i,d,g){var u=(d&j)!==0,s=a.length,c=r.items,f=r.effect.first,v,n=null,h,o=[],t=[],S,x,e,l;if(u)for(l=0;l<s;l+=1)S=a[l],x=g(S,l),e=c.get(x).e,(e.f&C)===0&&(e.nodes?.a?.measure(),(h??=new Set).add(e));for(l=0;l<s;l+=1){if(S=a[l],x=g(S,l),e=c.get(x).e,r.outrogroups!==null)for(const A of r.outrogroups)A.pending.delete(e),A.done.delete(e);if((e.f&C)!==0)if(e.f^=C,e===f)M(e,null,i);else{var b=n?n.next:f;e===r.effect.last&&(r.effect.last=e.prev),e.prev&&(e.prev.next=e.next),e.next&&(e.next.prev=e.prev),I(r,n,e),I(r,e,b),M(e,b,i),n=e,o=[],t=[],f=n.next;continue}if((e.f&R)!==0&&(B(e),u&&(e.nodes?.a?.unfix(),(h??=new Set).delete(e))),e!==f){if(v!==void 0&&v.has(e)){if(o.length<t.length){var m=t[0],_;n=m.prev;var w=o[0],T=o[o.length-1];for(_=0;_<o.length;_+=1)M(o[_],m,i);for(_=0;_<t.length;_+=1)v.delete(t[_]);I(r,w.prev,T.next),I(r,n,w),I(r,T,m),f=m,n=T,l-=1,o=[],t=[]}else v.delete(e),M(e,f,i),I(r,e.prev,e.next),I(r,e,n===null?r.effect.first:n.next),I(r,n,e),n=e;continue}for(o=[],t=[];f!==null&&f!==e;)(v??=new Set).add(f),t.push(f),f=f.next;if(f===null)continue}(e.f&C)===0&&o.push(e),n=e,f=e.next}if(r.outrogroups!==null){for(const A of r.outrogroups)A.pending.size===0&&(z(F(A.done)),r.outrogroups?.delete(A));r.outrogroups.size===0&&(r.outrogroups=null)}if(f!==null||v!==void 0){var E=[];if(v!==void 0)for(e of v)(e.f&R)===0&&E.push(e);for(;f!==null;)(f.f&R)===0&&f!==r.fallback&&E.push(f),f=f.next;var p=E.length;if(p>0){var N=(d&V)!==0&&s===0?i:null;if(u){for(l=0;l<p;l+=1)E[l].nodes?.a?.measure();for(l=0;l<p;l+=1)E[l].nodes?.a?.fix()}ne(r,E,N)}}u&&Z(()=>{if(h!==void 0)for(e of h)e.nodes?.a?.apply()})}function ae(r,a,i,d,g,u,s,c){var f=(s&P)!==0?(s&Q)===0?W(i,!1,!1):O(i):null,v=(s&K)!==0?O(g):null;return{v:f,i:v,e:k(()=>(u(a,f??i,v??g,c),()=>{r.delete(d)}))}}function M(r,a,i){if(r.nodes)for(var d=r.nodes.start,g=r.nodes.end,u=a&&(a.f&C)===0?a.nodes.start:i;d!==null;){var s=re(d);if(u.before(d),d===g)return;d=s}}function I(r,a,i){a===null?r.effect.first=i:a.next=i,i===null?r.effect.last=a:i.prev=a}export{ue as e,ie as i};
@@ -0,0 +1 @@
1
+ .alert-box.svelte-56ac3r{background:#fff3cd;border:1px solid #ffc107;border-radius:4px;padding:1rem;margin-top:1rem}.alert-box.svelte-56ac3r p:where(.svelte-56ac3r){margin:0;color:#856404}.text-content.svelte-q9c4pz{background:#f9f9f9;padding:1rem;border-left:3px solid #007bff;white-space:pre-wrap;font-family:inherit;line-height:1.6}.filing-detail.svelte-10ase3{max-width:1200px;margin:0 auto;padding:2rem}.header.svelte-10ase3{margin-bottom:2rem}.header.svelte-10ase3 h1:where(.svelte-10ase3){font-size:2rem;margin-bottom:.5rem}.filer-info.svelte-10ase3{margin-bottom:.75rem;font-size:1.1rem}.filer-name.svelte-10ase3 a:where(.svelte-10ase3){color:#06c;text-decoration:none}.filer-name.svelte-10ase3 a:where(.svelte-10ase3):hover{text-decoration:underline}.filer-id.svelte-10ase3{color:#666;font-size:.9rem}.links.svelte-10ase3{display:flex;gap:1rem;flex-wrap:wrap}.links.svelte-10ase3 a:where(.svelte-10ase3){color:#06c;text-decoration:none}.links.svelte-10ase3 a:where(.svelte-10ase3):hover{text-decoration:underline}.info-section.svelte-10ase3{background:#fff;border:1px solid #ddd;border-radius:8px;padding:1.5rem}.info-section.svelte-10ase3 h2:where(.svelte-10ase3){font-size:1.5rem;margin-bottom:1rem}.form-content.svelte-10ase3 h3:where(.svelte-10ase3){font-size:1.25rem;margin-bottom:1rem}.section-box.svelte-10ase3{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:1rem;margin-bottom:1.5rem}.section-box.svelte-10ase3 h4:where(.svelte-10ase3){font-size:1.1rem;margin-bottom:.75rem;font-weight:600}.form-content .section-box{background:#f9f9f9;border:1px solid #e0e0e0;border-radius:4px;padding:1rem;margin-bottom:1.5rem}.form-content .section-box h4{font-size:1.1rem;margin-bottom:.75rem;font-weight:600}.form-content address{font-style:normal;line-height:1.6}.form-content dl{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1rem}.form-content dt{font-weight:600}.form-content dd{margin:0}dl.svelte-10ase3{display:grid;grid-template-columns:max-content 1fr;gap:.5rem 1rem}dt.svelte-10ase3{font-weight:600}dd.svelte-10ase3{margin:0}details.svelte-10ase3{margin-top:1rem}pre.svelte-10ase3{background:#f5f5f5;padding:1rem;border-radius:4px;overflow-x:auto}