import{c as g,a as p,X as qe,d as $e,T as X,g as J,A as G,e as Fe}from"./index-DVdSf46I.js";import{j as n,u as Be,b as Ye}from"./vendor-query-BSpUEUJE.js";import{r as s}from"./vendor-react-CWq2BoMo.js";import{L as oe,E as re,G as se,H as Xe,q as Je,O as ne,s as le,y as Ge,T as ce,z as ie,B as Ke,r as Qe,c as Ze,u as A,p as et,P as M,d as W,b as R,w as N,n as tt,J as at,V as ot,K as de,M as rt,N as ue,Q as he,U as st,W as fe,X as nt,Y as me,Z as pe,_ as lt,$ as ct,a0 as ge}from"./vendor-ui-core-BWFXPlYg.js";import{h as ye,i as it}from"./vendor-ui-extra-CW6ezZiQ.js";/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const pa=g("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ga=g("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const dt=g("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const be=g("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ut=g("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ya=g("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ba=g("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.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const wa=g("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const va=g("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const xa=g("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Sa=g("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.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const _a=g("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ka=g("LockOpen",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ca=g("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Na=g("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ra=g("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ta=g("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ea=g("Printer",[["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["path",{d:"M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6",key:"1itne7"}],["rect",{x:"6",y:"14",width:"12",height:"8",rx:"1",key:"1ue0tg"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Pa=g("QrCode",[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const ja=g("Receipt",[["path",{d:"M4 2v20l2-1 2 1 2-1 2 1 2-1 2 1 2-1 2 1V2l-2 1-2-1-2 1-2-1-2 1-2-1-2 1Z",key:"q3az6g"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 17.5v-11",key:"1jc1ny"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Aa=g("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ma=g("Ruler",[["path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z",key:"icamh8"}],["path",{d:"m14.5 12.5 2-2",key:"inckbg"}],["path",{d:"m11.5 9.5 2-2",key:"fmmyf7"}],["path",{d:"m8.5 6.5 2-2",key:"vc6u1g"}],["path",{d:"m17.5 15.5 2-2",key:"wo5hmg"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Da=g("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const La=g("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const za=g("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Oa=g("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ha=g("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Va=g("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ia=g("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.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Ua=g("Store",[["path",{d:"m2 7 4.41-4.41A2 2 0 0 1 7.83 2h8.34a2 2 0 0 1 1.42.59L22 7",key:"ztvudi"}],["path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8",key:"1b2hhj"}],["path",{d:"M15 22v-4a2 2 0 0 0-2-2h-2a2 2 0 0 0-2 2v4",key:"2ebpfo"}],["path",{d:"M2 7h20",key:"1fcdvo"}],["path",{d:"M22 7v3a2 2 0 0 1-2 2a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 16 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 12 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 8 12a2.7 2.7 0 0 1-1.59-.63.7.7 0 0 0-.82 0A2.7 2.7 0 0 1 4 12a2 2 0 0 1-2-2V7",key:"6c3vgh"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const Wa=g("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
 * @license lucide-react v0.462.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const qa=g("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]),$a=Xe,ht=s.forwardRef(({className:e,...t},a)=>n.jsx(oe,{ref:a,className:p("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",e),...t}));ht.displayName=oe.displayName;const ft=s.forwardRef(({className:e,...t},a)=>n.jsx(re,{ref:a,className:p("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",e),...t}));ft.displayName=re.displayName;const mt=s.forwardRef(({className:e,...t},a)=>n.jsx(se,{ref:a,className:p("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));mt.displayName=se.displayName;const Fa=Je,Ba=Ke,pt=Qe,we=s.forwardRef(({className:e,...t},a)=>n.jsx(ne,{ref:a,className:p("fixed inset-0 z-50 bg-black/80  data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));we.displayName=ne.displayName;const gt=s.forwardRef(({className:e,children:t,...a},r)=>n.jsxs(pt,{children:[n.jsx(we,{}),n.jsxs(le,{ref:r,className:p("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...a,children:[t,n.jsxs(Ge,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[n.jsx(qe,{className:"h-4 w-4"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));gt.displayName=le.displayName;const yt=({className:e,...t})=>n.jsx("div",{className:p("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});yt.displayName="DialogHeader";const bt=({className:e,...t})=>n.jsx("div",{className:p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});bt.displayName="DialogFooter";const wt=s.forwardRef(({className:e,...t},a)=>n.jsx(ce,{ref:a,className:p("text-lg font-semibold leading-none tracking-tight",e),...t}));wt.displayName=ce.displayName;const vt=s.forwardRef(({className:e,...t},a)=>n.jsx(ie,{ref:a,className:p("text-sm text-muted-foreground",e),...t}));vt.displayName=ie.displayName;const xt=$e("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function Ya({className:e,variant:t,...a}){return n.jsx("div",{className:p(xt({variant:t}),e),...a})}function St(e,[t,a]){return Math.min(a,Math.max(t,e))}function _t(e,t){return s.useReducer((a,r)=>t[a][r]??a,e)}var K="ScrollArea",[ve,Xa]=Ze(K),[kt,S]=ve(K),xe=s.forwardRef((e,t)=>{const{__scopeScrollArea:a,type:r="hover",dir:o,scrollHideDelay:c=600,...d}=e,[l,i]=s.useState(null),[f,u]=s.useState(null),[m,h]=s.useState(null),[y,w]=s.useState(null),[C,v]=s.useState(null),[x,L]=s.useState(0),[F,z]=s.useState(0),[O,D]=s.useState(!1),[H,V]=s.useState(!1),b=A(t,E=>i(E)),_=et(o);return n.jsx(kt,{scope:a,type:r,dir:_,scrollHideDelay:c,scrollArea:l,viewport:f,onViewportChange:u,content:m,onContentChange:h,scrollbarX:y,onScrollbarXChange:w,scrollbarXEnabled:O,onScrollbarXEnabledChange:D,scrollbarY:C,onScrollbarYChange:v,scrollbarYEnabled:H,onScrollbarYEnabledChange:V,onCornerWidthChange:L,onCornerHeightChange:z,children:n.jsx(M.div,{dir:_,...d,ref:b,style:{position:"relative","--radix-scroll-area-corner-width":x+"px","--radix-scroll-area-corner-height":F+"px",...e.style}})})});xe.displayName=K;var Se="ScrollAreaViewport",_e=s.forwardRef((e,t)=>{const{__scopeScrollArea:a,children:r,asChild:o,nonce:c,...d}=e,l=S(Se,a),i=s.useRef(null),f=A(t,i,l.onViewportChange);return n.jsxs(n.Fragment,{children:[n.jsx("style",{dangerouslySetInnerHTML:{__html:`
[data-radix-scroll-area-viewport] {
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
[data-radix-scroll-area-viewport]::-webkit-scrollbar {
  display: none;
}
:where([data-radix-scroll-area-viewport]) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
:where([data-radix-scroll-area-content]) {
  flex-grow: 1;
}
`},nonce:c}),n.jsx(M.div,{"data-radix-scroll-area-viewport":"",...d,asChild:o,ref:f,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:Dt({asChild:o,children:r},u=>n.jsx("div",{"data-radix-scroll-area-content":"",ref:l.onContentChange,style:{minWidth:l.scrollbarXEnabled?"fit-content":void 0},children:u}))})]})});_e.displayName=Se;var k="ScrollAreaScrollbar",Q=s.forwardRef((e,t)=>{const{forceMount:a,...r}=e,o=S(k,e.__scopeScrollArea),{onScrollbarXEnabledChange:c,onScrollbarYEnabledChange:d}=o,l=e.orientation==="horizontal";return s.useEffect(()=>(l?c(!0):d(!0),()=>{l?c(!1):d(!1)}),[l,c,d]),o.type==="hover"?n.jsx(Ct,{...r,ref:t,forceMount:a}):o.type==="scroll"?n.jsx(Nt,{...r,ref:t,forceMount:a}):o.type==="auto"?n.jsx(ke,{...r,ref:t,forceMount:a}):o.type==="always"?n.jsx(Z,{...r,ref:t}):null});Q.displayName=k;var Ct=s.forwardRef((e,t)=>{const{forceMount:a,...r}=e,o=S(k,e.__scopeScrollArea),[c,d]=s.useState(!1);return s.useEffect(()=>{const l=o.scrollArea;let i=0;if(l){const f=()=>{window.clearTimeout(i),d(!0)},u=()=>{i=window.setTimeout(()=>d(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",f),l.addEventListener("pointerleave",u),()=>{window.clearTimeout(i),l.removeEventListener("pointerenter",f),l.removeEventListener("pointerleave",u)}}},[o.scrollArea,o.scrollHideDelay]),n.jsx(W,{present:a||c,children:n.jsx(ke,{"data-state":c?"visible":"hidden",...r,ref:t})})}),Nt=s.forwardRef((e,t)=>{const{forceMount:a,...r}=e,o=S(k,e.__scopeScrollArea),c=e.orientation==="horizontal",d=$(()=>i("SCROLL_END"),100),[l,i]=_t("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return s.useEffect(()=>{if(l==="idle"){const f=window.setTimeout(()=>i("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(f)}},[l,o.scrollHideDelay,i]),s.useEffect(()=>{const f=o.viewport,u=c?"scrollLeft":"scrollTop";if(f){let m=f[u];const h=()=>{const y=f[u];m!==y&&(i("SCROLL"),d()),m=y};return f.addEventListener("scroll",h),()=>f.removeEventListener("scroll",h)}},[o.viewport,c,i,d]),n.jsx(W,{present:a||l!=="hidden",children:n.jsx(Z,{"data-state":l==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:R(e.onPointerEnter,()=>i("POINTER_ENTER")),onPointerLeave:R(e.onPointerLeave,()=>i("POINTER_LEAVE"))})})}),ke=s.forwardRef((e,t)=>{const a=S(k,e.__scopeScrollArea),{forceMount:r,...o}=e,[c,d]=s.useState(!1),l=e.orientation==="horizontal",i=$(()=>{if(a.viewport){const f=a.viewport.offsetWidth<a.viewport.scrollWidth,u=a.viewport.offsetHeight<a.viewport.scrollHeight;d(l?f:u)}},10);return j(a.viewport,i),j(a.content,i),n.jsx(W,{present:r||c,children:n.jsx(Z,{"data-state":c?"visible":"hidden",...o,ref:t})})}),Z=s.forwardRef((e,t)=>{const{orientation:a="vertical",...r}=e,o=S(k,e.__scopeScrollArea),c=s.useRef(null),d=s.useRef(0),[l,i]=s.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),f=Ee(l.viewport,l.content),u={...r,sizes:l,onSizesChange:i,hasThumb:f>0&&f<1,onThumbChange:h=>c.current=h,onThumbPointerUp:()=>d.current=0,onThumbPointerDown:h=>d.current=h};function m(h,y){return At(h,d.current,l,y)}return a==="horizontal"?n.jsx(Rt,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const h=o.viewport.scrollLeft,y=te(h,l,o.dir);c.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollLeft=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollLeft=m(h,o.dir))}}):a==="vertical"?n.jsx(Tt,{...u,ref:t,onThumbPositionChange:()=>{if(o.viewport&&c.current){const h=o.viewport.scrollTop,y=te(h,l);c.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:h=>{o.viewport&&(o.viewport.scrollTop=h)},onDragScroll:h=>{o.viewport&&(o.viewport.scrollTop=m(h))}}):null}),Rt=s.forwardRef((e,t)=>{const{sizes:a,onSizesChange:r,...o}=e,c=S(k,e.__scopeScrollArea),[d,l]=s.useState(),i=s.useRef(null),f=A(t,i,c.onScrollbarXChange);return s.useEffect(()=>{i.current&&l(getComputedStyle(i.current))},[i]),n.jsx(Ne,{"data-orientation":"horizontal",...o,ref:f,sizes:a,style:{bottom:0,left:c.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:c.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":q(a)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.x),onDragScroll:u=>e.onDragScroll(u.x),onWheelScroll:(u,m)=>{if(c.viewport){const h=c.viewport.scrollLeft+u.deltaX;e.onWheelScroll(h),je(h,m)&&u.preventDefault()}},onResize:()=>{i.current&&c.viewport&&d&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:i.current.clientWidth,paddingStart:U(d.paddingLeft),paddingEnd:U(d.paddingRight)}})}})}),Tt=s.forwardRef((e,t)=>{const{sizes:a,onSizesChange:r,...o}=e,c=S(k,e.__scopeScrollArea),[d,l]=s.useState(),i=s.useRef(null),f=A(t,i,c.onScrollbarYChange);return s.useEffect(()=>{i.current&&l(getComputedStyle(i.current))},[i]),n.jsx(Ne,{"data-orientation":"vertical",...o,ref:f,sizes:a,style:{top:0,right:c.dir==="ltr"?0:void 0,left:c.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":q(a)+"px",...e.style},onThumbPointerDown:u=>e.onThumbPointerDown(u.y),onDragScroll:u=>e.onDragScroll(u.y),onWheelScroll:(u,m)=>{if(c.viewport){const h=c.viewport.scrollTop+u.deltaY;e.onWheelScroll(h),je(h,m)&&u.preventDefault()}},onResize:()=>{i.current&&c.viewport&&d&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:i.current.clientHeight,paddingStart:U(d.paddingTop),paddingEnd:U(d.paddingBottom)}})}})}),[Et,Ce]=ve(k),Ne=s.forwardRef((e,t)=>{const{__scopeScrollArea:a,sizes:r,hasThumb:o,onThumbChange:c,onThumbPointerUp:d,onThumbPointerDown:l,onThumbPositionChange:i,onDragScroll:f,onWheelScroll:u,onResize:m,...h}=e,y=S(k,a),[w,C]=s.useState(null),v=A(t,b=>C(b)),x=s.useRef(null),L=s.useRef(""),F=y.viewport,z=r.content-r.viewport,O=N(u),D=N(i),H=$(m,10);function V(b){if(x.current){const _=b.clientX-x.current.left,E=b.clientY-x.current.top;f({x:_,y:E})}}return s.useEffect(()=>{const b=_=>{const E=_.target;(w==null?void 0:w.contains(E))&&O(_,z)};return document.addEventListener("wheel",b,{passive:!1}),()=>document.removeEventListener("wheel",b,{passive:!1})},[F,w,z,O]),s.useEffect(D,[r,D]),j(w,H),j(y.content,H),n.jsx(Et,{scope:a,scrollbar:w,hasThumb:o,onThumbChange:N(c),onThumbPointerUp:N(d),onThumbPositionChange:D,onThumbPointerDown:N(l),children:n.jsx(M.div,{...h,ref:v,style:{position:"absolute",...h.style},onPointerDown:R(e.onPointerDown,b=>{b.button===0&&(b.target.setPointerCapture(b.pointerId),x.current=w.getBoundingClientRect(),L.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),V(b))}),onPointerMove:R(e.onPointerMove,V),onPointerUp:R(e.onPointerUp,b=>{const _=b.target;_.hasPointerCapture(b.pointerId)&&_.releasePointerCapture(b.pointerId),document.body.style.webkitUserSelect=L.current,y.viewport&&(y.viewport.style.scrollBehavior=""),x.current=null})})})}),I="ScrollAreaThumb",Re=s.forwardRef((e,t)=>{const{forceMount:a,...r}=e,o=Ce(I,e.__scopeScrollArea);return n.jsx(W,{present:a||o.hasThumb,children:n.jsx(Pt,{ref:t,...r})})}),Pt=s.forwardRef((e,t)=>{const{__scopeScrollArea:a,style:r,...o}=e,c=S(I,a),d=Ce(I,a),{onThumbPositionChange:l}=d,i=A(t,m=>d.onThumbChange(m)),f=s.useRef(),u=$(()=>{f.current&&(f.current(),f.current=void 0)},100);return s.useEffect(()=>{const m=c.viewport;if(m){const h=()=>{if(u(),!f.current){const y=Mt(m,l);f.current=y,l()}};return l(),m.addEventListener("scroll",h),()=>m.removeEventListener("scroll",h)}},[c.viewport,u,l]),n.jsx(M.div,{"data-state":d.hasThumb?"visible":"hidden",...o,ref:i,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:R(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),w=m.clientX-y.left,C=m.clientY-y.top;d.onThumbPointerDown({x:w,y:C})}),onPointerUp:R(e.onPointerUp,d.onThumbPointerUp)})});Re.displayName=I;var ee="ScrollAreaCorner",Te=s.forwardRef((e,t)=>{const a=S(ee,e.__scopeScrollArea),r=!!(a.scrollbarX&&a.scrollbarY);return a.type!=="scroll"&&r?n.jsx(jt,{...e,ref:t}):null});Te.displayName=ee;var jt=s.forwardRef((e,t)=>{const{__scopeScrollArea:a,...r}=e,o=S(ee,a),[c,d]=s.useState(0),[l,i]=s.useState(0),f=!!(c&&l);return j(o.scrollbarX,()=>{var m;const u=((m=o.scrollbarX)==null?void 0:m.offsetHeight)||0;o.onCornerHeightChange(u),i(u)}),j(o.scrollbarY,()=>{var m;const u=((m=o.scrollbarY)==null?void 0:m.offsetWidth)||0;o.onCornerWidthChange(u),d(u)}),f?n.jsx(M.div,{...r,ref:t,style:{width:c,height:l,position:"absolute",right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function U(e){return e?parseInt(e,10):0}function Ee(e,t){const a=e/t;return isNaN(a)?0:a}function q(e){const t=Ee(e.viewport,e.content),a=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-a)*t;return Math.max(r,18)}function At(e,t,a,r="ltr"){const o=q(a),c=o/2,d=t||c,l=o-d,i=a.scrollbar.paddingStart+d,f=a.scrollbar.size-a.scrollbar.paddingEnd-l,u=a.content-a.viewport,m=r==="ltr"?[0,u]:[u*-1,0];return Pe([i,f],m)(e)}function te(e,t,a="ltr"){const r=q(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,c=t.scrollbar.size-o,d=t.content-t.viewport,l=c-r,i=a==="ltr"?[0,d]:[d*-1,0],f=St(e,i);return Pe([0,d],[0,l])(f)}function Pe(e,t){return a=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(a-e[0])}}function je(e,t){return e>0&&e<t}var Mt=(e,t=()=>{})=>{let a={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const c={left:e.scrollLeft,top:e.scrollTop},d=a.left!==c.left,l=a.top!==c.top;(d||l)&&t(),a=c,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function $(e,t){const a=N(e),r=s.useRef(0);return s.useEffect(()=>()=>window.clearTimeout(r.current),[]),s.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(a,t)},[a,t])}function j(e,t){const a=N(t);tt(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(a)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,a])}function Dt(e,t){const{asChild:a,children:r}=e;if(!a)return typeof t=="function"?t(r):t;const o=s.Children.only(r);return s.cloneElement(o,{children:typeof t=="function"?t(o.props.children):t})}var Ae=xe,Lt=_e,zt=Te;const Ot=s.forwardRef(({className:e,children:t,...a},r)=>n.jsxs(Ae,{ref:r,className:p("relative overflow-hidden",e),...a,children:[n.jsx(Lt,{className:"h-full w-full rounded-[inherit]",children:t}),n.jsx(Me,{}),n.jsx(zt,{})]}));Ot.displayName=Ae.displayName;const Me=s.forwardRef(({className:e,orientation:t="vertical",...a},r)=>n.jsx(Q,{ref:r,orientation:t,className:p("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...a,children:n.jsx(Re,{className:"relative flex-1 rounded-full bg-border"})}));Me.displayName=Q.displayName;var Ht="Separator",ae="horizontal",Vt=["horizontal","vertical"],De=s.forwardRef((e,t)=>{const{decorative:a,orientation:r=ae,...o}=e,c=It(r)?r:ae,l=a?{role:"none"}:{"aria-orientation":c==="vertical"?c:void 0,role:"separator"};return n.jsx(M.div,{"data-orientation":c,...l,...o,ref:t})});De.displayName=Ht;function It(e){return Vt.includes(e)}var Le=De;const Ut=s.forwardRef(({className:e,orientation:t="horizontal",decorative:a=!0,...r},o)=>n.jsx(Le,{ref:o,decorative:a,orientation:t,className:p("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));Ut.displayName=Le.displayName;const Ja=at,Ga=ot,Wt=s.forwardRef(({className:e,children:t,...a},r)=>n.jsxs(de,{ref:r,className:p("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...a,children:[t,n.jsx(rt,{asChild:!0,children:n.jsx(be,{className:"h-4 w-4 opacity-50"})})]}));Wt.displayName=de.displayName;const ze=s.forwardRef(({className:e,...t},a)=>n.jsx(ue,{ref:a,className:p("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(ut,{className:"h-4 w-4"})}));ze.displayName=ue.displayName;const Oe=s.forwardRef(({className:e,...t},a)=>n.jsx(he,{ref:a,className:p("flex cursor-default items-center justify-center py-1",e),...t,children:n.jsx(be,{className:"h-4 w-4"})}));Oe.displayName=he.displayName;const qt=s.forwardRef(({className:e,children:t,position:a="popper",...r},o)=>n.jsx(st,{children:n.jsxs(fe,{ref:o,className:p("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",a==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:a,...r,children:[n.jsx(ze,{}),n.jsx(nt,{className:p("p-1",a==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),n.jsx(Oe,{})]})}));qt.displayName=fe.displayName;const $t=s.forwardRef(({className:e,...t},a)=>n.jsx(me,{ref:a,className:p("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t}));$t.displayName=me.displayName;const Ft=s.forwardRef(({className:e,children:t,...a},r)=>n.jsxs(pe,{ref:r,className:p("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...a,children:[n.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:n.jsx(lt,{children:n.jsx(dt,{className:"h-4 w-4"})})}),n.jsx(ct,{children:t})]}));Ft.displayName=pe.displayName;const Bt=s.forwardRef(({className:e,...t},a)=>n.jsx(ge,{ref:a,className:p("-mx-1 my-1 h-px bg-muted",e),...t}));Bt.displayName=ge.displayName;const B={setting_type:"both",show_company_name:!0,show_company_logo:!0,show_fawtra_logo:!0,show_tax_number:!0,show_income_number:!0,show_invoice_type_badge:!0,show_header_image:!0,show_invoice_number:!0,show_invoice_date:!0,show_payment_method:!0,show_cashier_name:!1,show_currency:!0,show_customer_name:!0,show_customer_number:!0,show_customer_phone:!0,show_customer_city:!0,show_postal_code:!1,show_item_number:!0,show_item_description:!0,show_item_quantity:!0,show_item_unit_price:!0,show_item_amount:!0,show_item_discount:!0,show_item_tax_percent:!0,show_item_tax_amount:!0,show_item_total:!0,show_subtotal:!0,show_total_before_tax:!0,show_total_tax:!0,show_total_discount:!0,show_final_total:!0,show_amount_in_words:!0,show_payment_info:!0,show_notes:!0,show_qr_code:!0,show_signature_field:!0,show_footer_text:!0,show_footer_image:!0,show_thank_you_message:!0,custom_thank_you_message:"شكراً لتعاملكم معنا",custom_footer_text:"",custom_invoice_title:"فاتورة ضريبية",custom_return_title:"فاتورة إرجاع"},T=new Map,He=5*60*1e3,P="pos_display_settings",Yt=30*60*1e3,Ve=(e,t)=>{try{const a=localStorage.getItem(P),r=a?JSON.parse(a):{};r[e]={data:t,timestamp:Date.now()},localStorage.setItem(P,JSON.stringify(r))}catch(a){console.warn("Failed to save settings to localStorage:",a)}},Ie=e=>{try{const t=localStorage.getItem(P);if(!t)return null;const r=JSON.parse(t)[e];if(r&&Date.now()-r.timestamp<Yt)return r.data}catch(t){console.warn("Failed to read settings from localStorage:",t)}return null},Ue=e=>{T.delete(e);try{const t=localStorage.getItem(P);if(t){const a=JSON.parse(t);delete a[e],localStorage.setItem(P,JSON.stringify(a))}}catch{localStorage.removeItem(P)}},Xt=e=>{const[t,a]=s.useState(null),[r,o]=s.useState(!0),[c,d]=s.useState(null),l=s.useCallback(async()=>{if(!e){a(null),o(!1);return}const u=T.get(e);if(u&&Date.now()-u.timestamp<He){a(u.data),o(!1);return}const m=Ie(e);if(m){a(m),T.set(e,{data:m,timestamp:Date.now()}),o(!1);return}o(!0),d(null);try{const h=localStorage.getItem(X),w=await(await fetch(`${J()}${G.GET_ALL("invoice_display_settings")}&seller_id=${e}`,{headers:{Authorization:`Bearer ${h}`}})).json();if(w.success&&w.data&&w.data.length>0){const v={...w.data[0]};Object.keys(v).forEach(x=>{typeof v[x]=="number"&&(v[x]===0||v[x]===1)&&(v[x]=v[x]===1),v[x]==="0"&&(v[x]=!1),v[x]==="1"&&(v[x]=!0)}),a(v),T.set(e,{data:v,timestamp:Date.now()}),Ve(e,v)}else{const C={...B,seller_id:e};a(C)}}catch(h){console.error("Failed to fetch invoice display settings:",h),d("فشل في تحميل إعدادات العرض");const y={...B,seller_id:e};a(y)}finally{o(!1)}},[e]);s.useEffect(()=>{l()},[l]);const i=s.useCallback(()=>{e&&Ue(e)},[e]),f=s.useCallback(()=>{i(),l()},[i,l]);return{settings:t,loading:r,error:c,refetch:f,invalidateCache:i}},Jt=async e=>{const t=T.get(e);if(t&&Date.now()-t.timestamp<He)return t.data;const a=Ie(e);if(a)return T.set(e,{data:a,timestamp:Date.now()}),a;try{const r=localStorage.getItem(X),c=await(await fetch(`${J()}${G.GET_ALL("invoice_display_settings")}&seller_id=${e}`,{headers:{Authorization:`Bearer ${r}`}})).json();if(c.success&&c.data&&c.data.length>0){const l={...c.data[0]};return Object.keys(l).forEach(i=>{typeof l[i]=="number"&&(l[i]===0||l[i]===1)&&(l[i]=l[i]===1),l[i]==="0"&&(l[i]=!1),l[i]==="1"&&(l[i]=!0)}),T.set(e,{data:l,timestamp:Date.now()}),Ve(e,l),l}}catch(r){console.error("Failed to fetch invoice display settings:",r)}return{...B,seller_id:e}},Ka=Object.freeze(Object.defineProperty({__proto__:null,fetchInvoiceDisplaySettings:Jt,invalidateSettingsCache:Ue,useInvoiceDisplaySettings:Xt},Symbol.toStringTag,{value:"Module"})),Gt=s.forwardRef(({className:e,...t},a)=>n.jsx("div",{className:"relative w-full overflow-auto",children:n.jsx("table",{ref:a,className:p("w-full caption-bottom text-sm",e),...t})}));Gt.displayName="Table";const Kt=s.forwardRef(({className:e,...t},a)=>n.jsx("thead",{ref:a,className:p("[&_tr]:border-b",e),...t}));Kt.displayName="TableHeader";const Qt=s.forwardRef(({className:e,...t},a)=>n.jsx("tbody",{ref:a,className:p("[&_tr:last-child]:border-0",e),...t}));Qt.displayName="TableBody";const Zt=s.forwardRef(({className:e,...t},a)=>n.jsx("tfoot",{ref:a,className:p("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Zt.displayName="TableFooter";const ea=s.forwardRef(({className:e,...t},a)=>n.jsx("tr",{ref:a,className:p("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ea.displayName="TableRow";const ta=s.forwardRef(({className:e,...t},a)=>n.jsx("th",{ref:a,className:p("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",e),...t}));ta.displayName="TableHead";const aa=s.forwardRef(({className:e,...t},a)=>n.jsx("td",{ref:a,className:p("p-4 align-middle [&:has([role=checkbox])]:pr-0",e),...t}));aa.displayName="TableCell";const oa=s.forwardRef(({className:e,...t},a)=>n.jsx("caption",{ref:a,className:p("mt-4 text-sm text-muted-foreground",e),...t}));oa.displayName="TableCaption";const ra=s.forwardRef(({className:e,...t},a)=>n.jsx(ye,{className:p("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:a,children:n.jsx(it,{className:p("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})}));ra.displayName=ye.displayName;async function sa(e){try{const t=localStorage.getItem(X),a=await fetch(`${J()}${G.GET_BY_ID("sellers",e)}&token=${t}`,{method:"GET"});if(!a.ok)throw new Error("Failed to fetch seller data");const o=(await a.json()).data;return o?{...o,show_company_logo:o.show_company_logo==1||o.show_company_logo===!0,enable_thermal_printing:o.enable_thermal_printing==1||o.enable_thermal_printing===!0,auto_print_thermal:o.auto_print_thermal==1||o.auto_print_thermal===!0,enable_bw_print:o.enable_bw_print==1||o.enable_bw_print===!0||o.enable_bw_print===void 0,show_cashier_name:o.show_cashier_name==1||o.show_cashier_name===!0,enable_fawatrah:o.enable_fawatrah==1||o.enable_fawatrah===!0,enable_full_offline_mode:o.enable_full_offline_mode==1||o.enable_full_offline_mode===!0}:null}catch(t){throw console.error("[useSellerData] Error fetching seller:",t),t}}function Qa(){const e=Fe(),t=Be(),a=Ye({queryKey:["seller",e],queryFn:()=>sa(e),enabled:!!e,staleTime:5*60*1e3,gcTime:30*60*1e3,refetchOnWindowFocus:!1,refetchOnReconnect:!1,retry:2}),r=()=>{e&&t.invalidateQueries({queryKey:["seller",e]})};return{seller:a.data,isLoading:a.isLoading,isError:a.isError,error:a.error,refetch:a.refetch,invalidateSellerData:r,sellerId:e}}const na=s.forwardRef(({className:e,...t},a)=>n.jsx("textarea",{className:p("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:a,...t}));na.displayName="Textarea";const Y={JOD:{code:"JOD",symbol:"د.أ",name:"دينار أردني",decimals:3,locale:"ar-JO",flag:"🇯🇴"},SAR:{code:"SAR",symbol:"ر.س",name:"ريال سعودي",decimals:2,locale:"ar-SA",flag:"🇸🇦"},AED:{code:"AED",symbol:"د.إ",name:"درهم إماراتي",decimals:2,locale:"ar-AE",flag:"🇦🇪"},USD:{code:"USD",symbol:"$",name:"دولار أمريكي",decimals:2,locale:"en-US",flag:"🇺🇸"},EUR:{code:"EUR",symbol:"€",name:"يورو",decimals:2,locale:"de-DE",flag:"🇪🇺"}},la="JOD",We="store_currency",Za=e=>{Y[e]&&localStorage.setItem(We,e)},ca=()=>{const e=localStorage.getItem(We),t=e&&Y[e]?e:la;return Y[t]},eo=e=>{const t=ca();return`${e.toLocaleString(t.locale,{minimumFractionDigits:t.decimals,maximumFractionDigits:t.decimals})} ${t.symbol}`};export{Oa as $,aa as A,Ya as B,ga as C,Fa as D,Ia as E,Sa as F,Ua as G,Va as H,_a as I,ra as J,Ra as K,Qa as L,pa as M,Ma as N,Na as O,Ca as P,na as Q,Aa as R,La as S,$a as T,Wa as U,ba as V,Za as W,va as X,Y,eo as Z,qa as _,gt as a,wa as a0,dt as a1,xa as a2,Pa as a3,bt as a4,ja as a5,ka as a6,Ha as a7,be as a8,ut as a9,Xt as aa,ca as ab,Ka as ac,za as b,yt as c,wt as d,vt as e,Ot as f,Ut as g,ya as h,Ta as i,ht as j,ft as k,mt as l,Ja as m,Wt as n,Ga as o,qt as p,Ft as q,Da as r,Ba as s,Ea as t,Jt as u,Gt as v,Kt as w,ea as x,ta as y,Qt as z};
