Presupuestador_web/dist/client/assets/index-BVZyG6kc.js

255 lines
281 KiB
JavaScript
Raw Normal View History

var L_=Object.defineProperty;var T_=(n,o,r)=>o in n?L_(n,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):n[o]=r;var Se=(n,o,r)=>T_(n,typeof o!="symbol"?o+"":o,r);import{u as Ec,a as Jt,b as en,c as Mn,d as Ne,j as i,P as O_,e as P_,f as ge,g as k_,N as Wi,R as Pe,J as Rt,h as ke,i as er,D as tr,l as La,M as Lt,V as q_,r as T,k as Ac,m as Fc,n as ir,o as Ic,B as U,C as $_,p as sr,q as ar,s as or,S as ao,t as lr,v as Bi,w,x as oo,y as Yi,z as Qi,A as Xi,E as Or,F as lo,G as Zi,H as Ji,I as es,K as ts,L as z_,O as Dn,Q as V_,T as B_,U as U_,W as Te,X as ct,Y as Ve,Z as He,_ as Oe,$ as hn,a0 as uo,a1 as G_,a2 as co,a3 as pn,a4 as fo,a5 as go,a6 as qr,a7 as Nt,a8 as Dc,a9 as H_,aa as Ui,ab as ur,ac as mo,ad as ho,ae as po,af as xo,ag as Mc,ah as vo,ai as _o,aj as bo,ak as ns,al as K_,am as Fn,an as rs,ao as fc,ap as W_,aq as Y_,ar as Q_,as as wo,at as zt,au as _n,av as is,aw as Lc,ax as In,ay as X_,az as Tc,aA as Z_,aB as se,aC as ss,aD as gc,aE as Oc,aF as Pc,aG as kc,aH as Ln,aI as qc,aJ as as,aK as zr,aL as Vr,aM as Br,aN as $r,aO as J_,aP as $c,aQ as Ke,aR as We,aS as Wa,aT as Ye,aU as nr,aV as cr,aW as rr,aX as e0,aY as t0,aZ as n0,a_ as Ya,a$ as r0,b0 as i0,b1 as Zn,b2 as zc,b3 as Qa,b4 as Vc,b5 as qt,b6 as s0,b7 as mc,b8 as os,b9 as dr,ba as Bc,bb as a0,bc as So,bd as o0,be as Uc,bf as Gc,bg as Hc,bh as Kc,bi as Wc,bj as Yc,bk as Qc,bl as Xc,bm as Zc,bn as l0,bo as Pi,bp as u0,bq as c0,br as d0,bs as f0,bt as g0,bu as m0,bv as h0,bw as p0,bx as x0,by as v0,bz as _0,bA as hc,bB as Jc,bC as ed,bD as td,bE as nd,bF as rd,bG as id,bH as sd,bI as b0,bJ as Ta,bK as w0,bL as S0,bM as j0,bN as ad,bO as od,bP as Xa,bQ as Za,bR as C0,bS as Oa,bT as y0,bU as N0,bV as pc}from"./index-QDyDWtz5.js";const R0=n=>{const{onSuccess:o,...r}=n||{},a=Mn(),{login:l}=Ec(),c=Jt();return en({mutationKey:a().auth().action("login").get(),mutationFn:l,onSuccess:async(d,h,p)=>{d.success&&c.removeQueries({queryKey:a().auth().get()}),await(o==null?void 0:o(d,h,p))},...r})};/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ld=Ne("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const E0=Ne("ArrowDownUp",[["path",{d:"m3 16 4 4 4-4",key:"1co6wj"}],["path",{d:"M7 20V4",key:"1yoxec"}],["path",{d:"m21 8-4-4-4 4",key:"1c9v7m"}],["path",{d:"M17 4v16",key:"7dpous"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xc=Ne("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vc=Ne("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const A0=Ne("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const F0=Ne("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ud=Ne("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const I0=Ne("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const D0=Ne("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const M0=Ne("CopyPlus",[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jo=Ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const cd=Ne("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const L0=Ne("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dd=Ne("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const T0=Ne("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const O0=Ne("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const fd=Ne("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const P0=Ne("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Co=Ne("PackagePlus",[["path",{d:"M16 16h6",key:"100bgy"}],["path",{d:"M19 13v6",key:"85cyf1"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const yo=Ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const k0=Ne("Scan",[["path",{d:"M3 7V5a2 2 0 0 1 2-2h2",key:"aa7l1z"}],["path",{d:"M17 3h2a2 2 0 0 1 2 2v2",key:"4qcy5o"}],["path",{d:"M21 17v2a2 2 0 0 1-2 2h-2",key:"6vwrx8"}],["path",{d:"M7 21H5a2 2 0 0 1-2-2v-2",key:"ioqczr"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const q0=Ne("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $0=Ne("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gd=Ne("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/**
* @license lucide-react v0.427.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const md=Ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]),z0=({className:n,...o})=>i.jsx(P_,{className:ge("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",n),...o}),_c=O_,V0=({withHandle:n,className:o,...r})=>i.jsx(k_,{className:ge("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",o),...r,children:n&&i.jsx("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:i.jsx(fd,{className:"h-2.5 w-2.5"})})});function ut({className:n,...o}){return i.jsx("div",{className:ge("animate-pulse rounded-md bg-muted",n),...o})}const B0=n=>typeof n=="object"&&n!==null&&n.hasOwnProperty("total_items");let ki;const U0=new Uint8Array(16);function G0(){if(!ki&&(ki=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!ki))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ki(U0)}const Ge=[];for(let n=0;n<256;++n)Ge.push((n+256).toString(16).slice(1));function H0(n,o=0){return Ge[n[o+0]]+Ge[n[o+1]]+Ge[n[o+2]]+Ge[n[o+3]]+"-"+Ge[n[o+4]]+Ge[n[o+5]]+"-"+Ge[n[o+6]]+Ge[n[o+7]]+"-"+Ge[n[o+8]]+Ge[n[o+9]]+"-"+Ge[n[o+10]]+Ge[n[o+11]]+Ge[n[o+12]]+Ge[n[o+13]]+Ge[n[o+14]]+Ge[n[o+15]]}const K0=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),bc={randomUUID:K0};function W0(n,o,r){if(bc.randomUUID&&!n)return bc.randomUUID();n=n||{};const a=n.random||(n.rng||G0)();return a[6]=a[6]&15|64,a[8]=a[8]&63|128,H0(a)}class dn extends Wi{static validate(o,r){const a=Pe.RULE_ALLOW_EMPTY.default(""),l=Rt.string().guid({version:["uuidv4"]}).label(r.label?r.label:"id"),c=Rt.alternatives(a,l);return Pe.validate(c,o)}static sanitize(o){return o.trim()}static create(o,r={}){const a={label:"id",generateOnEmpty:!1,...r};if(!o&&!a.generateOnEmpty)return ke.fail(er(tr.INVALID_INPUT_DATA,"ID is null or empty"));if(o){const l=dn.validate(o,a);return l.isFailure?ke.fail(er(tr.INVALID_INPUT_DATA,l.error.message,a)):ke.ok(new dn(dn.sanitize(l.object)))}return a.generateOnEmpty?dn.generateNewID():ke.ok(new dn(null))}static generateNewID(){return ke.ok(new dn(W0()))}get value(){return String(this.props)}toString(){return String(this.props)}toPrimitive(){return this.toString()}}const Pa={aa:{name:"Afar",nativeName:"Afaraf"},ab:{name:"Abkhaz",nativeName:"аҧсуа бызшәа"},ae:{name:"Avestan",nativeName:"avesta"},af:{name:"Afrikaans",nativeName:"Afrikaans"},ak:{name:"Akan",nativeName:"Akan"},am:{name:"Amharic",nativeName:"አማርኛ"},an:{name:"Aragonese",nativeName:"aragonés"},ar:{name:"Arabic",nativeName:"اَلْعَرَبِيَّةُ"},as:{name:"Assamese",nativeName:"অসমীয়া"},av:{name:"Avaric",nativeName:"авар мацӀ"},ay:{name:"Aymara",nativeName:"aymar aru"},az:{name:"Azerbaijani",nativeName:"azərbaycan dili"},ba:{name:"Bashkir",nativeName:"башҡорт теле"},be:{name:"Belarusian",nativeName:"беларуская мова"},bg:{name:"Bulgarian",nativeName:"български език"},bi:{name:"Bislama",nativeName:"Bislama"},bm:{name:"Bambara",nativeName:"bamanankan"},bn:{name:"Bengali",nativeName:"বাংলা"},bo:{name:"Tibetan",nativeName:"བོད་ཡིག"},br:{name:"Breton",nativeName:"brezhoneg"},bs:{name:"Bosnian"
* table-core
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function eb(){return{accessor:(n,o)=>typeof n=="function"?{...o,accessorFn:n}:{...o,accessorKey:n},display:n=>n,group:n=>n}}function gn(n,o){return typeof n=="function"?n(o):n}function xt(n,o){return r=>{o.setState(a=>({...a,[n]:gn(r,a[n])}))}}function ls(n){return n instanceof Function}function tb(n){return Array.isArray(n)&&n.every(o=>typeof o=="number")}function nb(n,o){const r=[],a=l=>{l.forEach(c=>{r.push(c);const d=o(c);d!=null&&d.length&&a(d)})};return a(n),r}function X(n,o,r){let a=[],l;return c=>{let d;r.key&&r.debug&&(d=Date.now());const h=n(c);if(!(h.length!==a.length||h.some((v,R)=>a[R]!==v)))return l;a=h;let x;if(r.key&&r.debug&&(x=Date.now()),l=o(...h),r==null||r.onChange==null||r.onChange(l),r.key&&r.debug&&r!=null&&r.debug()){const v=Math.round((Date.now()-d)*100)/100,R=Math.round((Date.now()-x)*100)/100,N=R/16,b=(E,C)=>{for(E=String(E);E.length<C;)E=" "+E;return E};console.info(`%c⏱ ${b(R,5)} /${b(v,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*N,120))}deg 100% 31%);`,r==null?void 0:r.key)}return l}}function Z(n,o,r,a){return{debug:()=>{var l;return(l=n==null?void 0:n.debugAll)!=null?l:n[o]},key:!1,onChange:a}}function rb(n,o,r,a){const l=()=>{var d;return(d=c.getValue())!=null?d:n.options.renderFallbackValue},c={id:`${o.id}_${r.id}`,row:o,column:r,getValue:()=>o.getValue(a),renderValue:l,getContext:X(()=>[n,r,o,c],(d,h,p,x)=>({table:d,column:h,row:p,cell:x,getValue:x.getValue,renderValue:x.renderValue}),Z(n.options,"debugCells"))};return n._features.forEach(d=>{d.createCell==null||d.createCell(c,r,o,n)},{}),c}function ib(n,o,r,a){var l,c;const h={...n._getDefaultColumnDef(),...o},p=h.accessorKey;let x=(l=(c=h.id)!=null?c:p?typeof String.prototype.replaceAll=="function"?p.replaceAll(".","_"):p.replace(/\./g,"_"):void 0)!=null?l:typeof h.header=="string"?h.header:void 0,v;if(h.accessorFn?v=h.accessorFn:p&&(p.includes(".")?v=N=>{let b=N;for(const C of p.split(".")){var E;b=(E=b)==null?void 0:E[C]}return b}:v=N=>N[h.accessorKey]),!x)throw new Error;let R={id:`${String(x)}`,accessorFn:v,parent:a,depth:r,columnDef:h,columns:[],getFlatColumns:X(()=>[!0],()=>{var N;return[R,...(N=R.columns)==null?void 0:N.flatMap(b=>b.getFlatColumns())]},Z(n.options,"debugColumns")),getLeafColumns:X(()=>[n._getOrderColumnsFn()],N=>{var b;if((b=R.columns)!=null&&b.length){let E=R.columns.flatMap(C=>C.getLeafColumns());return N(E)}return[R]},Z(n.options,"debugColumns"))};for(const N of n._features)N.createColumn==null||N.createColumn(R,n);return R}const Ze="debugHeaders";function Sc(n,o,r){var a;let c={id:(a=r.id)!=null?a:o.id,column:o,index:r.index,isPlaceholder:!!r.isPlaceholder,placeholderId:r.placeholderId,depth:r.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const d=[],h=p=>{p.subHeaders&&p.subHeaders.length&&p.subHeaders.map(h),d.push(p)};return h(c),d},getContext:()=>({table:n,header:c,column:o})};return n._features.forEach(d=>{d.createHeader==null||d.createHeader(c,n)}),c}const sb={createTable:n=>{n.getHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>{var c,d;const h=(c=a==null?void 0:a.map(R=>r.find(N=>N.id===R)).filter(Boolean))!=null?c:[],p=(d=l==null?void 0:l.map(R=>r.find(N=>N.id===R)).filter(Boolean))!=null?d:[],x=r.filter(R=>!(a!=null&&a.includes(R.id))&&!(l!=null&&l.includes(R.id)));return qi(o,[...h,...x,...p],n)},Z(n.options,Ze)),n.getCenterHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left,n.getState().columnPinning.right],(o,r,a,l)=>(r=r.filter(c=>!(a!=null&&a.includes(c.id))&&!(l!=null&&l.includes(c.id))),qi(o,r,n,"center")),Z(n.options,Ze)),n.getLeftHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.left],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(h=>h.id===d)).filter(Boolean))!=null?l:[];return qi(o,c,n,"left")},Z(n.options,Ze)),n.getRightHeaderGroups=X(()=>[n.getAllColumns(),n.getVisibleLeafColumns(),n.getState().columnPinning.right],(o,r,a)=>{var l;const c=(l=a==null?void 0:a.map(d=>r.find(h=>h.id===d)).filter(Boolean))!=null?l:[];return qi(o,c,n,"right")},Z(n.options,Ze)),n.getFooterGroups=X(()=>[n.getHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getLeftFooterGroups=X(()=>[n.getLeftHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getCenterFooterGroups=X(()=>[n.getCenterHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getRightFooterGroups=X(()=>[n.getRightHeaderGroups()],o=>[...o].reverse(),Z(n.options,Ze)),n.getFlatHeaders=X(()=>[n.getHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getLeftFlatHeaders=X(()=>[n.getLeftHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getCenterFlatHeaders=X(()=>[n.getCenterHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getRightFlatHeaders=X(()=>[n.getRightHeaderGroups()],o=>o.map(r=>r.headers).flat(),Z(n.options,Ze)),n.getCenterLeafHeaders=X(()=>[n.getCenterFlatHeaders()],o=>o.filter(r=>{v
* react-table
*
* Copyright (c) TanStack
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/function Gi(n,o){return n?Gb(n)?T.createElement(n,o):n:null}function Gb(n){return Hb(n)||typeof n=="function"||Kb(n)}function Hb(n){return typeof n=="function"&&(()=>{const o=Object.getPrototypeOf(n);return o.prototype&&o.prototype.isReactComponent})()}function Kb(n){return typeof n=="object"&&typeof n.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(n.$$typeof.description)}function Fd(n){const o={state:{},onStateChange:()=>{},renderFallbackValue:null,...n},[r]=T.useState(()=>({current:kb(o)})),[a,l]=T.useState(()=>r.current.initialState);return r.current.setOptions(c=>({...c,...n,state:{...a,...n.state},onStateChange:d=>{l(d),n.onStateChange==null||n.onStateChange(d)}})),r.current}const Wb=({buttonText:n,title:o="",content:r,className:a=""})=>i.jsx("div",{className:`flex items-baseline justify-center mr-4 font-medium ${a}`,children:i.jsxs(ir,{children:[i.jsx(Ic,{asChild:!0,children:i.jsxs(U,{variant:"link",className:"inline-flex items-center font-medium group",children:[i.jsx("span",{className:"underline-offset-4 group-hover:underline",children:n}),i.jsx($_,{className:"w-4 h-4 ml-1 text-muted-foreground"})]})}),i.jsxs(sr,{className:"sm:max-w-[425px]",children:[i.jsx(ar,{children:i.jsx(or,{children:o})}),i.jsxs(ao,{className:"grid gap-4 py-2",children:[r,i.jsx(lr,{children:i.jsx(Bi,{asChild:!0,children:i.jsx(U,{type:"button",children:w("common.close")})})})]})]})]})});function Yb(n){let a=0;for(let v=0;v<n.length;v++)a=n.charCodeAt(v)+((a<<5)-a);let l="#";for(let v=0;v<3;v++){const R=a>>v*8&255;l+=("00"+R.toString(16)).substr(-2)}const c=parseInt(l.substr(1,2),16),d=parseInt(l.substr(3,2),16),h=parseInt(l.substr(5,2),16),p=`#${(c*.7|0).toString(16).padStart(2,"0")}${(d*.7|0).toString(16).padStart(2,"0")}${(h*.7|0).toString(16).padStart(2,"0")}`,x=`#${Math.min(255,Math.floor(c+(255-c)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(d+(255-d)*.7)).toString(16).padStart(2,"0")}${Math.min(255,Math.floor(h+(255-h)*.7)).toString(16).padStart(2,"0")}`;return[p,x]}const Id=({label:n,className:o})=>{const[r,a]=Yb(n);return i.jsx(oo,{className:o,style:o?{}:{backgroundColor:a,color:r},children:n})};function Dd({table:n,header:o,className:r}){return o.column.getCanSort()?i.jsx("div",{className:ge("flex items-center space-x-2",r),children:i.jsxs(Yi,{children:[i.jsx(Qi,{asChild:!0,children:i.jsxs(U,{"aria-label":o.column.getIsSorted()==="desc"?w("common.sort_desc_description"):o.column.getIsSorted()==="asc"?w("common.sort_asc_description"):w("sort_none_description"),size:"sm",variant:"ghost",className:"-ml-3 h-8 data-[state=open]:bg-accent font-bold text-muted-foreground",children:[Gi(o.column.columnDef.header,o.getContext()),o.column.getIsSorted()==="desc"?i.jsx(xc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):o.column.getIsSorted()==="asc"?i.jsx(vc,{className:"w-4 h-4 ml-2","aria-hidden":"true"}):i.jsx(E0,{className:"w-4 h-4 ml-2 text-muted-foreground/30","aria-hidden":"true"})]})}),i.jsxs(Xi,{align:"start",children:[o.column.getCanSort()&&i.jsxs(i.Fragment,{children:[i.jsxs(Or,{onClick:()=>o.column.toggleSorting(!1),"aria-label":w("common.sort_asc"),children:[i.jsx(vc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_asc")]}),i.jsxs(Or,{onClick:()=>o.column.toggleSorting(!0),"aria-label":w("common.sort_desc"),children:[i.jsx(xc,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("common.sort_desc")]})]}),o.column.getCanSort()&&o.column.getCanHide()&&i.jsx(lo,{}),o.column.getCanHide()&&i.jsxs(Or,{onClick:()=>o.column.toggleVisibility(!1),"aria-label":w("Hide"),children:[i.jsx(dd,{className:"mr-2 h-3.5 w-3.5 text-muted-foreground/70","aria-hidden":"true"}),w("Hide")]})]})]})}):i.jsxs(i.Fragment,{children:[i.jsx("div",{className:ge("data-[state=open]:bg-accent tracking-wide text-ellipsis",r),children:o.isPlaceholder?null:Gi(o.column.columnDef.header,o.getContext())}),!1]})}function Qb({table:n,className:o,enablePageSizeSelector:r=!0,visible:a="auto"}){const l=T.useMemo(()=>a===!0,[a]),c=T.useMemo(()=>a==="auto",[a]);return!l||c&&
* @license
* Lodash <https://lodash.com/>
* Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
* Released under MIT license <https://lodash.com/license>
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
*/Ki.exports;(function(n,o){(function(){var r,a="4.17.21",l=200,c="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",d="Expected a function",h="Invalid `variable` option passed into `_.template`",p="__lodash_hash_undefined__",x=500,v="__lodash_placeholder__",R=1,N=2,b=4,E=1,C=2,L=1,I=2,q=4,$=8,te=16,O=32,k=64,K=128,ne=256,B=512,me=30,_e="...",W=800,Re=16,Je=1,Y=2,je=3,De=1/0,G=9007199254740991,be=17976931348623157e292,et=NaN,it=4294967295,bn=it-1,Hd=it>>>1,Kd=[["ary",K],["bind",L],["bindKey",I],["curry",$],["curryRight",te],["flip",B],["partial",O],["partialRight",k],["rearg",ne]],On="[object Arguments]",Gr="[object Array]",Wd="[object AsyncFunction]",fr="[object Boolean]",gr="[object Date]",Yd="[object DOMException]",Hr="[object Error]",Kr="[object Function]",To="[object GeneratorFunction]",Et="[object Map]",mr="[object Number]",Qd="[object Null]",Vt="[object Object]",Oo="[object Promise]",Xd="[object Proxy]",hr="[object RegExp]",At="[object Set]",pr="[object String]",Wr="[object Symbol]",Zd="[object Undefined]",xr="[object WeakMap]",Jd="[object WeakSet]",vr="[object ArrayBuffer]",Pn="[object DataView]",gs="[object Float32Array]",ms="[object Float64Array]",hs="[object Int8Array]",ps="[object Int16Array]",xs="[object Int32Array]",vs="[object Uint8Array]",_s="[object Uint8ClampedArray]",bs="[object Uint16Array]",ws="[object Uint32Array]",ef=/\b__p \+= '';/g,tf=/\b(__p \+=) '' \+/g,nf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Po=/&(?:amp|lt|gt|quot|#39);/g,ko=/[&<>"']/g,rf=RegExp(Po.source),sf=RegExp(ko.source),af=/<%-([\s\S]+?)%>/g,of=/<%([\s\S]+?)%>/g,qo=/<%=([\s\S]+?)%>/g,lf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,uf=/^\w*$/,cf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Ss=/[\\^$.*+?()[\]{}|]/g,df=RegExp(Ss.source),js=/^\s+/,ff=/\s/,gf=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,mf=/\{\n\/\* \[wrapped with (.+)\] \*/,hf=/,? & /,pf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,xf=/[()=,{}\[\]\/\s]/,vf=/\\(\\)?/g,_f=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,$o=/\w*$/,bf=/^[-+]0x[0-9a-f]+$/i,wf=/^0b[01]+$/i,Sf=/^\[object .+?Constructor\]$/,jf=/^0o[0-7]+$/i,Cf=/^(?:0|[1-9]\d*)$/,yf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Yr=/($^)/,Nf=/['\n\r\u2028\u2029\\]/g,Qr="\\ud800-\\udfff",Rf="\\u0300-\\u036f",Ef="\\ufe20-\\ufe2f",Af="\\u20d0-\\u20ff",zo=Rf+Ef+Af,Vo="\\u2700-\\u27bf",Bo="a-z\\xdf-\\xf6\\xf8-\\xff",Ff="\\xac\\xb1\\xd7\\xf7",If="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Df="\\u2000-\\u206f",Mf=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Uo="A-Z\\xc0-\\xd6\\xd8-\\xde",Go="\\ufe0e\\ufe0f",Ho=Ff+If+Df+Mf,Cs="['’]",Lf="["+Qr+"]",Ko="["+Ho+"]",Xr="["+zo+"]",Wo="\\d+",Tf="["+Vo+"]",Yo="["+Bo+"]",Qo="[^"+Qr+Ho+Wo+Vo+Bo+Uo+"]",ys="\\ud83c[\\udffb-\\udfff]",Of="(?:"+Xr+"|"+ys+")",Xo="[^"+Qr+"]",Ns="(?:\\ud83c[\\udde6-\\uddff]){2}",Rs="[\\ud800-\\udbff][\\udc00-\\udfff]",kn="["+Uo+"]",Zo="\\u200d",Jo="(?:"+Yo+"|"+Qo+")",Pf="(?:"+kn+"|"+Qo+")",el="(?:"+Cs+"(?:d|ll|m|re|s|t|ve))?",tl="(?:"+Cs+"(?:D|LL|M|RE|S|T|VE))?",nl=Of+"?",rl="["+Go+"]?",kf="(?:"+Zo+"(?:"+[Xo,Ns,Rs].join("|")+")"+rl+nl+")*",qf="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",$f="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",il=rl+nl+kf,zf="(?:"+[Tf,Ns,Rs].join("|")+")"+il,Vf="(?:"+[Xo+Xr+"?",Xr,Ns,Rs,Lf].join("|")+")",Bf=RegExp(Cs,"g"),Uf=RegExp(Xr,"g"),Es=RegExp(ys+"(?="+ys+")|"+Vf+il,"g"),Gf=RegExp([kn+"?"+Yo+"+"+el+"(?="+[Ko,kn,"$"].join("|")+")",Pf+"+"+tl+"(?="+[Ko,kn+Jo,"$"].join("|")+")",kn+"?"+Jo+"+"+el,kn+"+"+tl,$f,qf,Wo,zf].join("|"),"g"),Hf=RegExp("["+Zo+Qr+zo+Go+"]"),Kf=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Wf=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeou
/* [wrapped with `+t+`] */
`)}function fh(e){return ie(e)||An(e)||!!(Rl&&e&&e[Rl])}function Wt(e,t){var s=typeof e;return t=t??G,!!t&&(s=="number"||s!="symbol"&&Cf.test(e))&&e>-1&&e%1==0&&e<t}function nt(e,t,s){if(!Ae(s))return!1;var u=typeof t;return(u=="number"?at(s)&&Wt(t,s.length):u=="string"&&t in s)?Dt(s[t],e):!1}function ha(e,t){if(ie(e))return!1;var s=typeof e;return s=="number"||s=="symbol"||s=="boolean"||e==null||mt(e)?!0:uf.test(e)||!lf.test(e)||t!=null&&e in we(t)}function gh(e){var t=typeof e;return t=="string"||t=="number"||t=="symbol"||t=="boolean"?e!=="__proto__":e===null}function pa(e){var t=Ni(e),s=g[t];if(typeof s!="function"||!(t in ce.prototype))return!1;if(e===s)return!0;var u=fa(s);return!!u&&e===u[0]}function mh(e){return!!jl&&jl in e}var hh=ni?Yt:Ma;function Ir(e){var t=e&&e.constructor,s=typeof t=="function"&&t.prototype||Bn;return e===s}function ju(e){return e===e&&!Ae(e)}function Cu(e,t){return function(s){return s==null?!1:s[e]===t&&(t!==r||e in we(s))}}function ph(e){var t=Di(e,function(u){return s.size===x&&s.clear(),u}),s=t.cache;return t}function xh(e,t){var s=e[1],u=t[1],f=s|u,m=f<(L|I|K),_=u==K&&s==$||u==K&&s==ne&&e[7].length<=t[8]||u==(K|ne)&&t[7].length<=t[8]&&s==$;if(!(m||_))return e;u&L&&(e[2]=t[2],f|=s&L?0:q);var S=t[3];if(S){var y=e[3];e[3]=y?au(y,S,t[4]):S,e[4]=y?rn(e[3],v):t[4]}return S=t[5],S&&(y=e[5],e[5]=y?ou(y,S,t[6]):S,e[6]=y?rn(e[5],v):t[6]),S=t[7],S&&(e[7]=S),u&K&&(e[8]=e[8]==null?t[8]:Qe(e[8],t[8])),e[9]==null&&(e[9]=t[9]),e[0]=t[0],e[1]=f,e}function vh(e){var t=[];if(e!=null)for(var s in we(e))t.push(s);return t}function _h(e){return ii.call(e)}function yu(e,t,s){return t=$e(t===r?e.length-1:t,0),function(){for(var u=arguments,f=-1,m=$e(u.length-t,0),_=A(m);++f<m;)_[f]=u[t+f];f=-1;for(var S=A(t+1);++f<t;)S[f]=u[f];return S[t]=s(_),dt(e,this,S)}}function Nu(e,t){return t.length<2?e:Nn(e,jt(t,0,-1))}function bh(e,t){for(var s=e.length,u=Qe(t.length,s),f=st(e);u--;){var m=t[u];e[u]=Wt(m,s)?f[m]:r}return e}function xa(e,t){if(!(t==="constructor"&&typeof e[t]=="function")&&t!="__proto__")return e[t]}var Ru=Au(Ql),Dr=Tg||function(e,t){return Be.setTimeout(e,t)},va=Au(Bm);function Eu(e,t,s){var u=t+"";return va(e,dh(u,wh(lh(u),s)))}function Au(e){var t=0,s=0;return function(){var u=qg(),f=Re-(u-s);if(s=u,f>0){if(++t>=W)return arguments[0]}else t=0;return e.apply(r,arguments)}}function Ei(e,t){var s=-1,u=e.length,f=u-1;for(t=t===r?u:t;++s<t;){var m=ea(s,f),_=e[m];e[m]=e[s],e[s]=_}return e.length=t,e}var Fu=ph(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(""),e.replace(cf,function(s,u,f,m){t.push(f?m.replace(vf,"$1"):u||s)}),t});function kt(e){if(typeof e=="string"||mt(e))return e;var t=e+"";return t=="0"&&1/e==-1/0?"-0":t}function En(e){if(e!=null){try{return ri.call(e)}catch{}try{return e+""}catch{}}return""}function wh(e,t){return _t(Kd,function(s){var u="_."+s[0];t&s[1]&&!Zr(e,u)&&e.push(u)}),e.sort()}function Iu(e){if(e instanceof ce)return e.clone();var t=new wt(e.__wrapped__,e.__chain__);return t.__actions__=st(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Sh(e,t,s){(s?nt(e,t,s):t===r)?t=1:t=$e(ae(t),0);var u=e==null?0:e.length;if(!u||t<1)return[];for(var f=0,m=0,_=A(ci(u/t));f<u;)_[m++]=jt(e,f,f+=t);return _}function jh(e){for(var t=-1,s=e==null?0:e.length,u=0,f=[];++t<s;){var m=e[t];m&&(f[u++]=m)}return f}function Ch(){var e=arguments.length;if(!e)return[];for(var t=A(e-1),s=arguments[0],u=e;u--;)t[u-1]=arguments[u];return nn(ie(s)?st(s):[s],Ue(t,1))}var yh=le(function(e,t){return Me(e)?Nr(e,Ue(t,1,Me,!0)):[]}),Nh=le(function(e,t){var s=Ct(t);return Me(s)&&(s=r),Me(e)?Nr(e,Ue(t,1,Me,!0),Q(s,2)):[]}),Rh=le(function(e,t){var s=Ct(t);return Me(s)&&(s=r),Me(e)?Nr(e,Ue(t,1,Me,!0),r,s):[]});function Eh(e,t,s){var u=e==null?0:e.length;return u?(t=s||t===r?1:ae(t),jt(e,t<0?0:t,u)):[]}function Ah(e,t,s){var u=e==null?0:e.length;return u?(t=s||t===r?1:ae(t),t=u-t,jt(e,0,t<0?0:t)):[]}function Fh(e,t){return e&&e.length?bi(e,Q(t,3),!0,!0):[]}function Ih(e,t){return e&&e.length?bi(e,Q(t,3),!0):[]}function Dh(e,t,s,u){var f=e==null?0:e.length;return f?(s&&typeof s!="nu
`;e.replace(z,function(ee,ue,de,ht,rt,pt){return de||(de=ht),P+=e.slice(D,pt).replace(Nf,hg),ue&&(S=!0,P+=`' +
__e(`+ue+`) +
'`),rt&&(y=!0,P+=`';
`+rt+`;
__p += '`),de&&(P+=`' +
((__t = (`+de+`)) == null ? '' : __t) +
'`),D=pt+ee.length,ee}),P+=`';
`;var J=pe.call(t,"variable")&&t.variable;if(!J)P=`with (obj) {
`+P+`
}
`;else if(xf.test(J))throw new re(h);P=(y?P.replace(ef,""):P).replace(tf,"$1").replace(nf,"$1;"),P="function("+(J||"obj")+`) {
`+(J?"":`obj || (obj = {});
`)+"var __t, __p = ''"+(S?", __e = _.escape":"")+(y?`, __j = Array.prototype.join;
function print() { __p += __j.call(arguments, '') }
`:`;
`)+P+`return __p
}`;var oe=uc(function(){return fe(m,H+"return "+P).apply(r,_)});if(oe.source=P,ja(oe))throw oe;return oe}function zv(e){return he(e).toLowerCase()}function Vv(e){return he(e).toUpperCase()}function Bv(e,t,s){if(e=he(e),e&&(s||t===r))return vl(e);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=Ft(t),m=_l(u,f),_=bl(u,f)+1;return un(u,m,_).join("")}function Uv(e,t,s){if(e=he(e),e&&(s||t===r))return e.slice(0,Sl(e)+1);if(!e||!(t=gt(t)))return e;var u=Ft(e),f=bl(u,Ft(t))+1;return un(u,0,f).join("")}function Gv(e,t,s){if(e=he(e),e&&(s||t===r))return e.replace(js,"");if(!e||!(t=gt(t)))return e;var u=Ft(e),f=_l(u,Ft(t));return un(u,f).join("")}function Hv(e,t){var s=me,u=_e;if(Ae(t)){var f="separator"in t?t.separator:f;s="length"in t?ae(t.length):s,u="omission"in t?gt(t.omission):u}e=he(e);var m=e.length;if($n(e)){var _=Ft(e);m=_.length}if(s>=m)return e;var S=s-zn(u);if(S<1)return u;var y=_?un(_,0,S).join(""):e.slice(0,S);if(f===r)return y+u;if(_&&(S+=y.length-S),Ca(f)){if(e.slice(S).search(f)){var D,M=y;for(f.global||(f=$s(f.source,he($o.exec(f))+"g")),f.lastIndex=0;D=f.exec(M);)var P=D.index;y=y.slice(0,P===r?S:P)}}else if(e.indexOf(gt(f),S)!=S){var z=y.lastIndexOf(f);z>-1&&(y=y.slice(0,z))}return y+u}function Kv(e){return e=he(e),e&&rf.test(e)?e.replace(Po,Sg):e}var Wv=Wn(function(e,t,s){return e+(s?" ":"")+t.toUpperCase()}),Ra=cu("toUpperCase");function lc(e,t,s){return e=he(e),t=s?r:t,t===r?xg(e)?yg(e):lg(e):e.match(t)||[]}var uc=le(function(e,t){try{return dt(e,r,t)}catch(s){return ja(s)?s:new re(s)}}),Yv=Kt(function(e,t){return _t(t,function(s){s=kt(s),Gt(e,s,wa(e[s],e))}),e});function Qv(e){var t=e==null?0:e.length,s=Q();return e=t?Ee(e,function(u){if(typeof u[1]!="function")throw new bt(d);return[s(u[0]),u[1]]}):[],le(function(u){for(var f=-1;++f<t;){var m=e[f];if(dt(m[0],this,u))return dt(m[1],this,u)}})}function Xv(e){return Sm(St(e,R))}function Ea(e){return function(){return e}}function Zv(e,t){return e==null||e!==e?t:e}var Jv=fu(),e_=fu(!0);function lt(e){return e}function Aa(e){return Vl(typeof e=="function"?e:St(e,R))}function t_(e){return Ul(St(e,R))}function n_(e,t){return Gl(e,St(t,R))}var r_=le(function(e,t){return function(s){return Rr(s,e,t)}}),i_=le(function(e,t){return function(s){return Rr(e,s,t)}});function Fa(e,t,s){var u=ze(t),f=xi(t,u);s==null&&!(Ae(t)&&(f.length||!u.length))&&(s=t,t=e,e=this,f=xi(t,ze(t)));var m=!(Ae(s)&&"chain"in s)||!!s.chain,_=Yt(e);return _t(f,function(S){var y=t[S];e[S]=y,_&&(e.prototype[S]=function(){var D=this.__chain__;if(m||D){var M=e(this.__wrapped__),P=M.__actions__=st(this.__actions__);return P.push({func:y,args:arguments,thisArg:e}),M.__chain__=D,M}return y.apply(e,nn([this.value()],arguments))})}),e}function s_(){return Be._===this&&(Be._=Ig),this}function Ia(){}function a_(e){return e=ae(e),le(function(t){return Hl(t,e)})}var o_=la(Ee),l_=la(gl),u_=la(Ms);function cc(e){return ha(e)?Ls(kt(e)):qm(e)}function c_(e){return function(t){return e==null?r:Nn(e,t)}}var d_=mu(),f_=mu(!0);function Da(){return[]}function Ma(){return!1}function g_(){return{}}function m_(){return""}function h_(){return!0}function p_(e,t){if(e=ae(e),e<1||e>G)return[];var s=it,u=Qe(e,it);t=Q(t),e-=it;for(var f=Ps(u,t);++s<e;)t(s);return f}function x_(e){return ie(e)?Ee(e,kt):mt(e)?[e]:st(Fu(he(e)))}function v_(e){var t=++Ag;return he(e)+t}var __=ji(function(e,t){return e+t},0),b_=ua("ceil"),w_=ji(function(e,t){return e/t},1),S_=ua("floor");function j_(e){return e&&e.length?pi(e,lt,Ws):r}function C_(e,t){return e&&e.length?pi(e,Q(t,2),Ws):r}function y_(e){return pl(e,lt)}function N_(e,t){return pl(e,Q(t,2))}function R_(e){return e&&e.length?pi(e,lt,Zs):r}function E_(e,t){return e&&e.length?pi(e,Q(t,2),Zs):r}var A_=ji(function(e,t){return e*t},1),F_=ua("round"),I_=ji(function(e,t){return e-t},0);function D_(e){return e&&e.length?Os(e,lt):0}function M_(e,t){return e&&e.length?Os(e,Q(t,2)):0}return g.after=tx,g.ary=zu,g.assign=Vx,g.assignIn=tc,g.assignInWith=Oi,g.assignWith=Bx,g.at=Ux,g.before=Vu,g.bind=wa,g.bindAll=Yv,g.bindKey=Bu,g.castArray=gx,g.chain=ku,g.chunk=Sh,g.compact=jh,g.concat=Ch,g.cond=Qv,g.confo
Hanging rods: CHROME/ BLACK\r
Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r
Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r
Shoe rack door: YES/NO / Profile finish: BLACK LACQUER / SILVER MATTE\r
Shoe cabinet door glass finish: FLOAT BRONZE C-424\r
Composed of:`},{id:2000000084,code:"CAP_FRE_ARM_ABATIBLE_EN",title:"CHARACTERISTICS OF THE FRONT OF THE HINGED WARDROBE",body:`Size of opening: 2275x1390 mm.\r
Model: ARGO / Finish: LACQUER / Colour: TO BE DETERMINED\r
Door thickness: 22 or 19 mm\r
Door finish: SMOOTH \r
Handle: KNOB TO BE DETERMINED\r
Hardware finish: CHROME OR ANTHRACITE\r
Perimetral doorposts: VISIBLE, REMETED OR COMBI TO BE DETERMINED.\r
Number of doors: 2 \r
Composed of:`},{id:2000000089,code:"CAP_FRE_ARM_CORREDERA_EN",title:"Size of opening: 2440x5180mm. ",body:`Model: PANORAMIC P.O. / Finish: LACQUER / Colour: WHITE\r
No. of listers: NO LISTELS / Panels finish: LACQUERED PANEL \r
Handle: \r
Perimeter frame: \r
Nº of doors: \r
INCORPORATED HYDRAULIC BRAKE (not available in lower doors of 650 mm.) OR INCORPORATED MAGNETIC BRAKE. \r
Composed of:`},{id:2000000092,code:"CAP_INT_ARM_FORRADO_EN",title:"Finish: MELAMINE / colour: TO BE DETERMINED",body:`Thickness block: 19 mm / Thickness complements: 19 mm.\r
Hanging rods: CHROME/ BLACK\r
Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r
Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r
Composed of:`},{id:2000000109,code:"CAP_INT_EST_CRISTAL_EN",title:"Frames finish: BLACK ANODIZED",body:`Side frame panel finish: BRONZE FLOAT BRONZE GLASS C-424\r
Rear panel finish: BRONZE FLOAT GLASS C-424\r
Complements finish: MELAMIN / Colour: DENBER OAK M-242\r
Thickness of accessories: 25 mm.\r
Hanging bars: BLACK\r
Glass drawer fronts: STRAIGHT / "U" - FLOAT BRONZE C-424 \r
Drawer handle: xxxxx / Drawers: 4 DE 180 MM.\r
Composed of:`},{id:2000000095,code:"CAP_SEP_AMBIENTES_EN",title:"CHARACTERISTICS SEPARATION OF ROOMS",body:`Size of opening: 2450x3000 mm.\r
Model: LYN / Finish: ANODISED / Colour: BLACK\r
No. of crosspieces: 2 HORIZONTAL CROSSBARS\r
Panel finish: TRANSPARENT TEMPLARED \r
Handle: DOUBLE PER DOOR\r
Brake: DOUBLE PER DOOR (OPENING AND CLOSING)\r
Guide: VISTA (DOUBLE EMBELLECEDOR)\r
Number of panels: 2 SLIDING + 2 FIXED`}],es:[{id:54,code:"CAP_CLA_SEMI_SUSPENDIDO_ES",title:"Acabado vestidor: MELAMINA / color: A DETERMINAR",body:`Espesor bloque: 25 mm. / Espesor complementos: 25 mm.\r
Barras de colgar: CROMO/ NEGRA/ BRONCE\r
Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r
Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r
Baldas deslizantes: X DE 145 MM. A DETERMINAR\r
Compuesto por:`},{id:52,code:"CAP_FRE_ARM_ABATIBLE_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO",body:`Medida de hueco: 2275x1390 mm.\r
Modelo: ARGO / Acabado: LACADO / Color: A DETERMINAR\r
Grosor hoja: 22 o 19 mm\r
Acabado de hojas: LISAS\r
Tirador: UÑERO A DETERMINAR\r
Acabado herrajes: CROMADO O ANTRACITA\r
Jambas perimetrales: VISTAS, REMETIDAS O COMBI A DETERMINAR.\r
Nº de hojas: 2\r
Compuesto por:`},{id:51,code:"CAP_FRE_ARM_CORREDERA_ES",title:"CARACTERISTICAS FRENTE DE ARMARIO CORREDERA",body:`Medida de Hueco:2440x5180mm.\r
Modelo: PANORAMIC P.O. / Acabado: LACADO / Color: BLANCO\r
Nº de lístelos: SIN LISTELOS / Acabado paneles: PANEL LACADO\r
Tirador:\r
Cerco perimetral: \r
Nº de hojas:\r
FRENO HIDRAULICO INCORPORADO O FRENO MAGNETICO INCORPORADO\r
Compuesto por:`},{id:53,code:"CAP_INT_ARM_FORRADO_ES",title:"CARACTERISTICAS INTERIOR DE ARMARIO",body:`Acabado: MELAMINA / color: A DETERMINAR\r
Espesor bloque: 19 mm. / Espesor complementos: 19 mm.\r
Barras de colgar: CROMO/ NEGRA/ BRONCE\r
Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424\r
Tirador cajones: FRENTE BAJO / Cajones: 4 DE 180 MM. A DETERMINAR\r
Baldas deslizantes: X DE 145 MM. A DETERMINAR\r
Compuesto por:`},{id:2000000108,code:"CAP_INT_EST_CRISTAL_ES",title:"Acabado bastidores: ANODIZADO NEGRO",body:`Acabado panel bastidores laterales: CRISTAL TEMPLADO FLOAT BRONCE C-424\r
Acabado trasera: CRISTAL TEMPLADO FLOAT BRONCE C-424\r
Acabado complementos: MELAMINA / Color: ROBLE DENBER M-242\r
Espesor complementos: 25 mm.\r
Barras de colgar: NEGRA\r
Frentes cristal cajones: RECTO / “U” – FLOAT BRONCE C-424 \r
Tirador cajones: xxxxx / Cajones: 4 DE 180 MM.\r
Compuesto por:`},{id:50,code:"CAP_SEP_AMBIENTES_ES",title:"CARACTERISTICAS SEPARACIÓN DE AMBIENTES",body:`Medida de Hueco: 2450x3000 mm.\r
Modelo: LYN / Acabado: ANODIZADO / Color: NEGRO\r
Nº de travesaños: 2 TRAVESAÑOS HORIZONTALES\r
Acabado paneles: TRANSPARENTE TEMPLADO \r
Tirador: DOBLE POR PUERTA\r
Freno: DOBLE POR PUERTA (APERTURA Y CIERRE)\r
Guía: VISTA (DOBLE EMBELLECEDOR)\r
Nº de hojas: 2 CORREDERAS + 2 FIJOS`}]},Rc=({onSelect:n})=>{const{i18n:o}=rs(),[r]=T.useState(o.resolvedLanguage||"es"),[a]=T.useState(Iw[r.toLowerCase()]);return console.log(r),i.jsx(ao,{className:"h-96",children:i.jsx("div",{className:"flex flex-col gap-2 p-4 pt-0",children:a&&a.sort((l,c)=>l.title.localeCompare(c.title)).map((l,c)=>i.jsx("button",{className:"flex flex-col items-start gap-2 p-3 text-sm text-left transition-all border rounded-lg hover:bg-accent",onClick:()=>n&&n(l,1),children:i.jsxs("div",{className:"flex flex-col w-full gap-1",children:[i.jsx("div",{className:"flex items-center",children:i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("div",{className:"font-semibold",children:l.title})})}),i.jsx("div",{className:"text-xs line-clamp-2 text-muted-foreground",children:i.jsx("p",{dangerouslySetInnerHTML:{__html:l.body.substring(0,300).replace(`\r
`,"<br>")}})})]})},l.id))})})},Dw=({isOpen:n,onOpenChange:o,onSelect:r})=>Ld("(min-width: 768px)")?i.jsx(ir,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(sr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(os,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Rc,{onSelect:r}),i.jsx(lr,{children:i.jsx(U,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(Jc,{open:n,onOpenChange:o,children:i.jsxs(ed,{children:[i.jsxs(td,{className:"text-left",children:[i.jsx(nd,{children:w("quotes.blocks_picker_dialog.title")}),i.jsx(rd,{children:w("quotes.blocks_picker_dialog.description")})]}),i.jsx(Rc,{onSelect:r}),i.jsx(id,{className:"pt-2",children:i.jsx(sd,{asChild:!0,children:i.jsx(U,{variant:"outline",children:w("common.close")})})})]})}),Mw=({isOpen:n,onOpenChange:o,onSelect:r})=>Ld("(min-width: 768px)")?i.jsx(ir,{modal:!0,open:n,onOpenChange:o,children:i.jsxs(sr,{className:"w-full max-w-full md:w-9/12 lg:w-10/12",children:[i.jsxs(ar,{children:[i.jsx(or,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(os,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(rr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(so,{onSelect:r})}),i.jsx(lr,{children:i.jsx(U,{type:"submit",onClick:()=>o(!1),children:w("common.close")})})]})}):i.jsx(Jc,{open:n,onOpenChange:o,children:i.jsxs(ed,{children:[i.jsxs(td,{className:"text-left",children:[i.jsx(nd,{children:w("quotes.catalog_picker_dialog.title")}),i.jsx(rd,{children:w("quotes.catalog_picker_dialog.description")})]}),i.jsx(rr,{syncWithLocation:!1,initialPageSize:5,children:i.jsx(so,{onSelect:r})}),i.jsx(id,{className:"pt-2",children:i.jsx(sd,{asChild:!0,children:i.jsx(U,{variant:"outline",children:w("common.close")})})})]})}),Lw=({currency:n,language:o,defaultValues:r})=>{var ne;const{toast:a}=_n(),{control:l,getValues:c,setValue:d,watch:h}=ur(),p=h("show_line_discount_column")??!0,x=!!((ne=c("items"))!=null&&ne.some(B=>{var me;return Number((me=B.discount)==null?void 0:me.amount)>0})),[v]=T.useState("dialog"),[R,N]=T.useState(!1),[b,E]=T.useState(!1),{fields:C,...L}=b0({control:l,name:"items"}),I=xw([{id:"description",accessorKey:"description",header:w("quotes.form_fields.items.description.label"),cell:({row:{index:B,original:me}})=>i.jsx(qt,{readOnly:me==null?void 0:me.id_article,autoSize:!0,name:`items.${B}.description`}),minSize:200,size:400},{id:"quantity",accessorKey:"quantity",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.quantity.label")}),cell:({row:{index:B}})=>i.jsx(tw,{scale:0,className:"text-right",name:`items.${B}.quantity`}),size:75},{id:"unit_price",accessorKey:"unit_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.unit_price.label")}),cell:({row:{index:B}})=>i.jsx(Ta,{currency:n,language:o,scale:2,className:"text-right",name:`items.${B}.unit_price`}),size:125},{id:"subtotal_price",accessorKey:"subtotal_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.subtotal_price.label")}),cell:({row:{index:B}})=>i.jsx(Ta,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"text-right",name:`items.${B}.subtotal_price`}),size:150},{id:"discount",accessorKey:"discount",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.discount.label")}),cell:({row:{index:B}})=>i.jsx(Hi,{scale:2,className:"text-right",name:`items.${B}.discount`}),size:100},{id:"total_price",accessorKey:"total_price",header:()=>i.jsx("div",{className:"text-right",children:w("quotes.form_fields.items.total_price.label")}),cell:({row:{index:B}})=>i.jsx(Ta,{variant:"ghost",currency:n,language:o,scale:2,readOnly:!0,className:"font-semibold text-right",name:`items.${B}.total_price`}),size:150}],{enableDragHandleColumn:!0,enableSelectionColumn:!0}),q=T.useCallback((B,me=1)=>{L.append({...B,quantity:{amount:100*me,scale:xn.DEFAULT_SCALE},unit_price:B.retail_price,discount:{amount:null,scale:2}}),a({titl
${B.body}`,quantity:{amount:null,scale:xn.DEFAULT_SCALE},unit_price:{amount:null,scale:Y0.DEFAULT_SCALE},discount:{amount:null,scale:2}}),a({title:w("quotes.blocks_picker_dialog.toast_article_added"),description:B.title})},[L]),[te,O]=T.useState(!1),k=[265,440,655],K=4;return v==="dialog"?i.jsxs("div",{className:"relative",children:[i.jsx(Nc,{actions:{...L,getItem:B=>c(`items.${B}`),pickCatalogArticle:()=>N(!0),pickBlock:()=>E(!0)},columns:I,data:C,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:B=>d("show_line_discount_column",B,{shouldDirty:!0})}),i.jsx(Mw,{onSelect:q,isOpen:R,onOpenChange:N}),i.jsx(Dw,{onSelect:$,isOpen:b,onOpenChange:E})]}):i.jsxs(z0,{direction:"horizontal",autoSaveId:"uecko.quotes.details_layout",className:"items-stretch h-full",children:[i.jsx(_c,{defaultSize:k[0],collapsedSize:K,collapsible:!0,minSize:50,maxSize:90,onCollapse:()=>{O(!0)},onExpand:()=>{O(!1)},className:ge(te&&"min-w-[50px] transition-all duration-300 ease-in-out"),children:i.jsx(Nc,{actions:{...L,getItem:B=>c(`items.${B}`)},columns:I,data:C,defaultValues:r,showLineDiscountColumn:p,hasLineDiscounts:x,onShowLineDiscountColumnChange:B=>d("show_line_discount_column",B,{shouldDirty:!0})})}),i.jsx(V0,{withHandle:!0,className:"mx-3"}),i.jsx(_c,{defaultSize:k[1],minSize:10,children:i.jsx(rr,{syncWithLocation:!1,children:i.jsx(so,{onSelect:q})})})]})},Tw=()=>{const{formState:n}=ur();return i.jsxs("div",{className:"grid gap-6 md:grid-cols-6",children:[i.jsxs(Qa,{className:"md:col-span-6",title:w("quotes.create.form_groups.general.title"),description:w("quotes.create.form_groups.general.desc"),children:[i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(mn,{required:!0,className:"col-span-2",label:w("quotes.form_fields.customer_reference.label"),description:w("quotes.form_fields.customer_reference.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_reference.placeholder"),name:"customer_reference"}),i.jsx(Vc,{required:!0,label:w("quotes.form_fields.date.label"),description:w("quotes.form_fields.date.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.date.placeholder"),name:"date"}),i.jsx(mn,{label:w("quotes.form_fields.validity.label"),description:w("quotes.form_fields.validity.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.validity.placeholder"),name:"validity"}),i.jsx(qt,{className:"col-span-2",label:w("quotes.form_fields.payment_method.label"),description:w("quotes.form_fields.payment_method.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.payment_method.placeholder"),name:"payment_method"})]}),i.jsxs("div",{className:"grid grid-cols-6 gap-6",children:[i.jsx(qt,{className:"col-span-3",required:!0,label:w("quotes.form_fields.customer_information.label"),description:w("quotes.form_fields.customer_information.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.customer_information.placeholder"),name:"customer_information",errors:n.errors}),i.jsx(qt,{className:"col-span-3",label:w("quotes.form_fields.notes.label"),description:w("quotes.form_fields.notes.desc"),disabled:n.disabled,placeholder:w("quotes.form_fields.notes.placeholder"),name:"notes"})]})]}),i.jsx(Qa,{className:"hidden md:col-span-2",title:w("quotes.create.form_groups.status.title"),description:w("quotes.create.form_groups.status.desc"),children:i.jsxs("div",{className:"grid gap-6",children:[i.jsxs("div",{className:"grid gap-3",children:[i.jsx(dr,{htmlFor:"status",children:"Status"}),i.jsxs(Zi,{children:[i.jsx(Ji,{id:"status","aria-label":"Select status",children:i.jsx(es,{placeholder:"Select status"})}),i.jsxs(ts,{children:[i.jsx(Dn,{value:"draft",children:"Draft"}),i.jsx(Dn,{value:"published",children:"Active"}),i.jsx(Dn,{value:"archived",children:"Archived"})]})]})]}),i.jsx(mn,{required:!0,label:w("quotes.form_fields.lang_code.label"),description:w("quotes.form_fields.lang_code.desc"),placeholder:w("quotes.form_fields.lang_code.placeholder"),name:"lang_code"}),i.jsx(mn,{required:!0,label:w("quotes.form_fields.currency_code.label"),description:w("quotes.form_fi
`).map((be,et)=>i.jsxs("span",{className:et===0?"font-medium":"hidden text-sm text-muted-foreground md:inline",children:[be,i.jsx("br",{})]},et))}),size:500}],De=[{id:"row-actions",header:()=>null,cell:({row:{original:G}})=>{const be=(G==null?void 0:G.status)==="accepted"&&!(G!=null&&G.date_sent),et=(G==null?void 0:G.status)==="accepted"&&!!(G!=null&&G.date_sent),it=(G==null?void 0:G.status)==="archived";return i.jsxs("div",{className:"flex gap-1",children:[i.jsxs(nr,{className:"gap-0",children:[i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",disabled:et,onClick:bn=>{bn.preventDefault(),me(G)},children:[i.jsx(gd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Editar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Editar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",onClick:bn=>{bn.preventDefault(),_e(G.id)},children:[i.jsx(jo,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Duplicar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Duplicar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",onClick:()=>{k(G.id,C(G))},children:[i.jsx(cd,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Descargar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Descargar"})})]}),i.jsxs(Ke,{children:[i.jsx(We,{asChild:!0,children:i.jsxs(U,{variant:"ghost",size:"icon",disabled:it||et,onClick:bn=>{bn.preventDefault(),W(G.id)},children:[i.jsx(ld,{className:"w-4 h-4"}),i.jsx("span",{className:"sr-only",children:"Archivar"})]})}),i.jsx(Ye,{children:i.jsx("p",{children:"Archivar"})})]})]}),i.jsx(nr,{children:i.jsx(Ud,{id:G.id,onSentTo:()=>null,disabled:et||!be})})]})}}];return o?je:[...je,...De]},[o]),{table:Y}=fs({data:(q==null?void 0:q.items)??[],columns:Je,pageCount:(q==null?void 0:q.total_pages)??-1});return T.useEffect(()=>{Y&&q&&(q==null?void 0:q.total_pages)>0&&v(Y.getRowModel().rows[0])},[q,Y]),te?i.jsx(cr,{subtitle:O.message}):$?i.jsxs("div",{className:"grid items-start flex-1 gap-4 sm:py-0 md:gap-8 lg:grid-cols-3 xl:grid-cols-3",children:[i.jsx(Te,{className:"grid items-start gap-4 auto-rows-max md:gap-8 lg:col-span-2",children:i.jsx(Oe,{children:i.jsx(cs,{columnCount:6,searchableColumnCount:1,filterableColumnCount:2,shrinkZero:!0})})}),i.jsx("div",{})]}):(q==null?void 0:q.total_items)===0&&!p?i.jsx(Te,{children:i.jsx(Oe,{children:i.jsx(ds,{subtitle:"Empieza creando alguna cotización",buttonText:w("quotes.create.title"),onButtonClick:()=>r("add",{relative:"path"})})})}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"flex flex-col items-stretch flex-1 gap-4 xl:flex-row",children:[i.jsx("div",{id:l,className:"flex items-stretch flex-1",children:i.jsx(us,{table:Y,paginationOptions:{visible:!0},className:"grid items-start flex-1 gap-4 auto-rows-max md:gap-8 lg:col-span-2",onRowClick:ne,activeRowIndex:x==null?void 0:x.index,children:i.jsx(qd,{table:Y})})}),o&&i.jsx("div",{id:c,className:"flex items-stretch ",children:i.jsx(kw,{quoteId:x==null?void 0:x.original.id})})]}),i.jsx(Vd,{...K,onFinishDownload:B})]})},rS=()=>{const n=zt(),o=ww(),{toast:r}=_n(),[a,l]=T.useState(Oa.createDefaultCode().object),[c,d]=T.useState(Pr.createDefaultCode().object),h=T.useMemo(()=>({date:"",reference:"",customer_reference:"",customer_information:"",lang_code:"",currency_code:"",payment_method:"",notes:"",validity:"",show_line_discount_column:!0,subtotal_price:{amount:void 0,scale:2,currency_code:""},discount:{amount:0,scale:0},discount_price:{amount:0,scale:0,currency_code:""},before_tax_price:{amount:void 0,scale:2,currency_code:""},tax:{amount:void 0,scale:0},tax_label:"% IVA",tax_price:{amount:void 0,scale:2,currency_code:""},total_price:{amount:void 0,scale:2,currency_code:""},items:[{id_article:"",description:"",quantity:{amount:null,scale:2},unit_price:{amount:null,scale:2,currency_code:a.code},subtotal_price:{amount:null,scale:2,currency_code:a.code},discount:{amount:null,scale:2},total_price:{amount:null,scale:2,currency_code:a.code}}]}),[a.code]),{useOne:p,u