(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,542324,e=>{"use strict";var t=e.i(651681);let n={name:"pencil",size:24,node:[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]};n.node;let i=(0,t.f)(n);e.s(["f",0,i])},271825,e=>{"use strict";var t=e.i(542324);e.s(["f",()=>t.f])},596376,e=>{"use strict";var t=e.i(659350),n=e.i(663456),i=e.i(207298),r=e.i(136562);let a=(0,i.f)("mt-1 leading-body",{variants:{tone:{muted:"text-muted-foreground",foreground:"text-foreground"}},defaultVariants:{tone:"muted"}}),s="border-negative/30 bg-negative-bg text-foreground [&>svg]:text-negative",o=(0,i.f)("relative flex w-full rounded-lg border text-xs [&>svg]:mt-0.5 [&>svg]:shrink-0",{variants:{size:{default:"gap-3 px-4 py-3 [&>svg]:size-4",compact:"gap-1.5 px-2.5 py-1.5 [&>svg]:size-3.5"},variant:{default:"border-border bg-muted text-foreground [&>svg]:text-muted-foreground",destructive:s,positive:"border-positive/30 bg-positive-bg text-foreground [&>svg]:text-positive",negative:s,warning:"border-warning/30 bg-warning-bg text-foreground [&>svg]:text-warning",info:"border-info/30 bg-info-bg text-foreground [&>svg]:text-info",promo:"border-promo/30 bg-promo-bg text-foreground [&>svg]:text-promo"}},defaultVariants:{size:"default",variant:"default"}});e.s(["J",0,function(e){let i,a,s,l,d,c,u=(0,n.c)(12);return u[0]!==e?({className:i,variant:l,size:s,...a}=e,u[0]=e,u[1]=i,u[2]=a,u[3]=s,u[4]=l):(i=u[1],a=u[2],s=u[3],l=u[4]),u[5]!==i||u[6]!==s||u[7]!==l?(d=(0,r.f)(o({size:s,variant:l}),i),u[5]=i,u[6]=s,u[7]=l,u[8]=d):d=u[8],u[9]!==a||u[10]!==d?(c=(0,t.jsx)("div",{role:"alert",className:d,...a}),u[9]=a,u[10]=d,u[11]=c):c=u[11],c},"p",0,function(e){let i,s,o,l,d,c=(0,n.c)(10);return c[0]!==e?({className:i,tone:o,...s}=e,c[0]=e,c[1]=i,c[2]=s,c[3]=o):(i=c[1],s=c[2],o=c[3]),c[4]!==i||c[5]!==o?(l=(0,r.f)(a({tone:o}),i),c[4]=i,c[5]=o,c[6]=l):l=c[6],c[7]!==s||c[8]!==l?(d=(0,t.jsx)("div",{className:l,...s}),c[7]=s,c[8]=l,c[9]=d):d=c[9],d},"s",0,function(e){let i,a,s,o,l=(0,n.c)(8);return l[0]!==e?({className:i,...a}=e,l[0]=e,l[1]=i,l[2]=a):(i=l[1],a=l[2]),l[3]!==i?(s=(0,r.f)("font-medium leading-snug text-foreground",i),l[3]=i,l[4]=s):s=l[4],l[5]!==a||l[6]!==s?(o=(0,t.jsx)("h5",{className:s,...a,children:a.children}),l[5]=a,l[6]=s,l[7]=o):o=l[7],o}],596376)},554395,e=>{"use strict";var t=e.i(659350),n=e.i(663456),i=e.i(207298),r=e.i(136562),a=e.i(102187);let s=(0,i.f)((0,r.f)("flex w-full","text-body pointer-coarse:text-base","placeholder:text-muted-foreground/50","focus-visible:outline-hidden focus-visible:ring-0","disabled:cursor-not-allowed disabled:opacity-50"),{variants:{variant:{default:(0,r.f)("min-h-20 px-3 py-2","rounded-md border border-input bg-input-bg","focus-visible:border-focus-border focus-visible:shadow-focus"),embedded:"overflow-y-auto px-3 py-2.5"}},defaultVariants:{variant:"default"}}),o=s();e.s(["g",0,o,"o",0,function(e){let i,o,l,d,c,u,f,m,h=(0,n.c)(16);return h[0]!==e?({className:i,inputClassName:l,variant:u,font:o,ref:c,...d}=e,h[0]=e,h[1]=i,h[2]=o,h[3]=l,h[4]=d,h[5]=c,h[6]=u):(i=h[1],o=h[2],l=h[3],d=h[4],c=h[5],u=h[6]),h[7]!==i||h[8]!==o||h[9]!==l||h[10]!==u?(f=(0,r.f)(s({variant:u}),(0,a.f)({font:o}),l,i),h[7]=i,h[8]=o,h[9]=l,h[10]=u,h[11]=f):f=h[11],h[12]!==d||h[13]!==c||h[14]!==f?(m=(0,t.jsx)("textarea",{className:f,ref:c,...d}),h[12]=d,h[13]=c,h[14]=f,h[15]=m):m=h[15],m}])},852276,e=>{"use strict";var t=e.i(659350),n=e.i(663456),i=e.i(136562),r=e.i(596376),a=e.i(233452),s=e.i(139697),o=e.i(522396),l=e.i(530798),d=e.i(554395),c=e.i(647204);e.i(707060);var u=e.i(288265),f=e.i(271825),m=e.i(16043),h=e.i(375702),p=e.i(901869);let g="(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|June?|July?|Aug(?:ust)?|Sep(?:t(?:ember)?)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)",b={money:[/[$\u20AC£]\s?\d{1,3}(?:,\d{3})*(?:\.\d{1,2})?/g,/\b\d{1,3}(?:,\d{3})*(?:\.\d{2})?\s?(?:USD|EUR|GBP|dollars)\b/g],date:[RegExp(`\\b${g}\\.?\\s+\\d{1,2}(?:st|nd|rd|th)?,?\\s+\\d{4}\\b`,"g"),RegExp(`\\b\\d{1,2}(?:st|nd|rd|th)?\\s+${g}\\.?,?\\s+\\d{4}\\b`,"g"),/\b\d{4}-\d{2}-\d{2}\b/g,/\b\d{1,2}\/\d{1,2}\/\d{2,4}\b/g],id:[/\b(?:INV|PO|REF|ORD|SO|CN|ACC|CASE|TKT|QUO)-[A-Z0-9][A-Z0-9-]*\b/g,/#\d{3,}\b/g],name:[/\b[A-Z][a-z]+(?:\s+(?:[A-Z]\.|[A-Z][a-z]+)){1,2}\b/g],email:[/\b[\w.+-]+@[\w-]+(?:\.[\w-]+)+\b/g],percent:[/\b\d+(?:\.\d+)?\s?%/g,/\b\d+(?:\.\d+)?\s?percent\b/gi],duration:[RegExp("\\b(?:\\d+|(?:one|two|three|four|five|six|seven|eight|nine|ten|twelve|fourteen|thirty|forty-five|sixty|ninety))[-\\s]?(?:calendar\\s|business\\s)?(?:days?|weeks?|months?|years?|hours?)\\b","gi")],title:[/\b(?:(?:Senior|Staff|Principal|Lead|Junior|Associate|Chief)\s+)?(?:(?:Software|Product|Design|Data|Platform|Marketing|Sales|Engineering|Finance|Operations|People|Technology|Account|Growth|Research)\s+)?(?:Engineer|Designer|Manager|Scientist|Analyst|Officer|Architect|Director|Specialist|Coordinator|Recruiter)\b/g,/\b(?:Head|VP|Vice President|Director)\s+of\s+[A-Z][a-z]+\b/g]},v=/^(?:Dear|Hi|Hello|Subject|Thanks|Warmly|Sincerely|Best|Regards|Please|Your|Our|This|The|For|Tenant|Landlord|Term|Rent|Notice|Security|Compensation|Payment|Questions|Property|Unit|Apt|Oregon|Portland|Tacoma|Agreement|Effective|Initial|Renewal|Confidential)\b/;function y(e,t){let n=[],i=new Set;for(let r of b[t])for(let a of(r.lastIndex=0,e.matchAll(r))){let e=a[0].trim(),r=a.index??0,s=`${r}:${e.length}`;if(!(!e||i.has(s))&&!("name"===t&&v.test(e))&&(i.add(s),n.push({value:e,start:r,end:r+e.length}),n.length>=40))return n.sort((e,t)=>e.start-t.start)}return n.sort((e,t)=>e.start-t.start)}let w="none",x="A document to extract fields from. Judge only from `document`.",k="Chat model",j=[{id:"invoice",label:"Vendor invoice",short:"Invoice",text:`Subject: Invoice INV-2026-0917 for the September retainer Hi Priya, Please find attached invoice INV-2026-0917 from Northwind Traders for the September design retainer. Subtotal $4,800.00, tax $384.00, total due $5,184.00. Payment is due by October 15, 2026 (net 30). Your purchase order reference for this work is PO-77812. For your records, last month's invoice INV-2026-0816 for $4,650.00 was paid on September 2, 2026. Our previous PO on file, PO-76104, is now closed. Questions about billing go to accounts@northwindtraders.com. For project matters keep writing to me at dana.whitfield@northwindtraders.com. Thanks, Dana Whitfield Account Director, Northwind Traders`,fields:[{id:"invoice_number",label:"Invoice number",kind:"id",question:"invoice number of the new invoice being sent"},{id:"total_due",label:"Total due",kind:"money",question:"total amount due on the new invoice"},{id:"due_date",label:"Due date",kind:"date",question:"payment due date of the new invoice"},{id:"po_number",label:"PO number",kind:"id",question:"purchase order reference for the new invoice"},{id:"billing_email",label:"Billing contact",kind:"email",question:"email address for billing questions"}]},{id:"lease",label:"Residential lease",short:"Lease",text:`RESIDENTIAL LEASE AGREEMENT (excerpt) This lease is made on August 20, 2026 between Marisol Ortega ("Landlord") and Jordan Blake ("Tenant") for the premises at 418 Alder Street, Unit 3B, Portland, OR 97214. Tenant previously resided at 92 Harbor View Lane, Apt 12, Tacoma, WA 98402. Term: twelve months, beginning September 1, 2026 and ending August 31, 2027. Rent: $2,350.00 per month, due on the first day of each month. A late fee of $75.00 applies after five days. Security deposit: $2,350.00, held in accordance with Oregon law. A separate pet deposit of $300.00 applies if a pet is kept. Notice: either party must give at least 30 days written notice to end the tenancy after the initial term. Landlord must give 24 hours notice before entering the premises. Property manager for maintenance requests: Terrence Adebayo, Alder Property Group, maintenance@alderpg.com.`,fields:[{id:"monthly_rent",label:"Monthly rent",kind:"money",question:"monthly rent amount"},{id:"security_deposit",label:"Security deposit",kind:"money",question:"security deposit (not the pet deposit or late fee)"},{id:"lease_start",label:"Lease start",kind:"date",question:"lease start date (not the signing date)"},{id:"notice_period",label:"Notice period",kind:"duration",question:"notice period to end the tenancy (not entry notice)"},{id:"landlord_name",label:"Landlord",kind:"name",question:"landlord's full name"}]},{id:"offer",label:"Job offer letter",short:"Offer letter",text:`Dear Samira, We are delighted to offer you the position of Senior Product Designer at Halcyon Labs, reporting to Elena Marchetti, Head of Design. Your anticipated start date is November 3, 2026, pending a background check that we expect to complete by October 20, 2026. Compensation: an annual base salary of $185,000.00, paid semi-monthly. You will be granted an equity award of 0.15% of fully diluted shares, vesting over four years with a one year cliff. Halcyon also matches 401(k) contributions up to 4%. This offer replaces the earlier verbal discussion of $178,000.00 on September 9, 2026. Please sign by September 26, 2026. Your recruiter, Marcus Lindqvist, can answer questions at talent@halcyonlabs.com. Warmly, Rosa Kimura VP of People, Halcyon Labs`,fields:[{id:"job_title",label:"Job title",kind:"title",question:"new hire's job title"},{id:"base_salary",label:"Base salary",kind:"money",question:"annual base salary being offered"},{id:"start_date",label:"Start date",kind:"date",question:"anticipated start date"},{id:"equity",label:"Equity",kind:"percent",question:"equity award as a percentage of fully diluted shares"},{id:"manager_name",label:"Reports to",kind:"name",question:"name of the person the new hire reports to"},{id:"signing_bonus",label:"Signing bonus",kind:"money",question:"one-time signing bonus amount"}]},{id:"msa",label:"Master services agreement",short:"Agreement",text:`MASTER SERVICES AGREEMENT Agreement No. REF-MSA-2026-0412 This Master Services Agreement (the "Agreement") is entered into as of October 1, 2026 (the "Effective Date") between Bright Harbor Systems, Inc., a Delaware corporation with offices at 1400 Waterline Avenue, Suite 900, Wilmington, DE 19801 ("Client"), and Kestrel Data Works LLC, a Colorado limited liability company with offices at 77 Mesa Ridge Road, Boulder, CO 80302 ("Provider"). The parties signed this Agreement on September 24, 2026. It replaces the prior consulting agreement REF-MSA-2024-0103 dated March 15, 2024, which ran for three years and is terminated as of the Effective Date without further obligation on either side. 1. Services. Provider will deliver the data platform engineering services described in Statement of Work SO-2026-0412-01 (the "SOW") and in any later statement of work the parties sign under this Agreement. Work under the SOW begins on October 6, 2026. Provider's quote QUO-2026-0388 dated August 29, 2026 is superseded in full by this Agreement and the SOW. Client will issue purchase order PO-88210 to cover the first twelve invoices, and Provider must reference it on every invoice it sends. 2. Term and renewal. The initial term of this Agreement is 24 months from the Effective Date (the "Initial Term"). After the Initial Term the Agreement renews automatically for successive 12 month periods (each a "Renewal Term") unless either party gives written notice of non-renewal at least ninety days before the end of the then-current term. A statement of work that is still in progress when the Agreement ends continues under these terms until it is complete or terminated. 3. Fees. Client will pay Provider a fixed fee of $18,500.00 per month for the services in the SOW, invoiced monthly in advance beginning November 1, 2026. A one-time onboarding fee of $12,000.00 is due with the first invoice. Work outside the SOW is billed at $215.00 per hour and requires Client's prior written approval. Reasonable travel is reimbursed at cost up to $3,000.00 per calendar quarter. Fees under the prior agreement were $16,200.00 per month and do not carry forward. On each anniversary of the Effective Date the monthly fee may increase by no more than 3%. 4. Payment. Invoices are payable within 45 days of receipt. Client may dispute an invoice in good faith within 10 business days of receipt, and undisputed amounts remain due on schedule. Late amounts accrue interest at 1.5% per month or the maximum rate permitted by law, whichever is lower. Billing questions go to ap@brightharborsystems.com and invoices are sent to billing@brightharborsystems.com. Provider's finance contact is Priya Raman, and Client's finance contact is Devon Marsh. 5. Service levels. Provider will maintain 99.9% monthly availability for the managed pipelines described in the SOW, measured as set out there. If availability falls below 99.9% in any month, Client receives a service credit of 10% of that month's fee, and if it falls below 99.0% the credit is 25%. Provider will acknowledge priority incidents within 4 hours and all other requests within 5 business days. Support requests are tracked as tickets, and the open migration ticket TKT-4471 is carried over from the prior engagement. 6. Personnel. Provider's engagement lead is Amara Okonkwo, Principal Engineer, and its account manager is Noah Castellanos. Provider may replace personnel with people of equal qualification after notifying Client in writing. Client's project sponsor is Devon Marsh, Director of Operations, who approves deliverables on Client's behalf. 7. Confidentiality. Each party will protect the other's Confidential Information with at least the care it uses for its own, and no less than reasonable care, for five years after disclosure. Trade secrets remain protected for as long as they qualify as trade secrets. Confidential Information does not include information that is public through no fault of the receiving party or that the receiving party already held without restriction. 8. Intellectual property. Deliverables identified as such in the SOW are works made for hire and belong to Client on payment. Provider retains its pre-existing tools, libraries and know-how and grants Client a perpetual, royalty-free license to use them as embedded in the deliverables. 9. Warranties. Provider warrants that the services will be performed in a professional and workmanlike manner by qualified people. Client must report a breach of this warranty within 30 days of delivery, and Provider will re-perform the affected services or refund the fees paid for them. This is Client's sole remedy for breach of warranty. 10. Limitation of liability. Except for breaches of confidentiality, indemnity obligations and Client's obligation to pay fees, neither party's aggregate liability under this Agreement will exceed $222,000.00, which is the total of the fees payable in the twelve months before the claim. Neither party is liable for indirect, incidental or consequential damages, including lost profits, even if advised of their possibility. 11. Termination. Either party may terminate this Agreement for convenience on 120 days written notice. Either party may terminate for material breach if the breach is not cured within 30 days of written notice describing it. On termination Provider will return or delete Client data within 60 days, and Client will pay for services performed through the termination date. No early termination fee applies. 12. Notices. Legal notices must be in writing and sent to Client at legal@brightharborsystems.com, attention Grant Whitlock, General Counsel, with a copy by courier to the address above, and to Provider at contracts@kestreldataworks.com, attention Tobias Reinholt. Operational communications may go to amara.okonkwo@kestreldataworks.com or support@kestreldataworks.com. Notices are effective on receipt. 13. Governing law. This Agreement is governed by the laws of the State of Delaware without regard to its conflict of laws rules, and the parties submit to the state and federal courts located in New Castle County, Delaware. 14. Entire agreement. This Agreement, with its statements of work, is the entire agreement between the parties on its subject and supersedes all earlier agreements, proposals and quotes. It may be amended only in a writing signed by both parties. Signed for Bright Harbor Systems, Inc. by Helena Vasquez, Chief Operating Officer, on September 24, 2026. Signed for Kestrel Data Works LLC by Tobias Reinholt, Managing Member, on September 23, 2026.`,fields:[{id:"agreement_number",label:"Agreement number",kind:"id",question:"number of this agreement (not the prior agreement, SOW, quote, PO or ticket)"},{id:"effective_date",label:"Effective date",kind:"date",question:"effective date of this agreement (not the signing date or SOW start)"},{id:"initial_term",label:"Initial term",kind:"duration",question:"length of the initial term"},{id:"renewal_term",label:"Renewal term",kind:"duration",question:"length of each automatic renewal period"},{id:"termination_notice",label:"Termination notice",kind:"duration",question:"notice period to terminate for convenience (not non-renewal or cure)"},{id:"payment_terms",label:"Payment terms",kind:"duration",question:"time allowed to pay an invoice after receipt"},{id:"monthly_fee",label:"Monthly fee",kind:"money",question:"fixed monthly fee under this agreement (not the prior fee, onboarding fee or hourly rate)"},{id:"liability_cap",label:"Liability cap",kind:"money",question:"cap on either party's aggregate liability"},{id:"late_interest",label:"Late interest",kind:"percent",question:"monthly interest rate on late payments"},{id:"uptime",label:"Uptime commitment",kind:"percent",question:"monthly availability Provider commits to (not a credit or fee increase)"},{id:"client_signatory",label:"Client signatory",kind:"name",question:"person who signed for the Client, Bright Harbor Systems"},{id:"notices_email",label:"Legal notices to",kind:"email",question:"email address for legal notices to the Client"}]}];var S=e.i(13718),A=e.i(595106),N=e.i(521965);function T(e){let i,r=(0,n.c)(3),{text:s,marks:o}=e;if(r[0]!==o||r[1]!==s){let e=[],n=0;o.forEach(i=>{i.start>n&&e.push(s.slice(n,i.start));let r=s.slice(i.start,i.end);e.push("candidate"===i.kind?(0,t.jsx)("span",{className:"underline decoration-muted-foreground/40 decoration-dotted underline-offset-4",children:r},`${i.start}-${i.end}`):(0,t.jsxs)("span",{className:"rounded-(--radius-sm) bg-muted px-0.5 text-foreground",children:[r,(0,t.jsx)(a.Badge,{className:"ml-1 align-middle px-1 py-0 text-size-overline leading-4",children:i.field.label})]},`${i.start}-${i.end}`)),n=i.end}),n()=>e0.current?.abort(),D=[],eV[2]=v,eV[3]=D):(v=eV[2],D=eV[3]),(0,m.useEffect)(v,D),eV[4]!==eM.fields.length||eV[5]!==ez.status||eV[6]!==ez.stopped?(M=()=>{if("done"!==ez.status)return;if(ez.stopped)return void e1(eM.fields.length);e1(0);let e=0,t=setInterval(()=>{e1(e+=1),e>=eM.fields.length&&clearInterval(t)},120);return e2.current=t,()=>clearInterval(t)},eV[4]=eM.fields.length,eV[5]=ez.status,eV[6]=ez.stopped,eV[7]=M):M=eV[7],eV[8]!==eM.fields.length||eV[9]!==ez.ms||eV[10]!==ez.status||eV[11]!==ez.stopped?(L=[ez.status,ez.ms,ez.stopped,eM.fields.length],eV[8]=eM.fields.length,eV[9]=ez.ms,eV[10]=ez.status,eV[11]=ez.stopped,eV[12]=L):L=eV[12],(0,m.useEffect)(M,L),eV[13]!==eM.fields||eV[14]!==eW?(W=function(e,t){let n={},i={};for(let r of t){let t=Array.from(new Set(y(e,r.kind).map(e=>e.value)));if(0===t.length){i[r.id]={type:"choice",choice:w,confidence:1};continue}let a={};for(let e of t)a[e]="This exact value as it appears in the document.";a[w]="No candidate in the document is this value.",n[r.id]={type:"choice",instructions:`Which candidate is the ${r.question}?`,criteria:a}}return{questions:n,answers:i}}(eW,eM.fields),eV[13]=eM.fields,eV[14]=eW,eV[15]=W):W=eV[15];let{questions:e5,answers:e6}=W;eV[16]!==e5?(B=e=>Math.max(0,Object.keys(e5[e.id]?.criteria??{}).length-1),eV[16]=e5,eV[17]=B):B=eV[17];let e3=B;eV[18]===Symbol.for("react.memo_cache_sentinel")?(H=()=>{e0.current?.abort(),eJ({status:"idle",answers:{},cost:0}),eU({status:"idle",values:{},calls:0,failed:0,cost:0}),eQ("jev"),e1(0)},eV[18]=H):H=eV[18];let e4=H;eV[19]===Symbol.for("react.memo_cache_sentinel")?(F=e=>{let t=j.find(t=>t.id===e);t&&(eL(t),eB(t.text),eF(!1),e4())},eV[19]=F):F=eV[19];let e9=F;eV[20]!==eM.fields||eV[21]!==e6||eV[22]!==e5||eV[23]!==eW?(z=()=>{e0.current?.abort();let e=new AbortController;e0.current=e,eJ({status:"sending",answers:e6,cost:0}),eU({status:"sending",values:{},calls:0,failed:0,cost:0}),eQ("jev"),e1(0);let t=performance.now();eY(t),0===Object.keys(e5).length?eJ({status:"done",answers:e6,ms:0,cost:0}):(0,S.A)({state:{description:x,document:eW},questions:e5},e.signal).then(n=>{if(e.signal.aborted)return;if((0,c.V)(n))return void eJ({status:"error",answers:e6,ms:Math.round(performance.now()-t),cost:0,error:(0,S.G)(n.error)});let i={...e6};for(let[e,t]of Object.entries(n.data.answers))"choice"===t.type&&(i[e]=t);eJ({status:"done",answers:i,ms:Math.round(performance.now()-t),cost:n.data.usage.cost??0})}),(0,A.f)({items:eM.fields,limit:eM.fields.length,fn:t=>(0,S.e)({model:"openai/gpt-6-luna",system:"Extract the requested field from the document. Reply only with JSON. If the document does not state it, return an empty string.",user:`Field: the ${t.question} Document: ${eW}`,schema:{type:"object",properties:{value:{type:"string"}},required:["value"],additionalProperties:!1}},e.signal).then(e=>(0,c.V)(e)?e:(0,c.N)({field:t,value:String(e.data.json.value??"").trim(),cost:e.data.usage.cost??0})),onSettle:(t,n)=>{if(e.signal.aborted)return;let i=(0,S.a)(n);if((0,c.V)(i))return eU(V);eU(e=>({...e,values:{...e.values,[i.data.field.id]:i.data.value},calls:e.calls+1,cost:e.cost+i.data.cost}))}}).then(n=>{if(e.signal.aborted)return;let i=n.filter(I).length;eU(e=>({...e,status:i?"done":"error",ms:Math.round(performance.now()-t)}))})},eV[20]=eM.fields,eV[21]=e6,eV[22]=e5,eV[23]=eW,eV[24]=z):z=eV[24];let e7=z;eV[25]!==eM.fields.length||eV[26]!==eG?(J=()=>{e0.current?.abort(),e2.current&&clearInterval(e2.current),e1(eM.fields.length);let e=Math.round(performance.now()-eG);eJ(t=>"sending"===t.status?{...t,status:"done",ms:e,stopped:!0}:t),eU(t=>"sending"===t.status?{...t,status:"done",ms:e,stopped:!0}:t)},eV[25]=eM.fields.length,eV[26]=eG,eV[27]=J):J=eV[27];let e8=J,te=eM.fields.length,tt="done"===ez.status;if(eV[28]!==e3||eV[29]!==eM.fields||eV[30]!==ez.answers||eV[31]!==eK||eV[32]!==e5||eV[33]!==eX||eV[34]!==eW){let e;eV[36]!==e3||eV[37]!==ez.answers||eV[38]!==eK||eV[39]!==e5||eV[40]!==eX||eV[41]!==eW?(e=(e,t)=>{let n,i=te.value===a),s=i?i.start:t.indexOf(a);s>=0&&r.push({start:s,end:s+a.length,kind:"pick",field:e})}for(let e of n)r.push({start:e.start,end:e.end,kind:"candidate"})}r.sort((e,t)=>e.kind!==t.kind?"pick"===e.kind?-1:1:e.start-t.start||t.end-e.end);let a=[];for(let e of r)a.some(t=>e.starte.start-t.start)}({text:eW,fields:eM.fields,picks:ti}),eV[46]=eM.fields,eV[47]=ti,eV[48]=eW,eV[49]=G):G=eV[49];let tr=G;if(eV[50]!==tt||eV[51]!==eD||eV[52]!==ez.answers||eV[53]!==ez.stopped||eV[54]!==eK.status||eV[55]!==te||eV[56]!==eX||eV[57]!==tn){let e,t,n=tn.filter($).length,i=tn.filter(_).length;if(eV[62]!==tn?(e=(Y=tn.filter(R)).filter(E),eV[62]=tn,eV[63]=Y,eV[64]=e):(Y=eV[63],e=eV[64]),X=e.length,eV[65]!==eD||eV[66]!==eK.status||eV[67]!==tn){let e=tn.filter(P).length;t="sending"!==eK.status&&e?eD("{count} values are not in the document.",{count:e}):void 0,eV[65]=eD,eV[66]=eK.status,eV[67]=tn,eV[68]=t}else t=eV[68];if(Q=t,ez.stopped){let e,t;eV[69]!==ez.answers?(e=Object.keys(ez.answers),eV[69]=ez.answers,eV[70]=e):e=eV[70],eV[71]!==eD||eV[72]!==te||eV[73]!==e.length?(t=eD("Stopped after {done} of {total} fields.",{done:e.length,total:te}),eV[71]=eD,eV[72]=te,eV[73]=e.length,eV[74]=t):t=eV[74],Z=t}else tt&&eX>=te&&(Z=eD("Picked {picked} of {total} fields from the text{suffix}.",{picked:n,total:te,suffix:i?eD(", {count} none",{count:i}):""}));eV[50]=tt,eV[51]=eD,eV[52]=ez.answers,eV[53]=ez.stopped,eV[54]=eK.status,eV[55]=te,eV[56]=eX,eV[57]=tn,eV[58]=Y,eV[59]=Z,eV[60]=Q,eV[61]=X}else Y=eV[58],Z=eV[59],Q=eV[60],X=eV[61];if(tt&&0===Object.keys(e5).length){let e;eV[75]!==eD||eV[76]!==te?(e=eD("No candidates found. Completed {count} fields as none locally without model calls.",{count:te}),eV[75]=eD,eV[76]=te,eV[77]=e):e=eV[77],Q=Z=e}eV[78]!==eD||eV[79]!==ez.status||eV[80]!==eK.status||eV[81]!==eK.stopped||eV[82]!==eZ?(ee=e=>{if("jev"===eZ){if(void 0===e.jevValue){let n=eD("{count} candidates",{count:e.options});return"sending"===ez.status?n="…":0===e.options&&(n=eD("Nothing found")),(0,t.jsx)("span",{className:"text-muted-foreground/50",children:n})}return(0,t.jsxs)("div",{className:"inline-flex flex-wrap items-center gap-2 animate-in fade-in duration-300",children:[(0,t.jsx)("span",{className:e.jevValue?"font-medium text-foreground":"text-muted-foreground",children:e.jevValue||(0===e.options?eD("Nothing found"):w)}),e.review&&(0,t.jsx)(a.Badge,{children:eD("Review")})]})}if(void 0===e.llmValue){let e=eD("Failed");return"sending"===eK.status?e="…":eK.stopped&&(e=""),(0,t.jsx)("span",{className:"text-muted-foreground/50",children:e})}return""===e.llmValue?(0,t.jsx)("span",{className:"text-muted-foreground",children:0===e.options?eD("Nothing found"):w}):(0,t.jsxs)("div",{className:"inline-flex flex-wrap items-center gap-2 animate-in fade-in duration-300",children:[(0,t.jsx)("span",{className:e.llmInText?"font-medium text-foreground":"text-muted-foreground",children:e.llmValue}),!e.llmInText&&(0,t.jsx)(a.Badge,{variant:"negative",children:eD("Not in the text")})]})},eV[78]=eD,eV[79]=ez.status,eV[80]=eK.status,eV[81]=eK.stopped,eV[82]=eZ,eV[83]=ee):ee=eV[83];let ta=ee;eV[84]!==eD||eV[85]!==eZ?(et=e=>"llm"===eZ?void 0===e.llmValue?"":(0,t.jsx)("span",{className:"text-muted-foreground",children:eD("No number")}):void 0===e.confidence?"":(0,t.jsx)("span",{className:(0,i.f)("tabular-nums",(0,p.q)(e.confidence>=.9)),children:eD("{percent}%",{percent:Math.round(100*e.confidence)})}),eV[84]=eD,eV[85]=eZ,eV[86]=et):et=eV[86];let ts=et;if(eV[87]!==eM){let e,t;e=eM.fields.map(e=>` { id: '${e.id}', kind: '${e.kind}', question: '${e.question.replaceAll("'","\\'")}' },`).join("\n"),t=eM.fields[0]?.id??"",en=`import { OpenRouter } from '@openrouter/sdk'; const openRouter = new OpenRouter({ apiKey: process.env.OPENROUTER_API_KEY }); const finders = { money: /${b.money[0]?.source??""}/g, id: /${b.id[0]?.source??""}/g, email: /${b.email[0]?.source??""}/g, // dates, names, percentages, durations and titles the same way }; // Every value of one kind that appears in the document, in order. const candidates = (text, kind) => [...new Set([...text.matchAll(finders[kind])].map((m) => m[0].trim()))]; // One pick-one question per field. The options are the candidates, plus none. const fields = [ ${e} ]; const questions = {}; const answers = {}; for (const f of fields) { const values = candidates(text, f.kind); if (values.length === 0) { answers[f.id] = { type: 'choice', choice: '${w}', confidence: 1 }; continue; } questions[f.id] = { type: 'choice', instructions: \`Which candidate is the $\{f.question}?\`, criteria: Object.fromEntries([ ...values.map((v) => [v, 'This exact value as it appears in the document.']), ['${w}', 'No candidate in the document is this value.'], ]), }; } if (Object.keys(questions).length > 0) { const result = await openRouter.alpha.decisions.create({ decisionsRequest: { model: 'typesafe/jev-1.13', state: { description: '${x}', document: text }, questions, }, }); Object.assign(answers, result.answers); } answers.${t}.choice; // a candidate from the document, or '${w}' answers.${t}.confidence; // 0.99`,eV[87]=eM,eV[88]=en}else en=eV[88];eV[89]!==en?(ei={code:en,filename:"extract.ts"},eV[89]=en,eV[90]=ei):ei=eV[90];let to=eM.id;eV[91]===Symbol.for("react.memo_cache_sentinel")?(er=j.map(C),eV[91]=er):er=eV[91],eV[92]!==eM.id?(ea=(0,t.jsx)(o.c,{value:to,onValueChange:e9,className:"[&>button]:min-h-10",children:er}),eV[92]=eM.id,eV[93]=ea):ea=eV[93],eV[94]===Symbol.for("react.memo_cache_sentinel")?(es=()=>eF(O),eo=(0,t.jsx)(f.f,{className:"size-3.5"}),eV[94]=es,eV[95]=eo):(es=eV[94],eo=eV[95]),eV[96]!==eH||eV[97]!==eD?(el=eH?eD("Done editing"):eD("Edit text"),eV[96]=eH,eV[97]=eD,eV[98]=el):el=eV[98],eV[99]!==el?(ed=(0,t.jsxs)(s.Button,{variant:"ghost",tone:"subdued",onClick:es,children:[eo,el]}),eV[99]=el,eV[100]=ed):ed=eV[100],eV[101]!==eD||eV[102]!==te?(ec=eD("Extract {count} fields",{count:te}),eV[101]=eD,eV[102]=te,eV[103]=ec):ec=eV[103],eV[104]!==eD?(eu=eD("Extract again"),eV[104]=eD,eV[105]=eu):eu=eV[105],eV[106]!==eD?(ef=eD("Extracting…"),eV[106]=eD,eV[107]=ef):ef=eV[107];let tl="sending"===ez.status||"sending"===eK.status?"sending":ez.status;if(eV[108]!==e7||eV[109]!==e8||eV[110]!==ec||eV[111]!==eu||eV[112]!==ef||eV[113]!==tl?(em=(0,t.jsx)(p.K,{idle:ec,again:eu,running:ef,status:tl,onClick:e7,onStop:e8}),eV[108]=e7,eV[109]=e8,eV[110]=ec,eV[111]=eu,eV[112]=ef,eV[113]=tl,eV[114]=em):em=eV[114],eV[115]!==ea||eV[116]!==ed||eV[117]!==em?(eh=(0,t.jsxs)(t.Fragment,{children:[ea,ed,em]}),eV[115]=ea,eV[116]=ed,eV[117]=em,eV[118]=eh):eh=eV[118],eV[119]!==ez||eV[120]!==eK||eV[121]!==te||eV[122]!==e5||eV[123]!==tn||eV[124]!==eG?(ep="idle"!==ez.status?{startedAt:eG,jev:(0,N.I)(ez,{done:tn.filter(q).length,total:te,calls:+!!Object.keys(e5).length}),llm:(0,N.i)(eK,{total:te,done:Object.keys(eK.values).length})}:void 0,eV[119]=ez,eV[120]=eK,eV[121]=te,eV[122]=e5,eV[123]=tn,eV[124]=eG,eV[125]=ep):ep=eV[125],eV[126]!==Y.length||eV[127]!==X?(eg={same:X,of:Y.length},eV[126]=Y.length,eV[127]=X,eV[128]=eg):eg=eV[128],eV[129]!==te||eV[130]!==eZ||eV[131]!==eh||eV[132]!==ep||eV[133]!==eg?(eb=(0,t.jsx)(h.n,{controls:eh,total:te,shown:eZ,onShown:eQ,llmName:k,race:ep,agreement:eg}),eV[129]=te,eV[130]=eZ,eV[131]=eh,eV[132]=ep,eV[133]=eg,eV[134]=eb):eb=eV[134],eV[135]!==ez.error||eV[136]!==ez.status?(ev="error"===ez.status&&(0,t.jsx)(r.J,{variant:"negative",children:ez.error}),eV[135]=ez.error,eV[136]=ez.status,eV[137]=ev):ev=eV[137],eV[138]!==eb||eV[139]!==ev?(ey=(0,t.jsxs)(t.Fragment,{children:[eb,ev]}),eV[138]=eb,eV[139]=ev,eV[140]=ey):ey=eV[140],eV[141]!==Z||eV[142]!==Q||eV[143]!==eZ?(ew=("jev"===eZ?Z:Q)&&(0,t.jsx)(p.N,{children:"jev"===eZ?Z:Q}),eV[141]=Z,eV[142]=Q,eV[143]=eZ,eV[144]=ew):ew=eV[144],eV[145]!==eH||eV[146]!==eD||eV[147]!==ez.status||eV[148]!==tr||eV[149]!==eW?(ex=eH?(0,t.jsx)(d.o,{value:eW,onChange:e=>{eB(e.target.value),"idle"!==ez.status&&e4()},"aria-label":eD("Document text"),className:"order-2 min-h-80 leading-(--leading-body) md:order-1"}):(0,t.jsx)("div",{className:"order-2 whitespace-pre-wrap break-words rounded-(--radius-lg) border border-border p-5 text-body leading-(--leading-body) text-foreground/90 md:order-1",children:(0,t.jsx)(T,{text:eW,marks:tr})}),eV[145]=eH,eV[146]=eD,eV[147]=ez.status,eV[148]=tr,eV[149]=eW,eV[150]=ex):ex=eV[150],eV[151]===Symbol.for("react.memo_cache_sentinel")?(ek=(0,t.jsxs)("colgroup",{children:[(0,t.jsx)("col",{className:"w-[32%]"}),(0,t.jsx)("col",{}),(0,t.jsx)("col",{className:"w-[16%]"})]}),eV[151]=ek):ek=eV[151],eV[152]!==eD?(ej=eD("Field"),eV[152]=eD,eV[153]=ej):ej=eV[153],eV[154]!==ej?(eS=(0,t.jsx)(l.TableHead,{children:ej}),eV[154]=ej,eV[155]=eS):eS=eV[155],eV[156]!==eD||eV[157]!==eZ?(eA="jev"===eZ?eD("Jev"):k,eV[156]=eD,eV[157]=eZ,eV[158]=eA):eA=eV[158],eV[159]!==eA?(eN=(0,t.jsx)(l.TableHead,{children:eA}),eV[159]=eA,eV[160]=eN):eN=eV[160],eV[161]!==eD?(eT=eD("Sure"),eV[161]=eD,eV[162]=eT):eT=eV[162],eV[163]!==eT?(eq=(0,t.jsx)(l.TableHead,{className:"text-right",children:eT}),eV[163]=eT,eV[164]=eq):eq=eV[164],eV[165]!==eS||eV[166]!==eN||eV[167]!==eq?(eO=(0,t.jsx)(l.TableHeader,{sticky:!0,children:(0,t.jsxs)(l.TableRow,{interactive:!1,children:[eS,eN,eq]})}),eV[165]=eS,eV[166]=eN,eV[167]=eq,eV[168]=eO):eO=eV[168],eV[169]!==tn||eV[170]!==ts||eV[171]!==ta){let e;eV[173]!==ts||eV[174]!==ta?(e=e=>(0,t.jsxs)(l.TableRow,{children:[(0,t.jsx)(l.TableCell,{children:e.field.label}),(0,t.jsx)(l.TableCell,{children:ta(e)}),(0,t.jsx)(l.TableCell,{className:"text-right",children:ts(e)})]},e.field.id),eV[173]=ts,eV[174]=ta,eV[175]=e):e=eV[175],eC=tn.map(e),eV[169]=tn,eV[170]=ts,eV[171]=ta,eV[172]=eC}else eC=eV[172];if(eV[176]!==eC?(eP=(0,t.jsx)(l.TableBody,{children:eC}),eV[176]=eC,eV[177]=eP):eP=eV[177],eV[178]!==eO||eV[179]!==eP?(eE=(0,t.jsxs)(l.Table,{pageScroll:!0,containerClassName:"order-1 hidden md:order-2 md:block",children:[ek,eO,eP]}),eV[178]=eO,eV[179]=eP,eV[180]=eE):eE=eV[180],eV[181]!==tn||eV[182]!==ts||eV[183]!==ta){let e;eV[185]!==ts||eV[186]!==ta?(e=e=>(0,t.jsxs)("li",{className:"flex flex-col gap-1 px-4 py-3 text-body",children:[(0,t.jsx)("p",{className:"text-foreground",children:e.field.label}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[ta(e),ts(e)]})]},e.field.id),eV[185]=ts,eV[186]=ta,eV[187]=e):e=eV[187],eR=tn.map(e),eV[181]=tn,eV[182]=ts,eV[183]=ta,eV[184]=eR}else eR=eV[184];return eV[188]!==eR?(e_=(0,t.jsx)("ul",{className:"order-1 [&>*+*]:border-t [&>*+*]:border-border/50 rounded-(--radius-lg) border border-border md:hidden",children:eR}),eV[188]=eR,eV[189]=e_):e_=eV[189],eV[190]!==ex||eV[191]!==eE||eV[192]!==e_?(e$=(0,t.jsxs)("div",{className:"grid gap-6 md:grid-cols-[minmax(0,7fr)_minmax(0,5fr)] md:items-start",children:[ex,eE,e_]}),eV[190]=ex,eV[191]=eE,eV[192]=e_,eV[193]=e$):e$=eV[193],eV[194]!==ei||eV[195]!==ey||eV[196]!==ew||eV[197]!==e$?(eI=(0,t.jsxs)(p.B,{id:"extract",code:ei,controls:ey,children:[ew,e$]}),eV[194]=ei,eV[195]=ey,eV[196]=ew,eV[197]=e$,eV[198]=eI):eI=eV[198],eI}],852276)},595106,521965,e=>{"use strict";async function t(e){let{items:t,limit:n,fn:i,onSettle:r}=e,a=Array(t.length),s=0;async function o(){for(;s