(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,95057,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={formatUrl:function(){return l},formatWithValidation:function(){return d},urlObjectKeys:function(){return o}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(90809)._(e.r(98183)),s=/https?|ftp|gopher|file/;function l(e){let{auth:t,hostname:r}=e,n=e.protocol||"",a=e.pathname||"",l=e.hash||"",o=e.query||"",d=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?d=t+e.host:r&&(d=t+(~r.indexOf(":")?`[${r}]`:r),e.port&&(d+=":"+e.port)),o&&"object"==typeof o&&(o=String(i.urlQueryToSearchParams(o)));let c=e.search||o&&`?${o}`||"";return n&&!n.endsWith(":")&&(n+=":"),e.slashes||(!n||s.test(n))&&!1!==d?(d="//"+(d||""),a&&"/"!==a[0]&&(a="/"+a)):d||(d=""),l&&"#"!==l[0]&&(l="#"+l),c&&"?"!==c[0]&&(c="?"+c),a=a.replace(/[?#]/g,encodeURIComponent),c=c.replace("#","%23"),`${n}${d}${a}${c}${l}`}let o=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function d(e){return l(e)}},18581,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"useMergedRef",{enumerable:!0,get:function(){return a}});let n=e.r(71645);function a(e,t){let r=(0,n.useRef)(null),a=(0,n.useRef)(null);return(0,n.useCallback)(n=>{if(null===n){let e=r.current;e&&(r.current=null,e());let t=a.current;t&&(a.current=null,t())}else e&&(r.current=i(e,n)),t&&(a.current=i(t,n))},[e,t])}function i(e,t){if("function"!=typeof e)return e.current=t,()=>{e.current=null};{let r=e(t);return"function"==typeof r?r:()=>e(null)}}("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},73668,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=e.r(18967),a=e.r(52817);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,a.hasBasePath)(r.pathname)}catch(e){return!1}}},84508,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"errorOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},22016,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={default:function(){return y},useLinkStatus:function(){return x}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(90809),s=e.r(43476),l=i._(e.r(71645)),o=e.r(95057),d=e.r(8372),c=e.r(18581),u=e.r(18967),f=e.r(5550);e.r(33525);let p=e.r(88540),h=e.r(91949),m=e.r(73668),v=e.r(9396);function y(t){var r,n;let a,i,y,[x,b]=(0,l.useOptimistic)(h.IDLE_LINK_STATUS),j=(0,l.useRef)(null),{href:w,as:k,children:N,prefetch:_=null,passHref:C,replace:S,shallow:R,scroll:M,onClick:O,onMouseEnter:E,onTouchStart:P,legacyBehavior:z=!1,onNavigate:L,transitionTypes:A,ref:T,unstable_dynamicOnHover:B,...D}=t;a=N,z&&("string"==typeof a||"number"==typeof a)&&(a=(0,s.jsx)("a",{children:a}));let U=l.default.useContext(d.AppRouterContext),$=!1!==_,V=!1!==_?null===(n=_)||"auto"===n?v.FetchStrategy.PPR:v.FetchStrategy.Full:v.FetchStrategy.PPR,I="string"==typeof(r=k||w)?r:(0,o.formatUrl)(r);if(z){if(a?.$$typeof===Symbol.for("react.lazy"))throw Object.defineProperty(Error("`` received a direct child that is either a Server Component, or JSX that was loaded with React.lazy(). This is not supported. Either remove legacyBehavior, or make the direct child a Client Component that renders the Link's `` tag."),"__NEXT_ERROR_CODE",{value:"E863",enumerable:!1,configurable:!0});i=l.default.Children.only(a)}let W=z?i&&"object"==typeof i&&i.ref:T,F=l.default.useCallback(e=>(null!==U&&(j.current=(0,h.mountLinkInstance)(e,I,U,V,$,b)),()=>{j.current&&((0,h.unmountLinkForCurrentNavigation)(j.current),j.current=null),(0,h.unmountPrefetchableInstance)(e)}),[$,I,U,V,b]),K={ref:(0,c.useMergedRef)(F,W),onClick(t){z||"function"!=typeof O||O(t),z&&i.props&&"function"==typeof i.props.onClick&&i.props.onClick(t),!U||t.defaultPrevented||function(t,r,n,a,i,s,o){if("u">typeof window){let d,{nodeName:c}=t.currentTarget;if("A"===c.toUpperCase()&&((d=t.currentTarget.getAttribute("target"))&&"_self"!==d||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&2===t.nativeEvent.which)||t.currentTarget.hasAttribute("download"))return;if(!(0,m.isLocalURL)(r)){a&&(t.preventDefault(),location.replace(r));return}if(t.preventDefault(),s){let e=!1;if(s({preventDefault:()=>{e=!0}}),e)return}let{dispatchNavigateAction:u}=e.r(99781);l.default.startTransition(()=>{u(r,a?"replace":"push",!1===i?p.ScrollBehavior.NoScroll:p.ScrollBehavior.Default,n.current,o)})}}(t,I,j,S,M,L,A)},onMouseEnter(e){z||"function"!=typeof E||E(e),z&&i.props&&"function"==typeof i.props.onMouseEnter&&i.props.onMouseEnter(e),U&&$&&(0,h.onNavigationIntent)(e.currentTarget,!0===B)},onTouchStart:function(e){z||"function"!=typeof P||P(e),z&&i.props&&"function"==typeof i.props.onTouchStart&&i.props.onTouchStart(e),U&&$&&(0,h.onNavigationIntent)(e.currentTarget,!0===B)}};return(0,u.isAbsoluteUrl)(I)?K.href=I:z&&!C&&("a"!==i.type||"href"in i.props)||(K.href=(0,f.addBasePath)(I)),y=z?l.default.cloneElement(i,K):(0,s.jsx)("a",{...D,...K,children:a}),(0,s.jsx)(g.Provider,{value:x,children:y})}e.r(84508);let g=(0,l.createContext)(h.IDLE_LINK_STATUS),x=()=>(0,l.useContext)(g);("function"==typeof r.default||"object"==typeof r.default&&null!==r.default)&&void 0===r.default.__esModule&&(Object.defineProperty(r.default,"__esModule",{value:!0}),Object.assign(r.default,r),t.exports=r.default)},20783,e=>{"use strict";var t=e.i(71645);function r(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function n(...e){return t=>{let n=!1,a=e.map(e=>{let a=r(e,t);return n||"function"!=typeof a||(n=!0),a});if(n)return()=>{for(let t=0;t{"use strict";var t=e.i(71645),r=e.i(74080),n=e.i(20783),a=e.i(43476),i=Symbol("radix.slottable");function s(e){return t.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===i}var l=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,r)=>{var i,l;let o,d,c,u=(l=i=`Primitive.${r}`,(o=t.forwardRef((e,r)=>{let{children:a,...i}=e;if(t.isValidElement(a)){var s;let e,l,o=(s=a,(l=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(l=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),d=function(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(i,a.props);return a.type!==t.Fragment&&(d.ref=r?(0,n.composeRefs)(r,o):o),t.cloneElement(a,d)}return t.Children.count(a)>1?t.Children.only(null):null})).displayName=`${l}.SlotClone`,d=o,(c=t.forwardRef((e,r)=>{let{children:n,...i}=e,l=t.Children.toArray(n),o=l.find(s);if(o){let e=o.props.children,n=l.map(r=>r!==o?r:t.Children.count(e)>1?t.Children.only(null):t.isValidElement(e)?e.props.children:null);return(0,a.jsx)(d,{...i,ref:r,children:t.isValidElement(e)?t.cloneElement(e,void 0,n):null})}return(0,a.jsx)(d,{...i,ref:r,children:n})})).displayName=`${i}.Slot`,c),f=t.forwardRef((e,t)=>{let{asChild:n,...i}=e;return"u">typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,a.jsx)(n?u:r,{...i,ref:t})});return f.displayName=`Primitive.${r}`,{...e,[r]:f}},{});e.s(["Primitive",0,l,"dispatchDiscreteCustomEvent",0,function(e,t){e&&r.flushSync(()=>e.dispatchEvent(t))}],48425)},25913,e=>{"use strict";var t=e.i(7670);let r=e=>"boolean"==typeof e?`${e}`:0===e?"0":e,n=t.clsx;e.s(["cva",0,(e,t)=>a=>{var i;if((null==t?void 0:t.variants)==null)return n(e,null==a?void 0:a.class,null==a?void 0:a.className);let{variants:s,defaultVariants:l}=t,o=Object.keys(s).map(e=>{let t=null==a?void 0:a[e],n=null==l?void 0:l[e];if(null===t)return null;let i=r(t)||r(n);return s[e][i]}),d=a&&Object.entries(a).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return n(e,o,null==t||null==(i=t.compoundVariants)?void 0:i.reduce((e,t)=>{let{class:r,className:n,...a}=t;return Object.entries(a).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...l,...d}[t]):({...l,...d})[t]===r})?[...e,r,n]:e},[]),null==a?void 0:a.class,null==a?void 0:a.className)}])},67881,9840,e=>{"use strict";var t=e.i(43476),r=e.i(25913),n=e.i(71645),a=e.i(20783);function i(e){var r;let i,s=(r=e,(i=n.forwardRef((e,t)=>{let{children:r,...i}=e;if(n.isValidElement(r)){var s;let e,l,o=(s=r,(l=(e=Object.getOwnPropertyDescriptor(s.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.ref:(l=(e=Object.getOwnPropertyDescriptor(s,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning)?s.props.ref:s.props.ref||s.ref),d=function(e,t){let r={...t};for(let n in t){let a=e[n],i=t[n];/^on[A-Z]/.test(n)?a&&i?r[n]=(...e)=>{let t=i(...e);return a(...e),t}:a&&(r[n]=a):"style"===n?r[n]={...a,...i}:"className"===n&&(r[n]=[a,i].filter(Boolean).join(" "))}return{...e,...r}}(i,r.props);return r.type!==n.Fragment&&(d.ref=t?(0,a.composeRefs)(t,o):o),n.cloneElement(r,d)}return n.Children.count(r)>1?n.Children.only(null):null})).displayName=`${r}.SlotClone`,i),l=n.forwardRef((e,r)=>{let{children:a,...i}=e,l=n.Children.toArray(a),o=l.find(c);if(o){let e=o.props.children,a=l.map(t=>t!==o?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,t.jsx)(s,{...i,ref:r,children:n.isValidElement(e)?n.cloneElement(e,void 0,a):null})}return(0,t.jsx)(s,{...i,ref:r,children:a})});return l.displayName=`${e}.Slot`,l}var s=i("Slot"),l=Symbol("radix.slottable");function o(e){let r=({children:e})=>(0,t.jsx)(t.Fragment,{children:e});return r.displayName=`${e}.Slottable`,r.__radixId=l,r}var d=o("Slottable");function c(e){return n.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===l}e.s(["Root",0,s,"Slot",0,s,"Slottable",0,d,"createSlot",0,i,"createSlottable",0,o],43556);var u=e.i(43556);e.s(["Slot",0,u],9840);var u=u,f=e.i(47163);let p=(0,r.cva)("inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",xs:"h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",sm:"h-8 gap-1.5 rounded-md px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-xs":"size-6 rounded-md [&_svg:not([class*='size-'])]:size-3","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});e.s(["Button",0,function({className:e,variant:r="default",size:n="default",asChild:a=!1,...i}){let s=a?u.Root:"button";return(0,t.jsx)(s,{"data-slot":"button","data-variant":r,"data-size":n,className:(0,f.cn)(p({variant:r,size:n,className:e})),...i})}],67881)},70065,e=>{"use strict";var t=e.i(43476),r=e.i(47163);e.s(["Card",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card",className:(0,r.cn)("flex flex-col gap-6 rounded-xl border bg-card py-6 text-card-foreground shadow-sm",e),...n})},"CardContent",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-content",className:(0,r.cn)("px-6",e),...n})},"CardDescription",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-description",className:(0,r.cn)("text-sm text-muted-foreground",e),...n})},"CardFooter",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-footer",className:(0,r.cn)("flex items-center px-6 [.border-t]:pt-6",e),...n})},"CardHeader",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-header",className:(0,r.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",e),...n})},"CardTitle",0,function({className:e,...n}){return(0,t.jsx)("div",{"data-slot":"card-title",className:(0,r.cn)("leading-none font-semibold",e),...n})}])},23750,e=>{"use strict";var t=e.i(43476),r=e.i(47163);e.s(["Input",0,function({className:e,type:n,...a}){return(0,t.jsx)("input",{type:n,"data-slot":"input",className:(0,r.cn)("h-9 w-full min-w-0 rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none selection:bg-primary selection:text-primary-foreground file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm dark:bg-input/30","focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50","aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40",e),...a})}])},10708,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(48425),a=r.forwardRef((e,r)=>(0,t.jsx)(n.Primitive.label,{...e,ref:r,onMouseDown:t=>{t.target.closest("button, input, select, textarea")||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));a.displayName="Label",e.s(["Label",0,a,"Root",0,a],44461);var i=e.i(44461),i=i,s=e.i(47163);e.s(["Label",0,function({className:e,...r}){return(0,t.jsx)(i.Root,{"data-slot":"label",className:(0,s.cn)("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",e),...r})}],10708)},18566,(e,t,r)=>{t.exports=e.r(76562)},94179,e=>{"use strict";var t=e.i(43476),r=e.i(25913),n=e.i(47163);let a=(0,r.cva)("inline-flex items-center rounded-md 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 shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});e.s(["Badge",0,function({className:e,variant:r,...i}){return(0,t.jsx)("div",{className:(0,n.cn)(a({variant:r}),e),...i})}])},75254,e=>{"use strict";var t=e.i(71645);let r=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)},n=(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim();var a={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,t.forwardRef)(({color:e="currentColor",size:r=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:l="",children:o,iconNode:d,...c},u)=>(0,t.createElement)("svg",{ref:u,...a,width:r,height:r,stroke:e,strokeWidth:s?24*Number(i)/Number(r):i,className:n("lucide",l),...!o&&!(e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0})(c)&&{"aria-hidden":"true"},...c},[...d.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(o)?o:[o]]));e.s(["default",0,(e,a)=>{let s=(0,t.forwardRef)(({className:s,...l},o)=>(0,t.createElement)(i,{ref:o,iconNode:a,className:n(`lucide-${r(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,s),...l}));return s.displayName=r(e),s}],75254)},95187,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});var n={callServer:function(){return i.callServer},createServerReference:function(){return l.createServerReference},findSourceMapURL:function(){return s.findSourceMapURL}};for(var a in n)Object.defineProperty(r,a,{enumerable:!0,get:n[a]});let i=e.r(32120),s=e.r(92245),l=e.r(35326)},27612,e=>{"use strict";let t=(0,e.i(75254).default)("trash-2",[["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"}]]);e.s(["Trash2",0,t],27612)},7486,e=>{"use strict";let t=(0,e.i(75254).default)("building-2",[["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"}]]);e.s(["Building2",0,t],7486)},31278,e=>{"use strict";let t=(0,e.i(75254).default)("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);e.s(["Loader2",0,t],31278)},71689,e=>{"use strict";let t=(0,e.i(75254).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,t],71689)},52436,e=>{"use strict";var t=e.i(43476),r=e.i(71645),n=e.i(18566),a=e.i(22016),i=e.i(71689),s=e.i(75254);let l=(0,s.default)("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"}]]),o=(0,s.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);var d=e.i(31278),c=e.i(7486);let u=(0,s.default)("shopping-bag",[["path",{d:"M6 2 3 6v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6l-3-4Z",key:"hou9p0"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}]]);var f=e.i(27612),p=e.i(67881),h=e.i(70065),m=e.i(23750),v=e.i(10708),y=e.i(94179),g=e.i(95187);let x=(0,g.createServerReference)("40b1828e674eaaaba9492eb021cee55fcf1bf5db06",g.callServer,void 0,g.findSourceMapURL,"getEndCustomer"),b=(0,g.createServerReference)("604eedcac9aeacad0088ea6f03de48edc8c9904b05",g.callServer,void 0,g.findSourceMapURL,"updateEndCustomer"),j=(0,g.createServerReference)("40a0f04003dd01338359a0385cffe593cf4fb2b44c",g.callServer,void 0,g.findSourceMapURL,"anonymizeEndCustomer");e.s(["default",0,function({params:e}){let s=(0,n.useRouter)(),[g,w]=(0,r.useState)(null),[k,N]=(0,r.useState)(!0),[_,C]=(0,r.useState)(!1),[S,R]=(0,r.useState)(!1),[M,O]=(0,r.useState)(!1),[E,P]=(0,r.useState)({company_name:"",vat_id:"",first_name:"",last_name:"",street:"",zip:"",city:""});(0,r.useEffect)(()=>{e.then(({id:e})=>{x(e).then(e=>{e?(w(e),P({company_name:e.company_name??"",vat_id:e.vat_id??"",first_name:e.first_name??"",last_name:e.last_name??"",street:e.street??"",zip:e.zip??"",city:e.city??""}),N(!1)):s.push("/my-customers")})})},[e,s]);let z=async()=>{if(g&&E.company_name.trim()){C(!0);try{await b(g.id,E),w(e=>e?{...e,...E}:e),alert("Kundendaten gespeichert.")}catch(e){alert("Fehler beim Speichern.")}finally{C(!1)}}},L=async()=>{if(g){R(!0);try{await j(g.id),s.push("/my-customers")}catch(e){alert("Fehler bei der Anonymisierung."),R(!1)}}};return k?(0,t.jsx)("div",{className:"min-h-screen bg-[#020617] flex items-center justify-center",children:(0,t.jsx)(d.Loader2,{className:"w-8 h-8 animate-spin text-primary"})}):g?(0,t.jsx)("div",{className:"min-h-screen bg-[#020617] text-white px-4 py-12",children:(0,t.jsxs)("div",{className:"max-w-3xl mx-auto space-y-6",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(a.default,{href:"/my-customers",children:(0,t.jsxs)(p.Button,{variant:"ghost",size:"sm",className:"text-slate-400 hover:text-white",children:[(0,t.jsx)(i.ArrowLeft,{className:"w-4 h-4 mr-2"})," Meine Kunden"]})}),(0,t.jsxs)("div",{children:[(0,t.jsxs)("h1",{className:"text-2xl font-extrabold tracking-tight flex items-center gap-2",children:[(0,t.jsx)(c.Building2,{className:"w-6 h-6 text-primary"}),g.is_anonymized?"[Anonymisiert]":g.company_name]}),(0,t.jsxs)("p",{className:"text-slate-400 text-xs mt-0.5",children:["Kunden-ID: ",(0,t.jsxs)("span",{className:"font-mono",children:[g.id.slice(0,8),"…"]})]})]}),g.is_anonymized&&(0,t.jsxs)(y.Badge,{className:"bg-red-500/10 text-red-400 border-red-500/20 gap-1 ml-auto",children:[(0,t.jsx)(o,{className:"w-3 h-3"})," Anonymisiert"]})]}),!g.is_anonymized&&(0,t.jsxs)(h.Card,{className:"glass-dark border-white/10",children:[(0,t.jsxs)(h.CardHeader,{children:[(0,t.jsx)(h.CardTitle,{className:"text-white",children:"Stammdaten bearbeiten"}),(0,t.jsx)(h.CardDescription,{className:"text-slate-400",children:"Änderungen wirken sich nur auf zukünftige Bestellungen aus. Bestehende Snapshots bleiben unverändert."})]}),(0,t.jsxs)(h.CardContent,{className:"space-y-4",children:[(0,t.jsx)("div",{className:"grid md:grid-cols-2 gap-4",children:[{label:"Firmenname *",key:"company_name",span:!0},{label:"USt-IdNr.",key:"vat_id",span:!1},{label:"Vorname",key:"first_name",span:!1},{label:"Nachname",key:"last_name",span:!1},{label:"Straße & Hausnummer",key:"street",span:!0},{label:"PLZ",key:"zip",span:!1},{label:"Ort",key:"city",span:!1}].map(({label:e,key:r,span:n})=>(0,t.jsxs)("div",{className:`space-y-1.5 ${n?"md:col-span-2":""}`,children:[(0,t.jsx)(v.Label,{className:"text-slate-300 text-sm",children:e}),(0,t.jsx)(m.Input,{value:E[r],onChange:e=>P(t=>({...t,[r]:e.target.value})),className:"bg-white/5 border-white/10 text-white"})]},r))}),(0,t.jsxs)("div",{className:"flex gap-3 pt-2",children:[(0,t.jsxs)(p.Button,{onClick:z,disabled:_||!E.company_name.trim(),className:"gap-2",children:[_?(0,t.jsx)(d.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(l,{className:"w-4 h-4"}),"Speichern"]}),(0,t.jsx)(a.default,{href:"/my-orders",children:(0,t.jsxs)(p.Button,{variant:"outline",className:"border-white/10 hover:bg-white/5 gap-2",children:[(0,t.jsx)(u,{className:"w-4 h-4"})," Bestellungen ansehen"]})})]})]})]}),!g.is_anonymized&&(0,t.jsxs)(h.Card,{className:"glass-dark border-red-500/20 bg-red-500/5",children:[(0,t.jsxs)(h.CardHeader,{children:[(0,t.jsxs)(h.CardTitle,{className:"text-red-400 flex items-center gap-2",children:[(0,t.jsx)(f.Trash2,{className:"w-5 h-5"}),"Recht auf Vergessenwerden (DSGVO)"]}),(0,t.jsxs)(h.CardDescription,{className:"text-slate-400",children:["Auf Wunsch des Endkunden können Sie dessen personenbezogene Daten unwiderruflich anonymisieren. Bestehende Bestelldaten (PDF-Rechnungen, Snapshots) werden aus steuerrechtlichen Gründen",(0,t.jsx)("strong",{className:"text-white",children:" nicht "})," gelöscht."]})]}),(0,t.jsx)(h.CardContent,{children:M?(0,t.jsxs)("div",{className:"space-y-3 p-4 rounded-lg bg-red-500/10 border border-red-500/30",children:[(0,t.jsx)("p",{className:"text-sm text-red-300 font-semibold",children:"⚠️ Diese Aktion ist unwiderruflich. Alle personenbezogenen Daten werden überschrieben."}),(0,t.jsxs)("div",{className:"flex gap-3",children:[(0,t.jsxs)(p.Button,{onClick:L,disabled:S,className:"bg-red-600 hover:bg-red-700 gap-2",children:[S?(0,t.jsx)(d.Loader2,{className:"w-4 h-4 animate-spin"}):(0,t.jsx)(f.Trash2,{className:"w-4 h-4"}),"Ja, unwiderruflich anonymisieren"]}),(0,t.jsx)(p.Button,{variant:"ghost",onClick:()=>O(!1),children:"Abbrechen"})]})]}):(0,t.jsxs)(p.Button,{variant:"outline",className:"border-red-500/30 text-red-400 hover:bg-red-500/10 gap-2",onClick:()=>O(!0),children:[(0,t.jsx)(f.Trash2,{className:"w-4 h-4"})," Kundendaten anonymisieren"]})})]}),g.is_anonymized&&(0,t.jsx)(h.Card,{className:"glass-dark border-white/10",children:(0,t.jsxs)(h.CardContent,{className:"py-8 text-center space-y-2",children:[(0,t.jsx)(o,{className:"w-10 h-10 text-amber-400 mx-auto"}),(0,t.jsx)("p",{className:"text-slate-300",children:"Dieser Endkunde wurde bereits anonymisiert."}),(0,t.jsx)("p",{className:"text-slate-500 text-sm",children:"Die Daten können nicht wiederhergestellt werden."})]})})]})}):null}],52436)}]);