import{r as g,R as Db,D as Bb,C as zb,M as Ib,a as Rb,P as Fb,U as Vb,b as Md,c as _d,d as Ob,S as Ub,e as Wb,E as Hb,i as $b,f as Gb}from"./lucide-icons-66ioQXWI.js";(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const l of i.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();var Kf={exports:{}},Hi={};/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Kb=g,qb=Symbol.for("react.element"),Yb=Symbol.for("react.fragment"),Xb=Object.prototype.hasOwnProperty,Zb=Kb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,Qb={key:!0,ref:!0,__self:!0,__source:!0};function qf(e,t,n){var r,s={},i=null,l=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(l=t.ref);for(r in t)Xb.call(t,r)&&!Qb.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)s[r]===void 0&&(s[r]=t[r]);return{$$typeof:qb,type:e,key:i,ref:l,props:s,_owner:Zb.current}}Hi.Fragment=Yb;Hi.jsx=qf;Hi.jsxs=qf;Kf.exports=Hi;var a=Kf.exports,jo={},Yf={exports:{}},Je={},Xf={exports:{}},Zf={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */(function(e){function t(_,D){var z=_.length;_.push(D);e:for(;0>>1,G=_[O];if(0>>1;Os(Me,z))Ies(Kn,Me)?(_[O]=Kn,_[Ie]=z,O=Ie):(_[O]=Me,_[J]=z,O=J);else if(Ies(Kn,z))_[O]=Kn,_[Ie]=z,O=Ie;else break e}}return D}function s(_,D){var z=_.sortIndex-D.sortIndex;return z!==0?z:_.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var l=Date,o=l.now();e.unstable_now=function(){return l.now()-o}}var u=[],c=[],d=1,h=null,m=3,f=!1,x=!1,v=!1,k=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,p=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(_){for(var D=n(c);D!==null;){if(D.callback===null)r(c);else if(D.startTime<=_)r(c),D.sortIndex=D.expirationTime,t(u,D);else break;D=n(c)}}function w(_){if(v=!1,y(_),!x)if(n(u)!==null)x=!0,R(j);else{var D=n(c);D!==null&&K(w,D.startTime-_)}}function j(_,D){x=!1,v&&(v=!1,b(P),P=-1),f=!0;var z=m;try{for(y(D),h=n(u);h!==null&&(!(h.expirationTime>D)||_&&!E());){var O=h.callback;if(typeof O=="function"){h.callback=null,m=h.priorityLevel;var G=O(h.expirationTime<=D);D=e.unstable_now(),typeof G=="function"?h.callback=G:h===n(u)&&r(u),y(D)}else r(u);h=n(u)}if(h!==null)var Z=!0;else{var J=n(c);J!==null&&K(w,J.startTime-D),Z=!1}return Z}finally{h=null,m=z,f=!1}}var C=!1,S=null,P=-1,T=5,N=-1;function E(){return!(e.unstable_now()-N_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):T=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return n(u)},e.unstable_next=function(_){switch(m){case 1:case 2:case 3:var D=3;break;default:D=m}var z=m;m=D;try{return _()}finally{m=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,D){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var z=m;m=_;try{return D()}finally{m=z}},e.unstable_scheduleCallback=function(_,D,z){var O=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0O?(_.sortIndex=z,t(c,_),n(u)===null&&_===n(c)&&(v?(b(P),P=-1):v=!0,K(w,z-O))):(_.sortIndex=G,t(u,_),x||f||(x=!0,R(j))),_},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(_){var D=m;return function(){var z=m;m=D;try{return _.apply(this,arguments)}finally{m=z}}}})(Zf);Xf.exports=Zf;var Jb=Xf.exports;/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ey=g,Qe=Jb;function L(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),No=Object.prototype.hasOwnProperty,ty=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ld={},Dd={};function ny(e){return No.call(Dd,e)?!0:No.call(Ld,e)?!1:ty.test(e)?Dd[e]=!0:(Ld[e]=!0,!1)}function ry(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function sy(e,t,n,r){if(t===null||typeof t>"u"||ry(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function ze(e,t,n,r,s,i,l){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=l}var Se={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Se[e]=new ze(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Se[t]=new ze(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Se[e]=new ze(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Se[e]=new ze(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){Se[e]=new ze(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Se[e]=new ze(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Se[e]=new ze(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Se[e]=new ze(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Se[e]=new ze(e,5,!1,e.toLowerCase(),null,!1,!1)});var ec=/[\-:]([a-z])/g;function tc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(ec,tc);Se[t]=new ze(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(ec,tc);Se[t]=new ze(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(ec,tc);Se[t]=new ze(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Se[e]=new ze(e,1,!1,e.toLowerCase(),null,!1,!1)});Se.xlinkHref=new ze("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Se[e]=new ze(e,1,!1,e.toLowerCase(),null,!0,!0)});function nc(e,t,n,r){var s=Se.hasOwnProperty(t)?Se[t]:null;(s!==null?s.type!==0:r||!(2o||s[l]!==i[o]){var u=` `+s[l].replace(" at new "," at ");return e.displayName&&u.includes("")&&(u=u.replace("",e.displayName)),u}while(1<=l&&0<=o);break}}}finally{Nl=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ns(e):""}function ay(e){switch(e.tag){case 5:return ns(e.type);case 16:return ns("Lazy");case 13:return ns("Suspense");case 19:return ns("SuspenseList");case 0:case 2:case 15:return e=Sl(e.type,!1),e;case 11:return e=Sl(e.type.render,!1),e;case 1:return e=Sl(e.type,!0),e;default:return""}}function Eo(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Qn:return"Fragment";case Zn:return"Portal";case So:return"Profiler";case rc:return"StrictMode";case Co:return"Suspense";case Po:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ep:return(e.displayName||"Context")+".Consumer";case Jf:return(e._context.displayName||"Context")+".Provider";case sc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ac:return t=e.displayName||null,t!==null?t:Eo(e.type)||"Memo";case Zt:t=e._payload,e=e._init;try{return Eo(e(t))}catch{}}return null}function iy(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Eo(t);case 8:return t===rc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function xn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function np(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function ly(e){var t=np(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(l){r=""+l,i.call(this,l)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(l){r=""+l},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function ma(e){e._valueTracker||(e._valueTracker=ly(e))}function rp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=np(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function ai(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function To(e,t){var n=t.checked;return ue({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function zd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=xn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function sp(e,t){t=t.checked,t!=null&&nc(e,"checked",t,!1)}function Ao(e,t){sp(e,t);var n=xn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Mo(e,t.type,n):t.hasOwnProperty("defaultValue")&&Mo(e,t.type,xn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Id(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Mo(e,t,n){(t!=="number"||ai(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var rs=Array.isArray;function mr(e,t,n,r){if(e=e.options,t){t={};for(var s=0;s"+t.valueOf().toString()+"",t=fa.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Ss(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var os={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},oy=["Webkit","ms","Moz","O"];Object.keys(os).forEach(function(e){oy.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),os[t]=os[e]})});function op(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||os.hasOwnProperty(e)&&os[e]?(""+t).trim():t+"px"}function up(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=op(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,s):e[n]=s}}var uy=ue({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Do(e,t){if(t){if(uy[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(L(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(L(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(L(61))}if(t.style!=null&&typeof t.style!="object")throw Error(L(62))}}function Bo(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var zo=null;function ic(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Io=null,fr=null,pr=null;function Vd(e){if(e=Qs(e)){if(typeof Io!="function")throw Error(L(280));var t=e.stateNode;t&&(t=Yi(t),Io(e.stateNode,e.type,t))}}function cp(e){fr?pr?pr.push(e):pr=[e]:fr=e}function dp(){if(fr){var e=fr,t=pr;if(pr=fr=null,Vd(e),t)for(e=0;e>>=0,e===0?32:31-(vy(e)/ky|0)|0}var pa=64,ga=4194304;function ss(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ui(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,s=e.suspendedLanes,i=e.pingedLanes,l=n&268435455;if(l!==0){var o=l&~s;o!==0?r=ss(o):(i&=l,i!==0&&(r=ss(i)))}else l=n&~s,l!==0?r=ss(l):i!==0&&(r=ss(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&s)&&(s=r&-r,i=t&-t,s>=i||s===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Xs(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yt(t),e[t]=n}function Sy(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=cs),Yd=" ",Xd=!1;function Mp(e,t){switch(e){case"keyup":return Jy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function _p(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Jn=!1;function tv(e,t){switch(e){case"compositionend":return _p(t);case"keypress":return t.which!==32?null:(Xd=!0,Yd);case"textInput":return e=t.data,e===Yd&&Xd?null:e;default:return null}}function nv(e,t){if(Jn)return e==="compositionend"||!fc&&Mp(e,t)?(e=Tp(),Oa=dc=nn=null,Jn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=eh(n)}}function zp(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zp(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ip(){for(var e=window,t=ai();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=ai(e.document)}return t}function pc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function dv(e){var t=Ip(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&zp(n.ownerDocument.documentElement,n)){if(r!==null&&pc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!e.extend&&i>r&&(s=r,r=i,i=s),s=th(n,i);var l=th(n,r);s&&l&&(e.rangeCount!==1||e.anchorNode!==s.node||e.anchorOffset!==s.offset||e.focusNode!==l.node||e.focusOffset!==l.offset)&&(t=t.createRange(),t.setStart(s.node,s.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(l.node,l.offset)):(t.setEnd(l.node,l.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,er=null,Wo=null,hs=null,Ho=!1;function nh(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ho||er==null||er!==ai(r)||(r=er,"selectionStart"in r&&pc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),hs&&Ms(hs,r)||(hs=r,r=hi(Wo,"onSelect"),0rr||(e.current=Xo[rr],Xo[rr]=null,rr--)}function ne(e,t){rr++,Xo[rr]=e.current,e.current=t}var bn={},Ae=wn(bn),We=wn(!1),Fn=bn;function vr(e,t){var n=e.type.contextTypes;if(!n)return bn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=s),s}function He(e){return e=e.childContextTypes,e!=null}function fi(){se(We),se(Ae)}function uh(e,t,n){if(Ae.current!==bn)throw Error(L(168));ne(Ae,t),ne(We,n)}function Gp(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in t))throw Error(L(108,iy(e)||"Unknown",s));return ue({},n,r)}function pi(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||bn,Fn=Ae.current,ne(Ae,e),ne(We,We.current),!0}function ch(e,t,n){var r=e.stateNode;if(!r)throw Error(L(169));n?(e=Gp(e,t,Fn),r.__reactInternalMemoizedMergedChildContext=e,se(We),se(Ae),ne(Ae,e)):se(We),ne(We,n)}var It=null,Xi=!1,Fl=!1;function Kp(e){It===null?It=[e]:It.push(e)}function jv(e){Xi=!0,Kp(e)}function jn(){if(!Fl&&It!==null){Fl=!0;var e=0,t=ee;try{var n=It;for(ee=1;e>=l,s-=l,Rt=1<<32-yt(t)+s|n<P?(T=S,S=null):T=S.sibling;var N=m(b,S,y[P],w);if(N===null){S===null&&(S=T);break}e&&S&&N.alternate===null&&t(b,S),p=i(N,p,P),C===null?j=N:C.sibling=N,C=N,S=T}if(P===y.length)return n(b,S),ae&&Pn(b,P),j;if(S===null){for(;PP?(T=S,S=null):T=S.sibling;var E=m(b,S,N.value,w);if(E===null){S===null&&(S=T);break}e&&S&&E.alternate===null&&t(b,S),p=i(E,p,P),C===null?j=E:C.sibling=E,C=E,S=T}if(N.done)return n(b,S),ae&&Pn(b,P),j;if(S===null){for(;!N.done;P++,N=y.next())N=h(b,N.value,w),N!==null&&(p=i(N,p,P),C===null?j=N:C.sibling=N,C=N);return ae&&Pn(b,P),j}for(S=r(b,S);!N.done;P++,N=y.next())N=f(S,b,P,N.value,w),N!==null&&(e&&N.alternate!==null&&S.delete(N.key===null?P:N.key),p=i(N,p,P),C===null?j=N:C.sibling=N,C=N);return e&&S.forEach(function(B){return t(b,B)}),ae&&Pn(b,P),j}function k(b,p,y,w){if(typeof y=="object"&&y!==null&&y.type===Qn&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case ha:e:{for(var j=y.key,C=p;C!==null;){if(C.key===j){if(j=y.type,j===Qn){if(C.tag===7){n(b,C.sibling),p=s(C,y.props.children),p.return=b,b=p;break e}}else if(C.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===Zt&&mh(j)===C.type){n(b,C.sibling),p=s(C,y.props),p.ref=Xr(b,C,y),p.return=b,b=p;break e}n(b,C);break}else t(b,C);C=C.sibling}y.type===Qn?(p=zn(y.props.children,b.mode,w,y.key),p.return=b,b=p):(w=Ya(y.type,y.key,y.props,null,b.mode,w),w.ref=Xr(b,p,y),w.return=b,b=w)}return l(b);case Zn:e:{for(C=y.key;p!==null;){if(p.key===C)if(p.tag===4&&p.stateNode.containerInfo===y.containerInfo&&p.stateNode.implementation===y.implementation){n(b,p.sibling),p=s(p,y.children||[]),p.return=b,b=p;break e}else{n(b,p);break}else t(b,p);p=p.sibling}p=Kl(y,b.mode,w),p.return=b,b=p}return l(b);case Zt:return C=y._init,k(b,p,C(y._payload),w)}if(rs(y))return x(b,p,y,w);if($r(y))return v(b,p,y,w);ja(b,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,p!==null&&p.tag===6?(n(b,p.sibling),p=s(p,y),p.return=b,b=p):(n(b,p),p=Gl(y,b.mode,w),p.return=b,b=p),l(b)):n(b,p)}return k}var wr=Zp(!0),Qp=Zp(!1),bi=wn(null),yi=null,ir=null,yc=null;function vc(){yc=ir=yi=null}function kc(e){var t=bi.current;se(bi),e._currentValue=t}function Jo(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function xr(e,t){yi=e,yc=ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Oe=!0),e.firstContext=null)}function ot(e){var t=e._currentValue;if(yc!==e)if(e={context:e,memoizedValue:t,next:null},ir===null){if(yi===null)throw Error(L(308));ir=e,yi.dependencies={lanes:0,firstContext:e}}else ir=ir.next=e;return t}var Mn=null;function wc(e){Mn===null?Mn=[e]:Mn.push(e)}function Jp(e,t,n,r){var s=t.interleaved;return s===null?(n.next=n,wc(t)):(n.next=s.next,s.next=n),t.interleaved=n,Ht(e,r)}function Ht(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Qt=!1;function jc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function e0(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Ot(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function hn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,X&2){var s=r.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),r.pending=t,Ht(e,n)}return s=r.interleaved,s===null?(t.next=t,wc(r)):(t.next=s.next,s.next=t),r.interleaved=t,Ht(e,n)}function Wa(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,oc(e,n)}}function fh(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var l={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=l:i=i.next=l,n=n.next}while(n!==null);i===null?s=i=t:i=i.next=t}else s=i=t;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function vi(e,t,n,r){var s=e.updateQueue;Qt=!1;var i=s.firstBaseUpdate,l=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var u=o,c=u.next;u.next=null,l===null?i=c:l.next=c,l=u;var d=e.alternate;d!==null&&(d=d.updateQueue,o=d.lastBaseUpdate,o!==l&&(o===null?d.firstBaseUpdate=c:o.next=c,d.lastBaseUpdate=u))}if(i!==null){var h=s.baseState;l=0,d=c=u=null,o=i;do{var m=o.lane,f=o.eventTime;if((r&m)===m){d!==null&&(d=d.next={eventTime:f,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var x=e,v=o;switch(m=t,f=n,v.tag){case 1:if(x=v.payload,typeof x=="function"){h=x.call(f,h,m);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=v.payload,m=typeof x=="function"?x.call(f,h,m):x,m==null)break e;h=ue({},h,m);break e;case 2:Qt=!0}}o.callback!==null&&o.lane!==0&&(e.flags|=64,m=s.effects,m===null?s.effects=[o]:m.push(o))}else f={eventTime:f,lane:m,tag:o.tag,payload:o.payload,callback:o.callback,next:null},d===null?(c=d=f,u=h):d=d.next=f,l|=m;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;m=o,o=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(d===null&&(u=h),s.baseState=u,s.firstBaseUpdate=c,s.lastBaseUpdate=d,t=s.shared.interleaved,t!==null){s=t;do l|=s.lane,s=s.next;while(s!==t)}else i===null&&(s.shared.lanes=0);Un|=l,e.lanes=l,e.memoizedState=h}}function ph(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=Ol.transition;Ol.transition={};try{e(!1),t()}finally{ee=n,Ol.transition=r}}function x0(){return ut().memoizedState}function Pv(e,t,n){var r=fn(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},b0(e))y0(t,n);else if(n=Jp(e,t,n,r),n!==null){var s=Be();vt(n,e,r,s),v0(n,t,r)}}function Ev(e,t,n){var r=fn(e),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(b0(e))y0(t,s);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var l=t.lastRenderedState,o=i(l,n);if(s.hasEagerState=!0,s.eagerState=o,wt(o,l)){var u=t.interleaved;u===null?(s.next=s,wc(t)):(s.next=u.next,u.next=s),t.interleaved=s;return}}catch{}finally{}n=Jp(e,t,s,r),n!==null&&(s=Be(),vt(n,e,r,s),v0(n,t,r))}}function b0(e){var t=e.alternate;return e===le||t!==null&&t===le}function y0(e,t){ms=wi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function v0(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,oc(e,n)}}var ji={readContext:ot,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useInsertionEffect:Pe,useLayoutEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useMutableSource:Pe,useSyncExternalStore:Pe,useId:Pe,unstable_isNewReconciler:!1},Tv={readContext:ot,useCallback:function(e,t){return St().memoizedState=[e,t===void 0?null:t],e},useContext:ot,useEffect:xh,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,$a(4194308,4,h0.bind(null,t,e),n)},useLayoutEffect:function(e,t){return $a(4194308,4,e,t)},useInsertionEffect:function(e,t){return $a(4,2,e,t)},useMemo:function(e,t){var n=St();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=St();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=Pv.bind(null,le,e),[r.memoizedState,e]},useRef:function(e){var t=St();return e={current:e},t.memoizedState=e},useState:gh,useDebugValue:Mc,useDeferredValue:function(e){return St().memoizedState=e},useTransition:function(){var e=gh(!1),t=e[0];return e=Cv.bind(null,e[1]),St().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=le,s=St();if(ae){if(n===void 0)throw Error(L(407));n=n()}else{if(n=t(),ke===null)throw Error(L(349));On&30||s0(r,t,n)}s.memoizedState=n;var i={value:n,getSnapshot:t};return s.queue=i,xh(i0.bind(null,r,i,e),[e]),r.flags|=2048,Fs(9,a0.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=St(),t=ke.identifierPrefix;if(ae){var n=Ft,r=Rt;n=(r&~(1<<32-yt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Is++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=l.createElement(n,{is:r.is}):(e=l.createElement(n),n==="select"&&(l=e,r.multiple?l.multiple=!0:r.size&&(l.size=r.size))):e=l.createElementNS(e,n),e[Et]=t,e[Ds]=r,A0(e,t,!1,!1),t.stateNode=e;e:{switch(l=Bo(n,r),n){case"dialog":re("cancel",e),re("close",e),s=r;break;case"iframe":case"object":case"embed":re("load",e),s=r;break;case"video":case"audio":for(s=0;sSr&&(t.flags|=128,r=!0,Zr(i,!1),t.lanes=4194304)}else{if(!r)if(e=ki(l),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Zr(i,!0),i.tail===null&&i.tailMode==="hidden"&&!l.alternate&&!ae)return Ee(t),null}else 2*he()-i.renderingStartTime>Sr&&n!==1073741824&&(t.flags|=128,r=!0,Zr(i,!1),t.lanes=4194304);i.isBackwards?(l.sibling=t.child,t.child=l):(n=i.last,n!==null?n.sibling=l:t.child=l,i.last=l)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=he(),t.sibling=null,n=ie.current,ne(ie,r?n&1|2:n&1),t):(Ee(t),null);case 22:case 23:return Ic(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?qe&1073741824&&(Ee(t),t.subtreeFlags&6&&(t.flags|=8192)):Ee(t),null;case 24:return null;case 25:return null}throw Error(L(156,t.tag))}function Iv(e,t){switch(xc(t),t.tag){case 1:return He(t.type)&&fi(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return jr(),se(We),se(Ae),Cc(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sc(t),null;case 13:if(se(ie),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(L(340));kr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return se(ie),null;case 4:return jr(),null;case 10:return kc(t.type._context),null;case 22:case 23:return Ic(),null;case 24:return null;default:return null}}var Sa=!1,Te=!1,Rv=typeof WeakSet=="function"?WeakSet:Set,I=null;function lr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){de(e,t,r)}else n.current=null}function ou(e,t,n){try{n()}catch(r){de(e,t,r)}}var Eh=!1;function Fv(e,t){if($o=ci,e=Ip(),pc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var l=0,o=-1,u=-1,c=0,d=0,h=e,m=null;t:for(;;){for(var f;h!==n||s!==0&&h.nodeType!==3||(o=l+s),h!==i||r!==0&&h.nodeType!==3||(u=l+r),h.nodeType===3&&(l+=h.nodeValue.length),(f=h.firstChild)!==null;)m=h,h=f;for(;;){if(h===e)break t;if(m===n&&++c===s&&(o=l),m===i&&++d===r&&(u=l),(f=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=f}n=o===-1||u===-1?null:{start:o,end:u}}else n=null}n=n||{start:0,end:0}}else n=null;for(Go={focusedElem:e,selectionRange:n},ci=!1,I=t;I!==null;)if(t=I,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,I=e;else for(;I!==null;){t=I;try{var x=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var v=x.memoizedProps,k=x.memoizedState,b=t.stateNode,p=b.getSnapshotBeforeUpdate(t.elementType===t.type?v:pt(t.type,v),k);b.__reactInternalSnapshotBeforeUpdate=p}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(L(163))}}catch(w){de(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,I=e;break}I=t.return}return x=Eh,Eh=!1,x}function fs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&e)===e){var i=s.destroy;s.destroy=void 0,i!==void 0&&ou(t,n,i)}s=s.next}while(s!==r)}}function Ji(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function uu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function L0(e){var t=e.alternate;t!==null&&(e.alternate=null,L0(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Et],delete t[Ds],delete t[Yo],delete t[kv],delete t[wv])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function D0(e){return e.tag===5||e.tag===3||e.tag===4}function Th(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||D0(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function cu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=mi));else if(r!==4&&(e=e.child,e!==null))for(cu(e,t,n),e=e.sibling;e!==null;)cu(e,t,n),e=e.sibling}function du(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(du(e,t,n),e=e.sibling;e!==null;)du(e,t,n),e=e.sibling}var je=null,gt=!1;function Yt(e,t,n){for(n=n.child;n!==null;)B0(e,t,n),n=n.sibling}function B0(e,t,n){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount($i,n)}catch{}switch(n.tag){case 5:Te||lr(n,t);case 6:var r=je,s=gt;je=null,Yt(e,t,n),je=r,gt=s,je!==null&&(gt?(e=je,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):je.removeChild(n.stateNode));break;case 18:je!==null&&(gt?(e=je,n=n.stateNode,e.nodeType===8?Rl(e.parentNode,n):e.nodeType===1&&Rl(e,n),Ts(e)):Rl(je,n.stateNode));break;case 4:r=je,s=gt,je=n.stateNode.containerInfo,gt=!0,Yt(e,t,n),je=r,gt=s;break;case 0:case 11:case 14:case 15:if(!Te&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,l=i.destroy;i=i.tag,l!==void 0&&(i&2||i&4)&&ou(n,t,l),s=s.next}while(s!==r)}Yt(e,t,n);break;case 1:if(!Te&&(lr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(o){de(n,t,o)}Yt(e,t,n);break;case 21:Yt(e,t,n);break;case 22:n.mode&1?(Te=(r=Te)||n.memoizedState!==null,Yt(e,t,n),Te=r):Yt(e,t,n);break;default:Yt(e,t,n)}}function Ah(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new Rv),t.forEach(function(r){var s=qv.bind(null,e,r);n.has(r)||(n.add(r),r.then(s,s))})}}function ht(e,t){var n=t.deletions;if(n!==null)for(var r=0;rs&&(s=l),r&=~i}if(r=s,r=he()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Ov(r/1960))-r,10e?16:e,rn===null)var r=!1;else{if(e=rn,rn=null,Ci=0,X&6)throw Error(L(331));var s=X;for(X|=4,I=e.current;I!==null;){var i=I,l=i.child;if(I.flags&16){var o=i.deletions;if(o!==null){for(var u=0;uhe()-Bc?Bn(e,0):Dc|=n),$e(e,t)}function W0(e,t){t===0&&(e.mode&1?(t=ga,ga<<=1,!(ga&130023424)&&(ga=4194304)):t=1);var n=Be();e=Ht(e,t),e!==null&&(Xs(e,t,n),$e(e,n))}function Kv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),W0(e,n)}function qv(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,s=e.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(L(314))}r!==null&&r.delete(t),W0(e,n)}var H0;H0=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||We.current)Oe=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Oe=!1,Bv(e,t,n);Oe=!!(e.flags&131072)}else Oe=!1,ae&&t.flags&1048576&&qp(t,xi,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ga(e,t),e=t.pendingProps;var s=vr(t,Ae.current);xr(t,n),s=Ec(null,t,r,e,s,n);var i=Tc();return t.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,He(r)?(i=!0,pi(t)):i=!1,t.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,jc(t),s.updater=Qi,t.stateNode=s,s._reactInternals=t,tu(t,r,e,n),t=su(null,t,r,!0,i,n)):(t.tag=0,ae&&i&&gc(t),_e(null,t,s,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ga(e,t),e=t.pendingProps,s=r._init,r=s(r._payload),t.type=r,s=t.tag=Xv(r),e=pt(r,e),s){case 0:t=ru(null,t,r,e,n);break e;case 1:t=Sh(null,t,r,e,n);break e;case 11:t=jh(null,t,r,e,n);break e;case 14:t=Nh(null,t,r,pt(r.type,e),n);break e}throw Error(L(306,r,""))}return t;case 0:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:pt(r,s),ru(e,t,r,s,n);case 1:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:pt(r,s),Sh(e,t,r,s,n);case 3:e:{if(P0(t),e===null)throw Error(L(387));r=t.pendingProps,i=t.memoizedState,s=i.element,e0(e,t),vi(t,r,null,n);var l=t.memoizedState;if(r=l.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:l.cache,pendingSuspenseBoundaries:l.pendingSuspenseBoundaries,transitions:l.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){s=Nr(Error(L(423)),t),t=Ch(e,t,r,n,s);break e}else if(r!==s){s=Nr(Error(L(424)),t),t=Ch(e,t,r,n,s);break e}else for(Ye=dn(t.stateNode.containerInfo.firstChild),Xe=t,ae=!0,xt=null,n=Qp(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(kr(),r===s){t=$t(e,t,n);break e}_e(e,t,r,n)}t=t.child}return t;case 5:return t0(t),e===null&&Qo(t),r=t.type,s=t.pendingProps,i=e!==null?e.memoizedProps:null,l=s.children,Ko(r,s)?l=null:i!==null&&Ko(r,i)&&(t.flags|=32),C0(e,t),_e(e,t,l,n),t.child;case 6:return e===null&&Qo(t),null;case 13:return E0(e,t,n);case 4:return Nc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=wr(t,null,r,n):_e(e,t,r,n),t.child;case 11:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:pt(r,s),jh(e,t,r,s,n);case 7:return _e(e,t,t.pendingProps,n),t.child;case 8:return _e(e,t,t.pendingProps.children,n),t.child;case 12:return _e(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,s=t.pendingProps,i=t.memoizedProps,l=s.value,ne(bi,r._currentValue),r._currentValue=l,i!==null)if(wt(i.value,l)){if(i.children===s.children&&!We.current){t=$t(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var o=i.dependencies;if(o!==null){l=i.child;for(var u=o.firstContext;u!==null;){if(u.context===r){if(i.tag===1){u=Ot(-1,n&-n),u.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var d=c.pending;d===null?u.next=u:(u.next=d.next,d.next=u),c.pending=u}}i.lanes|=n,u=i.alternate,u!==null&&(u.lanes|=n),Jo(i.return,n,t),o.lanes|=n;break}u=u.next}}else if(i.tag===10)l=i.type===t.type?null:i.child;else if(i.tag===18){if(l=i.return,l===null)throw Error(L(341));l.lanes|=n,o=l.alternate,o!==null&&(o.lanes|=n),Jo(l,n,t),l=i.sibling}else l=i.child;if(l!==null)l.return=i;else for(l=i;l!==null;){if(l===t){l=null;break}if(i=l.sibling,i!==null){i.return=l.return,l=i;break}l=l.return}i=l}_e(e,t,s.children,n),t=t.child}return t;case 9:return s=t.type,r=t.pendingProps.children,xr(t,n),s=ot(s),r=r(s),t.flags|=1,_e(e,t,r,n),t.child;case 14:return r=t.type,s=pt(r,t.pendingProps),s=pt(r.type,s),Nh(e,t,r,s,n);case 15:return N0(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,s=t.pendingProps,s=t.elementType===r?s:pt(r,s),Ga(e,t),t.tag=1,He(r)?(e=!0,pi(t)):e=!1,xr(t,n),k0(t,r,s),tu(t,r,s,n),su(null,t,r,!0,e,n);case 19:return T0(e,t,n);case 22:return S0(e,t,n)}throw Error(L(156,t.tag))};function $0(e,t){return bp(e,t)}function Yv(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function at(e,t,n,r){return new Yv(e,t,n,r)}function Fc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xv(e){if(typeof e=="function")return Fc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===sc)return 11;if(e===ac)return 14}return 2}function pn(e,t){var n=e.alternate;return n===null?(n=at(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Ya(e,t,n,r,s,i){var l=2;if(r=e,typeof e=="function")Fc(e)&&(l=1);else if(typeof e=="string")l=5;else e:switch(e){case Qn:return zn(n.children,s,i,t);case rc:l=8,s|=8;break;case So:return e=at(12,n,t,s|2),e.elementType=So,e.lanes=i,e;case Co:return e=at(13,n,t,s),e.elementType=Co,e.lanes=i,e;case Po:return e=at(19,n,t,s),e.elementType=Po,e.lanes=i,e;case tp:return tl(n,s,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Jf:l=10;break e;case ep:l=9;break e;case sc:l=11;break e;case ac:l=14;break e;case Zt:l=16,r=null;break e}throw Error(L(130,e==null?e:typeof e,""))}return t=at(l,n,t,s),t.elementType=e,t.type=r,t.lanes=i,t}function zn(e,t,n,r){return e=at(7,e,r,t),e.lanes=n,e}function tl(e,t,n,r){return e=at(22,e,r,t),e.elementType=tp,e.lanes=n,e.stateNode={isHidden:!1},e}function Gl(e,t,n){return e=at(6,e,null,t),e.lanes=n,e}function Kl(e,t,n){return t=at(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Zv(e,t,n,r,s){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Pl(0),this.expirationTimes=Pl(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pl(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Vc(e,t,n,r,s,i,l,o,u){return e=new Zv(e,t,n,o,u),t===1?(t=1,i===!0&&(t|=8)):t=0,i=at(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jc(i),e}function Qv(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Y0)}catch(e){console.error(e)}}Y0(),Yf.exports=Je;var Hc=Yf.exports,Rh=Hc;jo.createRoot=Rh.createRoot,jo.hydrateRoot=Rh.hydrateRoot;/** * @remix-run/router v1.23.3 * * Copyright (c) Remix Software Inc. * * 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 Os(){return Os=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function $c(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function sk(){return Math.random().toString(36).substr(2,8)}function Vh(e,t){return{usr:e.state,key:e.key,idx:t}}function gu(e,t,n,r){return n===void 0&&(n=null),Os({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?zr(t):t,{state:n,key:t&&t.key||r||sk()})}function Ti(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function zr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function ak(e,t,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,l=s.history,o=sn.Pop,u=null,c=d();c==null&&(c=0,l.replaceState(Os({},l.state,{idx:c}),""));function d(){return(l.state||{idx:null}).idx}function h(){o=sn.Pop;let k=d(),b=k==null?null:k-c;c=k,u&&u({action:o,location:v.location,delta:b})}function m(k,b){o=sn.Push;let p=gu(v.location,k,b);c=d()+1;let y=Vh(p,c),w=v.createHref(p);try{l.pushState(y,"",w)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;s.location.assign(w)}i&&u&&u({action:o,location:v.location,delta:1})}function f(k,b){o=sn.Replace;let p=gu(v.location,k,b);c=d();let y=Vh(p,c),w=v.createHref(p);l.replaceState(y,"",w),i&&u&&u({action:o,location:v.location,delta:0})}function x(k){let b=s.location.origin!=="null"?s.location.origin:s.location.href,p=typeof k=="string"?k:Ti(k);return p=p.replace(/ $/,"%20"),oe(b,"No window.location.(origin|href) available to create URL for href: "+p),new URL(p,b)}let v={get action(){return o},get location(){return e(s,l)},listen(k){if(u)throw new Error("A history only accepts one active listener");return s.addEventListener(Fh,h),u=k,()=>{s.removeEventListener(Fh,h),u=null}},createHref(k){return t(s,k)},createURL:x,encodeLocation(k){let b=x(k);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:m,replace:f,go(k){return l.go(k)}};return v}var Oh;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Oh||(Oh={}));function ik(e,t,n){return n===void 0&&(n="/"),lk(e,t,n)}function lk(e,t,n,r){let s=typeof t=="string"?zr(t):t,i=Cr(s.pathname||"/",n);if(i==null)return null;let l=X0(e);ok(l);let o=null,u=yk(i);for(let c=0;o==null&&c{let u={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:l,route:i};u.relativePath.startsWith("/")&&(oe(u.relativePath.startsWith(r),'Absolute route path "'+u.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),u.relativePath=u.relativePath.slice(r.length));let c=gn([r,u.relativePath]),d=n.concat(u);i.children&&i.children.length>0&&(oe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+c+'".')),X0(i.children,t,d,c)),!(i.path==null&&!i.index)&&t.push({path:c,score:pk(c,i.index),routesMeta:d})};return e.forEach((i,l)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))s(i,l);else for(let u of Z0(i.path))s(i,l,u)}),t}function Z0(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let l=Z0(r.join("/")),o=[];return o.push(...l.map(u=>u===""?i:[i,u].join("/"))),s&&o.push(...l),o.map(u=>e.startsWith("/")&&u===""?"/":u)}function ok(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:gk(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const uk=/^:[\w-]+$/,ck=3,dk=2,hk=1,mk=10,fk=-2,Uh=e=>e==="*";function pk(e,t){let n=e.split("/"),r=n.length;return n.some(Uh)&&(r+=fk),t&&(r+=dk),n.filter(s=>!Uh(s)).reduce((s,i)=>s+(uk.test(i)?ck:i===""?hk:mk),r)}function gk(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function xk(e,t,n){let{routesMeta:r}=e,s={},i="/",l=[];for(let o=0;o{let{paramName:m,isOptional:f}=d;if(m==="*"){let v=o[h]||"";l=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const x=o[h];return f&&!x?c[m]=void 0:c[m]=(x||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:l,pattern:e}}function bk(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),$c(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,o,u)=>(r.push({paramName:o,isOptional:u!=null}),u?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function yk(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return $c(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Cr(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}const vk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kk=e=>vk.test(e);function wk(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?zr(e):e,i;if(n)if(kk(n))i=n;else{if(n.includes("//")){let l=n;n=Q0(n),$c(!1,"Pathnames cannot have embedded double slashes - normalizing "+(l+" -> "+n))}n.startsWith("/")?i=Wh(n.substring(1),"/"):i=Wh(n,t)}else i=t;return{pathname:i,search:Sk(r),hash:Ck(s)}}function Wh(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function ql(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function jk(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Gc(e,t){let n=jk(e);return t?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function Kc(e,t,n,r){r===void 0&&(r=!1);let s;typeof e=="string"?s=zr(e):(s=Os({},e),oe(!s.pathname||!s.pathname.includes("?"),ql("?","pathname","search",s)),oe(!s.pathname||!s.pathname.includes("#"),ql("#","pathname","hash",s)),oe(!s.search||!s.search.includes("#"),ql("#","search","hash",s)));let i=e===""||s.pathname==="",l=i?"/":s.pathname,o;if(l==null)o=n;else{let h=t.length-1;if(!r&&l.startsWith("..")){let m=l.split("/");for(;m[0]==="..";)m.shift(),h-=1;s.pathname=m.join("/")}o=h>=0?t[h]:"/"}let u=wk(s,o),c=l&&l!=="/"&&l.endsWith("/"),d=(i||l===".")&&n.endsWith("/");return!u.pathname.endsWith("/")&&(c||d)&&(u.pathname+="/"),u}const Q0=e=>e.replace(/\/\/+/g,"/"),gn=e=>Q0(e.join("/")),Nk=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),Sk=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,Ck=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Pk(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const J0=["post","put","patch","delete"];new Set(J0);const Ek=["get",...J0];new Set(Ek);/** * React Router v6.30.4 * * Copyright (c) Remix Software Inc. * * 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 Us(){return Us=Object.assign?Object.assign.bind():function(e){for(var t=1;t{o.current=!0}),g.useCallback(function(c,d){if(d===void 0&&(d={}),!o.current)return;if(typeof c=="number"){r.go(c);return}let h=Kc(c,JSON.parse(l),i,d.relative==="path");e==null&&t!=="/"&&(h.pathname=h.pathname==="/"?t:gn([t,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[t,r,l,i,e])}const Mk=g.createContext(null);function _k(e){let t=g.useContext(_t).outlet;return t&&g.createElement(Mk.Provider,{value:e},t)}function Gn(){let{matches:e}=g.useContext(_t),t=e[e.length-1];return t?t.params:{}}function ol(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=g.useContext(Kt),{matches:s}=g.useContext(_t),{pathname:i}=dt(),l=JSON.stringify(Gc(s,r.v7_relativeSplatPath));return g.useMemo(()=>Kc(e,JSON.parse(l),i,n==="path"),[e,l,i,n])}function Lk(e,t){return Dk(e,t)}function Dk(e,t,n,r){Ir()||oe(!1);let{navigator:s}=g.useContext(Kt),{matches:i}=g.useContext(_t),l=i[i.length-1],o=l?l.params:{};l&&l.pathname;let u=l?l.pathnameBase:"/";l&&l.route;let c=dt(),d;if(t){var h;let k=typeof t=="string"?zr(t):t;u==="/"||(h=k.pathname)!=null&&h.startsWith(u)||oe(!1),d=k}else d=c;let m=d.pathname||"/",f=m;if(u!=="/"){let k=u.replace(/^\//,"").split("/");f="/"+m.replace(/^\//,"").split("/").slice(k.length).join("/")}let x=ik(e,{pathname:f}),v=Fk(x&&x.map(k=>Object.assign({},k,{params:Object.assign({},o,k.params),pathname:gn([u,s.encodeLocation?s.encodeLocation(k.pathname).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?u:gn([u,s.encodeLocation?s.encodeLocation(k.pathnameBase).pathname:k.pathnameBase])})),i,n,r);return t&&v?g.createElement(ll.Provider,{value:{location:Us({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:sn.Pop}},v):v}function Bk(){let e=Wk(),t=Pk(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},t),n?g.createElement("pre",{style:s},n):null,null)}const zk=g.createElement(Bk,null);class Ik extends g.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?g.createElement(_t.Provider,{value:this.props.routeContext},g.createElement(tg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function Rk(e){let{routeContext:t,match:n,children:r}=e,s=g.useContext(il);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),g.createElement(_t.Provider,{value:t},r)}function Fk(e,t,n,r){var s;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,o=(s=n)==null?void 0:s.errors;if(o!=null){let d=l.findIndex(h=>h.route.id&&(o==null?void 0:o[h.route.id])!==void 0);d>=0||oe(!1),l=l.slice(0,Math.min(l.length,d+1))}let u=!1,c=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?l=l.slice(0,c+1):l=[l[0]];break}}}return l.reduceRight((d,h,m)=>{let f,x=!1,v=null,k=null;n&&(f=o&&h.route.id?o[h.route.id]:void 0,v=h.route.errorElement||zk,u&&(c<0&&m===0?($k("route-fallback"),x=!0,k=null):c===m&&(x=!0,k=h.route.hydrateFallbackElement||null)));let b=t.concat(l.slice(0,m+1)),p=()=>{let y;return f?y=v:x?y=k:h.route.Component?y=g.createElement(h.route.Component,null):h.route.element?y=h.route.element:y=d,g.createElement(Rk,{match:h,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:y})};return n&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?g.createElement(Ik,{location:n.location,revalidation:n.revalidation,component:v,error:f,children:p(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):p()},null)}var rg=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(rg||{}),sg=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(sg||{});function Vk(e){let t=g.useContext(il);return t||oe(!1),t}function Ok(e){let t=g.useContext(eg);return t||oe(!1),t}function Uk(e){let t=g.useContext(_t);return t||oe(!1),t}function ag(e){let t=Uk(),n=t.matches[t.matches.length-1];return n.route.id||oe(!1),n.route.id}function Wk(){var e;let t=g.useContext(tg),n=Ok(),r=ag();return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function Hk(){let{router:e}=Vk(rg.UseNavigateStable),t=ag(sg.UseNavigateStable),n=g.useRef(!1);return ng(()=>{n.current=!0}),g.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?e.navigate(s):e.navigate(s,Us({fromRouteId:t},i)))},[e,t])}const Hh={};function $k(e,t,n){Hh[e]||(Hh[e]=!0)}function Gk(e,t){e==null||e.v7_startTransition,e==null||e.v7_relativeSplatPath}function Ws(e){let{to:t,replace:n,state:r,relative:s}=e;Ir()||oe(!1);let{future:i,static:l}=g.useContext(Kt),{matches:o}=g.useContext(_t),{pathname:u}=dt(),c=ea(),d=Kc(t,Gc(o,i.v7_relativeSplatPath),u,s==="path"),h=JSON.stringify(d);return g.useEffect(()=>c(JSON.parse(h),{replace:n,state:r,relative:s}),[c,h,s,n,r]),null}function ul(e){return _k(e.context)}function H(e){oe(!1)}function Kk(e){let{basename:t="/",children:n=null,location:r,navigationType:s=sn.Pop,navigator:i,static:l=!1,future:o}=e;Ir()&&oe(!1);let u=t.replace(/^\/*/,"/"),c=g.useMemo(()=>({basename:u,navigator:i,static:l,future:Us({v7_relativeSplatPath:!1},o)}),[u,o,i,l]);typeof r=="string"&&(r=zr(r));let{pathname:d="/",search:h="",hash:m="",state:f=null,key:x="default"}=r,v=g.useMemo(()=>{let k=Cr(d,u);return k==null?null:{location:{pathname:k,search:h,hash:m,state:f,key:x},navigationType:s}},[u,d,h,m,f,x,s]);return v==null?null:g.createElement(Kt.Provider,{value:c},g.createElement(ll.Provider,{children:n,value:v}))}function qk(e){let{children:t,location:n}=e;return Lk(bu(t),n)}new Promise(()=>{});function bu(e,t){t===void 0&&(t=[]);let n=[];return g.Children.forEach(e,(r,s)=>{if(!g.isValidElement(r))return;let i=[...t,s];if(r.type===g.Fragment){n.push.apply(n,bu(r.props.children,i));return}r.type!==H&&oe(!1),!r.props.index||!r.props.children||oe(!1);let l={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(l.children=bu(r.props.children,i)),n.push(l)}),n}/** * React Router DOM v6.30.4 * * Copyright (c) Remix Software Inc. * * 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 Ai(){return Ai=Object.assign?Object.assign.bind():function(e){for(var t=1;t{let r=e[n];return t.concat(Array.isArray(r)?r.map(s=>[n,s]):[[n,r]])},[]))}function Zk(e,t){let n=yu(e);return t&&t.forEach((r,s)=>{n.has(s)||t.getAll(s).forEach(i=>{n.append(s,i)})}),n}const Qk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Jk=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],ew="6";try{window.__reactRouterVersion=ew}catch{}const tw=g.createContext({isTransitioning:!1}),nw="startTransition",$h=Db[nw];function rw(e){let{basename:t,children:n,future:r,window:s}=e,i=g.useRef();i.current==null&&(i.current=rk({window:s,v5Compat:!0}));let l=i.current,[o,u]=g.useState({action:l.action,location:l.location}),{v7_startTransition:c}=r||{},d=g.useCallback(h=>{c&&$h?$h(()=>u(h)):u(h)},[u,c]);return g.useLayoutEffect(()=>l.listen(d),[l,d]),g.useEffect(()=>Gk(r),[r]),g.createElement(Kk,{basename:t,children:n,location:o.location,navigationType:o.action,navigator:l,future:r})}const sw=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",aw=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,U=g.forwardRef(function(t,n){let{onClick:r,relative:s,reloadDocument:i,replace:l,state:o,target:u,to:c,preventScrollReset:d,viewTransition:h}=t,m=ig(t,Qk),{basename:f}=g.useContext(Kt),x,v=!1;if(typeof c=="string"&&aw.test(c)&&(x=c,sw))try{let y=new URL(window.location.href),w=c.startsWith("//")?new URL(y.protocol+c):new URL(c),j=Cr(w.pathname,f);w.origin===y.origin&&j!=null?c=j+w.search+w.hash:v=!0}catch{}let k=Tk(c,{relative:s}),b=lw(c,{replace:l,state:o,target:u,preventScrollReset:d,relative:s,viewTransition:h});function p(y){r&&r(y),y.defaultPrevented||b(y)}return g.createElement("a",Ai({},m,{href:x||k,onClick:v||i?r:p,ref:n,target:u}))}),lg=g.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:l=!1,style:o,to:u,viewTransition:c,children:d}=t,h=ig(t,Jk),m=ol(u,{relative:h.relative}),f=dt(),x=g.useContext(eg),{navigator:v,basename:k}=g.useContext(Kt),b=x!=null&&uw(m)&&c===!0,p=v.encodeLocation?v.encodeLocation(m).pathname:m.pathname,y=f.pathname,w=x&&x.navigation&&x.navigation.location?x.navigation.location.pathname:null;s||(y=y.toLowerCase(),w=w?w.toLowerCase():null,p=p.toLowerCase()),w&&k&&(w=Cr(w,k)||w);const j=p!=="/"&&p.endsWith("/")?p.length-1:p.length;let C=y===p||!l&&y.startsWith(p)&&y.charAt(j)==="/",S=w!=null&&(w===p||!l&&w.startsWith(p)&&w.charAt(p.length)==="/"),P={isActive:C,isPending:S,isTransitioning:b},T=C?r:void 0,N;typeof i=="function"?N=i(P):N=[i,C?"active":null,S?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let E=typeof o=="function"?o(P):o;return g.createElement(U,Ai({},h,{"aria-current":T,className:N,ref:n,style:E,to:u,viewTransition:c}),typeof d=="function"?d(P):d)});var vu;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(vu||(vu={}));var Gh;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Gh||(Gh={}));function iw(e){let t=g.useContext(il);return t||oe(!1),t}function lw(e,t){let{target:n,replace:r,state:s,preventScrollReset:i,relative:l,viewTransition:o}=t===void 0?{}:t,u=ea(),c=dt(),d=ol(e,{relative:l});return g.useCallback(h=>{if(Xk(h,n)){h.preventDefault();let m=r!==void 0?r:Ti(c)===Ti(d);u(e,{replace:m,state:s,preventScrollReset:i,relative:l,viewTransition:o})}},[c,u,d,r,s,n,e,i,l,o])}function ow(e){let t=g.useRef(yu(e)),n=g.useRef(!1),r=dt(),s=g.useMemo(()=>Zk(r.search,n.current?null:t.current),[r.search]),i=ea(),l=g.useCallback((o,u)=>{const c=yu(typeof o=="function"?o(s):o);n.current=!0,i("?"+c,u)},[i,s]);return[s,l]}function uw(e,t){t===void 0&&(t={});let n=g.useContext(tw);n==null&&oe(!1);let{basename:r}=iw(vu.useViewTransitionState),s=ol(e,{relative:t.relative});if(!n.isTransitioning)return!1;let i=Cr(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=Cr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xu(s.pathname,l)!=null||xu(s.pathname,i)!=null}function cw(){const{pathname:e}=dt();return g.useEffect(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},[e]),null}const dw='a, button, [role="button"], label, select, summary, [data-cursor="hover"], .cursor-pointer',hw='input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="submit"]):not([type="button"]):not([type="file"]), textarea, [contenteditable="true"]';function mw(){const e=g.useRef(null),t=g.useRef(null),n=g.useRef(null),r=g.useRef(null),s=g.useRef(null);return g.useEffect(()=>{const i=window.matchMedia("(pointer: fine)"),l=window.matchMedia("(prefers-reduced-motion: reduce)");if(!i.matches||l.matches)return;const o=e.current,u=t.current,c=n.current,d=r.current,h=s.current;if(!o||!u||!c||!d||!h)return;document.documentElement.classList.add("hifi-cursor-on");const m=-24*Math.PI/180,f=Math.cos(m),x=Math.sin(m);let v=-100,k=-100,b=0,p=2.4,y=2.4,w=16,j=6.5,C=16,S=6.5,P=!1,T,N=performance.now();const E=_=>{const D=Math.min((_-N)/1e3,.05);N=_,p+=(y-p)*Math.min(1,D*8),w+=(C-w)*Math.min(1,D*10),j+=(S-j)*Math.min(1,D*10),b+=p*D,u.style.transform=`translate3d(${v}px, ${k}px, 0)`,c.style.transform=`translate3d(${v}px, ${k}px, 0)`;const z=Math.cos(b)*w,O=Math.sin(b)*j;d.style.transform=`translate(${z*f-O*x}px, ${z*x+O*f}px)`,T=requestAnimationFrame(E)},B=_=>{o.dataset.state=_;const D=_==="hover";y=D?7:2.4,C=D?23:16,S=D?9.5:6.5},V=_=>{v=_.clientX,k=_.clientY,P||(P=!0,o.dataset.hidden="false")},$=_=>{const D=_.target;D instanceof Element&&(D.closest(hw)?B("text"):D.closest(dw)?B("hover"):B("default"))},Q=()=>{o.dataset.down="true",h.style.left=`${v}px`,h.style.top=`${k}px`,h.classList.remove("is-live"),h.offsetWidth,h.classList.add("is-live")},R=()=>{o.dataset.down="false"},K=()=>{P=!1,o.dataset.hidden="true"};return document.addEventListener("mousemove",V,{passive:!0}),document.addEventListener("mouseover",$,{passive:!0}),document.addEventListener("mousedown",Q,{passive:!0}),document.addEventListener("mouseup",R,{passive:!0}),document.documentElement.addEventListener("mouseleave",K),window.addEventListener("blur",K),T=requestAnimationFrame(E),()=>{cancelAnimationFrame(T),document.removeEventListener("mousemove",V),document.removeEventListener("mouseover",$),document.removeEventListener("mousedown",Q),document.removeEventListener("mouseup",R),document.documentElement.removeEventListener("mouseleave",K),window.removeEventListener("blur",K),document.documentElement.classList.remove("hifi-cursor-on")}},[]),a.jsxs("div",{ref:e,className:"hifi-cursor","data-state":"default","data-hidden":"true","data-down":"false","aria-hidden":"true",children:[a.jsxs("div",{ref:n,className:"hifi-cursor__orbit",children:[a.jsx("div",{className:"hifi-cursor__ring"}),a.jsx("div",{ref:r,className:"hifi-cursor__sat"})]}),a.jsx("div",{ref:t,className:"hifi-cursor__core"}),a.jsx("div",{ref:s,className:"hifi-cursor__pulse"})]})}const og=`${"/".replace(/\/$/,"")}/api`;async function Jr(e,t={}){const n=await fetch(`${og}${e}`,{credentials:"include",headers:t.body instanceof FormData?{}:{"Content-Type":"application/json"},...t}),r=await n.text();let s=null;if(r)try{s=JSON.parse(r)}catch{}if(!n.ok)throw new Error((s==null?void 0:s.error)||`Fehler ${n.status}`);if(s===null&&r)throw new Error("Unerwartete Server-Antwort (kein gültiges JSON)");return s}const M={get:e=>Jr(e),post:(e,t)=>Jr(e,{method:"POST",body:t instanceof FormData?t:JSON.stringify(t)}),put:(e,t)=>Jr(e,{method:"PUT",body:JSON.stringify(t)}),patch:(e,t)=>Jr(e,{method:"PATCH",body:JSON.stringify(t)}),delete:e=>Jr(e,{method:"DELETE"})};function fw({children:e}){const[t,n]=g.useState({pathname:null,needsSetup:null}),r=dt();return g.useEffect(()=>{let s=!1;return M.get("/setup/status").then(i=>{s||n({pathname:r.pathname,needsSetup:i.needs_setup})}).catch(()=>{s||n({pathname:r.pathname,needsSetup:!1})}),()=>{s=!0}},[r.pathname]),t.pathname!==r.pathname||t.needsSetup===null?a.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"}):t.needsSetup&&r.pathname!=="/setup"?a.jsx(Ws,{to:"/setup",replace:!0}):!t.needsSetup&&r.pathname==="/setup"?a.jsx(Ws,{to:"/",replace:!0}):e}const ug=g.createContext(null);function pw(){const e=new Date,t=e.getHours()+e.getMinutes()/60;return t>=6.5&&t<21?"light":"dark"}function gw({children:e}){const[t,n]=g.useState(()=>{const s=localStorage.getItem("hifi-theme");return s==="light"||s==="dark"?s:pw()});g.useEffect(()=>{document.documentElement.classList.toggle("dark",t==="dark"),localStorage.setItem("hifi-theme",t)},[t]);const r=()=>n(s=>s==="dark"?"light":"dark");return a.jsx(ug.Provider,{value:{theme:t,toggleTheme:r},children:e})}function xw(){return g.useContext(ug)}const bw={nav:{openMenu:"Menü öffnen",closeMenu:"Menü schließen",close:"Schließen",adminPanel:"Zum Admin-Panel",vehicles:"Fahrzeuge",services:"Leistungen",gallery:"Galerie",contact:"Kontakt",whatsapp:"WhatsApp",shop:"Zum Shop"},themeToggle:{label:"Theme umschalten"},languageToggle:{label:"Sprache auswählen"},footer:{routePlan:"Route planen",contactHeading:"Kontakt",contactForm:"Kontaktformular",hoursHeading:"Öffnungszeiten",open:"Geöffnet",closed:"Geschlossen",days:{monFri:"Montag – Freitag",sat:"Samstag",sun:"Sonntag"},copyright:e=>`© ${e} HifiPlanet. Alle Angaben ohne Gewähr.`,imprint:"Impressum",privacy:"Datenschutz",terms:"AGB",cookieSettings:"Cookie-Einstellungen"},cookieConsent:{bannerText:"Wir verwenden nur technisch notwendige Cookies. Für Google Maps, YouTube-Videos und Statistik-Cookies benötigen wir zusätzlich deine Zustimmung, da dabei Daten an Google übertragen werden.",moreInfo:"Mehr dazu in unserer",privacyPolicy:"Datenschutzerklärung",settings:"Einstellungen",onlyNecessary:"Nur notwendige",acceptAll:"Alle akzeptieren",modalTitle:"Cookie-Einstellungen",modalIntro:"Lege fest, welche Kategorien du zulassen möchtest. Mehr dazu in unserer",necessaryTitle:"Notwendig",necessaryDesc:"Für den Betrieb der Website erforderlich (z. B. Login-Session, Theme- und Cookie-Einstellung). Kann nicht deaktiviert werden.",externalTitle:"Externe Medien",externalDesc:"Google Maps und YouTube-Videos. Beim Laden werden Daten (u. a. deine IP-Adresse) an Google übertragen.",analyticsTitle:"Statistik",analyticsDesc:"Google Analytics hilft uns zu verstehen, wie die Website genutzt wird. Dabei werden Daten an Google übertragen.",cancel:"Abbrechen",saveSelection:"Auswahl speichern"},maintenance:{title:"Wartungsarbeiten",defaultMessage:"Dieser Bereich wird gerade aktualisiert. Bitte schau in Kürze wieder vorbei."},lightbox:{close:"Schließen",previous:"Vorheriges Bild",next:"Nächstes Bild"},home:{metaTitle:"Car-Hifi Umbauten nach Maß",metaDescription:"HifiPlanet – dein Car-Hifi Spezialist in Amorbach. Marke und Modell wählen, passende Sound-Pakete entdecken und unverbindlich anfragen.",stickyCta:"Bereit für deinen Sound-Umbau?",selectVehicle:"Fahrzeug auswählen",getInTouch:"Kontakt aufnehmen",welcome:"Willkommen bei HifiPlanet",heroTitle:"Home of pure Sound",heroSubtitle:"Dein Car-Hifi Spezialist für individuelle Sound-Umbauten. Wähle dein Fahrzeug, entdecke passende Pakete und frag unverbindlich an – wir kümmern uns um den Rest.",stats:[{value:"20+",label:"Jahre Erfahrung"},{value:"Riesige",label:"3D-Druckfarm im eigenen Haus"},{value:"Eigene",label:"CNC- & Laserwerkstatt"},{value:"International",label:"anerkannter Car-Hifi-Spezialist"}],brandsHeading:"Marken, mit denen wir arbeiten",youtubeBadge:"HifiPlanet präsentiert",youtubeTitle:"Das Handwerk hinter deinem Sound",youtubeText:"Entdecke die Handwerkskunst hinter unserer Arbeit",youtubeCta:"Jetzt ansehen",heroImageAlt:"Ground Zero Subwoofer und Endstufen mit violetter Ambiente-Beleuchtung",craftImageAlt:"Individueller Subwoofer-Bau",adviceImageAlt:"Endstufen-Einbau mit Ambiente-Beleuchtung",moreImageAlt:"Hochwertige Endstufe und Subwoofer, Studioaufnahme",craftEyebrow:"Handwerk",craftTitle:"Präzisionsarbeit in jedem Detail",craftText:"Ob eigens gefertigte Subwoofer-Gehäuse, integrierte Beleuchtung oder unsichtbar verlegte Kabelwege – dank eigener CNC-, Laser- und 3D-Druck-Fertigung entstehen bei uns Lösungen, die es von der Stange nicht gibt.",adviceEyebrow:"Beratung",adviceTitle:"Von der ersten Idee bis zum letzten Schliff",adviceText:"Jedes Fahrzeug und jeder Anspruch ist anders. Deshalb beraten wir dich persönlich und unverbindlich – vom dezenten Upgrade bis zum kompromisslosen High-End-System.",insightsTitle:"Einblicke in unsere Umbauten",insightsText:"Vom unauffälligen Sound-Upgrade bis zum aufwendigen Komplettumbau – Handarbeit aus unserer Werkstatt in Amorbach.",galleryAlts:["Individueller Subwoofer-Bau mit Ground Zero Bässen","Endstufen-Einbau mit violetter Ambiente-Beleuchtung","Hochtöner- und Mitteltöner-Einbau von Focal Utopia","Sony Navigationssystem mit Apple CarPlay im Cockpit","Verbauter Hochtöner im Kofferraum","Individueller Subwoofer-Einbau mit LED-Beleuchtung im Kofferraum"],reviewsRating:"5,0 von 181 Kunden bewertet",reviewsText:"Das sagen unsere Kunden über uns.",reviewsLink:"Alle Bewertungen auf Google ansehen →",testimonials:[{name:"Thomas K.",text:"Über YouTube auf dieses Klang-Juwel gestoßen. Beratung und Empfehlungen sind erstklassig – der Tesla-Vorführwagen hat meine Leidenschaft für guten Sound neu entfacht."},{name:"Andreas I.",text:"Sehr professionelle Beratung und Service. Obwohl ich von VAG zu Mercedes gewechselt bin, wurde alles reibungslos angepasst. Die 3-Wege-Lautsprecher und zwei Subwoofer liefern außergewöhnliche Leistung."},{name:"Thomas F.",text:"Kompletter Audi A4 B9 Umbau hat meine Erwartungen übertroffen. Von Anfang bis Ende professionell, mit tadelloser Verarbeitung und Klangqualität."},{name:"Drago G.",text:"Beeindruckt von der CNC-Arbeit, die auf YouTube gezeigt wird. Angefangen mit 3D-gedruckten Lautsprecherringen für meinen Ford Mustang – daraus wurde ein viel größeres Projekt."},{name:"Leonardo B.",text:"Toller Service und meisterhafte Handwerkskunst. Saubere Installation, Leidenschaft in jedem Detail erkennbar."},{name:"Marcel S.",text:"Unschlagbares Preis-Leistungs-Verhältnis. Das Team hat sich viel Zeit genommen, um genau die Lösung für mein Budget zu finden."},{name:"Julia W.",text:"Endlich ein Betrieb, der auch Wohnmobile ernst nimmt. Die Soundanlage in unserem Camper klingt jetzt wie im Wohnzimmer."},{name:"Kevin R.",text:"Dashcam und Alarmanlage in einem Termin sauber verbaut, keine sichtbaren Kabel. Absolute Empfehlung für alle, die Wert auf Verarbeitung legen."},{name:"Sabrina H.",text:"Mein Oldtimer hat jetzt modernen Sound, ohne dass es dem Original-Look geschadet hätte. Genau das habe ich gesucht."},{name:"Niklas P.",text:"Von der ersten Anfrage bis zum fertigen Umbau lief alles reibungslos. Ehrliche Beratung ohne Verkaufsdruck."}],moreTitle:"Mehr als nur Car-Hifi",moreText:"Neben individuellen Sound-Umbauten bieten wir CNC-Zerspanung, Lasertechnik, 3D-Druck und mehr – alles aus einer Hand in unserer eigenen Werkstatt.",moreCta:"Alle Leistungen entdecken",faqHeading:"Häufig gestellte Fragen"},vehicleSelect:{metaTitle:"Fahrzeug auswählen",metaDescription:"Wähle deine Fahrzeugmarke und dein Modell und entdecke passende Car-Hifi Sound-Pakete von HifiPlanet.",title:"Fahrzeug auswählen",intro:"Wähle zuerst deine Marke, dann dein Modell – wir zeigen dir direkt die passenden Sound-Pakete.",empty:"Es sind noch keine Marken hinterlegt."},brandPage:{metaTitleFallback:"Modell auswählen",metaDescription:e=>`Wähle dein ${e} Modell und entdecke passende Car-Hifi Sound-Pakete von HifiPlanet.`,loading:"Lädt…",breadcrumbVehicles:"Fahrzeuge",titleSuffix:"Modell wählen",empty:"Für diese Marke sind noch keine Modelle hinterlegt."},modelPage:{metaTitleFallback:"Sound-Pakete",metaTitle:(e,t)=>`${e} ${t} Sound-Pakete`,metaDescription:(e,t)=>`Car-Hifi Sound-Pakete für ${e} ${t} inkl. aktueller Preise – von HifiPlanet unverbindlich anfragen.`,loading:"Lädt…",breadcrumbVehicles:"Fahrzeuge",titleSuffix:"Sound-Pakete",empty:"Für dieses Modell sind noch keine Pakete hinterlegt.",totalPrice:"ab ca.",productLoading:"Produkt wird geladen…",requestContact:"Kontakt anfragen",featuredBadge:"Empfohlen",moreBullets:e=>e===1?"+ 1 weitere Leistung":`+ ${e} weitere Leistungen`,lessBullets:"Weniger anzeigen",wheelHint:"Mit dem Mausrad blättern"},leistungen:{metaTitle:"Leistungen",metaDescription:"Car-Hifi, Wohnmobil & Caravan, Oldtimer, CNC-Zerspanung, Lasertechnik, 3D-Druck, Alarmanlagen und Dash Cams – alles aus einer Hand bei HifiPlanet in Amorbach.",title:"Unsere Leistungen",intro:"Von individuellen Sound-Umbauten bis zur eigenen CNC- und 3D-Druck-Fertigung – alles aus einer Hand in unserer Werkstatt in Amorbach.",notListedTitle:"Dein Projekt ist nicht dabei?",notListedText:"Sprich uns einfach an – wir finden gemeinsam die passende Lösung.",contact:"Kontakt aufnehmen"},contactPage:{metaTitle:"Kontakt",metaDescription:"Kontaktiere HifiPlanet in Amorbach für dein individuelles Car-Hifi Projekt – wir beraten dich gerne unverbindlich.",title:"Kontakt aufnehmen",heroEyebrow:"Kontakt",heroTitlePre:"Sprich",heroTitleAccent:"mit",heroTitlePost:"uns.",heroSubtitle:"Ob Anlage, Einbau oder Klang-Tuning für dein Fahrzeug — schreib uns, wir melden uns schnellstmöglich zurück.",packageBoxTitle:"Deine Anfrage bezieht sich auf",formTitle:"Anfrage senden",sentTitle:"Anfrage gesendet ✓",sentText:"Danke! Wir melden uns innerhalb eines Werktags bei dir.",contextIntro:"Deine Anfrage bezieht sich auf:",contextBrand:"Marke",contextModel:"Modell",contextPackage:"Paket",contextProduct:"Produkt",packagePrice:"Paketpreis",upgrades:"Upgrades",optionalUpgrades:"Optionale Upgrades",totalWithUpgrades:"Gesamt inkl. Upgrades",nameLabel:"Name *",namePlaceholder:"Max Mustermann",emailLabel:"E-Mail *",emailPlaceholder:"max@mail.de",phoneLabel:"Telefon",phonePlaceholder:"Optional",vinLabel:"Fahrgestellnummer (FIN)",vinPlaceholder:"Optional – hilft bei der Einschätzung",messageLabel:"Nachricht",messagePlaceholder:"Erzähl uns von deinem Projekt – Fahrzeug, Wunschklang, Budget …",requiredHint:"* Pflichtfelder",sending:"Wird gesendet…",submit:"Anfrage senden",cardTitle:"HiFi Planet Amorbach",address:"Adresse",phone:"Telefon",email:"E-Mail",hours:"Öffnungszeiten",hoursWeek:"Mo–Fr: 9:00–18:00 Uhr",hoursSat:"Sa: 10:00–13:00 Uhr",hoursWeekDays:"Mo–Fr",hoursWeekTime:"9:00 – 18:00 Uhr",hoursSatDay:"Sa",hoursSatTime:"10:00 – 13:00 Uhr",directionsTitle:"Anfahrt",mapEmbedName:"Die Google-Maps-Karte",mapOpenChip:"In Maps öffnen",routePlan:"Route planen",featurePremiumTitle:"Premium Klang",featurePremiumSub:"Höchste Qualität",featureGermanyTitle:"Made in Germany",featureGermanySub:"Präzise Handarbeit",featureIndividualTitle:"Individuell",featureIndividualSub:"Maßgeschneiderte Lösungen",featureExpertsTitle:"Experten Team",featureExpertsSub:"Leidenschaft & Know-how"},galleryOverview:{metaTitle:"Bildergalerie",metaDescription:"Einblicke in unsere Car-Hifi Umbauten – nach Marke sortiert. Wähle eine Marke und entdecke die Projekte.",title:"Bildergalerie",intro:"Wähle eine Marke und entdecke unsere Umbauten im Detail.",loading:"Lädt…",empty:"Es sind noch keine Galerie-Marken hinterlegt."},galleryBrandPage:{metaTitleFallback:"Bildergalerie",metaTitle:e=>`${e} Umbauten`,metaDescription:e=>`Einblicke in unsere ${e} Car-Hifi Umbauten.`,loading:"Lädt…",breadcrumbGallery:"Galerie",titleSuffix:"Projekt wählen",empty:"Für diese Marke sind noch keine Projekte hinterlegt."},galleryProjectPage:{metaTitleFallback:"Bildergalerie",metaDescription:e=>`Fotos unseres ${e} Umbaus.`,loading:"Lädt…",breadcrumbGallery:"Galerie",empty:"Für dieses Projekt sind noch keine Fotos hinterlegt.",enlargeImage:"Bild vergrößern"}},yw={nav:{openMenu:"Open menu",closeMenu:"Close menu",close:"Close",adminPanel:"Go to admin panel",vehicles:"Vehicles",services:"Services",gallery:"Gallery",contact:"Contact",whatsapp:"WhatsApp",shop:"Visit shop"},themeToggle:{label:"Toggle theme"},languageToggle:{label:"Select language"},footer:{routePlan:"Get directions",contactHeading:"Contact",contactForm:"Contact form",hoursHeading:"Opening hours",open:"Open",closed:"Closed",days:{monFri:"Monday – Friday",sat:"Saturday",sun:"Sunday"},copyright:e=>`© ${e} HifiPlanet. All information without guarantee.`,imprint:"Legal notice",privacy:"Privacy",terms:"Terms",cookieSettings:"Cookie settings"},cookieConsent:{bannerText:"We only use technically necessary cookies. For Google Maps, YouTube videos and analytics cookies we need your additional consent, since data is transferred to Google in that case.",moreInfo:"More details in our",privacyPolicy:"privacy policy",settings:"Settings",onlyNecessary:"Necessary only",acceptAll:"Accept all",modalTitle:"Cookie settings",modalIntro:"Choose which categories you want to allow. More details in our",necessaryTitle:"Necessary",necessaryDesc:"Required to operate the website (e.g. login session, theme and cookie preference). Cannot be disabled.",externalTitle:"External media",externalDesc:"Google Maps and YouTube videos. Loading them transfers data (including your IP address) to Google.",analyticsTitle:"Analytics",analyticsDesc:"Google Analytics helps us understand how the website is used. This transfers data to Google.",cancel:"Cancel",saveSelection:"Save selection"},maintenance:{title:"Under maintenance",defaultMessage:"This area is currently being updated. Please check back shortly."},lightbox:{close:"Close",previous:"Previous image",next:"Next image"},home:{metaTitle:"Custom Car-Hifi Installations",metaDescription:"HifiPlanet – your car-hifi specialist in Amorbach, Germany. Choose your make and model, discover matching sound packages and get in touch, no obligation.",stickyCta:"Ready for your sound upgrade?",selectVehicle:"Select vehicle",getInTouch:"Get in touch",welcome:"Welcome to HifiPlanet",heroTitle:"Home of pure Sound",heroSubtitle:"Your car-hifi specialist for custom sound installations. Choose your vehicle, discover the right package and get in touch, no obligation – we take care of the rest.",stats:[{value:"20+",label:"years of experience"},{value:"Huge",label:"in-house 3D print farm"},{value:"In-house",label:"CNC & laser workshop"},{value:"International",label:"recognized car-hifi specialist"}],brandsHeading:"Brands we work with",youtubeBadge:"HifiPlanet presents",youtubeTitle:"The craft behind your sound",youtubeText:"Discover the artistry behind our work",youtubeCta:"Watch now",heroImageAlt:"Ground Zero subwoofer and amplifiers with purple ambient lighting",craftImageAlt:"Custom subwoofer build",adviceImageAlt:"Amplifier installation with ambient lighting",moreImageAlt:"High-end amplifier and subwoofer, studio shot",craftEyebrow:"Craftsmanship",craftTitle:"Precision work in every detail",craftText:"Whether custom-built subwoofer enclosures, integrated lighting or invisibly routed cabling – our own CNC, laser and 3D-printing production means we can build solutions you simply can't buy off the shelf.",adviceEyebrow:"Consultation",adviceTitle:"From the first idea to the final touch",adviceText:"Every vehicle and every requirement is different. That's why we advise you personally and without obligation – from a subtle upgrade to an uncompromising high-end system.",insightsTitle:"A look at our installations",insightsText:"From subtle sound upgrades to elaborate full installations – handcrafted in our workshop in Amorbach.",galleryAlts:["Custom subwoofer build with Ground Zero bass drivers","Amplifier installation with purple ambient lighting","Tweeter and midrange installation by Focal Utopia","Sony navigation system with Apple CarPlay in the cockpit","Installed tweeter in the trunk","Custom subwoofer installation with LED lighting in the trunk"],reviewsRating:"Rated 5.0 by 181 customers",reviewsText:"Here's what our customers say about us.",reviewsLink:"See all reviews on Google →",testimonials:[{name:"Thomas K.",text:"Found this gem through YouTube. Advice and recommendations are top-notch – the Tesla demo car reignited my passion for great sound."},{name:"Andreas I.",text:"Very professional advice and service. Even though I switched from VAG to Mercedes, everything was adapted smoothly. The 3-way speakers and two subwoofers deliver outstanding performance."},{name:"Thomas F.",text:"The complete Audi A4 B9 build exceeded my expectations. Professional from start to finish, with flawless workmanship and sound quality."},{name:"Drago G.",text:"Impressed by the CNC work shown on YouTube. Started with 3D-printed speaker rings for my Ford Mustang – it turned into a much bigger project."},{name:"Leonardo B.",text:"Great service and masterful craftsmanship. Clean installation, passion visible in every detail."},{name:"Marcel S.",text:"Unbeatable value for money. The team took a lot of time to find the exact solution for my budget."},{name:"Julia W.",text:"Finally a shop that takes motorhomes seriously too. The sound system in our camper now sounds like a living room."},{name:"Kevin R.",text:"Dash cam and alarm system installed cleanly in a single appointment, no visible cables. Highly recommended for anyone who values quality workmanship."},{name:"Sabrina H.",text:"My classic car now has modern sound without compromising the original look. Exactly what I was looking for."},{name:"Niklas P.",text:"From the first inquiry to the finished build, everything went smoothly. Honest advice with no sales pressure."}],moreTitle:"More than just car-hifi",moreText:"Besides custom sound installations, we also offer CNC machining, laser technology, 3D printing and more – all from a single source in our own workshop.",moreCta:"Discover all our services",faqHeading:"Frequently asked questions"},vehicleSelect:{metaTitle:"Select your vehicle",metaDescription:"Choose your vehicle make and model and discover matching car-hifi sound packages from HifiPlanet.",title:"Select your vehicle",intro:"Choose your make first, then your model – we'll show you the matching sound packages right away.",empty:"No brands have been added yet."},brandPage:{metaTitleFallback:"Select a model",metaDescription:e=>`Choose your ${e} model and discover matching car-hifi sound packages from HifiPlanet.`,loading:"Loading…",breadcrumbVehicles:"Vehicles",titleSuffix:"Select a model",empty:"No models have been added for this brand yet."},modelPage:{metaTitleFallback:"Sound packages",metaTitle:(e,t)=>`${e} ${t} sound packages`,metaDescription:(e,t)=>`Car-hifi sound packages for the ${e} ${t} including current prices – get in touch with HifiPlanet, no obligation.`,loading:"Loading…",breadcrumbVehicles:"Vehicles",titleSuffix:"Sound packages",empty:"No packages have been added for this model yet.",totalPrice:"from approx.",productLoading:"Loading product…",requestContact:"Request contact",featuredBadge:"Recommended",moreBullets:e=>e===1?"+ 1 more feature":`+ ${e} more features`,lessBullets:"Show less",wheelHint:"Scroll to browse"},leistungen:{metaTitle:"Services",metaDescription:"Car-hifi, motorhomes & caravans, classic cars, CNC machining, laser technology, 3D printing, alarm systems and dash cams – all from a single source at HifiPlanet in Amorbach.",title:"Our services",intro:"From custom sound installations to our own CNC and 3D-printing production – all from a single source in our workshop in Amorbach.",notListedTitle:"Don't see your project?",notListedText:"Just get in touch – we'll find the right solution together.",contact:"Get in touch"},contactPage:{metaTitle:"Contact",metaDescription:"Get in touch with HifiPlanet in Amorbach for your custom car-hifi project – we're happy to advise you, no obligation.",title:"Get in touch",heroEyebrow:"Contact",heroTitlePre:"Talk",heroTitleAccent:"to",heroTitlePost:"us.",heroSubtitle:"Whether it's a system, installation, or sound tuning for your car — write to us, we'll get back to you as soon as possible.",packageBoxTitle:"Your inquiry relates to",formTitle:"Send inquiry",sentTitle:"Inquiry sent ✓",sentText:"Thanks! We'll get back to you within one business day.",contextIntro:"Your inquiry relates to:",contextBrand:"Brand",contextModel:"Model",contextPackage:"Package",contextProduct:"Product",packagePrice:"Package price",upgrades:"Upgrades",optionalUpgrades:"Optional upgrades",totalWithUpgrades:"Total incl. upgrades",nameLabel:"Name *",namePlaceholder:"Max Mustermann",emailLabel:"Email *",emailPlaceholder:"max@mail.de",phoneLabel:"Phone",phonePlaceholder:"Optional",vinLabel:"Vehicle identification number (VIN)",vinPlaceholder:"Optional – helps us assess your vehicle",messageLabel:"Message",messagePlaceholder:"Tell us about your project – vehicle, desired sound, budget …",requiredHint:"* Required fields",sending:"Sending…",submit:"Send inquiry",cardTitle:"HiFi Planet Amorbach",address:"Address",phone:"Phone",email:"Email",hours:"Opening hours",hoursWeek:"Mon–Fri: 9:00 AM–6:00 PM",hoursSat:"Sat: 10:00 AM–1:00 PM",hoursWeekDays:"Mon–Fri",hoursWeekTime:"9:00 AM – 6:00 PM",hoursSatDay:"Sat",hoursSatTime:"10:00 AM – 1:00 PM",directionsTitle:"Directions",mapEmbedName:"The Google Maps map",mapOpenChip:"Open in Maps",routePlan:"Get directions",featurePremiumTitle:"Premium Sound",featurePremiumSub:"Highest quality",featureGermanyTitle:"Made in Germany",featureGermanySub:"Precision craftsmanship",featureIndividualTitle:"Custom-built",featureIndividualSub:"Tailored solutions",featureExpertsTitle:"Expert Team",featureExpertsSub:"Passion & know-how"},galleryOverview:{metaTitle:"Photo gallery",metaDescription:"A look at our car-hifi installations – sorted by brand. Choose a brand and explore the projects.",title:"Photo gallery",intro:"Choose a brand and explore our installations in detail.",loading:"Loading…",empty:"No gallery brands have been added yet."},galleryBrandPage:{metaTitleFallback:"Photo gallery",metaTitle:e=>`${e} installations`,metaDescription:e=>`A look at our ${e} car-hifi installations.`,loading:"Loading…",breadcrumbGallery:"Gallery",titleSuffix:"Select a project",empty:"No projects have been added for this brand yet."},galleryProjectPage:{metaTitleFallback:"Photo gallery",metaDescription:e=>`Photos of our ${e} installation.`,loading:"Loading…",breadcrumbGallery:"Gallery",empty:"No photos have been added for this project yet.",enlargeImage:"Enlarge image"}},Xa={de:bw,en:yw};function vw(){const e=localStorage.getItem("hifi-lang");return e==="de"||e==="en"?e:(navigator.language||"de").toLowerCase().startsWith("de")?"de":"en"}function ku(e,t){return t.split(".").reduce((n,r)=>n==null?void 0:n[r],e)}const cg=g.createContext({language:"de",setLanguage:()=>{},toggleLanguage:()=>{},t:e=>{const t=ku(Xa.de,e);return t!==void 0?t:e}});function Kh({children:e}){const[t,n]=g.useState(vw);g.useEffect(()=>{document.documentElement.setAttribute("lang",t),localStorage.setItem("hifi-lang",t)},[t]);const r=()=>n(i=>i==="de"?"en":"de"),s=i=>{const l=Xa[t]||Xa.de,o=ku(l,i);if(o!==void 0)return o;const u=ku(Xa.de,i);return u!==void 0?u:i};return a.jsx(cg.Provider,{value:{language:t,setLanguage:n,toggleLanguage:r,t:s},children:e})}function Ce(){return g.useContext(cg)}function dg({overHero:e=!1}){const{theme:t,toggleTheme:n}=xw(),{t:r}=Ce();return a.jsx("button",{onClick:n,"aria-label":r("themeToggle.label"),className:`rounded-full p-2 transition ${e?"text-white hover:bg-white/10":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:t==="dark"?a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:a.jsx("path",{d:"M12 3a1 1 0 011 1v1a1 1 0 11-2 0V4a1 1 0 011-1zm0 15a5 5 0 100-10 5 5 0 000 10zm9-6a1 1 0 010 2h-1a1 1 0 110-2h1zM4 12a1 1 0 010 2H3a1 1 0 110-2h1zm14.36-7.36a1 1 0 011.42 1.42l-.71.7a1 1 0 11-1.41-1.4l.7-.72zM5.64 18.36a1 1 0 011.41 1.41l-.7.71a1 1 0 11-1.42-1.41l.71-.71zm12.72 0l.71.7a1 1 0 11-1.41 1.42l-.71-.71a1 1 0 011.41-1.41zM6.34 5.64l-.7-.7A1 1 0 117.05 3.5l.7.71A1 1 0 016.34 5.64zM12 6a1 1 0 011-1v0a1 1 0 01-1 1zm0 12a1 1 0 011 1v1a1 1 0 11-2 0v-1a1 1 0 011-1z"})}):a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:"h-5 w-5",children:a.jsx("path",{fillRule:"evenodd",d:"M9.53 2.25a.75.75 0 01.19.82 8.25 8.25 0 0011.03 11.03.75.75 0 011.01.99A10.5 10.5 0 1112.9 2.1a.75.75 0 011.63-.85z",clipRule:"evenodd"})})})}function Ue({name:e,className:t="h-6 w-6",...n}){return e?a.jsx(Bb,{name:e,className:t,...n}):null}const hg=g.createContext(null);function kw({children:e}){const[t,n]=g.useState(null),[r,s]=g.useState(!0);g.useEffect(()=>{M.get("/auth/me").then(d=>n(d.authenticated===!1?null:d)).catch(()=>n(null)).finally(()=>s(!1))},[]);const i=async(d,h)=>{const m=await M.post("/auth/login",{username:d,password:h});return m.requires_2fa?{requires2fa:!0}:(n(m),{requires2fa:!1})},l=async d=>{const h=await M.post("/auth/verify-2fa",{code:d});n(h)},o=async()=>{await M.post("/auth/logout",{}),n(null)},u=async()=>{const d=await M.get("/auth/me");n(d.authenticated===!1?null:d)},c=d=>{var h;return!!t&&(t.is_super_admin||((h=t.permissions)==null?void 0:h.includes(d)))};return a.jsx(hg.Provider,{value:{user:t,loading:r,login:i,verifyTwoFactor:l,logout:o,refreshUser:u,hasPermission:c},children:e})}function Lt(){return g.useContext(hg)}const mg=g.createContext({phone:"09373 20 62 390",whatsapp:null,contact_email:"info@hifi-planet-amorbach.de",hero_image_path:null,ga_measurement_id:null}),ww=mg.Provider;function Rr(){return g.useContext(mg)}const Hs="/assets/logo-BNfZDkmN.png",Mi="/assets/logo-dark-R-ckaBhx.png",jw="https://www.audio4cars.de/",qh=e=>(e||"").replace(/[^\d+]/g,""),Yh=70,Nw=500;function Sw({className:e}){return a.jsxs("svg",{viewBox:"0 0 3 2",className:e,"aria-hidden":"true",children:[a.jsx("rect",{width:"3",height:"0.667",y:"0",fill:"#000"}),a.jsx("rect",{width:"3",height:"0.667",y:"0.667",fill:"#D00"}),a.jsx("rect",{width:"3",height:"0.666",y:"1.334",fill:"#FFCE00"})]})}function Cw({className:e}){return a.jsxs("svg",{viewBox:"0 0 60 30",className:e,"aria-hidden":"true",children:[a.jsx("clipPath",{id:"fgb-t",children:a.jsx("path",{d:"M30,15 h30 v15 z v15 h-30 z h-30 v-15 z v-15 h30 z"})}),a.jsx("path",{d:"M0,0 v30 h60 v-30 z",fill:"#00247d"}),a.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",stroke:"#fff",strokeWidth:"6"}),a.jsx("path",{d:"M0,0 L60,30 M60,0 L0,30",clipPath:"url(#fgb-t)",stroke:"#cf142b",strokeWidth:"4"}),a.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#fff",strokeWidth:"10"}),a.jsx("path",{d:"M30,0 v30 M0,15 h60",stroke:"#cf142b",strokeWidth:"6"})]})}const Yl=[{code:"de",label:"Deutsch",Flag:Sw},{code:"en",label:"English",Flag:Cw}];function Pw({overHero:e=!1}){const{language:t,setLanguage:n,t:r}=Ce(),[s,i]=g.useState(!1),l=g.useRef(null),o=Yl.find(u=>u.code===t)||Yl[0];return g.useEffect(()=>{if(!s)return;const u=d=>{l.current&&!l.current.contains(d.target)&&i(!1)},c=d=>{d.key==="Escape"&&i(!1)};return document.addEventListener("mousedown",u),document.addEventListener("keydown",c),()=>{document.removeEventListener("mousedown",u),document.removeEventListener("keydown",c)}},[s]),a.jsxs("div",{className:"relative",ref:l,children:[a.jsxs("button",{type:"button",onClick:()=>i(u=>!u),"aria-haspopup":"listbox","aria-expanded":s,"aria-label":r("languageToggle.label"),className:`flex items-center gap-1 rounded-full p-1.5 transition ${e?"hover:bg-white/10":"hover:bg-neutral-100 dark:hover:bg-neutral-800"}`,children:[a.jsx("span",{className:`block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ${e?"ring-white/50":"ring-neutral-300 dark:ring-neutral-600"}`,children:a.jsx(o.Flag,{className:"h-full w-full"})}),a.jsx("svg",{viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true",className:`h-3 w-3 transition-transform ${e?"text-white/70":"text-neutral-400"} ${s?"rotate-180":""}`,children:a.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z"})})]}),s&&a.jsx("div",{role:"listbox",className:"absolute right-0 z-50 mt-2 min-w-[9rem] overflow-hidden rounded-lg border border-neutral-200 bg-white py-1 shadow-lg dark:border-neutral-700 dark:bg-neutral-900",children:Yl.map(u=>a.jsxs("button",{type:"button",role:"option","aria-selected":u.code===t,onClick:()=>{n(u.code),i(!1)},className:`flex w-full items-center gap-2 px-3 py-2 text-left text-sm transition hover:bg-neutral-100 dark:hover:bg-neutral-800 ${u.code===t?"font-semibold text-brand-600 dark:text-brand-400":"text-neutral-700 dark:text-neutral-200"}`,children:[a.jsx("span",{className:"block h-4 w-6 shrink-0 overflow-hidden rounded-[3px] ring-1 ring-neutral-300 dark:ring-neutral-600",children:a.jsx(u.Flag,{className:"h-full w-full"})}),u.label]},u.code))})]})}function Ew(){const[e,t]=g.useState(!1),[n,r]=g.useState(!1),[s,i]=g.useState(!1),{user:l}=Lt(),{phone:o,whatsapp:u}=Rr(),{t:c}=Ce(),d=u?8:7,m=dt().pathname==="/",[f,x]=g.useState(!m);g.useEffect(()=>{if(!m){x(!0);return}const y=()=>x(window.scrollY>24);return y(),window.addEventListener("scroll",y,{passive:!0}),()=>window.removeEventListener("scroll",y)},[m]);const v=m&&!f;g.useEffect(()=>{if(e){r(!0);let j;const C=requestAnimationFrame(()=>{j=requestAnimationFrame(()=>i(!0))});return()=>{cancelAnimationFrame(C),j&&cancelAnimationFrame(j)}}i(!1);const y=Nw+(d-1)*Yh,w=setTimeout(()=>r(!1),y);return()=>clearTimeout(w)},[e,d]);const k=()=>`transition-all duration-500 ease-out ${s?"opacity-100":"opacity-0"}`,b=y=>({transitionDelay:`${(s?y:d-1-y)*Yh}ms`,transform:s?"translateY(0)":"translateY(-140px)"}),p=l&&a.jsx(U,{to:"/admin","aria-label":c("nav.adminPanel"),title:c("nav.adminPanel"),className:`rounded-full p-2 transition ${v?"text-white hover:bg-white/10":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:a.jsx(Ue,{name:"layout-dashboard",className:"h-5 w-5"})});return a.jsxs("header",{className:`sticky top-0 z-30 border-b transition-colors duration-300 ${v?"border-transparent bg-transparent":"border-neutral-200 bg-white/90 backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/90"}`,children:[a.jsxs("div",{className:"mx-auto grid max-w-6xl grid-cols-[1fr_auto_1fr] items-center gap-3 px-4 py-3 sm:px-6",children:[a.jsx("div",{className:"flex items-center justify-self-start",children:a.jsx("button",{onClick:()=>t(!0),"aria-label":c("nav.openMenu"),className:`rounded-md p-2 transition ${v?"text-white hover:bg-white/10":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-6 w-6",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})})}),a.jsxs(U,{to:"/",className:"flex items-center justify-self-center rounded-lg px-2 py-1",children:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-14 w-auto dark:hidden sm:h-16"}),a.jsx("img",{src:Mi,alt:"HifiPlanet",className:"hidden h-14 w-auto dark:block sm:h-16"})]}),a.jsxs("div",{className:"flex items-center justify-self-end gap-1",children:[p,!e&&a.jsx(Pw,{overHero:v}),a.jsx(dg,{overHero:v})]})]}),n&&Hc.createPortal(a.jsx("div",{className:"fixed inset-0 z-[100] overflow-y-auto text-left backdrop-blur-xl",style:{background:"linear-gradient(135deg, rgba(241,245,249,0.55) 0%, rgba(227,240,207,0.55) 50%, rgba(248,250,252,0.55) 100%)"},children:a.jsxs("div",{className:"relative mx-auto flex min-h-full max-w-6xl flex-col items-start justify-center gap-5 py-24 pl-6 pr-8 sm:pl-8",children:[a.jsxs("button",{onClick:()=>t(!1),"aria-label":c("nav.closeMenu"),className:"absolute left-6 top-8 flex items-center gap-2 text-neutral-600 hover:text-brand-600 sm:left-8 sm:top-[65px]",children:[a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-6 w-6",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})}),a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",children:c("nav.close")})]}),a.jsx(U,{to:"/fahrzeuge",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${k()}`,style:b(0),children:c("nav.vehicles")}),a.jsx(U,{to:"/leistungen",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${k()}`,style:b(1),children:c("nav.services")}),a.jsx(U,{to:"/galerie",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${k()}`,style:b(2),children:c("nav.gallery")}),a.jsx(U,{to:"/kontakt",onClick:()=>t(!1),className:`text-3xl font-extrabold tracking-tight text-neutral-900 hover:text-brand-600 ${k()}`,style:b(3),children:c("nav.contact")}),a.jsx("div",{className:`h-px w-16 bg-brand-500/60 ${k()}`,style:b(4)}),o&&a.jsxs("a",{href:`tel:${qh(o)}`,className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${k()}`,style:b(5),children:[a.jsx(Ue,{name:"phone",className:"h-4 w-4"}),o]}),u&&a.jsxs("a",{href:`https://wa.me/${qh(u).replace(/^0/,"49").replace("+","")}`,target:"_blank",rel:"noopener noreferrer",className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${k()}`,style:b(6),children:[a.jsx(Ue,{name:"message-circle",className:"h-4 w-4"}),c("nav.whatsapp")]}),a.jsxs("a",{href:jw,target:"_blank",rel:"noopener noreferrer",className:`flex items-center gap-2 text-sm font-semibold uppercase tracking-wide text-neutral-600 hover:text-brand-600 ${k()}`,style:b(u?7:6),children:[a.jsx(Ue,{name:"shopping-bag",className:"h-4 w-4"}),c("nav.shop")]})]})}),document.body)]})}const Xh="hifiplanet-cookie-consent",fg={necessary:!0,external:!1,analytics:!1},pg=g.createContext({consent:fg,decided:!1,settingsOpen:!1,acceptAll:()=>{},rejectNonEssential:()=>{},saveCustom:()=>{},openSettings:()=>{},closeSettings:()=>{}});function Tw({children:e}){const[t,n]=g.useState(fg),[r,s]=g.useState(!1),[i,l]=g.useState(!1);g.useEffect(()=>{try{const f=localStorage.getItem(Xh);if(f){const x=JSON.parse(f);n({necessary:!0,external:!!x.external,analytics:!!x.analytics}),s(!0)}}catch{}},[]);const o=g.useCallback(f=>{n(f),s(!0),l(!1),localStorage.setItem(Xh,JSON.stringify({...f,decidedAt:new Date().toISOString()}))},[]),u=g.useCallback(()=>o({necessary:!0,external:!0,analytics:!0}),[o]),c=g.useCallback(()=>o({necessary:!0,external:!1,analytics:!1}),[o]),d=g.useCallback(f=>o({necessary:!0,external:!!f.external,analytics:!!f.analytics}),[o]),h=g.useCallback(()=>l(!0),[]),m=g.useCallback(()=>l(!1),[]);return a.jsx(pg.Provider,{value:{consent:t,decided:r,settingsOpen:i,acceptAll:u,rejectNonEssential:c,saveCustom:d,openSettings:h,closeSettings:m},children:e})}function Fr(){return g.useContext(pg)}const Aw=e=>(e||"").replace(/[^\d+]/g,""),Mw=encodeURIComponent("Boxbrunner Str. 20a, 63916 Amorbach"),_w=`https://www.google.com/maps/dir/?api=1&destination=${Mw}`;function Lw(){const e=new Date,t=e.getHours()*60+e.getMinutes(),n=e.getDay();return n===0?!1:n===6?t>=10*60&&t<13*60:t>=9*60&&t<18*60}function Dw(){const e=Lw(),{openSettings:t}=Fr(),{pathname:n}=dt(),r=n==="/",{phone:s,contact_email:i}=Rr(),{t:l}=Ce(),o=[{key:"monFri",days:l("footer.days.monFri"),label:l("contactPage.hoursWeek")},{key:"sat",days:l("footer.days.sat"),label:l("contactPage.hoursSat")},{key:"sun",days:l("footer.days.sun"),label:l("footer.closed")}];return a.jsxs("footer",{className:`border-t border-neutral-200 bg-neutral-50 py-10 text-sm text-neutral-600 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-300 ${r?"pb-24":""}`,children:[a.jsxs("div",{className:"mx-auto grid max-w-6xl gap-4 px-4 sm:grid-cols-3 sm:px-6",children:[a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[a.jsx(Ue,{name:"map-pin",className:"h-4 w-4 text-brand-500"}),a.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:"HifiPlanet"})]}),a.jsx("p",{children:"Boxbrunner Str. 20a"}),a.jsx("p",{children:"63916 Amorbach"}),a.jsxs("a",{href:_w,target:"_blank",rel:"noopener noreferrer",className:"mt-4 flex items-center justify-center gap-1.5 rounded-md bg-brand-500 px-3 py-2 text-xs font-semibold text-white hover:bg-brand-600",children:[a.jsx(Ue,{name:"navigation",className:"h-3.5 w-3.5"}),l("footer.routePlan")]})]}),a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-3 flex items-center gap-2",children:[a.jsx(Ue,{name:"phone",className:"h-4 w-4 text-brand-500"}),a.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:l("footer.contactHeading")})]}),a.jsx("p",{children:a.jsx("a",{href:`tel:${Aw(s)}`,className:"inline-block py-1 hover:text-brand-500",children:s})}),a.jsx("p",{children:a.jsx("a",{href:`mailto:${i}`,className:"inline-block py-1 hover:text-brand-500",children:i})}),a.jsx(U,{to:"/kontakt",className:"mt-4 flex items-center justify-center gap-1.5 rounded-md border border-neutral-300 px-3 py-2 text-xs font-semibold text-neutral-700 hover:border-brand-500 hover:text-brand-600 dark:border-neutral-700 dark:text-neutral-200",children:l("footer.contactForm")})]}),a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-3 flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Ue,{name:"clock",className:"h-4 w-4 text-brand-500"}),a.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:l("footer.hoursHeading")})]}),a.jsxs("span",{className:`flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[11px] font-semibold ${e?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-neutral-100 text-neutral-500 dark:bg-neutral-800 dark:text-neutral-400"}`,children:[a.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${e?"bg-green-500":"bg-neutral-400"}`}),l(e?"footer.open":"footer.closed")]})]}),a.jsx("dl",{className:"space-y-1.5",children:o.map(u=>a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsx("dt",{className:"text-neutral-500 dark:text-neutral-400",children:u.days}),a.jsx("dd",{className:"font-medium text-neutral-700 dark:text-neutral-200",children:u.label})]},u.key))})]})]}),a.jsx("div",{className:"mx-auto mt-8 max-w-6xl border-t border-neutral-200 px-4 pt-6 text-center text-xs text-neutral-500 dark:border-neutral-800 dark:text-neutral-400 sm:px-6",children:a.jsxs("p",{className:"flex flex-wrap items-center justify-center gap-x-2 gap-y-1",children:[a.jsx("span",{children:l("footer.copyright")(new Date().getFullYear())}),a.jsx("span",{children:"·"}),a.jsx(U,{to:"/impressum",className:"hover:text-brand-500",children:l("footer.imprint")}),a.jsx("span",{children:"·"}),a.jsx(U,{to:"/datenschutz",className:"hover:text-brand-500",children:l("footer.privacy")}),a.jsx("span",{children:"·"}),a.jsx(U,{to:"/agb",className:"hover:text-brand-500",children:l("footer.terms")}),a.jsx("span",{children:"·"}),a.jsx("button",{type:"button",onClick:t,className:"hover:text-brand-500",children:l("footer.cookieSettings")})]})})]})}const qc=g.createContext({});function yn(e){const t=g.useRef(null);return t.current===null&&(t.current=e()),t.current}const Bw=typeof window<"u",ta=Bw?g.useLayoutEffect:g.useEffect,cl=g.createContext(null);function Yc(e,t){e.indexOf(t)===-1&&e.push(t)}function _i(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const jt=(e,t,n)=>n>t?t:n{};const vn={},gg=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),xg=e=>typeof e=="object"&&e!==null,bg=e=>/^0[^.\s]+$/u.test(e);function yg(e){let t;return()=>(t===void 0&&(t=e()),t)}const Ge=e=>e,na=(...e)=>e.reduce((t,n)=>r=>n(t(r))),Pr=(e,t,n)=>{const r=t-e;return r?(n-e)/r:1};class Zc{constructor(){this.subscriptions=[]}add(t){return Yc(this.subscriptions,t),()=>_i(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let i=0;ie*1e3,it=e=>e/1e3,Qc=(e,t)=>t?e*(1e3/t):0,vg=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,zw=1e-7,Iw=12;function Rw(e,t,n,r,s){let i,l,o=0;do l=t+(n-t)/2,i=vg(l,r,s)-e,i>0?n=l:t=l;while(Math.abs(i)>zw&&++oRw(i,0,1,e,n);return i=>i===0||i===1?i:vg(s(i),t,r)}const kg=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,wg=e=>t=>1-e(1-t),jg=ra(.33,1.53,.69,.99),Jc=wg(jg),Ng=kg(Jc),Sg=e=>e>=1?1:(e*=2)<1?.5*Jc(e):.5*(2-Math.pow(2,-10*(e-1))),ed=e=>1-Math.sin(Math.acos(e)),Cg=wg(ed),Pg=kg(ed),Fw=ra(.42,0,1,1),Vw=ra(0,0,.58,1),Eg=ra(.42,0,.58,1),Ow=e=>Array.isArray(e)&&typeof e[0]!="number",Tg=e=>Array.isArray(e)&&typeof e[0]=="number",Uw={linear:Ge,easeIn:Fw,easeInOut:Eg,easeOut:Vw,circIn:ed,circInOut:Pg,circOut:Cg,backIn:Jc,backInOut:Ng,backOut:jg,anticipate:Sg},Ww=e=>typeof e=="string",Zh=e=>{if(Tg(e)){Xc(e.length===4);const[t,n,r,s]=e;return ra(t,n,r,s)}else if(Ww(e))return Uw[e];return e},Ea=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function Hw(e){let t=new Set,n=new Set,r=!1,s=!1;const i=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function o(c){i.has(c)&&(u.schedule(c),e()),c(l)}const u={schedule:(c,d=!1,h=!1)=>{const f=h&&r?t:n;return d&&i.add(c),f.add(c),c},cancel:c=>{n.delete(c),i.delete(c)},process:c=>{if(l=c,r){s=!0;return}r=!0;const d=t;t=n,n=d,t.forEach(o),t.clear(),r=!1,s&&(s=!1,u.process(c))}};return u}const $w=40;function Ag(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,l=Ea.reduce((y,w)=>(y[w]=Hw(i),y),{}),{setup:o,read:u,resolveKeyframes:c,preUpdate:d,update:h,preRender:m,render:f,postRender:x}=l,v=()=>{const y=vn.useManualTiming,w=y?s.timestamp:performance.now();n=!1,y||(s.delta=r?1e3/60:Math.max(Math.min(w-s.timestamp,$w),1)),s.timestamp=w,s.isProcessing=!0,o.process(s),u.process(s),c.process(s),d.process(s),h.process(s),m.process(s),f.process(s),x.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(v))},k=()=>{n=!0,r=!0,s.isProcessing||e(v)};return{schedule:Ea.reduce((y,w)=>{const j=l[w];return y[w]=(C,S=!1,P=!1)=>(n||k(),j.schedule(C,S,P)),y},{}),cancel:y=>{for(let w=0;w(Za===void 0&&Le.set(ye.isProcessing||vn.useManualTiming?ye.timestamp:performance.now()),Za),set:e=>{Za=e,queueMicrotask(Gw)}},Mg=e=>t=>typeof t=="string"&&t.startsWith(e),_g=Mg("--"),Kw=Mg("var(--"),td=e=>Kw(e)?qw.test(e.split("/*")[0].trim()):!1,qw=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function Qh(e){return typeof e!="string"?!1:e.split("/*")[0].includes("var(--")}const Vr={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},$s={...Vr,transform:e=>jt(0,1,e)},Ta={...Vr,default:1},xs=e=>Math.round(e*1e5)/1e5,nd=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Yw(e){return e==null}const Xw=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,rd=(e,t)=>n=>!!(typeof n=="string"&&Xw.test(n)&&n.startsWith(e)||t&&!Yw(n)&&Object.prototype.hasOwnProperty.call(n,t)),Lg=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,i,l,o]=r.match(nd);return{[e]:parseFloat(s),[t]:parseFloat(i),[n]:parseFloat(l),alpha:o!==void 0?parseFloat(o):1}},Zw=e=>jt(0,255,e),Zl={...Vr,transform:e=>Math.round(Zw(e))},Ln={test:rd("rgb","red"),parse:Lg("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Zl.transform(e)+", "+Zl.transform(t)+", "+Zl.transform(n)+", "+xs($s.transform(r))+")"};function Qw(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const wu={test:rd("#"),parse:Qw,transform:Ln.transform},sa=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Bt=sa("deg"),Mt=sa("%"),F=sa("px"),Jw=sa("vh"),e1=sa("vw"),Jh={...Mt,parse:e=>Mt.parse(e)/100,transform:e=>Mt.transform(e*100)},ur={test:rd("hsl","hue"),parse:Lg("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+Mt.transform(xs(t))+", "+Mt.transform(xs(n))+", "+xs($s.transform(r))+")"},me={test:e=>Ln.test(e)||wu.test(e)||ur.test(e),parse:e=>Ln.test(e)?Ln.parse(e):ur.test(e)?ur.parse(e):wu.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ln.transform(e):ur.transform(e),getAnimatableNone:e=>{const t=me.parse(e);return t.alpha=0,me.transform(t)}},t1=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function n1(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(nd))==null?void 0:t.length)||0)+(((n=e.match(t1))==null?void 0:n.length)||0)>0}const Dg="number",Bg="color",r1="var",s1="var(",em="${}",a1=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Er(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const o=t.replace(a1,u=>(me.test(u)?(r.color.push(i),s.push(Bg),n.push(me.parse(u))):u.startsWith(s1)?(r.var.push(i),s.push(r1),n.push(u)):(r.number.push(i),s.push(Dg),n.push(parseFloat(u))),++i,em)).split(em);return{values:n,split:o,indexes:r,types:s}}function i1(e){return Er(e).values}function zg({split:e,types:t}){const n=e.length;return r=>{let s="";for(let i=0;itypeof e=="number"?0:me.test(e)?me.getAnimatableNone(e):e,u1=(e,t)=>typeof e=="number"?t!=null&&t.trim().endsWith("/")?e:0:o1(e);function c1(e){const t=Er(e);return zg(t)(t.values.map((r,s)=>u1(r,t.split[s])))}const kt={test:n1,parse:i1,createTransformer:l1,getAnimatableNone:c1};function Ql(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function d1({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,i=0,l=0;if(!t)s=i=l=n;else{const o=n<.5?n*(1+t):n+t-n*t,u=2*n-o;s=Ql(u,o,e+1/3),i=Ql(u,o,e),l=Ql(u,o,e-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(l*255),alpha:r}}function Li(e,t){return n=>n>0?t:e}const te=(e,t,n)=>e+(t-e)*n,Jl=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},h1=[wu,Ln,ur],m1=e=>h1.find(t=>t.test(e));function tm(e){const t=m1(e);if(!t)return!1;let n=t.parse(e);return t===ur&&(n=d1(n)),n}const nm=(e,t)=>{const n=tm(e),r=tm(t);if(!n||!r)return Li(e,t);const s={...n};return i=>(s.red=Jl(n.red,r.red,i),s.green=Jl(n.green,r.green,i),s.blue=Jl(n.blue,r.blue,i),s.alpha=te(n.alpha,r.alpha,i),Ln.transform(s))},ju=new Set(["none","hidden"]);function f1(e,t){return ju.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function p1(e,t){return n=>te(e,t,n)}function sd(e){return typeof e=="number"?p1:typeof e=="string"?td(e)?Li:me.test(e)?nm:b1:Array.isArray(e)?Ig:typeof e=="object"?me.test(e)?nm:g1:Li}function Ig(e,t){const n=[...e],r=n.length,s=e.map((i,l)=>sd(i)(i,t[l]));return i=>{for(let l=0;l{for(const i in r)n[i]=r[i](s);return n}}function x1(e,t){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=kt.createTransformer(t),r=Er(e),s=Er(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?ju.has(e)&&!s.values.length||ju.has(t)&&!r.values.length?f1(e,t):na(Ig(x1(r,s),s.values),n):Li(e,t)};function Rg(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?te(e,t,n):sd(e)(e,t)}const y1=e=>{const t=({timestamp:n})=>e(n);return{start:(n=!0)=>Y.update(t,n),stop:()=>ct(t),now:()=>ye.isProcessing?ye.timestamp:Le.now()}},Fg=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let i=0;i=Di?1/0:t}function v1(e,t=100,n){const r=n({...e,keyframes:[0,t]}),s=Math.min(ad(r),Di);return{type:"keyframes",ease:i=>r.next(s*i).value/t,duration:it(s)}}const ce={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function Nu(e,t){return e*Math.sqrt(1-t*t)}const k1=12;function w1(e,t,n){let r=n;for(let s=1;s{const d=c*l,h=d*e,m=d-n,f=Nu(c,l),x=Math.exp(-h);return eo-m/f*x},i=c=>{const h=c*l*e,m=h*n+n,f=Math.pow(l,2)*Math.pow(c,2)*e,x=Math.exp(-h),v=Nu(Math.pow(c,2),l);return(-s(c)+eo>0?-1:1)*((m-f)*x)/v}):(s=c=>{const d=Math.exp(-c*e),h=(c-n)*e+1;return-eo+d*h},i=c=>{const d=Math.exp(-c*e),h=(n-c)*(e*e);return d*h});const o=5/e,u=w1(s,i,o);if(e=Ze(e),isNaN(u))return{stiffness:ce.stiffness,damping:ce.damping,duration:e};{const c=Math.pow(u,2)*r;return{stiffness:c,damping:l*2*Math.sqrt(r*c),duration:e}}}const N1=["duration","bounce"],S1=["stiffness","damping","mass"];function rm(e,t){return t.some(n=>e[n]!==void 0)}function C1(e){let t={velocity:ce.velocity,stiffness:ce.stiffness,damping:ce.damping,mass:ce.mass,isResolvedFromDuration:!1,...e};if(!rm(e,S1)&&rm(e,N1))if(t.velocity=0,e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*jt(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:ce.mass,stiffness:s,damping:i}}else{const n=j1({...e,velocity:0});t={...t,...n,mass:ce.mass},t.isResolvedFromDuration=!0}return t}function Bi(e=ce.visualDuration,t=ce.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],l=n.keyframes[n.keyframes.length-1],o={done:!1,value:i},{stiffness:u,damping:c,mass:d,duration:h,velocity:m,isResolvedFromDuration:f}=C1({...n,velocity:-it(n.velocity||0)}),x=m||0,v=c/(2*Math.sqrt(u*d)),k=l-i,b=it(Math.sqrt(u/d)),p=Math.abs(k)<5;r||(r=p?ce.restSpeed.granular:ce.restSpeed.default),s||(s=p?ce.restDelta.granular:ce.restDelta.default);let y,w,j,C,S,P;if(v<1)j=Nu(b,v),C=(x+v*b*k)/j,y=N=>{const E=Math.exp(-v*b*N);return l-E*(C*Math.sin(j*N)+k*Math.cos(j*N))},S=v*b*C+k*j,P=v*b*k-C*j,w=N=>Math.exp(-v*b*N)*(S*Math.sin(j*N)+P*Math.cos(j*N));else if(v===1){y=E=>l-Math.exp(-b*E)*(k+(x+b*k)*E);const N=x+b*k;w=E=>Math.exp(-b*E)*(b*N*E-x)}else{const N=b*Math.sqrt(v*v-1);y=$=>{const Q=Math.exp(-v*b*$),R=Math.min(N*$,300);return l-Q*((x+v*b*k)*Math.sinh(R)+N*k*Math.cosh(R))/N};const E=(x+v*b*k)/N,B=v*b*E-k*N,V=v*b*k-E*N;w=$=>{const Q=Math.exp(-v*b*$),R=Math.min(N*$,300);return Q*(B*Math.sinh(R)+V*Math.cosh(R))}}const T={calculatedDuration:f&&h||null,velocity:N=>Ze(w(N)),next:N=>{if(!f&&v<1){const B=Math.exp(-v*b*N),V=Math.sin(j*N),$=Math.cos(j*N),Q=l-B*(C*V+k*$),R=Ze(B*(S*V+P*$));return o.done=Math.abs(R)<=r&&Math.abs(l-Q)<=s,o.value=o.done?l:Q,o}const E=y(N);if(f)o.done=N>=h;else{const B=Ze(w(N));o.done=Math.abs(B)<=r&&Math.abs(l-E)<=s}return o.value=o.done?l:E,o},toString:()=>{const N=Math.min(ad(T),Di),E=Fg(B=>T.next(N*B).value,N,30);return N+"ms "+E},toTransition:()=>{}};return T}Bi.applyToOptions=e=>{const t=v1(e,100,Bi);return e.ease=t.ease,e.duration=Ze(t.duration),e.type="keyframes",e};const P1=5;function Vg(e,t,n){const r=Math.max(t-P1,0);return Qc(n-e(r),t-r)}function Su({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:l,min:o,max:u,restDelta:c=.5,restSpeed:d}){const h=e[0],m={done:!1,value:h},f=P=>o!==void 0&&Pu,x=P=>o===void 0?u:u===void 0||Math.abs(o-P)-v*Math.exp(-P/r),y=P=>b+p(P),w=P=>{const T=p(P),N=y(P);m.done=Math.abs(T)<=c,m.value=m.done?b:N};let j,C;const S=P=>{f(m.value)&&(j=P,C=Bi({keyframes:[m.value,x(m.value)],velocity:Vg(y,P,m.value),damping:s,stiffness:i,restDelta:c,restSpeed:d}))};return S(0),{calculatedDuration:null,next:P=>{let T=!1;return!C&&j===void 0&&(T=!0,w(P),S(P)),j!==void 0&&P>=j?C.next(P-j):(!T&&w(P),m)}}}function E1(e,t,n){const r=[],s=n||vn.mix||Rg,i=e.length-1;for(let l=0;lt[0];if(i===2&&t[0]===t[1])return()=>t[1];const l=e[0]===e[1];e[0]>e[i-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=E1(t,r,s),u=o.length,c=d=>{if(l&&d1)for(;hc(jt(e[0],e[i-1],d)):c}function T1(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Pr(0,t,r);e.push(te(n,1,s))}}function Og(e){const t=[0];return T1(t,e.length-1),t}function A1(e,t){return e.map(n=>n*t)}function M1(e,t){return e.map(()=>t||Eg).splice(0,e.length-1)}function bs({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=Ow(r)?r.map(Zh):Zh(r),i={done:!1,value:t[0]},l=A1(n&&n.length===t.length?n:Og(t),e),o=id(l,t,{ease:Array.isArray(s)?s:M1(t,s)});return{calculatedDuration:e,next:u=>(i.value=o(u),i.done=u>=e,i)}}const _1=e=>e!==null;function dl(e,{repeat:t,repeatType:n="loop"},r,s=1){const i=e.filter(_1),o=s<0||t&&n!=="loop"&&t%2===1?0:i.length-1;return!o||r===void 0?i[o]:r}const L1={decay:Su,inertia:Su,tween:bs,keyframes:bs,spring:Bi};function Ug(e){typeof e.type=="string"&&(e.type=L1[e.type])}class ld{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(t=>{this.resolve=t})}notifyFinished(){this.resolve()}then(t,n){return this.finished.then(t,n)}}const D1=e=>e/100;class Gs extends ld{constructor(t){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==Le.now()&&this.tick(Le.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=t,this.initAnimation(),this.play(),t.autoplay===!1&&this.pause()}initAnimation(){const{options:t}=this;Ug(t);const{type:n=bs,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:l=0}=t;let{keyframes:o}=t;const u=n||bs;u!==bs&&typeof o[0]!="number"&&(this.mixKeyframes=na(D1,Rg(o[0],o[1])),o=[0,100]);const c=u({...t,keyframes:o});i==="mirror"&&(this.mirroredGenerator=u({...t,keyframes:[...o].reverse(),velocity:-l})),c.calculatedDuration===null&&(c.calculatedDuration=ad(c));const{calculatedDuration:d}=c;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=c}updateTime(t){const n=Math.round(t-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(t,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:l,resolvedDuration:o,calculatedDuration:u}=this;if(this.startTime===null)return r.next(0);const{delay:c=0,keyframes:d,repeat:h,repeatType:m,repeatDelay:f,type:x,onUpdate:v,finalKeyframe:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-s/this.speed,this.startTime)),n?this.currentTime=t:this.updateTime(t);const b=this.currentTime-c*(this.playbackSpeed>=0?1:-1),p=this.playbackSpeed>=0?b<0:b>s;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let y=this.currentTime,w=r;if(h){const P=Math.min(this.currentTime,s)/o;let T=Math.floor(P),N=P%1;!N&&P>=1&&(N=1),N===1&&T--,T=Math.min(T,h+1),!!(T%2)&&(m==="reverse"?(N=1-N,f&&(N-=f/o)):m==="mirror"&&(w=l)),y=jt(0,1,N)*o}let j;p?(this.delayState.value=d[0],j=this.delayState):j=w.next(y),i&&!p&&(j.value=i(j.value));let{done:C}=j;!p&&u!==null&&(C=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&C);return S&&x!==Su&&(j.value=dl(d,this.options,k,this.speed)),v&&v(j.value),S&&this.finish(),j}then(t,n){return this.finished.then(t,n)}get duration(){return it(this.calculatedDuration)}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+it(t)}get time(){return it(this.currentTime)}set time(t){t=Ze(t),this.currentTime=t,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=t,this.tick(t))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const n=this.generator.next(t).value;return Vg(r=>this.generator.next(r).value,t,n)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;n&&this.driver&&this.updateTime(Le.now()),this.playbackSpeed=t,n&&this.driver&&(this.time=it(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:t=y1,startTime:n}=this.options;this.driver||(this.driver=t(l=>this.tick(l))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(Le.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var t,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(t=this.options).onComplete)==null||n.call(t)}cancel(){var t,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(t=this.options).onCancel)==null||n.call(t)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}attachTimeline(t){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),t.observe(this)}}function B1(e){for(let t=1;te*180/Math.PI,Cu=e=>{const t=Dn(Math.atan2(e[1],e[0]));return Pu(t)},z1={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:Cu,rotateZ:Cu,skewX:e=>Dn(Math.atan(e[1])),skewY:e=>Dn(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Pu=e=>(e=e%360,e<0&&(e+=360),e),sm=Cu,am=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),im=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),I1={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:am,scaleY:im,scale:e=>(am(e)+im(e))/2,rotateX:e=>Pu(Dn(Math.atan2(e[6],e[5]))),rotateY:e=>Pu(Dn(Math.atan2(-e[2],e[0]))),rotateZ:sm,rotate:sm,skewX:e=>Dn(Math.atan(e[4])),skewY:e=>Dn(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Eu(e){return e.includes("scale")?1:0}function Tu(e,t){if(!e||e==="none")return Eu(t);const n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=I1,s=n;else{const o=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=z1,s=o}if(!s)return Eu(t);const i=r[t],l=s[1].split(",").map(F1);return typeof i=="function"?i(l):l[i]}const R1=(e,t)=>{const{transform:n="none"}=getComputedStyle(e);return Tu(n,t)};function F1(e){return parseFloat(e.trim())}const Or=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Ur=new Set([...Or,"pathRotation"]),lm=e=>e===Vr||e===F,V1=new Set(["x","y","z"]),O1=Or.filter(e=>!V1.has(e));function U1(e){const t=[];return O1.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const an={width:({x:e},{paddingLeft:t="0",paddingRight:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t="0",paddingBottom:n="0",boxSizing:r})=>{const s=e.max-e.min;return r==="border-box"?s:s-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>Tu(t,"x"),y:(e,{transform:t})=>Tu(t,"y")};an.translateX=an.x;an.translateY=an.y;const In=new Set;let Au=!1,Mu=!1,_u=!1;function Wg(){if(Mu){const e=Array.from(In).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=U1(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,l])=>{var o;(o=r.getValue(i))==null||o.set(l)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}Mu=!1,Au=!1,In.forEach(e=>e.complete(_u)),In.clear()}function Hg(){In.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Mu=!0)})}function W1(){_u=!0,Hg(),Wg(),_u=!1}class od{constructor(t,n,r,s,i,l=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=l}scheduleResolve(){this.state="scheduled",this.isAsync?(In.add(this),Au||(Au=!0,Y.read(Hg),Y.resolveKeyframes(Wg))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;if(t[0]===null){const i=s==null?void 0:s.get(),l=t[t.length-1];if(i!==void 0)t[0]=i;else if(r&&n){const o=r.readValue(n,l);o!=null&&(t[0]=o)}t[0]===void 0&&(t[0]=l),s&&i===void 0&&s.set(t[0])}B1(t)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(t=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,t),In.delete(this)}cancel(){this.state==="scheduled"&&(In.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const H1=e=>e.startsWith("--");function $g(e,t,n){H1(t)?e.style.setProperty(t,n):e.style[t]=n}const $1={};function ud(e,t){const n=yg(e);return()=>$1[t]??n()}const cd=ud(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),Gg=ud(()=>window.ViewTimeline!==void 0,"viewTimeline"),Kg=ud(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),is=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,om={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:is([0,.65,.55,1]),circOut:is([.55,0,1,.45]),backIn:is([.31,.01,.66,-.59]),backOut:is([.33,1.53,.69,.99])};function qg(e,t){if(e)return typeof e=="function"?Kg()?Fg(e,t):"ease-out":Tg(e)?is(e):Array.isArray(e)?e.map(n=>qg(n,t)||om.easeOut):om[e]}function G1(e,t,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:l="loop",ease:o="easeOut",times:u}={},c=void 0){const d={[t]:n};u&&(d.offset=u);const h=qg(o,s);Array.isArray(h)&&(d.easing=h);const m={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:l==="reverse"?"alternate":"normal"};return c&&(m.pseudoElement=c),e.animate(d,m)}function Yg(e){return typeof e=="function"&&"applyToOptions"in e}function K1({type:e,...t}){return Yg(e)&&Kg()?e.applyToOptions(t):(t.duration??(t.duration=300),t.ease??(t.ease="easeOut"),t)}class Xg extends ld{constructor(t){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!t)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:l=!1,finalKeyframe:o,onComplete:u}=t;this.isPseudoElement=!!i,this.allowFlatten=l,this.options=t,Xc(typeof t.type!="string");const c=K1(t);this.animation=G1(n,r,s,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=dl(s,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(d),$g(n,r,d),this.animation.cancel()}u==null||u(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var t,n;(n=(t=this.animation).finish)==null||n.call(t)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:t}=this;t==="idle"||t==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var n,r,s;const t=(n=this.options)==null?void 0:n.element;!this.isPseudoElement&&(t!=null&&t.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var n,r;const t=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return it(Number(t))}get iterationDuration(){const{delay:t=0}=this.options||{};return this.duration+it(t)}get time(){return it(Number(this.animation.currentTime)||0)}set time(t){const n=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=Ze(t),n&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(t){t<0&&(this.finishedTime=null),this.animation.playbackRate=t}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(t){this.manualStartTime=this.animation.startTime=t}attachTimeline({timeline:t,rangeStart:n,rangeEnd:r,observe:s}){var i;return this.allowFlatten&&((i=this.animation.effect)==null||i.updateTiming({easing:"linear"})),this.animation.onfinish=null,t&&cd()?(this.animation.timeline=t,n&&(this.animation.rangeStart=n),r&&(this.animation.rangeEnd=r),Ge):s(this)}}const Zg={anticipate:Sg,backInOut:Ng,circInOut:Pg};function q1(e){return e in Zg}function Y1(e){typeof e.ease=="string"&&q1(e.ease)&&(e.ease=Zg[e.ease])}const to=10;class X1 extends Xg{constructor(t){Y1(t),Ug(t),super(t),t.startTime!==void 0&&t.autoplay!==!1&&(this.startTime=t.startTime),this.options=t}updateMotionValue(t){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...l}=this.options;if(!n)return;if(t!==void 0){n.set(t);return}const o=new Gs({...l,autoplay:!1}),u=Math.max(to,Le.now()-this.startTime),c=jt(0,to,u-to),d=o.sample(u).value,{name:h}=this.options;i&&h&&$g(i,h,d),n.setWithVelocity(o.sample(Math.max(0,u-c)).value,d,c),o.stop()}}const um=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(kt.test(e)||e==="0")&&!e.startsWith("url("));function Z1(e){const t=e[0];if(e.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function rj(e){var h;const{motionValue:t,name:n,repeatDelay:r,repeatType:s,damping:i,type:l,keyframes:o}=e;if(!(((h=t==null?void 0:t.owner)==null?void 0:h.current)instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=t.owner.getProps();return nj()&&n&&(Qg.has(n)||tj.has(n)&&ej(o))&&(n!=="transform"||!d)&&!c&&!r&&s!=="mirror"&&i!==0&&l!=="inertia"}const sj=40;class aj extends ld{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:l="loop",keyframes:o,name:u,motionValue:c,element:d,...h}){var x;super(),this.stop=()=>{var v,k;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(k=this.keyframeResolver)==null||k.cancel()},this.createdAt=Le.now();const m={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:l,name:u,motionValue:c,element:d,...h},f=(d==null?void 0:d.KeyframeResolver)||od;this.keyframeResolver=new f(o,(v,k,b)=>this.onKeyframesResolved(v,k,m,!b),u,c,d),(x=this.keyframeResolver)==null||x.scheduleResolve()}onKeyframesResolved(t,n,r,s){var b,p;this.keyframeResolver=void 0;const{name:i,type:l,velocity:o,delay:u,isHandoff:c,onUpdate:d}=r;this.resolvedAt=Le.now();let h=!0;Q1(t,i,l,o)||(h=!1,(vn.instantAnimations||!u)&&(d==null||d(dl(t,r,n))),t[0]=t[t.length-1],Lu(r),r.repeat=0);const f={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>sj?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:t},x=h&&!c&&rj(f),v=(p=(b=f.motionValue)==null?void 0:b.owner)==null?void 0:p.current;let k;if(x)try{k=new X1({...f,element:v})}catch{k=new Gs(f)}else k=new Gs(f);k.finished.then(()=>{this.notifyFinished()}).catch(Ge),this.pendingTimeline&&(this.stopTimeline=k.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=k}get finished(){return this._animation?this.animation.finished:this._finished}then(t,n){return this.finished.finally(t).then(()=>{})}get animation(){var t;return this._animation||((t=this.keyframeResolver)==null||t.resume(),W1()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(t){this.animation.time=t}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(t){this.animation.speed=t}get startTime(){return this.animation.startTime}attachTimeline(t){return this._animation?this.stopTimeline=this.animation.attachTimeline(t):this.pendingTimeline=t,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var t;this._animation&&this.animation.cancel(),(t=this.keyframeResolver)==null||t.cancel()}}function Jg(e,t,n,r=0,s=1){const i=Array.from(e).sort((c,d)=>c.sortNodePosition(d)).indexOf(t),l=e.size,o=(l-1)*r;return typeof n=="function"?n(i,l):s===1?i*r:o-i*r}const cm=30,ij=e=>!isNaN(parseFloat(e)),ys={current:void 0};class lj{constructor(t,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=Le.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const l of this.dependents)l.dirty()},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=Le.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=ij(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new Zc);const r=this.events[t].add(n);return t==="change"?()=>{r(),Y.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t){this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var t;(t=this.events.change)==null||t.notify(this.current)}addDependent(t){this.dependents||(this.dependents=new Set),this.dependents.add(t)}removeDependent(t){this.dependents&&this.dependents.delete(t)}get(){return ys.current&&ys.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const t=Le.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>cm)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,cm);return Qc(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var t,n;(t=this.dependents)==null||t.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function bt(e,t){return new lj(e,t)}function ex(e,t){if(e!=null&&e.inherit&&t){const{inherit:n,...r}=e;return{...t,...r}}return e}function dd(e,t){const n=(e==null?void 0:e[t])??(e==null?void 0:e.default)??e;return n!==e?ex(n,e):n}const oj={type:"spring",stiffness:500,damping:25,restSpeed:10},uj=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),cj={type:"keyframes",duration:.8},dj={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},hj=(e,{keyframes:t})=>t.length>2?cj:Ur.has(e)?e.startsWith("scale")?uj(t[1]):oj:dj,mj=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function fj(e){for(const t in e)if(!mj.has(t))return!0;return!1}const hd=(e,t,n,r={},s,i)=>l=>{const o=dd(r,e)||{},u=o.delay||r.delay||0;let{elapsed:c=0}=r;c=c-Ze(u);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...o,delay:-c,onUpdate:m=>{t.set(m),o.onUpdate&&o.onUpdate(m)},onComplete:()=>{l(),o.onComplete&&o.onComplete()},name:e,motionValue:t,element:i?void 0:s};fj(o)||Object.assign(d,hj(e,d)),d.duration&&(d.duration=Ze(d.duration)),d.repeatDelay&&(d.repeatDelay=Ze(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Lu(d),d.delay===0&&(h=!0)),(vn.instantAnimations||vn.skipAnimations||s!=null&&s.shouldSkipAnimations||o.skipAnimations)&&(h=!0,Lu(d),d.delay=0),d.allowFlatten=!o.type&&!o.ease,h&&!i&&t.get()!==void 0){const m=dl(d.keyframes,o);if(m!==void 0){Y.update(()=>{d.onUpdate(m),d.onComplete()});return}}return o.isSync?new Gs(d):new aj(d)},pj=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function gj(e){const t=pj.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function tx(e,t,n=1){const[r,s]=gj(e);if(!r)return;const i=window.getComputedStyle(t).getPropertyValue(r);if(i){const l=i.trim();return gg(l)?parseFloat(l):l}return td(s)?tx(s,t,n+1):s}function dm(e){const t=[{},{}];return e==null||e.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function md(e,t,n,r){if(typeof t=="function"){const[s,i]=dm(r);t=t(n!==void 0?n:e.custom,s,i)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,i]=dm(r);t=t(n!==void 0?n:e.custom,s,i)}return t}function Rn(e,t,n){const r=e.getProps();return md(r,t,n!==void 0?n:r.custom,e)}const nx=new Set(["width","height","top","left","right","bottom",...Or]),Du=e=>Array.isArray(e);function xj(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,bt(n))}function bj(e){return Du(e)?e[e.length-1]||0:e}function yj(e,t){const n=Rn(e,t);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const l in i){const o=bj(i[l]);xj(e,l,o)}}const be=e=>!!(e&&e.getVelocity);function vj(e){return!!(be(e)&&e.add)}function Bu(e,t){const n=e.getValue("willChange");if(vj(n))return n.add(t);if(!n&&vn.WillChange){const r=new vn.WillChange("auto");e.addValue("willChange",r),r.add(t)}}function fd(e){return e.replace(/([A-Z])/g,t=>`-${t.toLowerCase()}`)}const kj="framerAppearId",rx="data-"+fd(kj);function sx(e){return e.props[rx]}function wj({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function ax(e,t,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i,transitionEnd:l,...o}=t;const u=e.getDefaultTransition();i=i?ex(i,u):u;const c=i==null?void 0:i.reduceMotion,d=i==null?void 0:i.skipAnimations;r&&(i=r);const h=[],m=s&&e.animationState&&e.animationState.getState()[s],f=i==null?void 0:i.path;f&&f.animateVisualElement(e,o,i,n,h);for(const x in o){const v=e.getValue(x,e.latestValues[x]??null),k=o[x];if(k===void 0||m&&wj(m,x))continue;const b={delay:n,...dd(i||{},x)};d&&(b.skipAnimations=!0);const p=v.get();if(p!==void 0&&!v.isAnimating()&&!Array.isArray(k)&&k===p&&!b.velocity){Y.update(()=>v.set(k));continue}let y=!1;if(window.MotionHandoffAnimation){const C=sx(e);if(C){const S=window.MotionHandoffAnimation(C,x,Y);S!==null&&(b.startTime=S,y=!0)}}Bu(e,x);const w=c??e.shouldReduceMotion;v.start(hd(x,v,k,w&&nx.has(x)?{type:!1}:b,e,y));const j=v.animation;j&&h.push(j)}if(l){const x=()=>Y.update(()=>{l&&yj(e,l)});h.length?Promise.all(h).then(x):x()}return h}function zu(e,t,n={}){var u;const r=Rn(e,t,n.type==="exit"?(u=e.presenceContext)==null?void 0:u.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(ax(e,r,n)):()=>Promise.resolve(),l=e.variantChildren&&e.variantChildren.size?(c=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:m}=s;return jj(e,t,c,d,h,m,n)}:()=>Promise.resolve(),{when:o}=s;if(o){const[c,d]=o==="beforeChildren"?[i,l]:[l,i];return c().then(()=>d())}else return Promise.all([i(),l(n.delay)])}function jj(e,t,n=0,r=0,s=0,i=1,l){const o=[];for(const u of e.variantChildren)u.notify("AnimationStart",t),o.push(zu(u,t,{...l,delay:n+(typeof r=="function"?0:r)+Jg(e.variantChildren,u,r,s,i)}).then(()=>u.notify("AnimationComplete",t)));return Promise.all(o)}function Nj(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(i=>zu(e,i,n));r=Promise.all(s)}else if(typeof t=="string")r=zu(e,t,n);else{const s=typeof t=="function"?Rn(e,t,n.custom):t;r=Promise.all(ax(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const Sj={test:e=>e==="auto",parse:e=>e},ix=e=>t=>t.test(e),lx=[Vr,F,Mt,Bt,e1,Jw,Sj],hm=e=>lx.find(ix(e));function Cj(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||bg(e):!0}const Pj=new Set(["brightness","contrast","saturate","opacity"]);function Ej(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(nd)||[];if(!r)return e;const s=n.replace(r,"");let i=Pj.has(t)?1:0;return r!==n&&(i*=100),t+"("+i+s+")"}const Tj=/\b([a-z-]*)\(.*?\)/gu,Iu={...kt,getAnimatableNone:e=>{const t=e.match(Tj);return t?t.map(Ej).join(" "):e}},Ru={...kt,getAnimatableNone:e=>{const t=kt.parse(e);return kt.createTransformer(e)(t.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},mm={...Vr,transform:Math.round},Aj={rotate:Bt,pathRotation:Bt,rotateX:Bt,rotateY:Bt,rotateZ:Bt,scale:Ta,scaleX:Ta,scaleY:Ta,scaleZ:Ta,skew:Bt,skewX:Bt,skewY:Bt,distance:F,translateX:F,translateY:F,translateZ:F,x:F,y:F,z:F,perspective:F,transformPerspective:F,opacity:$s,originX:Jh,originY:Jh,originZ:F},zi={borderWidth:F,borderTopWidth:F,borderRightWidth:F,borderBottomWidth:F,borderLeftWidth:F,borderRadius:F,borderTopLeftRadius:F,borderTopRightRadius:F,borderBottomRightRadius:F,borderBottomLeftRadius:F,width:F,maxWidth:F,height:F,maxHeight:F,top:F,right:F,bottom:F,left:F,inset:F,insetBlock:F,insetBlockStart:F,insetBlockEnd:F,insetInline:F,insetInlineStart:F,insetInlineEnd:F,padding:F,paddingTop:F,paddingRight:F,paddingBottom:F,paddingLeft:F,paddingBlock:F,paddingBlockStart:F,paddingBlockEnd:F,paddingInline:F,paddingInlineStart:F,paddingInlineEnd:F,margin:F,marginTop:F,marginRight:F,marginBottom:F,marginLeft:F,marginBlock:F,marginBlockStart:F,marginBlockEnd:F,marginInline:F,marginInlineStart:F,marginInlineEnd:F,fontSize:F,backgroundPositionX:F,backgroundPositionY:F,...Aj,zIndex:mm,fillOpacity:$s,strokeOpacity:$s,numOctaves:mm},Mj={...zi,color:me,backgroundColor:me,outlineColor:me,fill:me,stroke:me,borderColor:me,borderTopColor:me,borderRightColor:me,borderBottomColor:me,borderLeftColor:me,filter:Iu,WebkitFilter:Iu,mask:Ru,WebkitMask:Ru},ox=e=>Mj[e],_j=new Set([Iu,Ru]);function ux(e,t){let n=ox(e);return _j.has(n)||(n=kt),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Lj=new Set(["auto","none","0"]);function Dj(e,t,n){let r=0,s;for(;r{t.getValue(u).set(c)}),this.resolveNoneKeyframes()}}const pd=["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"];function cx(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e=="string"){const s=document.querySelectorAll(e);return s?Array.from(s):[]}return Array.from(e).filter(r=>r!=null)}const Fu=(e,t)=>t&&typeof e=="number"?t.transform(e):e;function vs(e){return xg(e)&&"offsetHeight"in e&&!("ownerSVGElement"in e)}const{schedule:Tr,cancel:dx}=Ag(queueMicrotask,!1),ft={x:!1,y:!1};function hx(){return ft.x||ft.y}function zj(e){return e==="x"||e==="y"?ft[e]?null:(ft[e]=!0,()=>{ft[e]=!1}):ft.x||ft.y?null:(ft.x=ft.y=!0,()=>{ft.x=ft.y=!1})}function mx(e,t){const n=cx(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function Ij(e){return!(e.pointerType==="touch"||hx())}function Rj(e,t,n={}){const[r,s,i]=mx(e,n);return r.forEach(l=>{let o=!1,u=!1,c;const d=()=>{l.removeEventListener("pointerleave",x)},h=k=>{c&&(c(k),c=void 0),d()},m=k=>{o=!1,window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",m),u&&(u=!1,h(k))},f=()=>{o=!0,window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",m,s)},x=k=>{if(k.pointerType!=="touch"){if(o){u=!0;return}h(k)}},v=k=>{if(!Ij(k))return;u=!1;const b=t(l,k);typeof b=="function"&&(c=b,l.addEventListener("pointerleave",x,s))};l.addEventListener("pointerenter",v,s),l.addEventListener("pointerdown",f,s)}),i}const fx=(e,t)=>t?e===t?!0:fx(e,t.parentElement):!1,gd=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,Fj=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function Vj(e){return Fj.has(e.tagName)||e.isContentEditable===!0}const Oj=new Set(["INPUT","SELECT","TEXTAREA"]);function Uj(e){return Oj.has(e.tagName)||e.isContentEditable===!0}const Qa=new WeakSet;function fm(e){return t=>{t.key==="Enter"&&e(t)}}function no(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const Wj=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=fm(()=>{if(Qa.has(n))return;no(n,"down");const s=fm(()=>{no(n,"up")}),i=()=>no(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",i,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function pm(e){return gd(e)&&!hx()}const gm=new WeakSet;function Hj(e,t,n={}){const[r,s,i]=mx(e,n),l=o=>{const u=o.currentTarget;if(!pm(o)||gm.has(o))return;Qa.add(u),n.stopPropagation&&gm.add(o);const c=t(u,o),d={...s,capture:!0},h=(x,v)=>{window.removeEventListener("pointerup",m,d),window.removeEventListener("pointercancel",f,d),Qa.has(u)&&Qa.delete(u),pm(x)&&typeof c=="function"&&c(x,{success:v})},m=x=>{h(x,u===window||u===document||n.useGlobalTarget||fx(u,x.target))},f=x=>{h(x,!1)};window.addEventListener("pointerup",m,d),window.addEventListener("pointercancel",f,d)};return r.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",l,s),vs(o)&&(o.addEventListener("focus",c=>Wj(c,s)),!Vj(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),i}function xd(e){return xg(e)&&"ownerSVGElement"in e}const Ja=new WeakMap;let Xt;const px=(e,t,n)=>(r,s)=>s&&s[0]?s[0][e+"Size"]:xd(r)&&"getBBox"in r?r.getBBox()[t]:r[n],$j=px("inline","width","offsetWidth"),Gj=px("block","height","offsetHeight");function Kj({target:e,borderBoxSize:t}){var n;(n=Ja.get(e))==null||n.forEach(r=>{r(e,{get width(){return $j(e,t)},get height(){return Gj(e,t)}})})}function qj(e){e.forEach(Kj)}function Yj(){typeof ResizeObserver>"u"||(Xt=new ResizeObserver(qj))}function Xj(e,t){Xt||Yj();const n=cx(e);return n.forEach(r=>{let s=Ja.get(r);s||(s=new Set,Ja.set(r,s)),s.add(t),Xt==null||Xt.observe(r)}),()=>{n.forEach(r=>{const s=Ja.get(r);s==null||s.delete(t),s!=null&&s.size||Xt==null||Xt.unobserve(r)})}}const ei=new Set;let cr;function Zj(){cr=()=>{const e={get width(){return window.innerWidth},get height(){return window.innerHeight}};ei.forEach(t=>t(e))},window.addEventListener("resize",cr)}function Qj(e){return ei.add(e),cr||Zj(),()=>{ei.delete(e),!ei.size&&typeof cr=="function"&&(window.removeEventListener("resize",cr),cr=void 0)}}function Vu(e,t){return typeof e=="function"?Qj(e):Xj(e,t)}function gx(e,t){let n;const r=()=>{const{currentTime:s}=t,l=(s===null?0:s.value)/100;n!==l&&e(l),n=l};return Y.preUpdate(r,!0),()=>ct(r)}function Jj(e){return xd(e)&&e.tagName==="svg"}function eN(...e){const t=!Array.isArray(e[0]),n=t?0:-1,r=e[0+n],s=e[1+n],i=e[2+n],l=e[3+n],o=id(s,i,l);return t?o(r):o}function tN(e,t,n={}){const r=e.get();let s=null,i=r,l;const o=typeof r=="string"?r.replace(/[\d.-]/g,""):void 0,u=()=>{s&&(s.stop(),s=null),e.animation=void 0},c=()=>{const h=xm(e.get()),m=xm(i);if(h===m){u();return}const f=s?s.getGeneratorVelocity():e.getVelocity();u(),s=new Gs({keyframes:[h,m],velocity:f,type:"spring",restDelta:.001,restSpeed:.01,...n,onUpdate:l})},d=()=>{var h;c(),e.animation=s??void 0,(h=e.events.animationStart)==null||h.notify(),s==null||s.then(()=>{var m;e.animation=void 0,(m=e.events.animationComplete)==null||m.notify()})};if(e.attach((h,m)=>{i=h,l=f=>m(ro(f,o)),Y.postRender(d)},u),be(t)){let h=n.skipInitialAnimation===!0;const m=t.on("change",x=>{h?(h=!1,e.jump(ro(x,o),!1)):e.set(ro(x,o))}),f=e.on("destroy",m);return()=>{m(),f()}}return u}function ro(e,t){return t?e+t:e}function xm(e){return typeof e=="number"?e:parseFloat(e)}const nN=[...lx,me,kt],rN=e=>nN.find(ix(e)),bm=()=>({translate:0,scale:1,origin:0,originPoint:0}),dr=()=>({x:bm(),y:bm()}),ym=()=>({min:0,max:0}),pe=()=>({x:ym(),y:ym()}),sN=new WeakMap;function hl(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}function Ks(e){return typeof e=="string"||Array.isArray(e)}const bd=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],yd=["initial",...bd];function ml(e){return hl(e.animate)||yd.some(t=>Ks(e[t]))}function xx(e){return!!(ml(e)||e.variants)}function aN(e,t,n){for(const r in t){const s=t[r],i=n[r];if(be(s))e.addValue(r,s);else if(be(i))e.addValue(r,bt(s,{owner:e}));else if(i!==s)if(e.hasValue(r)){const l=e.getValue(r);l.liveStyle===!0?l.jump(s):l.hasAnimated||l.set(s)}else{const l=e.getStaticValue(r);e.addValue(r,bt(l!==void 0?l:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const Ou={current:null},bx={current:!1},iN=typeof window<"u";function lN(){if(bx.current=!0,!!iN)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>Ou.current=e.matches;e.addEventListener("change",t),t()}else Ou.current=!1}const vm=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let Ii={};function yx(e){Ii=e}function oN(){return Ii}class uN{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,skipAnimations:i,blockInitialAnimation:l,visualState:o},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=od,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const f=Le.now();this.renderScheduledAtthis.bindToMotionValue(i,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(bx.current||lN(),this.shouldReduceMotion=Ou.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var t;this.projection&&this.projection.unmount(),ct(this.notifyUpdate),ct(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(t=this.parent)==null||t.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(t){this.children.add(t),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(t)}removeChild(t){this.children.delete(t),this.enteringChildren&&this.enteringChildren.delete(t)}bindToMotionValue(t,n){if(this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)(),n.accelerate&&Qg.has(t)&&this.current instanceof HTMLElement){const{factory:l,keyframes:o,times:u,ease:c,duration:d}=n.accelerate,h=new Xg({element:this.current,name:t,keyframes:o,times:u,ease:c,duration:Ze(d)}),m=l(h);this.valueSubscriptions.set(t,()=>{m(),h.cancel()});return}const r=Ur.has(t);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",l=>{this.latestValues[t]=l,this.props.onUpdate&&Y.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;typeof window<"u"&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),i&&i()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ii){const n=Ii[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const i=this.features[t];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):pe()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=bt(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){let r=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:this.getBaseTargetFromProps(this.props,t)??this.readValueFromInstance(this.current,t,this.options);return r!=null&&(typeof r=="string"&&(gg(r)||bg(r))?r=parseFloat(r):!rN(r)&&kt.test(n)&&(r=ux(t,n)),this.setBaseTarget(t,be(r)?r.get():r)),be(r)?r.get():r}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const l=md(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);l&&(r=l[t])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,t);return s!==void 0&&!be(s)?s:this.initialValues[t]!==void 0&&r===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new Zc),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}scheduleRenderMicrotask(){Tr.render(this.render)}}class vx extends uN{constructor(){super(...arguments),this.KeyframeResolver=Bj}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){const r=t.style;return r?r[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;be(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}class Nn{constructor(t){this.isMounted=!1,this.node=t}update(){}}function kx({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function cN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function dN(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function so(e){return e===void 0||e===1}function Uu({scale:e,scaleX:t,scaleY:n}){return!so(e)||!so(t)||!so(n)}function Tn(e){return Uu(e)||wx(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function wx(e){return km(e.x)||km(e.y)}function km(e){return e&&e!=="0%"}function Ri(e,t,n){const r=e-n,s=t*r;return n+s}function wm(e,t,n,r,s){return s!==void 0&&(e=Ri(e,s,r)),Ri(e,n,r)+t}function Wu(e,t=0,n=1,r,s){e.min=wm(e.min,t,n,r,s),e.max=wm(e.max,t,n,r,s)}function jx(e,{x:t,y:n}){Wu(e.x,t.translate,t.scale,t.originPoint),Wu(e.y,n.translate,n.scale,n.originPoint)}const jm=.999999999999,Nm=1.0000000000001;function hN(e,t,n,r=!1){var o;const s=n.length;if(!s)return;t.x=t.y=1;let i,l;for(let u=0;ujm&&(t.x=1),t.yjm&&(t.y=1)}function Pt(e,t){e.min+=t,e.max+=t}function Sm(e,t,n,r,s=.5){const i=te(e.min,e.max,s);Wu(e,t,n,i,r)}function Cm(e,t){return typeof e=="string"?parseFloat(e)/100*(t.max-t.min):e}function ti(e,t,n){const r=n??e;Sm(e.x,Cm(t.x,r.x),t.scaleX,t.scale,t.originX),Sm(e.y,Cm(t.y,r.y),t.scaleY,t.scale,t.originY)}function Nx(e,t){return kx(dN(e.getBoundingClientRect(),t))}function mN(e,t,n){const r=Nx(e,n),{scroll:s}=t;return s&&(Pt(r.x,s.offset.x),Pt(r.y,s.offset.y)),r}const fN={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},pN=Or.length;function gN(e,t,n){let r="",s=!0;for(let l=0;l{if(!t.target)return e;if(typeof e=="string")if(F.test(e))e=parseFloat(e);else return e;const n=Pm(e,t.target.x),r=Pm(e,t.target.y);return`${n}% ${r}%`}},xN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=kt.parse(e);if(s.length>5)return r;const i=kt.createTransformer(e),l=typeof s[0]!="number"?1:0,o=n.x.scale*t.x,u=n.y.scale*t.y;s[0+l]/=o,s[1+l]/=u;const c=te(o,u,.5);return typeof s[2+l]=="number"&&(s[2+l]/=c),typeof s[3+l]=="number"&&(s[3+l]/=c),i(s)}},Hu={borderRadius:{...es,applyTo:[...pd]},borderTopLeftRadius:es,borderTopRightRadius:es,borderBottomLeftRadius:es,borderBottomRightRadius:es,boxShadow:xN};function Cx(e,{layout:t,layoutId:n}){return Ur.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!Hu[e]||e==="opacity")}function kd(e,t,n){var l;const r=e.style,s=t==null?void 0:t.style,i={};if(!r)return i;for(const o in r)(be(r[o])||s&&be(s[o])||Cx(o,e)||((l=n==null?void 0:n.getValue(o))==null?void 0:l.liveStyle)!==void 0)&&(i[o]=r[o]);return i}function bN(e){return window.getComputedStyle(e)}class yN extends vx{constructor(){super(...arguments),this.type="html",this.renderInstance=Sx}readValueFromInstance(t,n){var r;if(Ur.has(n))return(r=this.projection)!=null&&r.isProjecting?Eu(n):R1(t,n);{const s=bN(t),i=(_g(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Nx(t,n)}build(t,n,r){vd(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return kd(t,n,r)}}const vN={offset:"stroke-dashoffset",array:"stroke-dasharray"},kN={offset:"strokeDashoffset",array:"strokeDasharray"};function wN(e,t,n=1,r=0,s=!0){e.pathLength=1;const i=s?vN:kN;e[i.offset]=`${-r}`,e[i.array]=`${t} ${n}`}const jN=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function Px(e,{attrX:t,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:l=0,...o},u,c,d){if(vd(e,o,c),u){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:h,style:m}=e;h.transform&&(m.transform=h.transform,delete h.transform),(m.transform||h.transformOrigin)&&(m.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),m.transform&&(m.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox);for(const f of jN)h[f]!==void 0&&(m[f]=h[f],delete h[f]);t!==void 0&&(h.x=t),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&wN(h,s,i,l,!1)}const Ex=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),Tx=e=>typeof e=="string"&&e.toLowerCase()==="svg";function NN(e,t,n,r){Sx(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(Ex.has(s)?s:fd(s),t.attrs[s])}function Ax(e,t,n){const r=kd(e,t,n);for(const s in e)if(be(e[s])||be(t[s])){const i=Or.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=e[s]}return r}class SN extends vx{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=pe}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if(Ur.has(n)){const r=ox(n);return r&&r.default||0}return n=Ex.has(n)?n:fd(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return Ax(t,n,r)}build(t,n,r){Px(t,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(t,n,r,s){NN(t,n,r,s)}mount(t){this.isSVGTag=Tx(t.tagName),super.mount(t)}}const CN=yd.length;function Mx(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Mx(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;nPromise.all(t.map(({animation:n,options:r})=>Nj(e,n,r)))}function AN(e){let t=TN(e),n=Em(),r=!0,s=!1;const i=c=>(d,h)=>{var f;const m=Rn(e,h,c==="exit"?(f=e.presenceContext)==null?void 0:f.custom:void 0);if(m){const{transition:x,transitionEnd:v,...k}=m;d={...d,...k,...v}}return d};function l(c){t=c(e)}function o(c){const{props:d}=e,h=Mx(e.parent)||{},m=[],f=new Set;let x={},v=1/0;for(let b=0;bv&&j,N=!1;const E=Array.isArray(w)?w:[w];let B=E.reduce(i(p),{});C===!1&&(B={});const{prevResolvedValues:V={}}=y,$={...V,...B},Q=_=>{T=!0,f.has(_)&&(N=!0,f.delete(_)),y.needsAnimating[_]=!0;const D=e.getValue(_);D&&(D.liveStyle=!1)};for(const _ in $){const D=B[_],z=V[_];if(x.hasOwnProperty(_))continue;let O=!1;Du(D)&&Du(z)?O=!_x(D,z)||P:O=D!==z,O?D!=null?Q(_):f.add(_):D!==void 0&&f.has(_)?Q(_):y.protectedKeys[_]=!0}y.prevProp=w,y.prevResolvedValues=B,y.isActive&&(x={...x,...B}),(r||s)&&e.blockInitialAnimation&&(T=!1);const R=S&&P;T&&(!R||N)&&m.push(...E.map(_=>{const D={type:p};if(typeof _=="string"&&(r||s)&&!R&&e.manuallyAnimateOnMount&&e.parent){const{parent:z}=e,O=Rn(z,_);if(z.enteringChildren&&O){const{delayChildren:G}=O.transition||{};D.delay=Jg(z.enteringChildren,e,G)}}return{animation:_,options:D}}))}if(f.size){const b={};if(typeof d.initial!="boolean"){const p=Rn(e,Array.isArray(d.initial)?d.initial[0]:d.initial);p&&p.transition&&(b.transition=p.transition)}f.forEach(p=>{const y=e.getBaseTarget(p),w=e.getValue(p);w&&(w.liveStyle=!0),b[p]=y??null}),m.push({animation:b})}let k=!!m.length;return r&&(d.initial===!1||d.initial===d.animate)&&!e.manuallyAnimateOnMount&&(k=!1),r=!1,s=!1,k?t(m):Promise.resolve()}function u(c,d){var m;if(n[c].isActive===d)return Promise.resolve();(m=e.variantChildren)==null||m.forEach(f=>{var x;return(x=f.animationState)==null?void 0:x.setActive(c,d)}),n[c].isActive=d;const h=o(c);for(const f in n)n[f].protectedKeys={};return h}return{animateChanges:o,setActive:u,setAnimateFunction:l,getState:()=>n,reset:()=>{n=Em(),s=!0}}}function MN(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!_x(t,e):!1}function Cn(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Em(){return{animate:Cn(!0),whileInView:Cn(),whileHover:Cn(),whileTap:Cn(),whileDrag:Cn(),whileFocus:Cn(),exit:Cn()}}function $u(e,t){e.min=t.min,e.max=t.max}function mt(e,t){$u(e.x,t.x),$u(e.y,t.y)}function Tm(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}const Lx=1e-4,_N=1-Lx,LN=1+Lx,Dx=.01,DN=0-Dx,BN=0+Dx;function De(e){return e.max-e.min}function zN(e,t,n){return Math.abs(e-t)<=n}function Am(e,t,n,r=.5){e.origin=r,e.originPoint=te(t.min,t.max,e.origin),e.scale=De(n)/De(t),e.translate=te(n.min,n.max,e.origin)-e.originPoint,(e.scale>=_N&&e.scale<=LN||isNaN(e.scale))&&(e.scale=1),(e.translate>=DN&&e.translate<=BN||isNaN(e.translate))&&(e.translate=0)}function ks(e,t,n,r){Am(e.x,t.x,n.x,r?r.originX:void 0),Am(e.y,t.y,n.y,r?r.originY:void 0)}function Mm(e,t,n,r=0){const s=r?te(n.min,n.max,r):n.min;e.min=s+t.min,e.max=e.min+De(t)}function IN(e,t,n,r){Mm(e.x,t.x,n.x,r==null?void 0:r.x),Mm(e.y,t.y,n.y,r==null?void 0:r.y)}function _m(e,t,n,r=0){const s=r?te(n.min,n.max,r):n.min;e.min=t.min-s,e.max=e.min+De(t)}function Fi(e,t,n,r){_m(e.x,t.x,n.x,r==null?void 0:r.x),_m(e.y,t.y,n.y,r==null?void 0:r.y)}function Lm(e,t,n,r,s){return e-=t,e=Ri(e,1/n,r),s!==void 0&&(e=Ri(e,1/s,r)),e}function RN(e,t=0,n=1,r=.5,s,i=e,l=e){if(Mt.test(t)&&(t=parseFloat(t),t=te(l.min,l.max,t/100)-l.min),typeof t!="number")return;let o=te(i.min,i.max,r);e===i&&(o-=t),e.min=Lm(e.min,t,n,o,s),e.max=Lm(e.max,t,n,o,s)}function Dm(e,t,[n,r,s],i,l){RN(e,t[n],t[r],t[s],t.scale,i,l)}const FN=["x","scaleX","originX"],VN=["y","scaleY","originY"];function Bm(e,t,n,r){Dm(e.x,t,FN,n?n.x:void 0,r?r.x:void 0),Dm(e.y,t,VN,n?n.y:void 0,r?r.y:void 0)}function zm(e){return e.translate===0&&e.scale===1}function Bx(e){return zm(e.x)&&zm(e.y)}function Im(e,t){return e.min===t.min&&e.max===t.max}function ON(e,t){return Im(e.x,t.x)&&Im(e.y,t.y)}function Rm(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function zx(e,t){return Rm(e.x,t.x)&&Rm(e.y,t.y)}function Fm(e){return De(e.x)/De(e.y)}function Vm(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function Ct(e){return[e("x"),e("y")]}function UN(e,t,n){let r="";const s=e.x.translate/t.x,i=e.y.translate/t.y,l=(n==null?void 0:n.z)||0;if((s||i||l)&&(r=`translate3d(${s}px, ${i}px, ${l}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:c,rotate:d,pathRotation:h,rotateX:m,rotateY:f,skewX:x,skewY:v}=n;c&&(r=`perspective(${c}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotateX(${m}deg) `),f&&(r+=`rotateY(${f}deg) `),x&&(r+=`skewX(${x}deg) `),v&&(r+=`skewY(${v}deg) `)}const o=e.x.scale*t.x,u=e.y.scale*t.y;return(o!==1||u!==1)&&(r+=`scale(${o}, ${u})`),r||"none"}const WN=pd.length,Om=e=>typeof e=="string"?parseFloat(e):e,Um=e=>typeof e=="number"||F.test(e);function HN(e,t,n,r,s,i){s?(e.opacity=te(0,n.opacity??1,$N(r)),e.opacityExit=te(t.opacity??1,0,GN(r))):i&&(e.opacity=te(t.opacity??1,n.opacity??1,r));for(let l=0;lrt?1:n(Pr(e,t,r))}function KN(e,t,n){const r=be(e)?e:bt(e);return r.start(hd("",r,t,n)),r.animation}function qs(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}const qN=(e,t)=>e.depth-t.depth;class YN{constructor(){this.children=[],this.isDirty=!1}add(t){Yc(this.children,t),this.isDirty=!0}remove(t){_i(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(qN),this.isDirty=!1,this.children.forEach(t)}}function XN(e,t){const n=Le.now(),r=({timestamp:s})=>{const i=s-n;i>=t&&(ct(r),e(i-t))};return Y.setup(r,!0),()=>ct(r)}function ni(e){return be(e)?e.get():e}class ZN{constructor(){this.members=[]}add(t){Yc(this.members,t);for(let n=this.members.length-1;n>=0;n--){const r=this.members[n];if(r===t||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(_i(this.members,r),r.unmount())}t.scheduleRender()}remove(t){if(_i(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){var n;for(let r=this.members.indexOf(t)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((n=s.instance)==null?void 0:n.isConnected)!==!1)return this.promote(s),!0}return!1}promote(t,n){var s;const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.updateSnapshot(),t.scheduleRender();const{layoutDependency:i}=r.options,{layoutDependency:l}=t.options;(i===void 0||i!==l)&&(t.resumeFrom=r,n&&(r.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),(s=t.root)!=null&&s.isUpdating&&(t.isLayoutDirty=!0)),t.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{var n,r,s,i,l;(r=(n=t.options).onExitComplete)==null||r.call(n),(l=(s=t.resumingFrom)==null?void 0:(i=s.options).onExitComplete)==null||l.call(i)})}scheduleRender(){this.members.forEach(t=>t.instance&&t.scheduleRender(!1))}removeLeadSnapshot(){var t;(t=this.lead)!=null&&t.snapshot&&(this.lead.snapshot=void 0)}}const ri={hasAnimatedSinceResize:!0,hasEverUpdated:!1},ao=["","X","Y","Z"],QN=1e3;let JN=0;function io(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Rx(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=sx(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",Y,!(s||i))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Rx(r)}function Fx({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(l={},o=t==null?void 0:t()){this.id=JN++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(nS),this.nodes.forEach(oS),this.nodes.forEach(uS),this.nodes.forEach(rS)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let u=0;uthis.root.updateBlockedByResize=!1;Y.read(()=>{h=window.innerWidth}),e(l,()=>{const f=window.innerWidth;f!==h&&(h=f,this.root.updateBlockedByResize=!0,d&&d(),d=XN(m,250),ri.hasAnimatedSinceResize&&(ri.hasAnimatedSinceResize=!1,this.nodes.forEach(Gm)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&c&&(o||u)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:m,layout:f})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const x=this.options.transition||c.getDefaultTransition()||fS,{onLayoutAnimationStart:v,onLayoutAnimationComplete:k}=c.getProps(),b=!this.targetLayout||!zx(this.targetLayout,f),p=!h&&m;if(this.options.layoutRoot||this.resumeFrom||p||h&&(b||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const y={...dd(x,"layout"),onPlay:v,onComplete:k};(c.shouldReduceMotion||this.options.layoutRoot)&&(y.delay=0,y.type=!1),this.startAnimation(y),this.setAnimationOrigin(d,p,y.path)}else h||Gm(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=f})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),ct(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(cS),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Rx(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!De(this.snapshot.measuredBox.x)&&!De(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let u=0;u{const S=C/1e3,P=j==null?void 0:j(S);P?(m.x.translate=P.x,m.x.scale=te(l.x.scale,1,S),m.x.origin=l.x.origin,m.x.originPoint=l.x.originPoint,m.y.translate=P.y,m.y.scale=te(l.y.scale,1,S),m.y.origin=l.y.origin,m.y.originPoint=l.y.originPoint):(Km(m.x,l.x,S),Km(m.y,l.y,S)),this.setTargetDelta(m),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Fi(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),hS(this.relativeTarget,this.relativeTargetOrigin,f,S),w&&ON(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=pe()),mt(w,this.relativeTarget)),k&&(this.animationValues=h,HN(h,d,this.latestValues,S,y,p)),P&&P.rotate!==void 0&&(this.animationValues||(this.animationValues=h),this.animationValues.pathRotation=P.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=S},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){var o,u,c;this.notifyListeners("animationStart"),(o=this.currentAnimation)==null||o.stop(),(c=(u=this.resumingFrom)==null?void 0:u.currentAnimation)==null||c.stop(),this.pendingAnimation&&(ct(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Y.update(()=>{ri.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=bt(0)),this.motionValue.jump(0,!1),this.currentAnimation=KN(this.motionValue,[0,1e3],{...l,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),l.onUpdate&&l.onUpdate(d)},onComplete:()=>{l.onComplete&&l.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(QN),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:o,target:u,layout:c,latestValues:d}=l;if(!(!o||!u||!c)){if(this!==l&&this.layout&&c&&Vx(this.options.animationType,this.layout.layoutBox,c.layoutBox)){u=this.target||pe();const h=De(this.layout.layoutBox.x);u.x.min=l.target.x.min,u.x.max=u.x.min+h;const m=De(this.layout.layoutBox.y);u.y.min=l.target.y.min,u.y.max=u.y.min+m}mt(o,u),ti(o,d),ks(this.projectionDeltaWithTransform,this.layoutCorrected,o,d)}}registerSharedNode(l,o){this.sharedNodes.has(l)||this.sharedNodes.set(l,new ZN),this.sharedNodes.get(l).add(o);const c=o.options.initialPromotionConfig;o.promote({transition:c?c.transition:void 0,preserveFollowOpacity:c&&c.shouldPreserveFollowOpacity?c.shouldPreserveFollowOpacity(o):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())==null?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())==null?void 0:o.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:o,preserveFollowOpacity:u}={}){const c=this.getStack();c&&c.promote(this,u),l&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let o=!1;const{latestValues:u}=l;if((u.z||u.rotate||u.rotateX||u.rotateY||u.rotateZ||u.skewX||u.skewY)&&(o=!0),!o)return;const c={};u.z&&io("z",l,c,this.animationValues);for(let d=0;d{var o;return(o=l.currentAnimation)==null?void 0:o.stop()}),this.root.nodes.forEach(Hm),this.root.sharedNodes.clear()}}}function eS(e){e.updateLayout()}function tS(e){var n;const t=((n=e.resumeFrom)==null?void 0:n.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:i}=e.options,l=t.source!==e.layout.source;if(i==="size")Ct(h=>{const m=l?t.measuredBox[h]:t.layoutBox[h],f=De(m);m.min=r[h].min,m.max=m.min+f});else if(i==="x"||i==="y"){const h=i==="x"?"y":"x";$u(l?t.measuredBox[h]:t.layoutBox[h],r[h])}else Vx(i,t.layoutBox,r)&&Ct(h=>{const m=l?t.measuredBox[h]:t.layoutBox[h],f=De(r[h]);m.max=m.min+f,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[h].max=e.relativeTarget[h].min+f)});const o=dr();ks(o,r,t.layoutBox);const u=dr();l?ks(u,e.applyTransform(s,!0),t.measuredBox):ks(u,r,t.layoutBox);const c=!Bx(o);let d=!1;if(!e.resumeFrom){const h=e.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:f}=h;if(m&&f){const x=e.options.layoutAnchor||void 0,v=pe();Fi(v,t.layoutBox,m.layoutBox,x);const k=pe();Fi(k,r,f.layoutBox,x),zx(v,k)||(d=!0),h.options.layoutRoot&&(e.relativeTarget=k,e.relativeTargetOrigin=v,e.relativeParent=h)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:t,delta:u,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:d})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function nS(e){e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function rS(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function sS(e){e.clearSnapshot()}function Hm(e){e.clearMeasurements()}function aS(e){e.isLayoutDirty=!0,e.updateLayout()}function $m(e){e.isLayoutDirty=!1}function iS(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function lS(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function Gm(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function oS(e){e.resolveTargetDelta()}function uS(e){e.calcProjection()}function cS(e){e.resetSkewAndRotation()}function dS(e){e.removeLeadSnapshot()}function Km(e,t,n){e.translate=te(t.translate,0,n),e.scale=te(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function qm(e,t,n,r){e.min=te(t.min,n.min,r),e.max=te(t.max,n.max,r)}function hS(e,t,n,r){qm(e.x,t.x,n.x,r),qm(e.y,t.y,n.y,r)}function mS(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const fS={duration:.45,ease:[.4,0,.1,1]},Ym=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),Xm=Ym("applewebkit/")&&!Ym("chrome/")?Math.round:Ge;function Zm(e){e.min=Xm(e.min),e.max=Xm(e.max)}function pS(e){Zm(e.x),Zm(e.y)}function Vx(e,t,n){return e==="position"||e==="preserve-aspect"&&!zN(Fm(t),Fm(n),.2)}function gS(e){var t;return e!==e.root&&((t=e.scroll)==null?void 0:t.wasRoot)}const xS=Fx({attachResizeListener:(e,t)=>qs(e,"resize",t),measureScroll:()=>{var e,t;return{x:document.documentElement.scrollLeft||((e=document.body)==null?void 0:e.scrollLeft)||0,y:document.documentElement.scrollTop||((t=document.body)==null?void 0:t.scrollTop)||0}},checkIsScrollRoot:()=>!0}),lo={current:void 0},Ox=Fx({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!lo.current){const e=new xS({});e.mount(window),e.setOptions({layoutScroll:!0}),lo.current=e}return lo.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),aa=g.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});function Qm(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function bS(...e){return t=>{let n=!1;const r=e.map(s=>{const i=Qm(s,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{width:f,height:x,top:v,left:k,right:b,bottom:p,direction:y}=u.current;if(t||i===!1||!o.current||!f||!x)return;const w=y==="rtl",j=n==="left"?w?`right: ${b}`:`left: ${k}`:w?`left: ${k}`:`right: ${b}`,C=r==="bottom"?`bottom: ${p}`:`top: ${v}`;o.current.dataset.motionPopId=l;const S=document.createElement("style");c&&(S.nonce=c);const P=s??document.head;return P.appendChild(S),S.sheet&&S.sheet.insertRule(` [data-motion-pop-id="${l}"] { position: absolute !important; width: ${f}px !important; height: ${x}px !important; ${j}px !important; ${C}px !important; } `),()=>{var T;(T=o.current)==null||T.removeAttribute("data-motion-pop-id"),P.contains(S)&&P.removeChild(S)}},[t]),a.jsx(vS,{isPresent:t,childRef:o,sizeRef:u,pop:i,children:i===!1?e:g.cloneElement(e,{ref:h})})}const wS=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:l,anchorX:o,anchorY:u,root:c})=>{const d=yn(jS),h=g.useId(),m=g.useRef(n),f=g.useRef(r);ta(()=>{m.current=n,f.current=r});let x=!0,v=g.useMemo(()=>(x=!1,{id:h,initial:t,isPresent:n,custom:s,onExitComplete:k=>{d.set(k,!0);for(const b of d.values())if(!b)return;r&&r()},register:k=>(d.set(k,!1),()=>{var b;d.delete(k),!m.current&&!d.size&&((b=f.current)==null||b.call(f))})}),[n,d,r]);return i&&x&&(v={...v}),g.useMemo(()=>{d.forEach((k,b)=>d.set(b,!1))},[n]),g.useEffect(()=>{!n&&!d.size&&r&&r()},[n]),e=a.jsx(kS,{pop:l==="popLayout",isPresent:n,anchorX:o,anchorY:u,root:c,children:e}),a.jsx(cl.Provider,{value:v,children:e})};function jS(){return new Map}function Ux(e=!0){const t=g.useContext(cl);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,i=g.useId();g.useEffect(()=>{if(e)return s(i)},[e]);const l=g.useCallback(()=>e&&r&&r(i),[i,r,e]);return!n&&r?[!1,l]:[!0]}const Aa=e=>e.key||"";function Jm(e){const t=[];return g.Children.forEach(e,n=>{g.isValidElement(n)&&t.push(n)}),t}const NS=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:l=!1,anchorX:o="left",anchorY:u="top",root:c})=>{const[d,h]=Ux(l),m=g.useMemo(()=>Jm(e),[e]),f=l&&!d?[]:m.map(Aa),x=g.useRef(!0),v=g.useRef(m),k=yn(()=>new Map),b=g.useRef(new Set),[p,y]=g.useState(m),[w,j]=g.useState(m);ta(()=>{x.current=!1,v.current=m;for(let P=0;P{const T=Aa(P),N=l&&!d?!1:m===w||f.includes(T),E=()=>{if(b.current.has(T))return;if(k.has(T))b.current.add(T),k.set(T,!0);else return;let B=!0;k.forEach(V=>{V||(B=!1)}),B&&(S==null||S(),j(v.current),l&&(h==null||h()),r&&r())};return a.jsx(wS,{isPresent:N,initial:!x.current||n?void 0:!1,custom:t,presenceAffectsLayout:s,mode:i,root:c,onExitComplete:N?void 0:E,anchorX:o,anchorY:u,children:P},T)})})},Wx=g.createContext({strict:!1}),ef={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let tf=!1;function SS(){if(tf)return;const e={};for(const t in ef)e[t]={isEnabled:n=>ef[t].some(r=>!!n[r])};yx(e),tf=!0}function Hx(){return SS(),oN()}function CS(e){const t=Hx();for(const n in e)t[n]={...t[n],...e[n]};yx(t)}const PS=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function Vi(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||PS.has(e)}let $x=e=>!Vi(e);function ES(e){typeof e=="function"&&($x=t=>t.startsWith("on")?!Vi(t):e(t))}try{ES(require("@emotion/is-prop-valid").default)}catch{}function TS(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||be(e[s])||($x(s)||n===!0&&Vi(s)||!t&&!Vi(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}const fl=g.createContext({});function AS(e,t){if(ml(e)){const{initial:n,animate:r}=e;return{initial:n===!1||Ks(n)?n:void 0,animate:Ks(r)?r:void 0}}return e.inherit!==!1?t:{}}function MS(e){const{initial:t,animate:n}=AS(e,g.useContext(fl));return g.useMemo(()=>({initial:t,animate:n}),[nf(t),nf(n)])}function nf(e){return Array.isArray(e)?e.join(" "):e}const wd=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Gx(e,t,n){for(const r in t)!be(t[r])&&!Cx(r,n)&&(e[r]=t[r])}function _S({transformTemplate:e},t){return g.useMemo(()=>{const n=wd();return vd(n,t,e),Object.assign({},n.vars,n.style)},[t])}function LS(e,t){const n=e.style||{},r={};return Gx(r,n,e),Object.assign(r,_S(e,t)),r}function DS(e,t){const n={},r=LS(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Kx=()=>({...wd(),attrs:{}});function BS(e,t,n,r){const s=g.useMemo(()=>{const i=Kx();return Px(i,t,Tx(r),e.transformTemplate,e.style),{...i.attrs,style:{...i.style}}},[t]);if(e.style){const i={};Gx(i,e.style,e),s.style={...i,...s.style}}return s}const zS=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function jd(e){return typeof e!="string"||e.includes("-")?!1:!!(zS.indexOf(e)>-1||/[A-Z]/u.test(e))}function IS(e,t,n,{latestValues:r},s,i=!1,l){const u=(l??jd(e)?BS:DS)(t,r,s,e),c=TS(t,typeof e=="string",i),d=e!==g.Fragment?{...c,...u,ref:n}:{},{children:h}=t,m=g.useMemo(()=>be(h)?h.get():h,[h]);return g.createElement(e,{...d,children:m})}function RS({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,s){return{latestValues:FS(n,r,s,e),renderState:t()}}function FS(e,t,n,r){const s={},i=r(e,{});for(const m in i)s[m]=ni(i[m]);let{initial:l,animate:o}=e;const u=ml(e),c=xx(e);t&&c&&!u&&e.inherit!==!1&&(l===void 0&&(l=t.initial),o===void 0&&(o=t.animate));let d=n?n.initial===!1:!1;d=d||l===!1;const h=d?o:l;if(h&&typeof h!="boolean"&&!hl(h)){const m=Array.isArray(h)?h:[h];for(let f=0;f(t,n)=>{const r=g.useContext(fl),s=g.useContext(cl),i=()=>RS(e,t,r,s);return n?i():yn(i)},VS=qx({scrapeMotionValuesFromProps:kd,createRenderState:wd}),OS=qx({scrapeMotionValuesFromProps:Ax,createRenderState:Kx}),US=Symbol.for("motionComponentSymbol");function WS(e,t,n){const r=g.useRef(n);g.useInsertionEffect(()=>{r.current=n});const s=g.useRef(null);return g.useCallback(i=>{var o;i&&((o=e.onMount)==null||o.call(e,i)),t&&(i?t.mount(i):t.unmount());const l=r.current;if(typeof l=="function")if(i){const u=l(i);typeof u=="function"&&(s.current=u)}else s.current?(s.current(),s.current=null):l(i);else l&&(l.current=i)},[t])}const Yx=g.createContext({});function Xn(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function HS(e,t,n,r,s,i){var y,w;const{visualElement:l}=g.useContext(fl),o=g.useContext(Wx),u=g.useContext(cl),c=g.useContext(aa),d=c.reducedMotion,h=c.skipAnimations,m=g.useRef(null),f=g.useRef(!1);r=r||o.renderer,!m.current&&r&&(m.current=r(e,{visualState:t,parent:l,props:n,presenceContext:u,blockInitialAnimation:u?u.initial===!1:!1,reducedMotionConfig:d,skipAnimations:h,isSVG:i}),f.current&&m.current&&(m.current.manuallyAnimateOnMount=!0));const x=m.current,v=g.useContext(Yx);x&&!x.projection&&s&&(x.type==="html"||x.type==="svg")&&$S(m.current,n,s,v);const k=g.useRef(!1);g.useInsertionEffect(()=>{x&&k.current&&x.update(n,u)});const b=n[rx],p=g.useRef(!!b&&typeof window<"u"&&!((y=window.MotionHandoffIsComplete)!=null&&y.call(window,b))&&((w=window.MotionHasOptimisedAnimation)==null?void 0:w.call(window,b)));return ta(()=>{f.current=!0,x&&(k.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),x.scheduleRenderMicrotask(),p.current&&x.animationState&&x.animationState.animateChanges())}),g.useEffect(()=>{x&&(!p.current&&x.animationState&&x.animationState.animateChanges(),p.current&&(queueMicrotask(()=>{var j;(j=window.MotionHandoffMarkAsComplete)==null||j.call(window,b)}),p.current=!1),x.enteringChildren=void 0)}),x}function $S(e,t,n,r){const{layoutId:s,layout:i,drag:l,dragConstraints:o,layoutScroll:u,layoutRoot:c,layoutAnchor:d,layoutCrossfade:h}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:Xx(e.parent)),e.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!l||o&&Xn(o),visualElement:e,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:h,layoutScroll:u,layoutRoot:c,layoutAnchor:d})}function Xx(e){if(e)return e.options.allowProjection!==!1?e.projection:Xx(e.parent)}function oo(e,{forwardMotionProps:t=!1,type:n}={},r,s){r&&CS(r);const i=n?n==="svg":jd(e),l=i?OS:VS;function o(c,d){let h;const m={...g.useContext(aa),...c,layoutId:GS(c)},{isStatic:f}=m,x=MS(c),v=l(c,f);if(!f&&typeof window<"u"){KS();const k=qS(m);h=k.MeasureLayout,x.visualElement=HS(e,v,m,s,k.ProjectionNode,i)}return a.jsxs(fl.Provider,{value:x,children:[h&&x.visualElement?a.jsx(h,{visualElement:x.visualElement,...m}):null,IS(e,c,WS(v,x.visualElement,d),v,f,t,i)]})}o.displayName=`motion.${typeof e=="string"?e:`create(${e.displayName??e.name??""})`}`;const u=g.forwardRef(o);return u[US]=e,u}function GS({layoutId:e}){const t=g.useContext(qc).id;return t&&e!==void 0?t+"-"+e:e}function KS(e,t){g.useContext(Wx).strict}function qS(e){const t=Hx(),{drag:n,layout:r}=t;if(!n&&!r)return{};const s={...n,...r};return{MeasureLayout:n!=null&&n.isEnabled(e)||r!=null&&r.isEnabled(e)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function YS(e,t){if(typeof Proxy>"u")return oo;const n=new Map,r=(i,l)=>oo(i,l,e,t),s=(i,l)=>r(i,l);return new Proxy(s,{get:(i,l)=>l==="create"?r:(n.has(l)||n.set(l,oo(l,void 0,e,t)),n.get(l))})}const XS=(e,t)=>t.isSVG??jd(e)?new SN(t):new yN(t,{allowProjection:e!==g.Fragment});class ZS extends Nn{constructor(t){super(t),t.animationState||(t.animationState=AN(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();hl(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)==null||t.call(this)}}let QS=0;class JS extends Nn{constructor(){super(...arguments),this.id=QS++,this.isExitComplete=!1}update(){var i;if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;if(t&&r===!1){if(this.isExitComplete){const{initial:l,custom:o}=this.node.getProps();if(typeof l=="string"||typeof l=="object"&&l!==null&&!Array.isArray(l)){const u=Rn(this.node,l,o);if(u){const{transition:c,transitionEnd:d,...h}=u;for(const m in h)(i=this.node.getValue(m))==null||i.jump(h[m])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>{this.isExitComplete=!0,n(this.id)})}mount(){const{register:t,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),t&&(this.unmount=t(this.id))}unmount(){}}const e2={animation:{Feature:ZS},exit:{Feature:JS}};function ia(e){return{point:{x:e.pageX,y:e.pageY}}}const t2=e=>t=>gd(t)&&e(t,ia(t));function ws(e,t,n,r){return qs(e,t,t2(n),r)}const Zx=({current:e})=>e?e.ownerDocument.defaultView:null,rf=(e,t)=>Math.abs(e-t);function n2(e,t){const n=rf(e.x,t.x),r=rf(e.y,t.y);return Math.sqrt(n**2+r**2)}const sf=new Set(["auto","scroll"]);class Qx{constructor(t,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:l=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=Ma(this.lastRawMoveEventInfo,this.transformPagePoint));const x=uo(this.lastMoveEventInfo,this.history),v=this.startEvent!==null,k=n2(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!v&&!k)return;const{point:b}=x,{timestamp:p}=ye;this.history.push({...b,timestamp:p});const{onStart:y,onMove:w}=this.handlers;v||(y&&y(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),w&&w(this.lastMoveEvent,x)},this.handlePointerMove=(x,v)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=v,this.lastMoveEventInfo=Ma(v,this.transformPagePoint),Y.update(this.updatePoint,!0)},this.handlePointerUp=(x,v)=>{this.end();const{onEnd:k,onSessionEnd:b,resumeAnimation:p}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&p&&p(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const y=uo(x.type==="pointercancel"?this.lastMoveEventInfo:Ma(v,this.transformPagePoint),this.history);this.startEvent&&k&&k(x,y),b&&b(x,y)},!gd(t))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=l,this.contextWindow=s||window;const u=ia(t),c=Ma(u,this.transformPagePoint),{point:d}=c,{timestamp:h}=ye;this.history=[{...d,timestamp:h}];const{onSessionStart:m}=n;m&&m(t,uo(c,this.history));const f={passive:!0,capture:!0};this.removeListeners=na(ws(this.contextWindow,"pointermove",this.handlePointerMove,f),ws(this.contextWindow,"pointerup",this.handlePointerUp,f),ws(this.contextWindow,"pointercancel",this.handlePointerUp,f)),o&&this.startScrollTracking(o)}startScrollTracking(t){let n=t.parentElement;for(;n;){const r=getComputedStyle(n);(sf.has(r.overflowX)||sf.has(r.overflowY))&&this.scrollPositions.set(n,{x:n.scrollLeft,y:n.scrollTop}),n=n.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(t){const n=this.scrollPositions.get(t);if(!n)return;const r=t===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:t.scrollLeft,y:t.scrollTop},i={x:s.x-n.x,y:s.y-n.y};i.x===0&&i.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(t,s),Y.update(this.updatePoint,!0))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),ct(this.updatePoint)}}function Ma(e,t){return t?{point:t(e.point)}:e}function af(e,t){return{x:e.x-t.x,y:e.y-t.y}}function uo({point:e},t){return{point:e,delta:af(e,Jx(t)),offset:af(e,r2(t)),velocity:s2(t,.1)}}function r2(e){return e[0]}function Jx(e){return e[e.length-1]}function s2(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Jx(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>Ze(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&s.timestamp-r.timestamp>Ze(t)*2&&(r=e[1]);const i=it(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const l={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}function a2(e,{min:t,max:n},r){return t!==void 0&&en&&(e=r?te(n,e,r.max):Math.min(e,n)),e}function lf(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function i2(e,{top:t,left:n,bottom:r,right:s}){return{x:lf(e.x,n,s),y:lf(e.y,t,r)}}function of(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.minr?n=Pr(t.min,t.max-r,e.min):r>s&&(n=Pr(e.min,e.max-s,t.min)),jt(0,1,n)}function u2(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const Gu=.35;function c2(e=Gu){return e===!1?e=0:e===!0&&(e=Gu),{x:uf(e,"left","right"),y:uf(e,"top","bottom")}}function uf(e,t,n){return{min:cf(e,t),max:cf(e,n)}}function cf(e,t){return typeof e=="number"?e:e[t]||0}const d2=new WeakMap;class h2{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=pe(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=t}start(t,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{n&&this.snapToCursor(ia(h).point),this.stopAnimation()},l=(h,m)=>{const{drag:f,dragPropagation:x,onDragStart:v}=this.getProps();if(f&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=zj(f),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=m,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ct(b=>{let p=this.getAxisMotionValue(b).get()||0;if(Mt.test(p)){const{projection:y}=this.visualElement;if(y&&y.layout){const w=y.layout.layoutBox[b];w&&(p=De(w)*(parseFloat(p)/100))}}this.originPoint[b]=p}),v&&Y.update(()=>v(h,m),!1,!0),Bu(this.visualElement,"transform");const{animationState:k}=this.visualElement;k&&k.setActive("whileDrag",!0)},o=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m;const{dragPropagation:f,dragDirectionLock:x,onDirectionLock:v,onDrag:k}=this.getProps();if(!f&&!this.openDragLock)return;const{offset:b}=m;if(x&&this.currentDirection===null){this.currentDirection=f2(b),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",m.point,b),this.updateAxis("y",m.point,b),this.visualElement.render(),k&&Y.update(()=>k(h,m),!1,!0)},u=(h,m)=>{this.latestPointerEvent=h,this.latestPanInfo=m,this.stop(h,m),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{const{dragSnapToOrigin:h}=this.getProps();(h||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:d}=this.getProps();this.panSession=new Qx(t,{onSessionStart:i,onStart:l,onMove:o,onSessionEnd:u,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:Zx(this.visualElement),element:this.visualElement.current})}stop(t,n){const r=t||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:l}=s;this.startAnimation(l);const{onDragEnd:o}=this.getProps();o&&Y.postRender(()=>o(r,s))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!_a(t,s,this.currentDirection))return;const i=this.getAxisMotionValue(t);let l=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(l=a2(l,this.constraints[t],this.elastic[t])),i.set(l)}resolveConstraints(){var i;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;t&&Xn(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=i2(r.layoutBox,t):this.constraints=!1,this.elastic=c2(n),s!==this.constraints&&!Xn(t)&&r&&this.constraints&&!this.hasMutatedConstraints&&Ct(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=u2(r.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Xn(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const i=mN(r,s.root,this.visualElement.getTransformPagePoint());let l=l2(s.layout.layoutBox,i);if(n){const o=n(cN(l));this.hasMutatedConstraints=!!o,o&&(l=kx(o))}return l}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:l,onDragTransitionEnd:o}=this.getProps(),u=this.constraints||{},c=Ct(d=>{if(!_a(d,n,this.currentDirection))return;let h=u&&u[d]||{};(l===!0||l===d)&&(h={min:0,max:0});const m=s?200:1e6,f=s?40:1e7,x={type:"inertia",velocity:r?t[d]:0,bounceStiffness:m,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(d,x)});return Promise.all(c).then(o)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Bu(this.visualElement,t),r.start(hd(t,r,0,n,this.visualElement,!1))}stopAnimation(){Ct(t=>this.getAxisMotionValue(t).stop())}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,s=this.visualElement.getProps()[n];return s||this.visualElement.getValue(t,this.visualElement.latestValues[t]??0)}snapToCursor(t){Ct(n=>{const{drag:r}=this.getProps();if(!_a(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:l,max:o}=s.layout.layoutBox[n],u=i.get()||0;i.set(t[n]-te(l,o,.5)+u)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Xn(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Ct(l=>{const o=this.getAxisMotionValue(l);if(o&&this.constraints!==!1){const u=o.get();s[l]=o2({min:u,max:u},this.constraints[l])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),Ct(l=>{if(!_a(l,t,null))return;const o=this.getAxisMotionValue(l),{min:u,max:c}=this.constraints[l];o.set(te(u,c,s[l]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;d2.set(this.visualElement,this);const t=this.visualElement.current,n=ws(t,"pointerdown",c=>{const{drag:d,dragListener:h=!0}=this.getProps(),m=c.target,f=m!==t&&Uj(m);d&&h&&!f&&this.start(c)});let r;const s=()=>{const{dragConstraints:c}=this.getProps();Xn(c)&&c.current&&(this.constraints=this.resolveRefConstraints(),r||(r=m2(t,c.current,()=>this.scalePositionWithinConstraints())))},{projection:i}=this.visualElement,l=i.addEventListener("measure",s);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Y.read(s);const o=qs(window,"resize",()=>this.scalePositionWithinConstraints()),u=i.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Ct(h=>{const m=this.getAxisMotionValue(h);m&&(this.originPoint[h]+=c[h].translate,m.set(m.get()+c[h].translate))}),this.visualElement.render())});return()=>{o(),n(),l(),u&&u(),r&&r()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:l=Gu,dragMomentum:o=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:l,dragMomentum:o}}}function df(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function m2(e,t,n){const r=Vu(e,df(n)),s=Vu(t,df(n));return()=>{r(),s()}}function _a(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function f2(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class p2 extends Nn{constructor(t){super(t),this.removeGroupControls=Ge,this.removeListeners=Ge,this.controls=new h2(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ge}update(){const{dragControls:t}=this.node.getProps(),{dragControls:n}=this.node.prevProps||{};t!==n&&(this.removeGroupControls(),t&&(this.removeGroupControls=t.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const co=e=>(t,n)=>{e&&Y.update(()=>e(t,n),!1,!0)};class g2 extends Nn{constructor(){super(...arguments),this.removePointerDownListener=Ge}onPointerDown(t){this.session=new Qx(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:Zx(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:co(t),onStart:co(n),onMove:co(r),onEnd:(i,l)=>{delete this.session,s&&Y.postRender(()=>s(i,l))}}}mount(){this.removePointerDownListener=ws(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ho=!1;class x2 extends g.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=t;i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),ho&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),ri.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:l}=r;return l&&(l.isPresent=i,t.layoutDependency!==n&&l.setOptions({...l.options,layoutDependency:n}),ho=!0,s||t.layoutDependency!==n||n===void 0||t.isPresent!==i?l.willUpdate():this.safeToRemove(),t.isPresent!==i&&(i?l.promote():l.relegate()||Y.postRender(()=>{const o=l.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:t,layoutAnchor:n}=this.props,{projection:r}=t;r&&(r.options.layoutAnchor=n,r.root.didUpdate(),Tr.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;ho=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function eb(e){const[t,n]=Ux(),r=g.useContext(qc);return a.jsx(x2,{...e,layoutGroup:r,switchLayoutGroup:g.useContext(Yx),isPresent:t,safeToRemove:n})}const b2={pan:{Feature:g2},drag:{Feature:p2,ProjectionNode:Ox,MeasureLayout:eb}};function hf(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Y.postRender(()=>i(t,ia(t)))}class y2 extends Nn{mount(){const{current:t}=this.node;t&&(this.unmount=Rj(t,(n,r)=>(hf(this.node,r,"Start"),s=>hf(this.node,s,"End"))))}unmount(){}}class v2 extends Nn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=na(qs(this.node.current,"focus",()=>this.onFocus()),qs(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function mf(e,t,n){const{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Y.postRender(()=>i(t,ia(t)))}class k2 extends Nn{mount(){const{current:t}=this.node;if(!t)return;const{globalTapTarget:n,propagate:r}=this.node.props;this.unmount=Hj(t,(s,i)=>(mf(this.node,i,"Start"),(l,{success:o})=>mf(this.node,l,o?"End":"Cancel")),{useGlobalTarget:n,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const Ku=new WeakMap,mo=new WeakMap,w2=e=>{const t=Ku.get(e.target);t&&t(e)},j2=e=>{e.forEach(w2)};function N2({root:e,...t}){const n=e||document;mo.has(n)||mo.set(n,{});const r=mo.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(j2,{root:e,...t})),r[s]}function S2(e,t,n){const r=N2(t);return Ku.set(e,n),r.observe(e),()=>{Ku.delete(e),r.unobserve(e)}}const C2={some:0,all:1};class P2 extends Nn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var u;(u=this.stopObserver)==null||u.call(this);const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=t,l={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:C2[s]},o=c=>{const{isIntersecting:d}=c;if(this.isInView===d||(this.isInView=d,i&&!d&&this.hasEnteredView))return;d&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",d);const{onViewportEnter:h,onViewportLeave:m}=this.node.getProps(),f=d?h:m;f&&f(c)};this.stopObserver=S2(this.node.current,l,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(E2(t,n))&&this.startObserver()}unmount(){var t;(t=this.stopObserver)==null||t.call(this),this.hasEnteredView=!1,this.isInView=!1}}function E2({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const T2={inView:{Feature:P2},tap:{Feature:k2},focus:{Feature:v2},hover:{Feature:y2}},A2={layout:{ProjectionNode:Ox,MeasureLayout:eb}},M2={...e2,...T2,...b2,...A2},Vt=YS(M2,XS);function Oi(e){return typeof window>"u"?!1:e?Gg():cd()}const _2=50,ff=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),L2=()=>({time:0,x:ff(),y:ff()}),D2={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function pf(e,t,n,r){const s=n[t],{length:i,position:l}=D2[t],o=s.current,u=n.time;s.current=Math.abs(e[`scroll${l}`]),s.scrollLength=e[`scroll${i}`]-e[`client${i}`],s.offset.length=0,s.offset[0]=0,s.offset[1]=s.scrollLength,s.progress=Pr(0,s.scrollLength,s.current);const c=r-u;s.velocity=c>_2?0:Qc(s.current-o,c)}function B2(e,t,n){pf(e,"x",t,n),pf(e,"y",t,n),t.time=n}function z2(e,t){const n={x:0,y:0};let r=e;for(;r&&r!==t;)if(vs(r))n.x+=r.offsetLeft,n.y+=r.offsetTop,r=r.offsetParent;else if(r.tagName==="svg"){const s=r.getBoundingClientRect();r=r.parentElement;const i=r.getBoundingClientRect();n.x+=s.left-i.left,n.y+=s.top-i.top}else if(r instanceof SVGGraphicsElement){const{x:s,y:i}=r.getBBox();n.x+=s,n.y+=i;let l=null,o=r.parentNode;for(;!l;)o.tagName==="svg"&&(l=o),o=r.parentNode;r=l}else break;return n}const qu={start:0,center:.5,end:1};function gf(e,t,n=0){let r=0;if(e in qu&&(e=qu[e]),typeof e=="string"){const s=parseFloat(e);e.endsWith("px")?r=s:e.endsWith("%")?e=s/100:e.endsWith("vw")?r=s/100*document.documentElement.clientWidth:e.endsWith("vh")?r=s/100*document.documentElement.clientHeight:e=s}return typeof e=="number"&&(r=t*e),n+r}const I2=[0,0];function R2(e,t,n,r){let s=Array.isArray(e)?e:I2,i=0,l=0;return typeof e=="number"?s=[e,e]:typeof e=="string"&&(e=e.trim(),e.includes(" ")?s=e.split(" "):s=[e,qu[e]?e:"0"]),i=gf(s[0],n,r),l=gf(s[1],t),i-l}const ls={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},F2={x:0,y:0};function V2(e){return"getBBox"in e&&e.tagName!=="svg"?e.getBBox():{width:e.clientWidth,height:e.clientHeight}}function O2(e,t,n){const{offset:r=ls.All}=n,{target:s=e,axis:i="y"}=n,l=i==="y"?"height":"width",o=s!==e?z2(s,e):F2,u=s===e?{width:e.scrollWidth,height:e.scrollHeight}:V2(s),c={width:e.clientWidth,height:e.clientHeight};t[i].offset.length=0;let d=!t[i].interpolate;const h=r.length;for(let m=0;m{U2(e,r.target,n),B2(e,n,s),(r.offset||r.target)&&O2(e,n,r)},notify:()=>t(n)}}const Yn=new WeakMap,xf=new WeakMap,fo=new WeakMap,bf=new WeakMap,La=new WeakMap,yf=e=>e===document.scrollingElement?window:e;function tb(e,{container:t=document.scrollingElement,trackContentSize:n=!1,...r}={}){if(!t)return Ge;let s=fo.get(t);s||(s=new Set,fo.set(t,s));const i=L2(),l=W2(t,e,i,r);if(s.add(l),!Yn.has(t)){const u=()=>{for(const m of s)m.measure(ye.timestamp);Y.preUpdate(c)},c=()=>{for(const m of s)m.notify()},d=()=>Y.read(u);Yn.set(t,d);const h=yf(t);window.addEventListener("resize",d),t!==document.documentElement&&xf.set(t,Vu(t,d)),h.addEventListener("scroll",d),d()}if(n&&!La.has(t)){const u=Yn.get(t),c={width:t.scrollWidth,height:t.scrollHeight};bf.set(t,c);const d=()=>{const m=t.scrollWidth,f=t.scrollHeight;(c.width!==m||c.height!==f)&&(u(),c.width=m,c.height=f)},h=Y.read(d,!0);La.set(t,h)}const o=Yn.get(t);return Y.read(o,!1,!0),()=>{var h;ct(o);const u=fo.get(t);if(!u||(u.delete(l),u.size))return;const c=Yn.get(t);Yn.delete(t),c&&(yf(t).removeEventListener("scroll",c),(h=xf.get(t))==null||h(),window.removeEventListener("resize",c));const d=La.get(t);d&&(ct(d),La.delete(t)),bf.delete(t)}}const H2=[[ls.Enter,"entry"],[ls.Exit,"exit"],[ls.Any,"cover"],[ls.All,"contain"]],vf={start:0,end:1};function $2(e){const t=e.trim().split(/\s+/);if(t.length!==2)return;const n=vf[t[0]],r=vf[t[1]];if(!(n===void 0||r===void 0))return[n,r]}function G2(e){if(e.length!==2)return;const t=[];for(const n of e)if(Array.isArray(n))t.push(n);else if(typeof n=="string"){const r=$2(n);if(!r)return;t.push(r)}else return;return t}function K2(e,t){const n=G2(e);if(!n)return!1;for(let r=0;r<2;r++){const s=n[r],i=t[r];if(s[0]!==i[0]||s[1]!==i[1])return!1}return!0}function Nd(e){if(!e)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};for(const[t,n]of H2)if(K2(e,t))return{rangeStart:`${n} 0%`,rangeEnd:`${n} 100%`}}const kf=new Map;function wf(e){const t={value:0},n=tb(r=>{t.value=r[e.axis].progress*100},e);return{currentTime:t,cancel:n}}function nb({source:e,container:t,...n}){const{axis:r}=n;e&&(t=e);let s=kf.get(t);s||(s=new Map,kf.set(t,s));const i=n.target??"self";let l=s.get(i);l||(l={},s.set(i,l));const o=r+(n.offset??[]).join(",");return l[o]||(n.target&&Oi(n.target)?Nd(n.offset)?l[o]=new ViewTimeline({subject:n.target,axis:r}):l[o]=wf({container:t,...n}):Oi()?l[o]=new ScrollTimeline({source:t,axis:r}):l[o]=wf({container:t,...n})),l[o]}function q2(e,t){const n=nb(t),r=t.target?Nd(t.offset):void 0,s=t.target?Oi(t.target)&&!!r:Oi();return e.attachTimeline({timeline:s?n:void 0,...r&&s&&{rangeStart:r.rangeStart,rangeEnd:r.rangeEnd},observe:i=>(i.pause(),gx(l=>{i.time=i.iterationDuration*l},n))})}function Y2(e){return e&&(e.target||e.offset)}function X2(e){return e.length===2}function Z2(e,t){return X2(e)||Y2(t)?tb(n=>{e(n[t.axis].progress,n)},t):gx(e,nb(t))}function rb(e,{axis:t="y",container:n=document.scrollingElement,...r}={}){if(!n)return Ge;const s={axis:t,container:n,...r};return typeof e=="function"?Z2(e,s):q2(e,s)}const Q2=()=>({scrollX:bt(0),scrollY:bt(0),scrollXProgress:bt(0),scrollYProgress:bt(0)}),hr=e=>e?!e.current:!1;function jf(e,t,n,r){return{factory:s=>{let i;const l=()=>{if(hr(n)||hr(r)){Tr.read(l);return}i=rb(s,{...t,axis:e,container:(n==null?void 0:n.current)||void 0,target:(r==null?void 0:r.current)||void 0})};return Tr.read(l),()=>{dx(l),i==null||i()}},times:[0,1],keyframes:[0,1],ease:s=>s,duration:1}}function J2(e,t){return typeof window>"u"?!1:e?Gg()&&!!Nd(t):cd()}function sb({container:e,target:t,...n}={}){const r=yn(Q2);J2(t,n.offset)&&(r.scrollXProgress.accelerate=jf("x",n,e,t),r.scrollYProgress.accelerate=jf("y",n,e,t));const s=g.useRef(null),i=g.useRef(!1),l=g.useCallback(()=>(s.current=rb((o,{x:u,y:c})=>{r.scrollX.set(u.current),r.scrollXProgress.set(u.progress),r.scrollY.set(c.current),r.scrollYProgress.set(c.progress)},{...n,container:(e==null?void 0:e.current)||void 0,target:(t==null?void 0:t.current)||void 0}),()=>{var o;(o=s.current)==null||o.call(s)}),[e,t,JSON.stringify(n.offset)]);return ta(()=>{if(i.current=!1,hr(e)||hr(t)){i.current=!0;return}else return l()},[l]),g.useEffect(()=>{if(!i.current)return;let o;const u=()=>{const c=hr(e),d=hr(t);!c&&!d&&(o=l())};return Tr.read(u),()=>{dx(u),o==null||o()}},[l]),r}function ab(e){const t=yn(()=>bt(e)),{isStatic:n}=g.useContext(aa);if(n){const[,r]=g.useState(e);g.useEffect(()=>t.on("change",r),[])}return t}function ib(e,t){const n=ab(t()),r=()=>n.set(t());return r(),ta(()=>{const s=()=>Y.preRender(r,!1,!0),i=e.map(l=>l.on("change",s));return()=>{i.forEach(l=>l()),ct(r)}}),n}function eC(e){ys.current=[],e();const t=ib(ys.current,e);return ys.current=void 0,t}function Jt(e,t,n,r){if(typeof e=="function")return eC(e);if(n!==void 0&&!Array.isArray(n)&&typeof t!="function")return tC(e,t,n,r);const l=typeof t=="function"?t:eN(t,n,r),o=Array.isArray(e)?Nf(e,l):Nf([e],([c])=>l(c)),u=Array.isArray(e)?void 0:e.accelerate;return u&&!u.isTransformed&&typeof t!="function"&&Array.isArray(n)&&(r==null?void 0:r.clamp)!==!1&&(o.accelerate={...u,times:t,keyframes:n,isTransformed:!0}),o}function Nf(e,t){const n=yn(()=>[]);return ib(e,()=>{n.length=0;const r=e.length;for(let s=0;sObject.keys(n)),i=yn(()=>({}));for(const l of s)i[l]=Jt(e,t,n[l],r);return i}function nC(e,t={}){const{isStatic:n}=g.useContext(aa),r=()=>be(e)?e.get():e;if(n)return Jt(r);const s=ab(r());return g.useInsertionEffect(()=>tN(s,e,t),[s,JSON.stringify(t)]),s}function rC(e,t={}){return nC(e,{type:"spring",...t})}function sC(){const{scrollYProgress:e}=sb(),t=rC(e,{stiffness:200,damping:30,restDelta:.001});return a.jsx(Vt.div,{style:{scaleX:t},className:"fixed left-0 top-0 z-40 h-0.5 w-full origin-left bg-brand-500"})}const aC=()=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",className:"h-10 w-10",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M14.7 6.3a4 4 0 0 0-5.5 4.5L3 17l2 2 6.2-6.2a4 4 0 0 0 4.5-5.5l-2.6 2.6-2-2 2.6-2.6Z"})});function la({message:e,fullScreen:t=!1}){const{t:n}=Ce(),r=a.jsxs("div",{className:"mx-auto max-w-md text-center",children:[a.jsx("div",{className:"mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:a.jsx(aC,{})}),a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:n("maintenance.title")}),a.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:e||n("maintenance.defaultMessage")})]});return t?a.jsx("div",{className:"flex min-h-screen items-center justify-center bg-white px-4 dark:bg-neutral-950",children:r}):a.jsx("div",{className:"mx-auto max-w-6xl px-4 py-20 sm:px-6",children:r})}const Sf=a.jsx(a.Fragment,{children:'Wartungsmodus aktiv – Besucher sehen aktuell eine Wartungsmeldung. Du siehst diese Seite nur, weil du die Berechtigung "Wartungsmodus umgehen" hast.'});function oa({inline:e=!1}){return e?a.jsx("div",{className:"mb-8 rounded-lg bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:Sf}):a.jsx("div",{className:"bg-amber-500 px-4 py-2 text-center text-xs font-semibold text-white",children:Sf})}function iC({onClose:e}){const{consent:t,saveCustom:n}=Fr(),[r,s]=g.useState(t.external),[i,l]=g.useState(t.analytics),{t:o}=Ce();return a.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/50 p-4",onClick:e,children:a.jsxs("div",{className:"w-full max-w-md rounded-xl bg-white p-6 dark:bg-neutral-900",onClick:u=>u.stopPropagation(),children:[a.jsx("h2",{className:"mb-1 text-lg font-bold text-neutral-900 dark:text-white",children:o("cookieConsent.modalTitle")}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:[o("cookieConsent.modalIntro")," ",a.jsx(U,{to:"/datenschutz",className:"underline hover:text-brand-500",onClick:e,children:o("cookieConsent.privacyPolicy")}),"."]}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:o("cookieConsent.necessaryTitle")}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:o("cookieConsent.necessaryDesc")})]}),a.jsx("input",{type:"checkbox",checked:!0,disabled:!0,className:"mt-1 h-4 w-4 shrink-0"})]}),a.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:o("cookieConsent.externalTitle")}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:o("cookieConsent.externalDesc")})]}),a.jsx("input",{type:"checkbox",checked:r,onChange:u=>s(u.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]}),a.jsxs("div",{className:"flex items-start justify-between gap-3 rounded-lg border border-neutral-200 p-3 dark:border-neutral-700",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-semibold text-neutral-800 dark:text-neutral-100",children:o("cookieConsent.analyticsTitle")}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:o("cookieConsent.analyticsDesc")})]}),a.jsx("input",{type:"checkbox",checked:i,onChange:u=>l(u.target.checked),className:"mt-1 h-4 w-4 shrink-0"})]})]}),a.jsxs("div",{className:"mt-5 flex justify-end gap-2",children:[a.jsx("button",{type:"button",onClick:e,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:o("cookieConsent.cancel")}),a.jsx("button",{type:"button",onClick:()=>n({external:r,analytics:i}),className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:o("cookieConsent.saveSelection")})]})]})})}function lC(){const{decided:e,settingsOpen:t,acceptAll:n,rejectNonEssential:r,openSettings:s,closeSettings:i}=Fr(),{t:l}=Ce();return a.jsxs(a.Fragment,{children:[!e&&a.jsx("div",{className:"fixed inset-x-0 bottom-0 z-50 border-t border-neutral-200 bg-white/95 p-4 shadow-lg backdrop-blur dark:border-neutral-800 dark:bg-neutral-900/95 sm:p-5",children:a.jsxs("div",{className:"mx-auto flex max-w-6xl flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:[l("cookieConsent.bannerText")," ",l("cookieConsent.moreInfo")," ",a.jsx(U,{to:"/datenschutz",className:"underline hover:text-brand-500",children:l("cookieConsent.privacyPolicy")}),"."]}),a.jsxs("div",{className:"flex flex-wrap gap-2 sm:shrink-0",children:[a.jsx("button",{type:"button",onClick:s,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:l("cookieConsent.settings")}),a.jsx("button",{type:"button",onClick:r,className:"rounded-md border border-neutral-300 px-3 py-2 text-sm dark:border-neutral-700",children:l("cookieConsent.onlyNecessary")}),a.jsx("button",{type:"button",onClick:n,className:"rounded-md bg-brand-500 px-3 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:l("cookieConsent.acceptAll")})]})]})}),t&&a.jsx(iC,{onClose:i})]})}function oC(){const{consent:e}=Fr(),{ga_measurement_id:t}=Rr(),n=g.useRef(!1);return g.useEffect(()=>{if(!t||!e.analytics||n.current)return;n.current=!0;const r=document.createElement("script");r.src=`https://www.googletagmanager.com/gtag/js?id=${t}`,r.async=!0,document.head.appendChild(r),window.dataLayer=window.dataLayer||[];function s(...i){window.dataLayer.push(i)}window.gtag=s,s("js",new Date),s("config",t,{anonymize_ip:!0})},[t,e.analytics]),null}const lb=g.createContext({global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null},bypass:!1}),uC=lb.Provider;function pl(){return g.useContext(lb)}const cC={global:{enabled:!1,message:null},services:{enabled:!1,message:null},vehicles:{enabled:!1,message:null}},dC={phone:"09373 20 62 390",whatsapp:null,contact_email:"info@hifi-planet-amorbach.de",hero_image_path:null,ga_measurement_id:null,package_card_theme:"graphite",package_card_layout:"strip"},hC=["/impressum","/datenschutz","/agb"];function mC(){const[e,t]=g.useState(null),[n,r]=g.useState(dC),{loading:s,hasPermission:i}=Lt(),l=dt();if(g.useEffect(()=>{M.get("/maintenance").then(t).catch(()=>t(cC)),M.get("/site-settings").then(r).catch(()=>{})},[]),e===null||s)return a.jsx("div",{className:"min-h-screen bg-white dark:bg-neutral-950"});const o=i("maintenance.bypass"),u=hC.includes(l.pathname);return e.global.enabled&&!o&&!u?a.jsx(Kh,{children:a.jsx(la,{message:e.global.message,fullScreen:!0})}):a.jsx(Kh,{children:a.jsx(uC,{value:{...e,bypass:o},children:a.jsx(ww,{value:n,children:a.jsxs("div",{className:"page-texture flex min-h-screen flex-col text-neutral-900 dark:text-neutral-100",children:[o&&e.global.enabled&&a.jsx(oa,{}),a.jsx(sC,{}),a.jsx(Ew,{}),a.jsx("main",{className:"flex-1",children:a.jsx(ul,{})}),a.jsx(Dw,{}),a.jsx(lC,{}),a.jsx(oC,{})]})})})})}const fC={home:"M3 11.5 12 4l9 7.5M5 10v9a1 1 0 0 0 1 1h4v-6h4v6h4a1 1 0 0 0 1-1v-9",tag:"M4 4h7l9 9-7 7-9-9V4Zm3.5 3.5h.01",car:"M3 13.5 4.5 9A2 2 0 0 1 6.4 7.5h11.2A2 2 0 0 1 19.5 9L21 13.5M3 13.5v4a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1h12v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-4M3 13.5h18M6.5 16.5h.01M17.5 16.5h.01",box:"M12 3 4 7.5v9L12 21l8-4.5v-9L12 3Zm0 9 8-4.5M12 12v9M12 12 4 7.5",mail:"M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm0 0 8 7 8-7",users:"M16 7a4 4 0 1 1-8 0 4 4 0 0 1 8 0Zm-4 6c-4 0-7 2-7 4.5V19h14v-1.5C19 15 16 13 12 13Z",shield:"M12 3 4 6v6c0 4.5 3.4 7.7 8 9 4.6-1.3 8-4.5 8-9V6l-8-3Zm-1.5 9.5 4-4 1 1-5 5-2.5-2.5 1-1 1.5 1.5Z",lock:"M6 10V8a6 6 0 1 1 12 0v2m-13 0h14a1 1 0 0 1 1 1v9a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-9a1 1 0 0 1 1-1Zm7 5v2",briefcase:"M4 7h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V8a1 1 0 0 1 1-1Zm4 0V5a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2M3 12h18",sliders:"M4 6h16M4 6a2 2 0 1 0 4 0 2 2 0 0 0-4 0Zm16 6H4m10 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0ZM4 18h16m-12 0a2 2 0 1 0 4 0 2 2 0 0 0-4 0Z",image:"M4 5h16a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1Zm2 12 4.5-5.5L14 16l2.5-3L20 17H6ZM8 9.5a1.5 1.5 0 1 1-3 0 1.5 1.5 0 0 1 3 0Z",help:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Zm0-5.5v.01M9.5 9.25a2.5 2.5 0 1 1 3.5 2.29c-.7.32-1 .77-1 1.46v.3"},pC=({path:e})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"h-5 w-5 shrink-0",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})});function gC(){const{logout:e,user:t,hasPermission:n}=Lt(),r=ea(),[s,i]=g.useState(!1),[l,o]=g.useState(0);g.useEffect(()=>{n("contact.manage")&&M.get("/contact").then(m=>o(m.filter(f=>f.status==="new").length)).catch(()=>{})},[]);const u=[{title:null,links:[{to:"/admin",label:"Dashboard",icon:"home",end:!0},{to:"/admin/account",label:"Mein Konto",icon:"lock"}]},{title:"Fahrzeug-Katalog",links:[{to:"/admin/brands",label:"Marken",icon:"tag",permission:"brands.manage"},{to:"/admin/models",label:"Modelle",icon:"car",permission:"models.manage"},{to:"/admin/packages",label:"Pakete",icon:"box",permission:"packages.manage"}]},{title:"Website",links:[{to:"/admin/services",label:"Leistungen",icon:"briefcase",permission:"services.manage"},{to:"/admin/faqs",label:"FAQ",icon:"help",permission:"content.manage"}]},{title:"Bildergalerie",links:[{to:"/admin/gallery-brands",label:"Marken",icon:"tag",permission:"gallery.manage"},{to:"/admin/gallery-projects",label:"Projekte",icon:"image",permission:"gallery.manage"}]},{title:"Kunden",links:[{to:"/admin/contact-requests",label:"Kontaktanfragen",icon:"mail",permission:"contact.manage",badge:l}]},{title:"Verwaltung",links:[{to:"/admin/users",label:"Benutzer",icon:"users",permission:"users.manage"},{to:"/admin/permission-groups",label:"Berechtigungsgruppen",icon:"shield",permission:"permission_groups.manage"},{to:"/admin/settings",label:"Einstellungen",icon:"sliders",permission:"settings.manage"}]}].map(m=>({...m,links:m.links.filter(f=>!f.permission||n(f.permission))})).filter(m=>m.links.length>0),c=async()=>{await e(),r("/admin/login")},d=({isActive:m})=>`flex items-center justify-between gap-2 rounded-md px-3 py-2 text-sm font-medium transition ${m?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,h=({onNavigate:m})=>a.jsx("nav",{className:"space-y-5",children:u.map((f,x)=>a.jsxs("div",{children:[f.title&&a.jsx("p",{className:"mb-1.5 px-3 text-xs font-semibold uppercase tracking-wide text-neutral-400 dark:text-neutral-500",children:f.title}),a.jsx("div",{className:"space-y-1",children:f.links.map(v=>a.jsxs(lg,{to:v.to,end:v.end,className:d,onClick:m,children:[a.jsxs("span",{className:"flex items-center gap-2.5",children:[a.jsx(pC,{path:fC[v.icon]}),v.label]}),!!v.badge&&a.jsx("span",{className:"rounded-full bg-red-500 px-2 py-0.5 text-xs font-bold text-white",children:v.badge})]},v.to))})]},x))});return a.jsxs("div",{className:"flex min-h-screen bg-neutral-50 text-neutral-900 dark:bg-neutral-950 dark:text-neutral-100",children:[a.jsxs("aside",{className:"hidden w-60 shrink-0 border-r border-neutral-200 p-4 dark:border-neutral-800 sm:block",children:[a.jsxs("div",{className:"mb-6 flex items-center gap-2 px-3",children:[a.jsxs("span",{className:"rounded-lg px-2 py-1",children:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-7 w-auto dark:hidden"}),a.jsx("img",{src:Mi,alt:"HifiPlanet",className:"hidden h-7 w-auto dark:block"})]}),a.jsx("span",{className:"text-sm font-semibold text-neutral-500 dark:text-neutral-400",children:"Admin"})]}),a.jsx(h,{})]}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("header",{className:"border-b border-neutral-200 dark:border-neutral-800",children:[a.jsxs("div",{className:"flex items-center justify-between px-4 py-3 sm:px-6",children:[a.jsxs("div",{className:"flex items-center gap-2 sm:hidden",children:[a.jsx("button",{onClick:()=>i(m=>!m),"aria-label":"Menü öffnen",className:"rounded-md p-2 text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-6 w-6",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 6h16M4 12h16M4 18h16"})})}),a.jsxs("span",{className:"rounded-lg px-1.5 py-0.5",children:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-6 w-auto dark:hidden"}),a.jsx("img",{src:Mi,alt:"HifiPlanet",className:"hidden h-6 w-auto dark:block"})]})]}),a.jsxs("p",{className:"hidden text-sm text-neutral-500 dark:text-neutral-400 sm:block",children:["Angemeldet als ",t==null?void 0:t.username,t!=null&&t.is_super_admin?" · Super-Admin":""]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(dg,{}),a.jsx("button",{onClick:c,className:"rounded-md border border-neutral-300 px-3 py-1.5 text-sm font-medium text-neutral-700 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:"Abmelden"})]})]}),s&&a.jsx("div",{className:"border-t border-neutral-200 px-4 py-3 dark:border-neutral-800 sm:hidden",children:a.jsx(h,{onNavigate:()=>i(!1)})})]}),a.jsx("main",{className:"p-4 sm:p-6",children:a.jsx(ul,{})})]})]})}function xC(){const{user:e,loading:t}=Lt();return t?a.jsx("div",{className:"flex min-h-screen items-center justify-center text-neutral-500",children:"Lädt…"}):e?a.jsx(ul,{}):a.jsx(Ws,{to:"/admin/login",replace:!0})}function Fe({permission:e,children:t}){const{hasPermission:n}=Lt();return(Array.isArray(e)?e:[e]).some(i=>n(i))?t:a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-8 text-center dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h1",{className:"mb-2 text-lg font-bold text-neutral-900 dark:text-white",children:"Keine Berechtigung"}),a.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:"Du hast keinen Zugriff auf diesen Bereich. Bitte wende dich an einen Administrator, falls du hier Zugriff brauchst."})]})}function po(e,t,n="name"){if(!t)return;let r=document.head.querySelector(`meta[${n}="${e}"]`);r||(r=document.createElement("meta"),r.setAttribute(n,e),document.head.appendChild(r)),r.setAttribute("content",t)}function bC(e){let t=document.head.querySelector('link[rel="canonical"]');t||(t=document.createElement("link"),t.setAttribute("rel","canonical"),document.head.appendChild(t)),t.setAttribute("href",`https://hifi-planet.de${e}`)}function tt({title:e,description:t,path:n}){g.useEffect(()=>{e&&(document.title=`${e} | HifiPlanet`,po("og:title",`${e} | HifiPlanet`,"property")),t&&(po("description",t),po("og:description",t,"property")),n&&bC(n)},[e,t,n])}const yC=[.16,1,.3,1],Cf={up:{y:40},left:{x:-56},right:{x:56}};function vC(e){return{hidden:{opacity:0,scale:.96,filter:"blur(8px)",...Cf[e]||Cf.up},visible:{opacity:1,scale:1,x:0,y:0,filter:"blur(0px)"}}}const kC={hidden:{x:"-130%"},visible:{x:"230%",transition:{duration:1.1,ease:"easeInOut",delay:.4}}};function we({children:e,direction:t="up",className:n="",index:r=0,shine:s=!1}){const i=Math.min(r*.09,.45);return a.jsxs(Vt.div,{className:n,style:{position:"relative",overflow:"hidden"},initial:"hidden",whileInView:"visible",viewport:{once:!0,amount:.25,margin:"-100px"},variants:vC(t),transition:{duration:.75,ease:yC,delay:i},children:[e,s&&a.jsx(Vt.div,{"aria-hidden":!0,variants:kC,className:"pointer-events-none absolute inset-y-0 -left-1/3 w-1/3 rotate-12 bg-gradient-to-r from-transparent via-white/40 to-transparent"})]})}function wC({items:e}){const[t,n]=g.useState(null);return a.jsx("div",{className:"divide-y divide-neutral-200 rounded-xl border border-neutral-200 bg-white dark:divide-neutral-800 dark:border-neutral-800 dark:bg-neutral-900",children:e.map((r,s)=>{const i=t===s;return a.jsxs("div",{children:[a.jsxs("button",{onClick:()=>n(i?null:s),className:"flex w-full items-center justify-between gap-4 px-5 py-4 text-left","aria-expanded":i,children:[a.jsx("span",{className:"font-medium text-neutral-900 dark:text-white",children:r.question}),a.jsx(Vt.svg,{animate:{rotate:i?180:0},transition:{duration:.2},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-5 w-5 shrink-0 text-neutral-500",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m6 9 6 6 6-6"})})]}),a.jsx(NS,{initial:!1,children:i&&a.jsx(Vt.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.25,ease:"easeInOut"},className:"overflow-hidden",children:a.jsx("p",{className:"px-5 pb-4 text-sm text-neutral-600 dark:text-neutral-300",children:r.answer})})})]},r.question)})})}function ob({count:e=5,className:t="h-4 w-4"}){return a.jsx("div",{className:"flex gap-0.5 text-amber-400",children:Array.from({length:e}).map((n,r)=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",className:t,children:a.jsx("path",{d:"M10 1.5l2.6 5.6 6.1.6-4.6 4.1 1.3 6-5.4-3.1-5.4 3.1 1.3-6-4.6-4.1 6.1-.6L10 1.5z"})},r))})}const jC=70;function NC({testimonials:e}){const t=g.useRef(null),n=g.useRef(null),r=g.useRef({pos:0,half:0,hovering:!1,dragging:!1,dragStartX:0,dragStartPos:0,lastTime:null,rafId:null}).current;g.useLayoutEffect(()=>{const i=n.current,l=window.matchMedia("(prefers-reduced-motion: reduce)").matches,o=()=>{i.style.transform=`translateX(${r.pos}px)`},u=p=>{if(r.half<=0)return p;for(;p>0;)p-=r.half;for(;p<=-r.half;)p+=r.half;return p},c=()=>{r.half=i.scrollWidth/2,r.pos===0?r.pos=-r.half:r.pos=u(r.pos),o()};c();const d=new ResizeObserver(c);d.observe(i);const h=p=>{r.lastTime===null&&(r.lastTime=p);const y=(p-r.lastTime)/1e3;r.lastTime=p,!r.dragging&&!r.hovering&&!l&&(r.pos=u(r.pos+jC*y),o()),r.rafId=requestAnimationFrame(h)};r.rafId=requestAnimationFrame(h);const m=t.current,f=()=>{r.hovering=!0},x=()=>{r.hovering=!1},v=p=>{r.dragging=!0,r.dragStartX=p.clientX,r.dragStartPos=r.pos,m.setPointerCapture(p.pointerId),m.classList.add("cursor-grabbing"),m.classList.remove("cursor-grab")},k=p=>{r.dragging&&(r.pos=u(r.dragStartPos+(p.clientX-r.dragStartX)),o())},b=p=>{r.dragging&&(r.dragging=!1,m.hasPointerCapture(p.pointerId)&&m.releasePointerCapture(p.pointerId),m.classList.remove("cursor-grabbing"),m.classList.add("cursor-grab"))};return m.addEventListener("pointerenter",f),m.addEventListener("pointerleave",x),m.addEventListener("pointerdown",v),m.addEventListener("pointermove",k),m.addEventListener("pointerup",b),m.addEventListener("pointercancel",b),()=>{cancelAnimationFrame(r.rafId),d.disconnect(),m.removeEventListener("pointerenter",f),m.removeEventListener("pointerleave",x),m.removeEventListener("pointerdown",v),m.removeEventListener("pointermove",k),m.removeEventListener("pointerup",b),m.removeEventListener("pointercancel",b)}},[e.length]);const s=[...e,...e];return a.jsx("div",{ref:t,className:"marquee-viewport cursor-grab touch-pan-y select-none overflow-hidden",children:a.jsx("div",{ref:n,className:"marquee-track flex w-max gap-5",children:s.map((i,l)=>a.jsx("div",{className:"w-64 shrink-0 sm:w-72 lg:w-80",children:a.jsxs("div",{className:"flex h-full flex-col rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx(ob,{className:"mb-3 h-4 w-4"}),a.jsxs("p",{className:"mb-4 flex-1 text-sm text-neutral-600 dark:text-neutral-300",children:["„",i.text,'"']}),a.jsx("p",{className:"text-sm font-semibold text-neutral-900 dark:text-white",children:i.name})]})},`${i.name}-${l}`))})})}const SC="/assets/gallery-dash2-CEVCErVK.webp",ub="/assets/gallery-amp-purple-CESAKuOf.webp",CC="/assets/gallery-speaker-CUXQZ49Q.webp",cb="/assets/gallery-subs-COSd4seJ.webp",db="/assets/gallery-dash-Cg-7v9qo.webp",PC="/assets/hero-trunk-Dp4_JHDh.webp",EC="/assets/gallery-rear-8cIXPC7T.webp",TC="/assets/hero-highlight-Co4f1Kj5.webp",AC="/assets/youtube-hintergrund-C0osNxn7.mp4",MC="ostj2mKDVUc",_C=["Ground Zero Audio","Audison","Hertz","Helix","Brax","Gladen","Alpine","Pioneer","Kenwood","JVC"],LC=[{src:cb,width:900,height:600},{src:ub,width:900,height:600},{src:CC,width:900,height:1200},{src:db,width:900,height:814},{src:EC,width:900,height:1200},{src:PC,width:1920,height:1280}];function DC(){const{hero_image_path:e}=Rr(),t=e||SC,{t:n,language:r}=Ce(),s=n("home.stats"),i=n("home.galleryAlts"),l=LC.map((p,y)=>({...p,alt:i[y]})),o=n("home.testimonials"),[u,c]=g.useState([]);g.useEffect(()=>{M.get("/faqs").then(p=>{c(p.map(y=>({question:r==="de"?y.question_de:y.question_en,answer:r==="de"?y.answer_de:y.answer_en})))}).catch(()=>{})},[r]),tt({title:n("home.metaTitle"),description:n("home.metaDescription"),path:"/"}),g.useEffect(()=>{if(u.length===0)return;const p=document.createElement("script");return p.type="application/ld+json",p.text=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:u.map(y=>({"@type":"Question",name:y.question,acceptedAnswer:{"@type":"Answer",text:y.answer}}))}),document.head.appendChild(p),()=>document.head.removeChild(p)},[u]);const d=g.useRef(null),{scrollYProgress:h}=sb({target:d,offset:["start start","end start"]}),m=Jt(h,[0,1],["-6%","6%"]),f=Jt(h,[0,1],["0%","60%"]),x=Jt(h,[0,.8],[1,0]),v=Jt(h,[.5,1],[0,1]),k=Jt(v,p=>p>.05?"auto":"none"),b=Jt(h,[.5,1],[16,0]);return a.jsxs("div",{children:[a.jsx(Vt.div,{style:{opacity:v,pointerEvents:k,y:b},className:"fixed inset-x-0 bottom-0 z-20 border-t border-neutral-200 bg-white/95 px-4 py-3 shadow-[0_-8px_24px_rgba(0,0,0,0.08)] backdrop-blur dark:border-neutral-800 dark:bg-neutral-950/95 sm:px-6",children:a.jsxs("div",{className:"mx-auto flex max-w-6xl items-center justify-between gap-3",children:[a.jsx("p",{className:"hidden text-sm font-medium text-neutral-600 dark:text-neutral-300 sm:block",children:n("home.stickyCta")}),a.jsxs("div",{className:"flex w-full gap-3 sm:w-auto",children:[a.jsx(U,{to:"/fahrzeuge",className:"flex-1 rounded-md bg-brand-500 px-5 py-2.5 text-center text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 sm:flex-none",children:n("home.selectVehicle")}),a.jsx(U,{to:"/kontakt",className:"flex-1 rounded-md border border-neutral-300 px-5 py-2.5 text-center text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800 sm:flex-none",children:n("home.getInTouch")})]})]})}),a.jsxs("section",{ref:d,className:"relative -mt-[89px] h-dvh min-h-[560px] overflow-hidden sm:-mt-[97px]",children:[a.jsx(Vt.img,{style:{y:m,scale:1.15},src:t,alt:n("home.heroImageAlt"),className:"absolute inset-0 h-full w-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-neutral-950 via-neutral-950/80 to-neutral-950/40"}),a.jsx(Vt.div,{style:{y:f,opacity:x},className:"relative flex h-full max-w-6xl flex-col items-center justify-center px-4 mx-auto text-center sm:px-6",children:a.jsxs(Vt.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.7,ease:"easeOut"},children:[a.jsx("p",{className:"mb-3 text-sm font-semibold uppercase tracking-wide text-brand-400",children:n("home.welcome")}),a.jsx("h1",{className:"text-3xl font-extrabold tracking-tight text-white sm:text-5xl",children:n("home.heroTitle")}),a.jsx("p",{className:"mx-auto mt-4 max-w-2xl text-base text-neutral-200 sm:text-lg",children:n("home.heroSubtitle")}),a.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-3",children:[a.jsx(U,{to:"/fahrzeuge",className:"rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white shadow-sm transition hover:-translate-y-0.5 hover:bg-brand-600 hover:shadow-lg",children:n("home.selectVehicle")}),a.jsx(U,{to:"/kontakt",className:"rounded-md border border-white/30 bg-white/10 px-6 py-3 text-sm font-semibold text-white backdrop-blur transition hover:-translate-y-0.5 hover:bg-white/20",children:n("home.getInTouch")})]})]})})]}),a.jsx("section",{className:"border-b border-neutral-200 bg-neutral-950 py-8 dark:border-neutral-800",children:a.jsx("div",{className:"mx-auto grid max-w-6xl grid-cols-2 gap-6 px-4 text-center sm:grid-cols-4 sm:px-6",children:s.map((p,y)=>a.jsxs(we,{index:y,children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-400 sm:text-3xl",children:p.value}),a.jsx("p",{className:"text-sm text-neutral-400",children:p.label})]},p.label))})}),a.jsx("section",{className:"border-b border-neutral-200 py-8 dark:border-neutral-800",children:a.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[a.jsx("p",{className:"mb-4 text-center text-xs font-semibold uppercase tracking-wide text-neutral-400",children:n("home.brandsHeading")}),a.jsx("div",{className:"flex flex-wrap items-center justify-center gap-x-8 gap-y-3",children:_C.map((p,y)=>a.jsx(we,{index:y,className:"text-lg font-bold text-neutral-400 dark:text-neutral-600",children:p},p))})]})}),a.jsxs("section",{className:"relative flex min-h-[70vh] items-center justify-center overflow-hidden sm:min-h-[85vh]",children:[a.jsx("video",{autoPlay:!0,loop:!0,muted:!0,playsInline:!0,poster:db,className:"absolute inset-0 h-full w-full object-cover",children:a.jsx("source",{src:AC,type:"video/mp4"})}),a.jsx("div",{className:"absolute inset-0 bg-black/55"}),a.jsxs(we,{className:"relative mx-auto max-w-3xl px-4 text-center sm:px-6",children:[a.jsx("p",{className:"mb-4 text-xs font-semibold uppercase tracking-[0.2em] text-neutral-200 sm:text-sm",children:n("home.youtubeBadge")}),a.jsx("h2",{className:"text-3xl font-bold uppercase tracking-wide text-white sm:text-5xl",children:n("home.youtubeTitle")}),a.jsx("p",{className:"mt-4 text-xs font-semibold uppercase tracking-wide text-neutral-200 sm:text-sm",children:n("home.youtubeText")}),a.jsx("a",{href:`https://www.youtube.com/watch?v=${MC}`,target:"_blank",rel:"noopener noreferrer",className:"mt-8 inline-flex items-center justify-center rounded-full bg-white px-8 py-3 text-xs font-bold uppercase tracking-wide text-neutral-900 transition hover:-translate-y-0.5 hover:bg-neutral-100",children:n("home.youtubeCta")})]})]}),a.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:a.jsxs("div",{className:"mx-auto max-w-6xl space-y-16 overflow-hidden px-4 sm:px-6",children:[a.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[a.jsx(we,{direction:"left",shine:!0,className:"rounded-xl shadow-lg",children:a.jsx("img",{src:cb,alt:n("home.craftImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})}),a.jsxs(we,{direction:"right",index:1,children:[a.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:n("home.craftEyebrow")}),a.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.craftTitle")}),a.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:n("home.craftText")})]})]}),a.jsxs("div",{className:"grid items-center gap-8 md:grid-cols-2",children:[a.jsxs(we,{direction:"left",className:"order-2 md:order-1",children:[a.jsx("p",{className:"mb-2 text-sm font-semibold uppercase tracking-wide text-brand-600 dark:text-brand-400",children:n("home.adviceEyebrow")}),a.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.adviceTitle")}),a.jsx("p",{className:"text-neutral-600 dark:text-neutral-300",children:n("home.adviceText")})]}),a.jsx(we,{direction:"right",index:1,shine:!0,className:"order-1 md:order-2 rounded-xl shadow-lg",children:a.jsx("img",{src:ub,alt:n("home.adviceImageAlt"),width:900,height:600,className:"w-full rounded-xl object-cover",style:{maxHeight:380}})})]})]})}),a.jsxs("section",{className:"mx-auto max-w-6xl px-4 py-16 sm:px-6",children:[a.jsxs(we,{className:"mb-8 text-center",children:[a.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.insightsTitle")}),a.jsx("p",{className:"mt-2 text-neutral-600 dark:text-neutral-300",children:n("home.insightsText")})]}),a.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:l.map((p,y)=>a.jsx(we,{index:y%3,shine:!0,className:"aspect-square overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsx("img",{src:p.src,alt:p.alt,width:p.width,height:p.height,loading:"lazy",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})},p.src))})]}),a.jsx("section",{className:"grain-band border-y border-neutral-200 bg-neutral-50 py-16 dark:border-neutral-800 dark:bg-neutral-900/40",children:a.jsxs("div",{className:"mx-auto max-w-6xl px-4 sm:px-6",children:[a.jsxs(we,{className:"mb-10 text-center",children:[a.jsx("div",{className:"mb-2 flex items-center justify-center gap-2",children:a.jsx(ob,{className:"h-6 w-6"})}),a.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.reviewsRating")}),a.jsx("p",{className:"mt-1 text-neutral-600 dark:text-neutral-300",children:n("home.reviewsText")}),a.jsx("a",{href:"https://www.google.com/maps/search/?api=1&query=Hifi+Planet+Amorbach+Boxbrunner+Stra%C3%9Fe+20a",target:"_blank",rel:"noopener noreferrer",className:"mt-2 inline-block text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:n("home.reviewsLink")})]}),a.jsx(we,{children:a.jsx(NC,{testimonials:o})})]})}),a.jsx("section",{className:"mx-auto max-w-6xl overflow-hidden px-4 py-16 sm:px-6",children:a.jsxs("div",{className:"grid items-center gap-10 md:grid-cols-2",children:[a.jsx(we,{direction:"left",shine:!0,className:"overflow-hidden rounded-xl shadow-lg",children:a.jsx("img",{src:TC,alt:n("home.moreImageAlt"),width:1600,height:905,className:"h-full w-full object-cover",loading:"lazy"})}),a.jsxs(we,{direction:"right",index:1,className:"rounded-xl border border-neutral-200 bg-white p-8 text-center shadow-sm dark:border-neutral-800 dark:bg-neutral-900 md:text-left",children:[a.jsx("h2",{className:"mb-3 text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.moreTitle")}),a.jsx("p",{className:"mx-auto mb-8 max-w-2xl text-neutral-600 dark:text-neutral-300 md:mx-0",children:n("home.moreText")}),a.jsx(U,{to:"/leistungen",className:"inline-block rounded-md border border-neutral-300 px-6 py-3 text-sm font-semibold text-neutral-700 transition hover:-translate-y-0.5 hover:bg-neutral-100 dark:border-neutral-700 dark:text-neutral-200 dark:hover:bg-neutral-800",children:n("home.moreCta")})]})]})}),a.jsx("section",{className:"border-t border-neutral-300 py-16 dark:border-neutral-700",children:a.jsxs("div",{className:"mx-auto max-w-3xl px-4 sm:px-6",children:[a.jsx(we,{className:"mb-8 text-center",children:a.jsx("h2",{className:"text-2xl font-bold text-neutral-900 dark:text-white",children:n("home.faqHeading")})}),a.jsx(we,{index:1,children:a.jsx(wC,{items:u})})]})})]})}function BC(){const[e,t]=g.useState([]),[n,r]=g.useState(""),s=pl(),{t:i}=Ce();return tt({title:i("vehicleSelect.metaTitle"),description:i("vehicleSelect.metaDescription"),path:"/fahrzeuge"}),g.useEffect(()=>{s.vehicles.enabled&&!s.bypass||M.get("/brands").then(t).catch(l=>r(l.message))},[s.vehicles.enabled,s.bypass]),s.vehicles.enabled&&!s.bypass?a.jsx(la,{message:s.vehicles.message}):a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[s.vehicles.enabled&&s.bypass&&a.jsx(oa,{inline:!0}),a.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:i("vehicleSelect.title")}),a.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:i("vehicleSelect.intro")}),n&&a.jsx("p",{className:"text-red-600",children:n}),e.length===0&&!n&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("vehicleSelect.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:e.map(l=>a.jsx(U,{to:`/fahrzeuge/${l.slug}`,className:"flex items-center justify-center rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:l.name},l.id))})]})}function zC(){const{brandSlug:e}=Gn(),[t,n]=g.useState(null),[r,s]=g.useState(""),i=pl(),{t:l}=Ce();return g.useEffect(()=>{i.vehicles.enabled&&!i.bypass||M.get(`/brands/${e}/models`).then(n).catch(o=>s(o.message))},[e,i.vehicles.enabled,i.bypass]),tt({title:t?`${t.brand.name} ${l("brandPage.titleSuffix")}`:l("brandPage.metaTitleFallback"),description:t?l("brandPage.metaDescription")(t.brand.name):void 0,path:`/fahrzeuge/${e}`}),i.vehicles.enabled&&!i.bypass?a.jsx(la,{message:i.vehicles.message}):r?a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[i.vehicles.enabled&&i.bypass&&a.jsx(oa,{inline:!0}),a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(U,{to:"/fahrzeuge",className:"hover:text-brand-500",children:l("brandPage.breadcrumbVehicles")})," / ",t.brand.name]}),a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",l("brandPage.titleSuffix")]}),t.models.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:l("brandPage.empty")}),a.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 md:grid-cols-3",children:t.models.map(o=>a.jsx(U,{to:`/fahrzeuge/${e}/${o.slug}`,className:"flex items-center justify-center rounded-xl border border-neutral-200 bg-white px-6 py-8 text-center font-semibold text-neutral-800 shadow-sm transition hover:-translate-y-0.5 hover:border-brand-500 hover:shadow-md dark:border-neutral-800 dark:bg-neutral-900 dark:text-neutral-100",children:o.name},o.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:l("brandPage.loading")})}const Pf="data:image/webp;base64,UklGRmoNAABXRUJQVlA4IF4NAAAQjACdASrgAVYDPlEok0ajoqGhIRK4IHAKCWlu/F+5xDCoDux8VXNtc99B5Uf715Q+k/+V6E/yD7bfvf7tYI7QKys1Pu/n/K9wD+L/0L/aeqHflfZf937AH81/p//N/yXr9f9f+M/yf7c+4D6R/7n+O+BL9d+rb+0f//9yX9VQU+fHDhw4cN7KTkCBAgQIECBAgQIEB8GtgzU5WrVq1atWrVq1atTTWWxGRvDLM5r169evXr169evVcNgPhleRXp06dOnTp06dOnTpUIn65+OKaJVsmzZs2bNmzZs2bNmSyYC6ipEunTp06dOnTp06dOlydZVuN901q1atWrVq1atWrVXZqLYS16JYyeHDhw4cOHDhw4cN4wtQeDaQLgECBAgQIECBAgQIDddB6sEmQB2atWrVq1atWrVq1aq1iYS5JU9iBlzXr169evXr169evXeEPp+8N6OklatWrVq1atWrVq1V3IfqDdZ8CK1AgQIECBAgQIECBBQFoI3bXHSzdGb8+OHDhw4cOHDhw4ZwLNj/Gx48ePHjx48ePHjx5HaZ5q8hFQPLVq1atWrVq1atWrVWlrSSS1atWrVq1atWrVq1VouJ4vs1atWrVq1atWrVqzMNN6naRaj4OHDhw4cOHDhwzggYy8goXr169evXr169evXbAmy3nWg79+/fv379+/fv377Aw+GV3JG24BIkSJEiRIkSJEiRH091sORb3KZK2rVq1atWrVq1atWZgOgxn2g3CECBAgQIECBAgQHwEh4tRYq5WHRSJEiRIkSJEiRIkRmQ4gXd9q0Xa9evXr169evXr169SUP3aSDmqBOfHDhw4cOHDhw4cN/rYXzoW6jx48ePHjx48ePHjwyNgV/F/hRIkSJEiRIkSJEiRGcgeccx2x48ePHjx48ePHjx5+h2DL7y1q1atWrVq1atWrVqrLjxn1+UevXr169evXr169epWz/ixb7G7Fx48ePHjx48ePHjx64Dpo0+TFzjw4cOHDhw4cOHDhwr64/FOVqj1ftlBYsWLFixYsWLFixsB93m6MKtrfi/YePHjx48ePHjx48eGCFP4MdBX+BXbQiRIkSJEiRIkSJEiA+X4/Ne4l0FixYsWLFixYsWLTKZjxkHLs7TTrVq1atWrVq1atWrSGY83Cktx0PPjhw4cOHDhw4cN/7Xmd/H4DxEePHjx48ePHjx48ct7KWpas7p5jy5cuXLly5cuXLlyM+h2/gRIkSJEiRIkSJEiRAPRMs9EnbFixYsWLFixYsWLBwJstxClHwcOHDhw4cOHDhw3+o6GvCGxY8ePHjx48ePHjx45aAayr3BCnnxw4cOHDhw4cOG/2HuJWxIvK1JLZs2bNmzZs2bNmyAMNnZLnTo6dOnTp06dOnTp06Vd0rFPQfnwwCPHjx48ePHjx48eOU7jRhCFUn5bFixYsWLFixYsWKZRr/1LzwcOHDhw4cOHDhw4ZshIGgexQoECBAgQIECBAgQH+hD+jvXr169eu0AAP7/2BA2pStbx3f0LK6/mZcFuZpv73FLTm7GUv07j8lFLoOGX1EwKUHfPc4FImBkAvjxF1E2TgBogJKpQ2lbMv5bOqPckB4PELJo9ZXlMwGup4PkMOtTZPmrbNoaCJqn0H4Bx7A0xA439P5hkMGBnAEfInQIN5UeUIDb3y6tLej2gR8HhJ5XmTsxvmM15ltL5ZwdGmoNeW8NevUVUKqJ8mNngu7ocCsyGYaeYOGGZBBt6rj6bPVKVbxvb8onw6mljAaaxGTz0W+aNPv06kK3qhDe6/uHi8kg2qvjF3njhRMyOJKZzg12h4qOtVgTuKPAMRWYDkgwiRs9iYqcumonNNXvXk3FAk2LO5XnyjtD5sHSUO3pIrztpBvqq+UJzKeIwGBlPwA2NP46tOJxLzbrKeH4SQjt2HAsbrVcQ/b/TgKZGPwaqfGDN+OjqJK3Z9dyCkGGfGKeG1w9+HSZTm/qh052lQEJAcdUX6vm/+sDBxtrfl4Sg8iMcVnDsfTKJpsTYF/vzJ1oQ6/VPyIX1HpDwnPXsptu9rKDFazlkwc3ofi8uKJmycgPiG9xOLlzn4Af8Dm+LcjJUMAtA7XeZPLlW1bwogbRthU8oA4LcURuku6eXDJ1eb1IKUU7k/UK0cBeK+R5YVcmrOnZIyHzcIaClYnrIwerP535fHv4VXjURTO6/85BvSeTNWvQGqkW5v1hG6AEMrxBryfat3kmr+SNEz5wC2f54z1O7C2KsRpt3maISh9PhMg7jDIxmVe07eHtkLtz6v3yQUJQV95yazDYpH5JfpuYSb8dtmB1cKjeoDTPvik9dCA1UFCTZBfojpIOwXdwAR7JEdZkEi/24hMNKJJlB6udZZKqNJB1hNl24Z++z6lAGSAuRgSwDZGdbqxs+0iL6wmRHilqPOiYB6hQiPZ7cfpMZxesqRwyhcf1O29w4ORG/7BlerR8hYvY4B1XsPYbDORvPk6FHIDXwTXGpuDIta7G4F6RNDdOvCFkAl53GZo5h/p2QkWUry5YuyegnPlKjT3He6ewYypA9YOvMhaqip7kr9sF4TU2bX9foKZ+FFZNzhyySS+13+g4BdJo9YF3bw5b6eSxUfTWiDLNh50VjuqRQWHUEkiA8zJqnqkKCwuDy6iY2oF20FJQlGIPpCDKPBzdXSb/n9NDltaoUlbam7cDAU7CwNdaWFXTABRk0S0e49iF4tO106Uwul7DGYpq0Eu71TnKUjCtEBc83QH8skvRzHniEne3AtJLYRH0cMNSSzeCJ1g+Nfc8RaZkhLhCaZGZdYe5j0LGmQnVFt2iapZvGBi7Sw0X56zdziC9Foq0OPsqKFetZdICc2eUV5Vu1+nvisSzn8wlSDUt3OmRkt/gJxfJQfWxcu5HZ26qqNpA4ablWrX4E9DEmvXzpFGYCnYJMheN2BlWwBVLh1cyQ8INngXaoB8I5Pj9oYyuz/W+jvJQ6G074luX9D3pLkuc88D0Hae3ZqXrRYRzGF1vD8pHsk9Co8B6rpE/4GEwW/zsCtnjz5G8m4KFwf2qW1k0HkNv7Nlg38bcz6TdTzuw/jega5XZQQhflLu4I6l+s90BHFIR+JEXTBBqJwT+IgTnpHNc+h5Ek74HiKqXuGUNGIKIozHkiFxMlnrsklrpweBzYY6ype9CzepAuQF63xC/eIJw1pMZEC1pPgq/r+1gWx5M6g8fpu2O12sb6pLeqT+G4mK3yHMZTojfp1xwQedRmwZnWQ8SCh4XV2a/+3OTz4D4pmmumyBV7V2VW3he8y6usinSjfYPxLyTng27fgw6jQhHl2mVhxBBjiwr5ljvJV7L+MJYDiZjGWfBCsTmehk6rbNt7ahTJpHu4B9ctRqiZXjx0zGpTF91OKifmy4nTq31p1XaIsZAHCWvItXKeke06KKKRTIm6mCT9yBJVwG1sqQhjrkP77q0/JGYgOwgdCQCstsAZQ0FlOrGYXYTIQK/krLyCAZjg8vP/Ers/KVN8F88OsyU5/T1e5ba8A2F63qgwhtkWoVIEZErOVL8sM/DtpWTlcBNsvVOFl4tT+Sk6a2ScCptFL5F6cZXTIw8JmgoCbyqB6xyU+uPP5y09s5T8MDC7Em7NpxCjgD39eed40gHQrBm6CtAbS9JOCVPkPxbpcGDj/LoAGbnyYzMpOmTi28LJ9FTIqyGuAI0jxY/QpNelOOEvNK3io1HeYkK3AprImDk99tlUjgt9bc3ejCOFDXt9LqGHjFssGrhVHyJBmWjwHQipcIMHxF2jfP5jfAGuHtJRRncHIFgLWmJ1XmzJ0LLqWCJShdJSJLc7L6YeVcgKfzOZCwhtzJ7VeI3uBhPXQNOqCf5tlQ32HApAMvCIiBwhYrpfFo/kvjfTMB/NJ0w2Lk8GAFfFQY+U6uX1oB0hztGmA5HggJTwgLo8exG64m3Xu4fg2g4MmQol7z6xNwwubABnpoS3Og85giFkaarUP2ovQyixFpXki8Xf5a5NwjUGCPbx+LD3WKJiBtkiHsYMMV/VAZVNvdg/Ph/V4ZYOr+hw7g9mOJXi+oVZxG9pqJC9w8nRkegsnQ2lpRHn22lTsIa9aOkR0X8zp/IajQxUzv057a3WptBst0EZbZtfmWp6h2K0sDQS9oQT1PqOkGDJlz6ZHZzDMShDTcwJfIZMdnjpeHdPoYoqlcn3M8daRuMeTSP3mabP1/pdQrs6Wl7ToKog2Au/gv46pUMgVcKmdWNJdDF8RplMMXJpU2tZMdkTWq4ofSypsCfuWfeHOpFQGJdFF6OoH2pDJXvkqpj1a832g3uYtVQg1TGyqYqI7UBZQy4NEZbdj6O/s6MNEnfujUDQ8QZj7rSE2RI77egKDWzM708AsvlMFoeX4CVP09rMzXNP2aOZwY7zOBTvBgEEqCWlXAFlY8pW0zIm16gqSPiwRUgH41i1PuJx382C0zTWGT243ZhLnyOIlreUrMQAfwR/oYt+ljnDFKqa5PEczDPa+u/vWmR6UM+Q/lLFiIlgBJTfaekWoeLpPd9FPN4gIHzK1ZS8kDHyq3lh/e6FQ84a4Zg6JlfQC/qhAAAAA==",IC="/assets/base-BKOm0Bib.webp",RC="/assets/clear-DZZMSrMX.webp",FC="/assets/drive-BE2W1yna.webp",VC="/assets/prime-BTVNe2Gb.webp",OC="/assets/elite_r-BRvz_pyr.webp",UC="/assets/apex-CFy2qup8.webp",WC="/assets/statement-pTO-wTPx.webp",HC="/assets/limitless-DDs0S_PU.webp",$C=(e,t,n)=>{t/=100,n/=100;const r=l=>(l+e/30)%12,s=t*Math.min(n,1-n),i=l=>n-s*Math.max(-1,Math.min(r(l)-3,Math.min(9-r(l),1)));return[Math.round(i(0)*255),Math.round(i(8)*255),Math.round(i(4)*255)]},go=(e,t,n)=>`rgb(${$C(e,t,n).join(", ")})`,Ef=e=>e.map(([t,n,r,s,i,l])=>({bgTop:go(t,n,r),border:go(t,n,r+8),accent:go(s,i,l),img:null})),Tf={graphite:[{accent:"#b6b6b6",border:"#2a2a2a",bgTop:"#1c1c1c",img:IC},{accent:"#d3d3d3",border:"#2e2e2e",bgTop:"#212121",img:RC},{accent:"#8fb8bd",border:"#26383b",bgTop:"#16282b",img:FC},{accent:"#6fbf73",border:"#1f3a24",bgTop:"#122916",img:VC},{accent:"#63d34f",border:"#204a1c",bgTop:"#123312",img:OC},{accent:"#8bea3c",border:"#2b5518",bgTop:"#173a0f",img:UC},{accent:"#d9a83c",border:"#4a3a16",bgTop:"#33270d",img:WC},{accent:"#f2c14e",border:"#5a4718",bgTop:"#3d2f0c",img:HC}],"deep-blue":Ef([[215,18,11,210,15,60],[212,25,11,208,32,60],[210,38,12,206,46,60],[212,46,12,205,56,61],[214,52,12,205,63,62],[216,58,12,205,68,63],[220,62,12,212,73,65],[226,66,12,216,78,68]]),"warm-bronze":Ef([[30,15,11,34,22,60],[34,32,11,34,46,60],[32,46,12,30,58,60],[26,52,12,24,65,60],[20,55,12,18,68,60],[14,55,12,12,68,61],[8,52,12,6,64,62],[2,50,12,358,60,63]])},GC="#f2f2f2",KC="#8a8a8a",qC="#c4c4c4",Af=5;function YC({pkg:e,tier:t,tierT:n,layout:r,bullets:s,formatPrice:i,contactUrl:l,t:o}){const[u,c]=g.useState(!1),d=s.length-Af,h=u?s:s.slice(0,Af),m=t.img?null:{backgroundColor:t.accent,WebkitMaskImage:`url(${Pf})`,maskImage:`url(${Pf})`,maskMode:"luminance",WebkitMaskSize:"cover",maskSize:"cover",WebkitMaskPosition:"center",maskPosition:"center",WebkitMaskRepeat:"no-repeat",maskRepeat:"no-repeat"};return a.jsxs("div",{style:{borderColor:t.border,background:`linear-gradient(180deg, ${t.bgTop} 0%, #0b0b0b 55%, #080808 100%)`},className:r==="strip"?"relative flex min-h-[640px] grow shrink basis-[190px] min-w-[190px] max-w-[240px] snap-start flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40 sm:basis-[210px]":r==="coverflow"?"relative flex min-h-[640px] w-[230px] shrink-0 snap-center flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 will-change-transform dark:shadow-black/40":"relative flex min-h-[640px] flex-col overflow-hidden rounded-[18px] border shadow-xl shadow-neutral-900/20 dark:shadow-black/40",children:[t.img?a.jsx("img",{src:t.img,alt:"","aria-hidden":"true",className:"pointer-events-none absolute inset-0 h-full w-full object-cover"}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...m,opacity:.2+n*.45,filter:"blur(18px)"},"aria-hidden":"true"}),a.jsx("div",{className:"pointer-events-none absolute inset-0",style:{...m,opacity:.55+n*.45},"aria-hidden":"true"})]}),e.is_featured&&a.jsx("span",{className:"absolute top-2 left-1/2 z-10 -translate-x-1/2 rounded-full bg-brand-500 px-3 py-1 text-xs font-bold text-white shadow",children:o("modelPage.featuredBadge")}),a.jsxs("div",{className:"relative z-10 text-center",style:{padding:"34px 20px 0"},children:[a.jsx("div",{style:{fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",letterSpacing:"3px",fontWeight:600,color:t.accent,textTransform:"uppercase",lineHeight:1.1},children:e.name}),a.jsx("div",{style:{width:"44px",height:"2px",margin:"14px auto 0",background:`linear-gradient(90deg, rgba(255,255,255,0) 0%, ${t.accent} 50%, rgba(255,255,255,0) 100%)`}})]}),s.length>0&&a.jsxs("div",{className:"relative z-10",style:{padding:"18px 20px 14px",background:u?"linear-gradient(180deg, rgba(8,8,8,0.7) 0%, rgba(8,8,8,0.62) 94%, rgba(8,8,8,0) 100%)":"linear-gradient(180deg, rgba(8,8,8,0.55) 0%, rgba(8,8,8,0.48) 92%, rgba(8,8,8,0) 100%)"},children:[a.jsx("ul",{className:"space-y-1.5 text-left",children:h.map((f,x)=>a.jsxs("li",{className:"flex items-start gap-2",style:{fontSize:"13px",color:qC},children:[a.jsx(Ue,{name:"check",className:"mt-0.5 h-3.5 w-3.5 shrink-0",style:{color:t.accent}}),a.jsx("span",{className:"leading-snug",children:f})]},x))}),d>0&&a.jsxs("button",{type:"button",onClick:()=>c(f=>!f),className:"mt-2.5 flex items-center gap-1 hover:opacity-80",style:{fontSize:"13px",color:t.accent},children:[u?o("modelPage.lessBullets"):o("modelPage.moreBullets")(d),a.jsx(Ue,{name:u?"chevron-up":"chevron-down",className:"h-3.5 w-3.5"})]})]}),a.jsx("div",{className:"relative z-10 flex-1"}),a.jsx("div",{className:"relative z-10",style:{padding:"20px 20px 28px",background:"linear-gradient(180deg, rgba(8,8,8,0) 0%, rgba(8,8,8,0.85) 45%, rgba(8,8,8,0.95) 100%)"},children:a.jsxs("div",{className:"text-center",children:[!e.price_text&&a.jsx("div",{style:{fontSize:"13px",color:KC},children:o("modelPage.totalPrice")}),a.jsx("div",{style:{marginTop:"4px",fontFamily:"'Barlow Condensed', sans-serif",fontSize:"30px",fontWeight:600,letterSpacing:"1px",color:GC},children:e.price_text||i(e.total_price)}),a.jsx(U,{to:l(e),className:"mt-4 inline-block rounded-md bg-brand-500 px-4 py-2 text-center text-sm font-semibold text-white shadow-lg shadow-brand-500/30 hover:bg-brand-400",children:o("modelPage.requestContact")})]})})]})}function XC(){const{brandSlug:e,modelSlug:t}=Gn(),[n,r]=g.useState(null),[s,i]=g.useState(""),l=pl(),{t:o,language:u}=Ce(),{package_card_theme:c,package_card_layout:d}=Rr(),h=Tf[c]||Tf.graphite,m=["grid","strip","coverflow"].includes(d)?d:"strip",f=g.useRef(null),x=g.useRef(null),v=g.useRef(null),k=g.useRef(!1),[b,p]=g.useState(!1),y=N=>new Intl.NumberFormat(u==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(N);if(g.useEffect(()=>{l.vehicles.enabled&&!l.bypass||M.get(`/models/${e}/${t}/packages`).then(r).catch(N=>i(N.message))},[e,t,l.vehicles.enabled,l.bypass]),g.useEffect(()=>{const N=f.current;if(m!=="coverflow"||!N)return;let E=0;const B=()=>{E=0;const Q=N.scrollLeft+N.clientWidth/2;for(const R of N.children){const K=R.offsetLeft+R.offsetWidth/2,_=Math.max(-1,Math.min(1,(K-Q)/(R.offsetWidth*1.4))),D=Math.abs(_);R.style.transform=`rotateY(${(-_*35).toFixed(2)}deg) scale(${(1-D*.13).toFixed(3)}) translateZ(${(-D*60).toFixed(1)}px)`,R.style.zIndex=String(100-Math.round(D*50))}},V=()=>{E||(E=requestAnimationFrame(B))};B(),N.addEventListener("scroll",V,{passive:!0});const $=new ResizeObserver(V);return $.observe(N),()=>{N.removeEventListener("scroll",V),$.disconnect(),cancelAnimationFrame(E)}},[m,n]),g.useEffect(()=>{const N=f.current;if(m==="grid"||!N||k.current)return;const E=window.matchMedia("(pointer: coarse)").matches;if(window.matchMedia("(prefers-reduced-motion: reduce)").matches)return;k.current=!0;const V=Math.min(N.clientWidth*.4,160),$=[setTimeout(()=>N.scrollTo({left:V,behavior:"smooth"}),500),setTimeout(()=>N.scrollTo({left:0,behavior:"smooth"}),1250)];return E||($.push(setTimeout(()=>p(!0),450)),$.push(setTimeout(()=>p(!1),1700))),()=>$.forEach(clearTimeout)},[m,n]),g.useEffect(()=>{const N=f.current;if(m==="grid"||!N)return;let E=0,B=0,V=!1,$=0,Q=0;const R=()=>[...N.children].map(z=>z.offsetLeft+z.offsetWidth/2),K=(z,O)=>{let G=0,Z=1/0;return z.forEach((J,Me)=>{const Ie=Math.abs(J-O);Ie{V=!1;const z=R();if(!z.length)return;const O=N.scrollLeft+N.clientWidth/2,G=K(z,O);let Z=G;G===$&&Math.abs(Q)>4&&(Z=Q>0?Math.min($+1,z.length-1):Math.max($-1,0));const J=N.scrollWidth-N.clientWidth,Me=Math.max(0,Math.min(z[Z]-N.clientWidth/2,J));N.scrollTo({left:Me,behavior:"smooth"}),clearTimeout(B),B=setTimeout(()=>{N.style.scrollSnapType=""},450)},D=z=>{if(Math.abs(z.deltaX)>Math.abs(z.deltaY))return;const O=N.scrollWidth-N.clientWidth;if(O<=1)return;const G=N.scrollLeft<=1,Z=N.scrollLeft>=O-1;z.deltaY<0&&G||z.deltaY>0&&Z||(z.preventDefault(),V||(V=!0,Q=0,$=K(R(),N.scrollLeft+N.clientWidth/2)),Q+=z.deltaY,N.style.scrollSnapType="none",N.scrollLeft+=z.deltaY,clearTimeout(E),E=setTimeout(_,150))};return N.addEventListener("wheel",D,{passive:!1}),()=>{N.removeEventListener("wheel",D),clearTimeout(E),clearTimeout(B)}},[m,n]),g.useEffect(()=>{const N=f.current,E=x.current,B=v.current;if(m==="grid"||!N||!E||!B)return;let V=0;const $=()=>{V=0;const Z=N.scrollWidth-N.clientWidth;if(Z<=1){E.style.opacity="0",E.style.pointerEvents="none";return}E.style.opacity="1",E.style.pointerEvents="auto";const J=E.clientWidth,Me=Math.max(32,N.clientWidth/N.scrollWidth*J);B.style.width=`${Me}px`,B.style.transform=`translateX(${(N.scrollLeft/Z*(J-Me)).toFixed(1)}px)`},Q=()=>{V||(V=requestAnimationFrame($))};$(),N.addEventListener("scroll",Q,{passive:!0});const R=new ResizeObserver(Q);R.observe(N);let K=!1,_=0;const D=Z=>{const J=E.getBoundingClientRect(),Me=B.clientWidth,Ie=Math.min(Math.max(Z-J.left-_,0),J.width-Me);N.scrollLeft=Ie/(J.width-Me)*(N.scrollWidth-N.clientWidth)},z=Z=>{K=!0,E.setPointerCapture(Z.pointerId),N.style.scrollSnapType="none";const J=B.getBoundingClientRect();_=Z.clientX>=J.left&&Z.clientX<=J.right?Z.clientX-J.left:B.clientWidth/2,Z.clientX>=J.left&&Z.clientX<=J.right||D(Z.clientX)},O=Z=>{K&&D(Z.clientX)},G=Z=>{var J;K&&(K=!1,(J=E.hasPointerCapture)!=null&&J.call(E,Z.pointerId)&&E.releasePointerCapture(Z.pointerId),N.style.scrollSnapType="")};return E.addEventListener("pointerdown",z),E.addEventListener("pointermove",O),E.addEventListener("pointerup",G),E.addEventListener("pointercancel",G),()=>{N.removeEventListener("scroll",Q),R.disconnect(),cancelAnimationFrame(V),E.removeEventListener("pointerdown",z),E.removeEventListener("pointermove",O),E.removeEventListener("pointerup",G),E.removeEventListener("pointercancel",G)}},[m,n]),tt({title:n?o("modelPage.metaTitle")(n.model.brand_name,n.model.name):o("modelPage.metaTitleFallback"),description:n?o("modelPage.metaDescription")(n.model.brand_name,n.model.name):void 0,path:`/fahrzeuge/${e}/${t}`}),l.vehicles.enabled&&!l.bypass)return a.jsx(la,{message:l.vehicles.message});if(s)return a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s});if(!n)return a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:o("modelPage.loading")});const{model:w,packages:j}=n,C=new Map([...j].sort((N,E)=>N.total_price-E.total_price).map((N,E)=>[N.id,E])),S=N=>{const E=j.length,B=C.get(N.id)??0,V=E<=1?0:B/(E-1),$=Math.round(V*(h.length-1));return{tier:h[$],tierT:V}},P=N=>[...N.products.map(E=>E.name_override||E.scraped_name||o("modelPage.productLoading")),...(N.description||"").split(` `).map(E=>E.trim()).filter(Boolean)],T=N=>`/kontakt?${new URLSearchParams({brand:w.brand_name,model:w.name,package:N.name,packageId:N.id,total:N.total_price}).toString()}`;return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mx-auto max-w-6xl px-4 pt-12 sm:px-6",children:[l.vehicles.enabled&&l.bypass&&a.jsx(oa,{inline:!0}),a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(U,{to:"/fahrzeuge",className:"hover:text-brand-500",children:o("modelPage.breadcrumbVehicles")})," /"," ",a.jsx(U,{to:`/fahrzeuge/${e}`,className:"hover:text-brand-500",children:w.brand_name})," / ",w.name]}),a.jsxs("h1",{className:`text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl ${j.length?"mb-2":"mb-8"}`,children:[w.brand_name," ",w.name," – ",o("modelPage.titleSuffix")]}),j.length===0&&a.jsx("p",{className:"pb-12 text-neutral-500 dark:text-neutral-400",children:o("modelPage.empty")})]}),j.length>0&&a.jsx("section",{className:"py-10 sm:py-14",style:{fontFamily:"'Barlow', sans-serif"},children:a.jsxs("div",{className:m==="grid"?"mx-auto max-w-6xl px-4 sm:px-6":"relative mx-auto max-w-[1880px] px-4 sm:px-6",children:[a.jsx("div",{ref:m==="grid"?void 0:f,className:m==="grid"?"grid items-start gap-[18px] sm:grid-cols-2 xl:grid-cols-3":"flex select-none items-start gap-[18px] overflow-x-auto pb-3 snap-x snap-mandatory [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",style:m==="coverflow"?{perspective:"1200px",paddingLeft:"calc(50% - 115px)",paddingRight:"calc(50% - 115px)",paddingTop:"10px"}:void 0,children:j.map(N=>{const{tier:E,tierT:B}=S(N);return a.jsx(YC,{pkg:N,tier:E,tierT:B,layout:m,bullets:P(N),formatPrice:y,contactUrl:T,t:o},N.id)})}),m!=="grid"&&a.jsx("div",{className:`pointer-events-none absolute inset-x-0 top-1/2 z-[200] flex -translate-y-1/2 justify-center transition-opacity duration-300 ${b?"opacity-100":"opacity-0"}`,"aria-hidden":"true",children:a.jsxs("div",{className:"flex items-center gap-2 rounded-full border border-white/10 bg-neutral-900/85 px-4 py-2 text-xs font-medium text-white shadow-lg backdrop-blur-sm",children:[a.jsx(zb,{className:"h-3.5 w-3.5 text-brand-400"}),a.jsx(Ib,{className:"h-4 w-4 text-brand-400"}),a.jsx(Rb,{className:"h-3.5 w-3.5 text-brand-400"}),a.jsx("span",{children:o("modelPage.wheelHint")})]})}),m!=="grid"&&a.jsx("div",{ref:x,className:"relative mx-auto mt-5 h-2 w-56 max-w-full cursor-pointer rounded-full bg-neutral-900/10 transition-opacity duration-200 dark:bg-white/10",style:{touchAction:"none"},"aria-hidden":"true",children:a.jsx("div",{ref:v,className:"absolute left-0 top-0 h-full rounded-full bg-brand-500 shadow-[0_0_10px_rgba(107,166,38,0.7)]",style:{width:"48px"}})})]})})]})}function ZC(){const[e,t]=g.useState(null),[n,r]=g.useState(""),{t:s}=Ce();return tt({title:s("galleryOverview.metaTitle"),description:s("galleryOverview.metaDescription"),path:"/galerie"}),g.useEffect(()=>{M.get("/gallery-brands").then(t).catch(i=>r(i.message))},[]),a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:s("galleryOverview.title")}),a.jsx("p",{className:"mb-8 text-neutral-600 dark:text-neutral-300",children:s("galleryOverview.intro")}),n&&a.jsx("p",{className:"text-red-600",children:n}),!e&&!n&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.loading")}),e&&e.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:s("galleryOverview.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:e==null?void 0:e.map(i=>a.jsxs(U,{to:`/galerie/${i.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[i.cover_image_path?a.jsx("img",{src:i.cover_image_path,alt:i.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):a.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),a.jsx("span",{className:"absolute inset-x-0 bottom-0 p-4 text-lg font-extrabold text-white",children:i.name})]},i.id))})]})}function QC(){const{brandSlug:e}=Gn(),[t,n]=g.useState(null),[r,s]=g.useState(""),{t:i}=Ce();return g.useEffect(()=>{M.get(`/gallery-brands/${e}/projects`).then(n).catch(l=>s(l.message))},[e]),tt({title:t?i("galleryBrandPage.metaTitle")(t.brand.name):i("galleryBrandPage.metaTitleFallback"),description:t?i("galleryBrandPage.metaDescription")(t.brand.name):void 0,path:`/galerie/${e}`}),r?a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:r}):t?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(U,{to:"/galerie",className:"hover:text-brand-500",children:i("galleryBrandPage.breadcrumbGallery")})," / ",t.brand.name]}),a.jsxs("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:[t.brand.name," – ",i("galleryBrandPage.titleSuffix")]}),t.projects.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:i("galleryBrandPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:t.projects.map(l=>a.jsxs(U,{to:`/galerie/${e}/${l.slug}`,className:"group relative block aspect-[4/3] overflow-hidden rounded-xl bg-neutral-900 shadow-sm transition hover:shadow-lg",children:[l.cover_image_path?a.jsx("img",{src:l.cover_image_path,alt:l.name,className:"h-full w-full object-cover transition duration-300 group-hover:scale-105"}):a.jsx("div",{className:"flex h-full w-full items-center justify-center bg-neutral-200 dark:bg-neutral-800"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/85 via-black/10 to-transparent transition group-hover:from-black/95"}),a.jsx("span",{className:"absolute inset-x-0 bottom-0 p-4 text-lg font-extrabold text-white",children:l.name})]},l.id))})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:i("galleryBrandPage.loading")})}function JC({photos:e,index:t,onClose:n,onNavigate:r}){const{t:s}=Ce();if(g.useEffect(()=>{if(t==null)return;const o=u=>{u.key==="Escape"&&n(),u.key==="ArrowRight"&&r(1),u.key==="ArrowLeft"&&r(-1)};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[t,n,r]),t==null)return null;const i=e[t],l=o=>o.stopPropagation();return Hc.createPortal(a.jsxs("div",{className:"fixed inset-0 z-[200] flex items-center justify-center bg-black/90 p-4",onClick:n,children:[a.jsx("button",{onClick:o=>{l(o),n()},"aria-label":s("lightbox.close"),className:"absolute right-4 top-4 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-7 w-7",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 6l12 12M18 6 6 18"})})}),e.length>1&&a.jsx("button",{onClick:o=>{l(o),r(-1)},"aria-label":s("lightbox.previous"),className:"absolute left-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:left-4",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m15 18-6-6 6-6"})})}),a.jsx("img",{src:i.image_path,alt:i.caption||"",onClick:l,className:"max-h-[85vh] max-w-full rounded-lg object-contain"}),e.length>1&&a.jsx("button",{onClick:o=>{l(o),r(1)},"aria-label":s("lightbox.next"),className:"absolute right-2 top-1/2 -translate-y-1/2 rounded-full p-2 text-white/80 hover:bg-white/10 hover:text-white sm:right-4",children:a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",className:"h-8 w-8",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m9 18 6-6-6-6"})})}),i.caption&&a.jsx("p",{onClick:l,className:"absolute bottom-4 left-1/2 -translate-x-1/2 rounded-full bg-black/60 px-4 py-1.5 text-sm text-white",children:i.caption})]}),document.body)}function eP(){const{brandSlug:e,projectSlug:t}=Gn(),[n,r]=g.useState(null),[s,i]=g.useState(""),[l,o]=g.useState(null),{t:u}=Ce();g.useEffect(()=>{M.get(`/gallery-brands/${e}/${t}/photos`).then(r).catch(d=>i(d.message))},[e,t]),tt({title:n?`${n.project.name} – ${n.project.brand_name}`:u("galleryProjectPage.metaTitleFallback"),description:n?u("galleryProjectPage.metaDescription")(n.project.name):void 0,path:`/galerie/${e}/${t}`});const c=d=>{o(h=>{const m=n.photos.length;return(h+d+m)%m})};return s?a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-red-600 sm:px-6",children:s}):n?a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[a.jsxs("p",{className:"mb-1 text-sm text-neutral-500 dark:text-neutral-400",children:[a.jsx(U,{to:"/galerie",className:"hover:text-brand-500",children:u("galleryProjectPage.breadcrumbGallery")})," /"," ",a.jsx(U,{to:`/galerie/${e}`,className:"hover:text-brand-500",children:n.project.brand_name})," / ",n.project.name]}),a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:n.project.name}),n.photos.length===0&&a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:u("galleryProjectPage.empty")}),a.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3",children:n.photos.map((d,h)=>a.jsx(we,{index:h%6,shine:!0,className:"aspect-square overflow-hidden rounded-xl",children:a.jsx("button",{onClick:()=>o(h),className:"block h-full w-full","aria-label":d.caption||u("galleryProjectPage.enlargeImage"),children:a.jsx("img",{src:d.image_path,alt:d.caption||"",className:"h-full w-full object-cover transition duration-300 hover:scale-105"})})},d.id))}),a.jsx(JC,{photos:n.photos,index:l,onClose:()=>o(null),onNavigate:c})]}):a.jsx("p",{className:"mx-auto max-w-6xl px-4 py-12 text-neutral-500 sm:px-6",children:u("galleryProjectPage.loading")})}function tP(){const[e,t]=g.useState([]),n=pl(),{t:r}=Ce();return g.useEffect(()=>{M.get("/services").then(t).catch(()=>t([]))},[]),tt({title:r("leistungen.metaTitle"),description:r("leistungen.metaDescription"),path:"/leistungen"}),n.services.enabled&&!n.bypass?a.jsx(la,{message:n.services.message}):a.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-12 sm:px-6",children:[n.services.enabled&&n.bypass&&a.jsx(oa,{inline:!0}),a.jsx("h1",{className:"mb-2 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:r("leistungen.title")}),a.jsx("p",{className:"mb-10 max-w-2xl text-neutral-600 dark:text-neutral-300",children:r("leistungen.intro")}),a.jsx("div",{className:"grid gap-5 sm:grid-cols-2 lg:grid-cols-3",children:e.map((s,i)=>a.jsxs(we,{index:i%3,shine:!0,className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"relative aspect-[4/3]",children:[s.image_path&&a.jsx("img",{src:s.image_path,alt:s.title,className:"h-full w-full object-cover",loading:"lazy"}),a.jsx("div",{className:"absolute -bottom-5 left-5 flex h-12 w-12 items-center justify-center rounded-full bg-brand-500 text-white shadow-lg ring-4 ring-white dark:ring-neutral-900",children:a.jsx(Ue,{name:s.icon_name,className:"h-6 w-6"})})]}),a.jsxs("div",{className:"p-6 pt-8",children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:s.title}),a.jsx("p",{className:"mb-3 text-sm text-neutral-600 dark:text-neutral-300",children:s.description}),s.cta_label&&s.cta_url&&a.jsxs(U,{to:s.cta_url,className:"text-sm font-semibold text-brand-600 hover:underline dark:text-brand-400",children:[s.cta_label," →"]})]})]},s.id))}),a.jsxs("div",{className:"mt-12 rounded-xl border border-neutral-200 bg-neutral-50 p-8 text-center dark:border-neutral-800 dark:bg-neutral-900/40",children:[a.jsx("h2",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:r("leistungen.notListedTitle")}),a.jsx("p",{className:"mb-5 text-neutral-600 dark:text-neutral-300",children:r("leistungen.notListedText")}),a.jsx(U,{to:"/kontakt",className:"inline-block rounded-md bg-brand-500 px-6 py-3 text-sm font-semibold text-white hover:bg-brand-600",children:r("leistungen.contact")})]})]})}function nP({name:e,description:t,className:n="",children:r}){const{consent:s,acceptAll:i,openSettings:l}=Fr();return s.external?r:a.jsxs("div",{className:`flex flex-col items-center justify-center gap-3 rounded-xl border border-neutral-200 bg-neutral-50 p-6 text-center dark:border-neutral-800 dark:bg-neutral-900/40 ${n}`,children:[a.jsx("p",{className:"text-sm text-neutral-600 dark:text-neutral-300",children:t||`${e} wird erst nach deiner Zustimmung geladen, da dabei Daten an Google übertragen werden.`}),a.jsxs("div",{className:"flex flex-wrap justify-center gap-2",children:[a.jsx("button",{type:"button",onClick:i,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Laden erlauben"}),a.jsx("button",{type:"button",onClick:l,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Cookie-Einstellungen"})]})]})}const hb=e=>(e||"").replace(/[^\d+]/g,""),rP=e=>`https://wa.me/${hb(e).replace(/^0/,"49").replace("+","")}`,mb=encodeURIComponent("Boxbrunner Str. 20a, 63916 Amorbach"),Mf=`https://www.google.com/maps/dir/?api=1&destination=${mb}`,si={fontFamily:"'Michroma', sans-serif"};function sP({className:e}){return a.jsx("svg",{className:e,viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("path",{d:"M12 2a10 10 0 0 0-8.6 15l-1.3 4.8 5-1.3A10 10 0 1 0 12 2zm0 2a8 8 0 1 1-4.2 14.8l-.3-.2-2.6.7.7-2.5-.2-.3A8 8 0 0 1 12 4zm4.3 9.9c-.2-.1-1.4-.7-1.6-.8s-.4-.1-.5.1l-.7.9c-.1.1-.3.2-.5.1a6.5 6.5 0 0 1-3.2-2.8c-.1-.2 0-.4.1-.5l.4-.5.2-.4v-.4l-.7-1.7c-.2-.4-.4-.4-.5-.4h-.5c-.2 0-.4.1-.6.3-.7.7-.9 1.6-.6 2.7.5 1.7 1.6 3.1 3.4 4.2 1.7 1 2.5 1 3.4.9.5-.1 1.4-.6 1.6-1.1.2-.5.2-1 .1-1.1z"})})}function aP({path:e,className:t}){return a.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:e})})}const iP={premium:"M4 12v3M8 8v11M12 4v16M16 8v11M20 12v3",germany:"M12 12m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0 M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5 19 19M19 5l-1.5 1.5M6.5 17.5 5 19",individual:"M6 3h12l4 6-10 12L2 9z M11 3 8 9l4 12 4-12-3-6M2 9h20",experts:"M20 6 9 17l-5-5"};function _f({formatted:e,color:t}){const[n,r]=e.split("€");return a.jsxs("span",{style:{...si,color:t},children:[n,a.jsx("span",{style:{fontFamily:"'Barlow', sans-serif"},children:"€"}),r]})}function Da({icon:e,label:t,name:n,type:r="text",required:s,value:i,onChange:l,placeholder:o}){return a.jsxs("div",{className:"flex flex-col gap-2",children:[a.jsx("label",{htmlFor:`kf-${n}`,className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:t}),a.jsxs("div",{className:"relative flex items-center",children:[a.jsx(e,{className:"pointer-events-none absolute left-[14px] h-[17px] w-[17px]",style:{color:"var(--kf-fieldicon)"}}),a.jsx("input",{id:`kf-${n}`,name:n,type:r,required:s,value:i,onChange:l,placeholder:o,className:"w-full rounded-lg border py-3.5 pl-[42px] pr-4 text-[15px] outline-none transition-colors",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)",color:"var(--kf-text2)"}})]})]})}function lP(){const[e]=ow(),{phone:t,whatsapp:n,contact_email:r}=Rr(),{t:s,language:i}=Ce(),{consent:l}=Fr(),o=E=>new Intl.NumberFormat(i==="de"?"de-DE":"en-US",{style:"currency",currency:"EUR"}).format(E),[u,c]=g.useState({name:"",email:"",phone:"",vin:"",message:""}),[d,h]=g.useState("idle"),[m,f]=g.useState(""),[x,v]=g.useState([]),[k,b]=g.useState([]),p=e.get("packageId"),y=e.get("total")?Number(e.get("total")):null;g.useEffect(()=>{if(!p){v([]);return}M.get(`/packages/${p}/upgrades`).then(v).catch(()=>v([]))},[p]);const w=E=>{b(B=>B.includes(E)?B.filter(V=>V!==E):[...B,E])},j=x.filter(E=>k.includes(E.id)).reduce((E,B)=>E+Number(B.price),0);tt({title:s("contactPage.metaTitle"),description:s("contactPage.metaDescription"),path:"/kontakt"});const C={brand:e.get("brand")||"",model:e.get("model")||"",package:e.get("package")||""},S=!!(C.brand&&C.model&&C.package),P=E=>c(B=>({...B,[E.target.name]:E.target.value})),T=async E=>{E.preventDefault(),h("sending"),f("");try{await M.post("/contact",{...u,brand_name:C.brand||null,model_name:C.model||null,package_name:C.package||null,product_name:e.get("product")||null,package_id:p||null,package_product_id:e.get("productId")||null,upgrade_ids:k}),h("sent"),c({name:"",email:"",phone:"",vin:"",message:""})}catch(B){f(B.message),h("idle")}},N=[{key:"premium",title:s("contactPage.featurePremiumTitle"),sub:s("contactPage.featurePremiumSub")},{key:"germany",title:s("contactPage.featureGermanyTitle"),sub:s("contactPage.featureGermanySub")},{key:"individual",title:s("contactPage.featureIndividualTitle"),sub:s("contactPage.featureIndividualSub")},{key:"experts",title:s("contactPage.featureExpertsTitle"),sub:s("contactPage.featureExpertsSub")}];return a.jsx("div",{className:"kf-page kontakt-sektion relative w-full overflow-hidden px-4 pb-10 sm:px-10",style:{color:"var(--kf-text2)",fontFamily:"'Barlow', sans-serif"},children:a.jsxs("div",{className:"relative z-10 mx-auto max-w-[1280px] pt-10 sm:pt-14",children:[a.jsx("div",{className:"mb-3 text-[13px] font-semibold uppercase tracking-[6px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.heroEyebrow")}),a.jsxs("h1",{className:"text-[34px] leading-[1.08] sm:text-[46px] lg:text-[60px]",style:{...si,color:"var(--kf-text)"},children:[s("contactPage.heroTitlePre")," ",a.jsx("span",{style:{color:"var(--kf-accent2)"},children:s("contactPage.heroTitleAccent")})," ",s("contactPage.heroTitlePost")]}),a.jsx("p",{className:"mb-10 mt-5 max-w-[520px] text-lg leading-[1.55]",style:{color:"var(--kf-muted)"},children:s("contactPage.heroSubtitle")}),a.jsxs("div",{className:"grid grid-cols-1 items-start gap-10 min-[981px]:grid-cols-[minmax(0,1.35fr)_minmax(320px,1fr)]",children:[a.jsx("div",{children:a.jsxs("div",{className:"rounded-2xl border p-[22px] sm:p-10",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[S&&a.jsxs("div",{className:"mb-8 rounded-xl border px-6 py-[22px]",style:{background:"var(--kf-pkgbg)",borderColor:"var(--kf-pkgbrd)"},children:[a.jsxs("div",{className:"mb-3.5 flex items-center gap-2.5 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:[a.jsx(Fb,{className:"h-4 w-4"}),s("contactPage.packageBoxTitle")]}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-5 gap-y-2 text-[15px]",children:[a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.contextBrand")}),a.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:C.brand}),a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.contextModel")}),a.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:C.model}),a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.contextPackage")}),a.jsx("span",{className:"font-semibold",style:{color:"var(--kf-text2)"},children:C.package})]}),a.jsxs("div",{className:"mt-3.5 flex items-baseline justify-between border-t pt-3.5",style:{borderColor:"var(--kf-pkgbrd)"},children:[a.jsx("span",{className:"text-[13px] font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:s("contactPage.packagePrice")}),a.jsx("span",{className:"text-xl",children:y!=null?a.jsx(_f,{formatted:o(y),color:"var(--kf-text)"}):"—"})]})]}),x.length>0&&a.jsxs("div",{className:"mb-8 rounded-xl border p-5",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)"},children:[a.jsx("div",{className:"mb-3 text-xs font-bold uppercase tracking-[2px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.optionalUpgrades")}),a.jsx("div",{className:"space-y-2",children:x.map(E=>a.jsxs("label",{className:"flex cursor-pointer items-start gap-3 rounded-lg border p-3 text-sm",style:{borderColor:"var(--kf-fieldbrd)"},children:[a.jsx("input",{type:"checkbox",checked:k.includes(E.id),onChange:()=>w(E.id),className:"mt-0.5 h-4 w-4 rounded",style:{accentColor:"var(--kf-accent)"}}),a.jsxs("span",{className:"flex-1",children:[a.jsx("span",{className:"block font-semibold",style:{color:"var(--kf-text2)"},children:E.name}),E.description&&a.jsx("span",{className:"block text-xs",style:{color:"var(--kf-muted)"},children:E.description})]}),a.jsxs("span",{className:"font-semibold",style:{color:"var(--kf-accent2)"},children:["+",o(E.price)]})]},E.id))}),k.length>0&&y!=null&&a.jsxs("div",{className:"mt-3 flex items-baseline justify-between border-t pt-3 text-sm",style:{borderColor:"var(--kf-pkgbrd)"},children:[a.jsx("span",{className:"text-xs font-semibold uppercase tracking-wide",style:{color:"var(--kf-muted)"},children:s("contactPage.totalWithUpgrades")}),a.jsx(_f,{formatted:o(y+j),color:"var(--kf-text)"})]})]}),a.jsx("h2",{className:"mb-8 text-xl",style:{...si,color:"var(--kf-text)"},children:s("contactPage.formTitle")}),d==="sent"&&a.jsxs("div",{className:"mb-6 rounded-[10px] border p-5",style:{borderColor:"var(--kf-accent)",background:"var(--kf-accentsoft)"},children:[a.jsx("div",{className:"text-base font-bold",style:{color:"var(--kf-accent2)"},children:s("contactPage.sentTitle")}),a.jsx("div",{className:"mt-1 text-sm",style:{color:"var(--kf-muted)"},children:s("contactPage.sentText")})]}),a.jsxs("form",{onSubmit:T,children:[a.jsxs("div",{className:"grid grid-cols-1 gap-6 min-[641px]:grid-cols-2",children:[a.jsx(Da,{icon:Vb,label:s("contactPage.nameLabel"),name:"name",required:!0,value:u.name,onChange:P,placeholder:s("contactPage.namePlaceholder")}),a.jsx(Da,{icon:Md,label:s("contactPage.emailLabel"),name:"email",type:"email",required:!0,value:u.email,onChange:P,placeholder:s("contactPage.emailPlaceholder")}),a.jsx(Da,{icon:_d,label:s("contactPage.phoneLabel"),name:"phone",value:u.phone,onChange:P,placeholder:s("contactPage.phonePlaceholder")}),a.jsx(Da,{icon:Ob,label:s("contactPage.vinLabel"),name:"vin",value:u.vin,onChange:P,placeholder:s("contactPage.vinPlaceholder")})]}),a.jsxs("div",{className:"mt-6 flex flex-col gap-2",children:[a.jsx("label",{htmlFor:"kf-message",className:"text-xs font-semibold uppercase tracking-[2px]",style:{color:"var(--kf-label)"},children:s("contactPage.messageLabel")}),a.jsx("textarea",{id:"kf-message",name:"message",rows:5,value:u.message,onChange:P,placeholder:s("contactPage.messagePlaceholder"),className:"w-full resize-y rounded-lg border px-4 py-3.5 text-[15px] outline-none",style:{background:"var(--kf-field)",borderColor:"var(--kf-fieldbrd)",color:"var(--kf-text2)"}})]}),m&&a.jsx("p",{className:"mt-4 text-sm text-red-600 dark:text-red-400",children:m}),a.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-5",children:[a.jsxs("button",{type:"submit",disabled:d==="sending",className:"inline-flex items-center gap-3 rounded-lg px-8 py-4 text-sm font-bold uppercase tracking-[3px] transition-[filter,box-shadow] hover:brightness-110 disabled:opacity-60",style:{background:"var(--kf-accent)",color:"var(--kf-btntext)",boxShadow:"0 10px 24px rgba(150,200,20,0.32)"},children:[a.jsx(Ub,{className:"h-[18px] w-[18px]"}),s(d==="sending"?"contactPage.sending":"contactPage.submit")]}),a.jsx("div",{className:"text-[13px]",style:{color:"var(--kf-label)"},children:s("contactPage.requiredHint")})]})]})]})}),a.jsxs("div",{className:"flex flex-col gap-6",children:[a.jsxs("div",{className:"relative overflow-hidden rounded-2xl border px-[22px] py-[26px] sm:px-8 sm:py-[34px]",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[a.jsx("div",{className:"pointer-events-none absolute -right-[60px] -top-[60px] h-[190px] w-[190px] rounded-full border border-dashed",style:{borderColor:"var(--kf-pkgbrd)"}}),a.jsx("h2",{className:"mb-7 text-[17px]",style:{...si,color:"var(--kf-text)"},children:s("contactPage.cardTitle")}),a.jsxs("div",{className:"flex flex-col gap-5",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(_d,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.phone")}),a.jsx("a",{href:`tel:${hb(t)}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:t})]})]}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(Md,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.email")}),a.jsx("a",{href:`mailto:${r}`,className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:r})]})]}),a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(Wb,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.address")}),a.jsxs("div",{className:"text-base font-semibold leading-[1.4]",style:{color:"var(--kf-text2)"},children:["Boxbrunner Straße 20a",a.jsx("br",{}),"63916 Amorbach"]})]})]}),n&&a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsx("div",{className:"flex h-11 w-11 flex-shrink-0 items-center justify-center rounded-full",style:{background:"var(--kf-accentsoft)"},children:a.jsx(sP,{className:"h-[18px] w-[18px]",style:{color:"var(--kf-accent2)"}})}),a.jsxs("div",{children:[a.jsx("div",{className:"mb-1 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("nav.whatsapp")}),a.jsx("a",{href:rP(n),className:"text-base font-semibold",style:{color:"var(--kf-text2)"},children:n})]})]})]}),a.jsxs("div",{className:"mt-7 border-t pt-6",style:{borderColor:"var(--kf-divider)"},children:[a.jsx("div",{className:"mb-3 text-[11px] font-semibold uppercase tracking-[3px]",style:{color:"var(--kf-accent2)"},children:s("contactPage.hours")}),a.jsxs("div",{className:"grid grid-cols-[auto_1fr] gap-x-6 gap-y-2 text-[15px]",children:[a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.hoursWeekDays")}),a.jsx("span",{children:s("contactPage.hoursWeekTime")}),a.jsx("span",{style:{color:"var(--kf-label)"},children:s("contactPage.hoursSatDay")}),a.jsx("span",{children:s("contactPage.hoursSatTime")})]})]})]}),a.jsxs("div",{className:"relative overflow-hidden rounded-2xl border",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow)"},children:[l.external&&a.jsxs("a",{href:Mf,target:"_blank",rel:"noopener noreferrer",className:"absolute left-3.5 top-3.5 z-10 inline-flex items-center gap-2 rounded-lg border px-3.5 py-2 text-[13px] font-semibold hover:border-[var(--kf-accent)]",style:{background:"var(--kf-pill)",borderColor:"var(--kf-pillbrd)",color:"var(--kf-text2)",boxShadow:"var(--kf-shadow2)"},children:[s("contactPage.mapOpenChip"),a.jsx(Hb,{className:"h-3.5 w-3.5",style:{color:"var(--kf-accent2)"}})]}),a.jsx(nP,{name:s("contactPage.mapEmbedName"),className:"h-[210px] w-full",children:a.jsx("div",{className:"h-[210px] overflow-hidden",children:a.jsx("iframe",{title:"HifiPlanet Amorbach – Standort",src:`https://www.google.com/maps?q=${mb}&output=embed`,width:"100%",height:"290",style:{border:0,display:"block",marginTop:"-60px"},loading:"lazy",referrerPolicy:"no-referrer-when-downgrade"})})}),a.jsxs("a",{href:Mf,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2.5 border-t px-4 py-4 text-[13px] font-bold uppercase tracking-[3px] hover:bg-[var(--kf-accentsoft)]",style:{borderColor:"var(--kf-divider)",color:"var(--kf-accent2)"},children:[s("contactPage.routePlan")," →"]})]})]})]}),a.jsx("div",{className:"mt-10 grid grid-cols-1 overflow-hidden rounded-2xl border min-[641px]:grid-cols-2 min-[901px]:grid-cols-4",style:{background:"var(--kf-card)",borderColor:"var(--kf-cardbrd)",boxShadow:"var(--kf-shadow2)"},children:N.map(E=>a.jsxs("div",{className:"flex items-center gap-4 border-b p-6 last:border-b-0 min-[641px]:border-b-0 min-[641px]:border-r min-[641px]:last:border-r-0",style:{borderColor:"var(--kf-divider)"},children:[a.jsx("div",{className:"flex h-[46px] w-[46px] flex-shrink-0 items-center justify-center rounded-full border-[1.5px]",style:{borderColor:"var(--kf-pkgbrd)",color:"var(--kf-accent2)"},children:a.jsx(aP,{path:iP[E.key],className:"h-[22px] w-[22px]"})}),a.jsxs("div",{children:[a.jsx("div",{className:"text-[15px] font-bold",style:{color:"var(--kf-text)"},children:E.title}),a.jsx("div",{className:"mt-0.5 text-[13px]",style:{color:"var(--kf-muted)"},children:E.sub})]})]},E.key))})]})})}function oP(){return tt({title:"Impressum",description:"Impressum von HifiPlanet Amorbach gemäß § 5 DDG.",path:"/impressum"}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:"Impressum"}),a.jsxs("div",{className:"space-y-8 text-sm text-neutral-600 dark:text-neutral-300",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Angaben gemäß § 5 DDG"}),a.jsxs("p",{children:["Hifi Planet e.K.",a.jsx("br",{}),"Inhaber: Christopher Horndasch",a.jsx("br",{}),"Boxbrunner Str. 20a",a.jsx("br",{}),"63916 Amorbach"]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Kontakt"}),a.jsxs("p",{children:["Telefon: ",a.jsx("a",{href:"tel:+4993732062390",className:"hover:text-brand-500",children:"09373 20 62 390"}),a.jsx("br",{}),"E-Mail: ",a.jsx("a",{href:"mailto:info@hifi-planet-amorbach.de",className:"hover:text-brand-500",children:"info@hifi-planet-amorbach.de"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Umsatzsteuer-ID"}),a.jsx("p",{children:"Umsatzsteuer-Identifikationsnummer gemäß § 27a Umsatzsteuergesetz: DE 275084766"})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Zuständige Kammer"}),a.jsx("p",{children:"IHK Aschaffenburg"})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Verantwortlich für den Inhalt nach § 18 Abs. 2 MStV"}),a.jsxs("p",{children:["Christopher Horndasch",a.jsx("br",{}),"Anschrift wie oben"]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Verbraucherstreitbeilegung"}),a.jsx("p",{children:"Wir sind nicht bereit und nicht verpflichtet, an Streitbeilegungsverfahren vor einer Verbraucherschlichtungsstelle im Sinne des Verbraucherstreitbeilegungsgesetzes (VSBG) teilzunehmen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Haftung für Inhalte"}),a.jsx("p",{children:"Als Diensteanbieter sind wir gemäß § 7 Abs. 1 DDG für eigene Inhalte auf diesen Seiten nach den allgemeinen Gesetzen verantwortlich. Nach §§ 8 bis 10 DDG sind wir als Diensteanbieter jedoch nicht verpflichtet, übermittelte oder gespeicherte fremde Informationen zu überwachen oder nach Umständen zu forschen, die auf eine rechtswidrige Tätigkeit hinweisen. Verpflichtungen zur Entfernung oder Sperrung der Nutzung von Informationen nach den allgemeinen Gesetzen bleiben hiervon unberührt. Eine diesbezügliche Haftung ist jedoch erst ab dem Zeitpunkt der Kenntnis einer konkreten Rechtsverletzung möglich. Bei Bekanntwerden von entsprechenden Rechtsverletzungen werden wir diese Inhalte umgehend entfernen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Haftung für Links"}),a.jsx("p",{children:"Unser Angebot enthält Links zu externen Websites Dritter, auf deren Inhalte wir keinen Einfluss haben. Deshalb können wir für diese fremden Inhalte auch keine Gewähr übernehmen. Für die Inhalte der verlinkten Seiten ist stets der jeweilige Anbieter oder Betreiber der Seiten verantwortlich. Eine permanente inhaltliche Kontrolle der verlinkten Seiten ist ohne konkrete Anhaltspunkte einer Rechtsverletzung nicht zumutbar. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Links umgehend entfernen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"Urheberrecht"}),a.jsx("p",{children:"Die durch die Seitenbetreiber erstellten Inhalte und Werke auf diesen Seiten unterliegen dem deutschen Urheberrecht. Die Vervielfältigung, Bearbeitung, Verbreitung und jede Art der Verwertung außerhalb der Grenzen des Urheberrechtes bedürfen der schriftlichen Zustimmung des jeweiligen Autors bzw. Erstellers. Downloads und Kopien dieser Seite sind nur für den privaten, nicht kommerziellen Gebrauch gestattet. Soweit die Inhalte auf dieser Seite nicht vom Betreiber erstellt wurden, werden die Urheberrechte Dritter beachtet. Insbesondere werden Inhalte Dritter als solche gekennzeichnet. Sollten Sie trotzdem auf eine Urheberrechtsverletzung aufmerksam werden, bitten wir um einen entsprechenden Hinweis. Bei Bekanntwerden von Rechtsverletzungen werden wir derartige Inhalte umgehend entfernen."})]})]})]})}function uP(){return tt({title:"Datenschutzerklärung",description:"Datenschutzerklärung von HifiPlanet Amorbach gemäß Art. 13 DSGVO.",path:"/datenschutz"}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:"Datenschutzerklärung"}),a.jsxs("div",{className:"space-y-8 text-sm text-neutral-600 dark:text-neutral-300",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"1. Verantwortlicher"}),a.jsxs("p",{children:["Verantwortlicher im Sinne der Datenschutz-Grundverordnung (DSGVO) ist:",a.jsx("br",{}),"Hifi Planet e.K., Christopher Horndasch",a.jsx("br",{}),"Boxbrunner Str. 20a, 63916 Amorbach",a.jsx("br",{}),"Telefon: 09373 20 62 390 · E-Mail:"," ",a.jsx("a",{href:"mailto:info@hifi-planet-amorbach.de",className:"hover:text-brand-500",children:"info@hifi-planet-amorbach.de"})]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"2. Ihre Rechte als betroffene Person"}),a.jsx("p",{className:"mb-2",children:"Sie haben jederzeit das Recht,"}),a.jsxs("ul",{className:"list-disc space-y-1 pl-5",children:[a.jsx("li",{children:"Auskunft über Ihre bei uns gespeicherten personenbezogenen Daten zu erhalten (Art. 15 DSGVO),"}),a.jsx("li",{children:"die Berichtigung unrichtiger Daten zu verlangen (Art. 16 DSGVO),"}),a.jsx("li",{children:"die Löschung Ihrer Daten zu verlangen (Art. 17 DSGVO),"}),a.jsx("li",{children:"die Verarbeitung Ihrer Daten einschränken zu lassen (Art. 18 DSGVO),"}),a.jsx("li",{children:"der Verarbeitung Ihrer Daten zu widersprechen (Art. 21 DSGVO),"}),a.jsx("li",{children:"Ihre Daten in einem gängigen Format zu erhalten (Datenübertragbarkeit, Art. 20 DSGVO), und"}),a.jsx("li",{children:"eine erteilte Einwilligung jederzeit mit Wirkung für die Zukunft zu widerrufen (Art. 7 Abs. 3 DSGVO)."})]}),a.jsx("p",{className:"mt-2",children:"Außerdem haben Sie das Recht, sich bei einer Datenschutz-Aufsichtsbehörde über die Verarbeitung Ihrer personenbezogenen Daten durch uns zu beschweren, zum Beispiel beim Bayerischen Landesamt für Datenschutzaufsicht (BayLDA)."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"3. Hosting und Server-Logfiles"}),a.jsx("p",{children:"Beim Aufruf dieser Website erhebt der Webserver automatisch Daten in sogenannten Server-Logfiles, die Ihr Browser übermittelt. Dazu gehören: IP-Adresse, Datum und Uhrzeit der Anfrage, aufgerufene Seite, verwendeter Browser und Betriebssystem sowie die zuvor besuchte Seite (Referrer-URL). Diese Daten dienen ausschließlich der technisch fehlerfreien Auslieferung der Website sowie der IT-Sicherheit (z. B. zur Abwehr von Angriffen) und werden nicht mit anderen Datenquellen zusammengeführt. Rechtsgrundlage ist unser berechtigtes Interesse an einem sicheren und stabilen Betrieb der Website (Art. 6 Abs. 1 lit. f DSGVO)."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"4. Kontaktformular"}),a.jsx("p",{children:"Wenn Sie uns über das Kontaktformular eine Anfrage zukommen lassen, werden Ihre Angaben aus dem Formular (Name, E-Mail-Adresse, optional Telefonnummer, Nachricht sowie ggf. der Kontext Ihrer Anfrage wie Marke, Modell oder Paket) inklusive der von Ihnen dort angegebenen Kontaktdaten bei uns gespeichert, um Ihre Anfrage zu bearbeiten und zu beantworten. Die Verarbeitung erfolgt auf Grundlage Ihrer Einwilligung durch Absenden des Formulars (Art. 6 Abs. 1 lit. a DSGVO) bzw., sofern Ihre Anfrage der Vorbereitung eines Vertrags dient, auf Grundlage von Art. 6 Abs. 1 lit. b DSGVO. Wir löschen die Anfrage inklusive der Kontaktdaten, sobald der jeweilige Sachverhalt abschließend geklärt ist und keine gesetzlichen Aufbewahrungspflichten entgegenstehen. Diese Einwilligung können Sie jederzeit widerrufen, indem Sie uns formlos per E-Mail kontaktieren."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"5. Cookies und lokale Speicherung"}),a.jsx("p",{className:"mb-2",children:"Diese Website verwendet technisch notwendige Cookies bzw. Speichertechnologien, die für den Betrieb der Seite erforderlich sind und ohne die einzelne Funktionen nicht funktionieren würden. Dazu gehören:"}),a.jsxs("ul",{className:"list-disc space-y-1 pl-5",children:[a.jsxs("li",{children:["ein Session-Cookie (",a.jsx("code",{children:"hifi_admin_session"}),"), das für den Anmeldestatus im Mitarbeiter-Login benötigt wird und mit Ende der Browsersitzung abläuft,"]}),a.jsxs("li",{children:["eine lokale Speicherung (",a.jsx("code",{children:"localStorage"}),") Ihrer Hell-/Dunkelmodus-Einstellung sowie Ihrer Cookie-Auswahl, damit wir Sie nicht bei jedem Besuch erneut danach fragen müssen."]})]}),a.jsx("p",{className:"mt-2",children:'Für diese technisch notwendigen Cookies ist gemäß § 25 Abs. 2 Nr. 2 TTDSG keine Einwilligung erforderlich. Rechtsgrundlage ist unser berechtigtes Interesse am technischen Betrieb der Website (Art. 6 Abs. 1 lit. f DSGVO). Für alle darüber hinausgehenden Inhalte und Dienste – aktuell die eingebundenen Google Maps- und YouTube-Elemente sowie Google Analytics – fragen wir Sie beim ersten Besuch aktiv nach Ihrer Einwilligung. Sie können Ihre Auswahl jederzeit über den Link „Cookie-Einstellungen" im Footer ändern.'})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"6. Google Maps"}),a.jsxs("p",{children:['Auf unserer Kontaktseite und im Footer binden wir Kartenmaterial des Dienstes „Google Maps" ein, um Ihnen die Anfahrt zu unserem Standort zu erleichtern. Anbieter ist Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland. Die eingebettete Karte wird erst geladen, nachdem Sie dem im Cookie-Banner unter „Externe Medien" zugestimmt haben. Beim Laden der Karte wird Ihre IP-Adresse an Google übertragen; eine Verarbeitung kann dabei auch auf Servern außerhalb der EU/des EWR erfolgen. Die Verarbeitung erfolgt auf Grundlage Ihrer Einwilligung (Art. 6 Abs. 1 lit. a DSGVO), die Sie jederzeit über die Cookie-Einstellungen widerrufen können. Weitere Informationen finden Sie in der'," ",a.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-500",children:"Datenschutzerklärung von Google"}),"."]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"7. YouTube"}),a.jsxs("p",{children:['Auf unserer Startseite binden wir ein Video des Anbieters YouTube (Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland) im „erweiterten Datenschutzmodus" ein (Domain youtube-nocookie.com). Auch dieses Video wird erst geladen, nachdem Sie unter „Externe Medien" zugestimmt haben. Nach Angaben von Google werden dabei bis zum Start der Wiedergabe keine Cookies gesetzt; beim Laden des Players wird jedoch bereits eine Verbindung zu Google-Servern aufgebaut und Ihre IP-Adresse übertragen. Die Verarbeitung erfolgt auf Grundlage Ihrer Einwilligung (Art. 6 Abs. 1 lit. a DSGVO), die Sie jederzeit über die Cookie-Einstellungen widerrufen können. Weitere Informationen finden Sie in der'," ",a.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-500",children:"Datenschutzerklärung von Google"}),"."]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"8. Google Analytics"}),a.jsxs("p",{children:['Sofern Sie der Statistik-Kategorie im Cookie-Banner zugestimmt haben, setzen wir „Google Analytics" ein, einen Webanalysedienst der Google Ireland Limited, Gordon House, Barrow Street, Dublin 4, Irland. Google Analytics verwendet Cookies und ähnliche Technologien, die eine Analyse der Benutzung dieser Website durch Sie ermöglichen. Die dabei erzeugten Informationen (u. a. Ihre IP-Adresse, die vor der Verarbeitung durch die Aktivierung der IP-Anonymisierung gekürzt wird) werden an einen Server von Google übertragen und dort gespeichert; eine Verarbeitung kann dabei auch auf Servern außerhalb der EU/des EWR erfolgen. Die Verarbeitung erfolgt ausschließlich auf Grundlage Ihrer Einwilligung (Art. 6 Abs. 1 lit. a DSGVO), die Sie jederzeit über die Cookie-Einstellungen mit Wirkung für die Zukunft widerrufen können. Weitere Informationen finden Sie in der'," ",a.jsx("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-brand-500",children:"Datenschutzerklärung von Google"}),"."]})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"9. Empfänger der Daten"}),a.jsx("p",{children:"Ihre Daten werden grundsätzlich nur innerhalb unseres Unternehmens verarbeitet. Eine Weitergabe an Dritte erfolgt nur, soweit dies zur Bearbeitung Ihrer Anfrage erforderlich ist (z. B. an unseren Hosting-Provider zum Betrieb dieser Website und an unseren E-Mail-Anbieter zur Zustellung Ihrer Kontaktanfrage) oder soweit wir gesetzlich dazu verpflichtet sind."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"10. Speicherdauer"}),a.jsx("p",{children:"Sofern in dieser Erklärung keine speziellere Speicherdauer genannt wurde, verbleiben Ihre personenbezogenen Daten bei uns, bis der Zweck für die Datenspeicherung entfällt. Gesetzliche Aufbewahrungsfristen (z. B. aus dem Handels- oder Steuerrecht) bleiben hiervon unberührt und können eine längere Speicherung erforderlich machen."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"11. SSL-/TLS-Verschlüsselung"}),a.jsx("p",{children:"Diese Seite nutzt aus Sicherheitsgründen eine SSL-/TLS-Verschlüsselung zur Übertragung Ihrer Daten. Eine verschlüsselte Verbindung erkennen Sie an dem Schloss-Symbol in der Adresszeile Ihres Browsers."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"12. Änderung dieser Datenschutzerklärung"}),a.jsx("p",{children:"Wir passen diese Datenschutzerklärung an, sobald sich die von uns eingesetzten Datenverarbeitungen ändern. Es gilt jeweils die zum Zeitpunkt Ihres Besuchs aktuelle, auf dieser Seite veröffentlichte Fassung."})]}),a.jsxs("p",{children:["Fragen zum Datenschutz beantworten wir Ihnen gerne über unser"," ",a.jsx(U,{to:"/kontakt",className:"underline hover:text-brand-500",children:"Kontaktformular"})," oder direkt per E-Mail."]})]})]})}function cP(){return tt({title:"AGB",description:"Allgemeine Geschäftsbedingungen von HifiPlanet Amorbach.",path:"/agb"}),a.jsxs("div",{className:"mx-auto max-w-3xl px-4 py-12 sm:px-6",children:[a.jsx("h1",{className:"mb-8 text-2xl font-bold text-neutral-900 dark:text-white sm:text-3xl",children:"Allgemeine Geschäftsbedingungen"}),a.jsxs("div",{className:"space-y-8 text-sm text-neutral-600 dark:text-neutral-300",children:[a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"1. Geltungsbereich"}),a.jsx("p",{children:'Diese Allgemeinen Geschäftsbedingungen (AGB) gelten für alle Beratungs-, Werkstatt- und Umbauleistungen, die die Hifi Planet e.K., Boxbrunner Str. 20a, 63916 Amorbach („wir", „HifiPlanet") gegenüber ihren Kunden erbringt, sowie für die Nutzung des Kontaktformulars auf dieser Website.'})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"2. Anfragen über die Website"}),a.jsx("p",{children:"Über das Kontaktformular können Sie unverbindlich eine Beratung oder ein Angebot zu einem einzelnen Produkt oder einem ganzen Paket anfragen. Die auf der Website angezeigten Preise sind, soweit sie von Drittanbietern automatisiert übernommen werden, unverbindliche Circa-Preise ohne Einbau und können sich bis zur Erstellung eines konkreten Angebots ändern. Mit dem Absenden einer Anfrage kommt noch kein Vertrag zustande."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"3. Vertragsschluss"}),a.jsx("p",{children:"Ein verbindlicher Vertrag über Beratung, Material und Einbauleistungen kommt erst zustande, wenn wir Ihnen nach persönlicher oder schriftlicher Abstimmung ein konkretes Angebot unterbreitet haben und Sie dieses angenommen haben, spätestens jedoch mit der Übergabe Ihres Fahrzeugs zur vereinbarten Auftragsdurchführung in unserer Werkstatt in Amorbach."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"4. Preise und Zahlung"}),a.jsx("p",{children:"Es gelten die im jeweiligen Einzelangebot genannten Preise inklusive der zum Zeitpunkt der Rechnungsstellung gesetzlich geltenden Umsatzsteuer. Sofern nichts anderes vereinbart ist, ist die Rechnung nach Abnahme der Leistung bzw. Übergabe des Fahrzeugs ohne Abzug fällig."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"5. Termine und Fahrzeugübergabe"}),a.jsx("p",{children:"Vereinbarte Termine zur Fahrzeugübergabe sind von beiden Seiten einzuhalten. Verschiebungen sind möglichst frühzeitig mitzuteilen. Für Gegenstände, die sich zum Zeitpunkt der Übergabe im Fahrzeug befinden und nicht Gegenstand des Auftrags sind, übernehmen wir keine Haftung."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"6. Gewährleistung"}),a.jsx("p",{children:"Es gelten die gesetzlichen Gewährleistungsrechte. Mängel sind uns unverzüglich nach Feststellung anzuzeigen, damit wir Ihnen Nacherfüllung anbieten können. Für Verschleißteile sowie für Schäden, die auf unsachgemäße Behandlung, Fremdeingriffe Dritter oder normalen Verschleiß zurückzuführen sind, besteht kein Gewährleistungsanspruch."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"7. Eigentumsvorbehalt"}),a.jsx("p",{children:"Verbautes Material und gelieferte Ware bleiben bis zur vollständigen Bezahlung unser Eigentum."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"8. Haftung"}),a.jsx("p",{children:"Wir haften unbeschränkt bei Vorsatz und grober Fahrlässigkeit sowie nach Maßgabe des Produkthaftungsgesetzes. Bei leichter Fahrlässigkeit haften wir nur bei Verletzung einer wesentlichen Vertragspflicht (Kardinalpflicht) und begrenzt auf den vertragstypisch vorhersehbaren Schaden. Die Haftung für Schäden aus der Verletzung des Lebens, des Körpers oder der Gesundheit bleibt hiervon unberührt."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"9. Widerrufsrecht"}),a.jsx("p",{children:"Ein gesetzliches Widerrufsrecht für Verbraucher besteht bei Verträgen, die außerhalb von Geschäftsräumen oder im Fernabsatz geschlossen werden. Da der eigentliche Werkvertrag über Beratung und Einbauleistungen erst bei persönlicher Fahrzeugübergabe in unseren Geschäftsräumen in Amorbach geschlossen wird, handelt es sich hierbei nicht um einen Fernabsatzvertrag; ein gesetzliches Widerrufsrecht besteht in diesem Fall nicht. Sollte im Einzelfall ausnahmsweise ein Vertrag im Fernabsatz zustande kommen, informieren wir Sie gesondert über Ihr gesetzliches Widerrufsrecht."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"10. Anwendbares Recht und Gerichtsstand"}),a.jsx("p",{children:"Es gilt das Recht der Bundesrepublik Deutschland unter Ausschluss des UN-Kaufrechts. Ist der Kunde Kaufmann, juristische Person des öffentlichen Rechts oder öffentlich-rechtliches Sondervermögen, ist Gerichtsstand für alle Streitigkeiten aus diesem Vertragsverhältnis unser Geschäftssitz in Amorbach."})]}),a.jsxs("section",{children:[a.jsx("h2",{className:"mb-2 font-semibold text-neutral-900 dark:text-white",children:"11. Schlussbestimmungen"}),a.jsx("p",{children:"Sollte eine Bestimmung dieser AGB unwirksam sein oder werden, bleibt die Wirksamkeit der übrigen Bestimmungen hiervon unberührt."})]})]})]})}const dP={host:"",name:"",user:"",password:"",charset:"utf8mb4"},hP={username:"",password:"",password_confirmation:""};function mP(){tt({title:"Ersteinrichtung",path:"/setup"});const[e,t]=g.useState("loading"),[n,r]=g.useState(""),[s,i]=g.useState(!1),[l,o]=g.useState(""),[u,c]=g.useState(dP),[d,h]=g.useState(hP),[m,f]=g.useState(null),x=()=>M.get("/setup/status").then(S=>(S.needs_setup?S.steps.admin.ok?t("done"):S.steps.schema.ok?t("admin"):t(S.steps.database.ok?"schema":"database"):t("locked"),S));g.useEffect(()=>{M.get("/setup/status").then(S=>t(S.needs_setup?"password":"locked")).catch(()=>t("locked"))},[]);const v=async S=>{S.preventDefault(),r(""),i(!0);try{await M.post("/setup/verify-password",{password:l}),await x()}catch(P){r(P.message)}finally{i(!1)}},k=async S=>{S.preventDefault(),r(""),i(!0);try{await M.post("/setup/database",u),await x()}catch(P){r(P.message)}finally{i(!1)}},b=async()=>{r(""),i(!0);try{const S=await M.post("/setup/migrate",{});f(S.actions),S.status.steps.schema.ok&&t("admin")}catch(S){r(S.message)}finally{i(!1)}},p=async S=>{if(S.preventDefault(),r(""),d.password!==d.password_confirmation){r("Die Passwörter stimmen nicht überein");return}i(!0);try{await M.post("/setup/admin",d),t("done")}catch(P){r(P.message)}finally{i(!1)}},y="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900",w="mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",j=[{key:"database",label:"Datenbank"},{key:"schema",label:"Struktur"},{key:"admin",label:"Admin-Account"}],C=j.findIndex(S=>S.key===e);return a.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 py-12 dark:bg-neutral-950",children:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-16 w-auto sm:h-20"}),a.jsxs("div",{className:"w-full max-w-md rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[e==="loading"&&a.jsx("p",{className:"text-center text-sm text-neutral-400",children:"Lädt…"}),e==="locked"&&a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bereits eingerichtet"}),a.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Seite wurde bereits vollständig eingerichtet. Der Assistent ist deshalb gesperrt."}),a.jsx(U,{to:"/admin/login",className:"text-sm font-medium text-brand-600 hover:underline dark:text-brand-400",children:"Zum Login"})]}),["database","schema","admin"].includes(e)&&a.jsx("div",{className:"mb-6 flex items-center justify-center gap-2",children:j.map((S,P)=>a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:`flex h-6 w-6 items-center justify-center rounded-full text-xs font-semibold ${Po(S.target.value),required:!0,autoFocus:!0,className:y})]}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Prüfe…":"Weiter"})]}),e==="database"&&a.jsxs("form",{onSubmit:k,children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),a.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Trage die Zugangsdaten der Datenbank auf diesem Server ein. Die Verbindung wird vor dem Speichern getestet."}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Host *"}),a.jsx("input",{required:!0,value:u.host,onChange:S=>c({...u,host:S.target.value}),className:y})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Datenbankname *"}),a.jsx("input",{required:!0,value:u.name,onChange:S=>c({...u,name:S.target.value}),className:y})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Benutzer *"}),a.jsx("input",{required:!0,value:u.user,onChange:S=>c({...u,user:S.target.value}),className:y})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Passwort"}),a.jsx("input",{type:"password",value:u.password,onChange:S=>c({...u,password:S.target.value}),className:y})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:w,children:"Zeichensatz"}),a.jsx("input",{value:u.charset,onChange:S=>c({...u,charset:S.target.value}),className:y})]}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Teste Verbindung…":"Verbindung testen & speichern"})]}),e==="schema"&&a.jsxs("div",{children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),a.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Datenbankverbindung funktioniert. Jetzt legen wir die benötigten Tabellen an."}),m&&a.jsx("ul",{className:"mb-4 space-y-1 rounded-md bg-neutral-50 p-3 text-sm text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:m.map((S,P)=>a.jsx("li",{children:S},P))}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"button",onClick:b,disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Richte ein…":"Datenbankstruktur einrichten"})]}),e==="admin"&&a.jsxs("form",{onSubmit:p,children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Erster Admin-Account"}),a.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Lege den ersten Super-Admin-Account an, mit dem du dich anschließend einloggen kannst."}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Benutzername"}),a.jsx("input",{required:!0,autoFocus:!0,value:d.username,onChange:S=>h({...d,username:S.target.value}),className:y})]}),a.jsxs("div",{className:"mb-3",children:[a.jsx("label",{className:w,children:"Passwort"}),a.jsx("input",{type:"password",required:!0,minLength:8,value:d.password,onChange:S=>h({...d,password:S.target.value}),className:y})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:w,children:"Passwort wiederholen"}),a.jsx("input",{type:"password",required:!0,minLength:8,value:d.password_confirmation,onChange:S=>h({...d,password_confirmation:S.target.value}),className:y})]}),n&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:n}),a.jsx("button",{type:"submit",disabled:s,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:s?"Lege an…":"Admin-Account anlegen"})]}),e==="done"&&a.jsxs("div",{className:"text-center",children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Fertig!"}),a.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Die Ersteinrichtung ist abgeschlossen. Du kannst dich jetzt mit deinem neuen Admin-Account anmelden."}),a.jsx(U,{to:"/admin/login",className:"inline-block w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600",children:"Zum Login"})]})]})]})}function fP(){const{user:e,login:t,verifyTwoFactor:n}=Lt(),r=ea(),[s,i]=g.useState("credentials"),[l,o]=g.useState(""),[u,c]=g.useState(""),[d,h]=g.useState(""),[m,f]=g.useState(""),[x,v]=g.useState(!1);if(e)return a.jsx(Ws,{to:"/admin",replace:!0});const k=async p=>{p.preventDefault(),v(!0),f("");try{(await t(l,u)).requires2fa?i("code"):r("/admin")}catch(y){f(y.message)}finally{v(!1)}},b=async p=>{p.preventDefault(),v(!0),f("");try{await n(d),r("/admin")}catch(y){f(y.message)}finally{v(!1)}};return a.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center gap-6 bg-neutral-50 px-4 dark:bg-neutral-950",children:[a.jsx("img",{src:Hs,alt:"HifiPlanet",className:"h-16 w-auto dark:hidden sm:h-20"}),a.jsx("img",{src:Mi,alt:"HifiPlanet",className:"hidden h-16 w-auto dark:block sm:h-20"}),s==="credentials"?a.jsxs("form",{onSubmit:k,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h1",{className:"mb-6 text-xl font-bold text-neutral-900 dark:text-white",children:"Admin-Login"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),a.jsx("input",{value:l,onChange:p=>o(p.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort"}),a.jsx("input",{type:"password",value:u,onChange:p=>c(p.target.value),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),a.jsx("button",{type:"submit",disabled:x,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:x?"Anmelden…":"Anmelden"})]}):a.jsxs("form",{onSubmit:b,className:"w-full max-w-sm rounded-xl border border-neutral-200 bg-white p-8 shadow-sm dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h1",{className:"mb-2 text-xl font-bold text-neutral-900 dark:text-white",children:"Bestätigungscode"}),a.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Öffne die Google Authenticator App und gib den 6-stelligen Code ein. Alternativ kannst du auch einen deiner Wiederherstellungscodes verwenden."}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Code"}),a.jsx("input",{value:d,onChange:p=>h(p.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest focus:border-brand-500 focus:outline-none dark:border-neutral-700 dark:bg-neutral-900"})]}),m&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:m}),a.jsx("button",{type:"submit",disabled:x,className:"w-full rounded-md bg-brand-500 px-4 py-2.5 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:x?"Prüfe…":"Bestätigen"}),a.jsx("button",{type:"button",onClick:()=>{i("credentials"),h(""),f("")},className:"mt-3 w-full text-sm text-neutral-500 hover:underline dark:text-neutral-400",children:"Zurück zum Login"})]})]})}const pP={tag:"M4 4h7l9 9-7 7-9-9V4Zm3.5 3.5h.01",car:"M3 13.5 4.5 9A2 2 0 0 1 6.4 7.5h11.2A2 2 0 0 1 19.5 9L21 13.5M3 13.5v4a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-1h12v1a1 1 0 0 0 1 1h1a1 1 0 0 0 1-1v-4M3 13.5h18M6.5 16.5h.01M17.5 16.5h.01",box:"M12 3 4 7.5v9L12 21l8-4.5v-9L12 3Zm0 9 8-4.5M12 12v9M12 12 4 7.5",mail:"M4 6h16a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1Zm0 0 8 7 8-7"},gP=({path:e,className:t="h-6 w-6"})=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:t,children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:e})});function xP(){const[e,t]=g.useState(null),[n,r]=g.useState("");if(g.useEffect(()=>{M.get("/analytics/report").then(t).catch(i=>r(i.message))},[]),n)return a.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsx("p",{className:"text-sm text-red-600",children:n})]});if(!e)return null;if(!e.configured)return a.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsxs("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:["Noch nicht eingerichtet. Unter"," ",a.jsx(U,{to:"/admin/settings/website",className:"text-brand-600 hover:underline dark:text-brand-400",children:"Einstellungen → Website"})," ","kannst du die Dashboard-Anbindung konfigurieren, um hier Besucherzahlen zu sehen."]})]});const s=Math.max(1,...e.daily.map(i=>i.pageviews));return a.jsxs("section",{className:"mt-8 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Letzte 7 Tage."}),a.jsxs("div",{className:"mb-6 grid grid-cols-3 gap-4",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:e.totals.users}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Nutzer"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:e.totals.sessions}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Sitzungen"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-2xl font-extrabold text-brand-600 dark:text-brand-400",children:e.totals.pageviews}),a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:"Seitenaufrufe"})]})]}),e.daily.length>0&&a.jsx("div",{className:"mb-6 flex h-24 items-end gap-1.5",children:e.daily.map(i=>a.jsxs("div",{className:"flex flex-1 flex-col items-center gap-1",children:[a.jsx("div",{className:"w-full rounded-t bg-brand-400 dark:bg-brand-500",style:{height:`${Math.max(4,i.pageviews/s*80)}px`},title:`${i.date}: ${i.pageviews} Seitenaufrufe`}),a.jsxs("span",{className:"text-[10px] text-neutral-400",children:[i.date.slice(6,8),".",i.date.slice(4,6),"."]})]},i.date))}),e.top_pages.length>0&&a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-neutral-400",children:"Meistbesuchte Seiten"}),a.jsx("ul",{className:"space-y-1 text-sm",children:e.top_pages.map(i=>a.jsxs("li",{className:"flex items-center justify-between gap-3 text-neutral-700 dark:text-neutral-300",children:[a.jsx("span",{className:"truncate font-mono text-xs",children:i.path}),a.jsx("span",{className:"shrink-0 font-semibold",children:i.pageviews})]},i.path))})]})]})}function bP(){const{user:e,hasPermission:t}=Lt(),[n,r]=g.useState({});g.useEffect(()=>{t("brands.manage")&&M.get("/brands").then(i=>r(l=>({...l,brands:i.length}))),(t("models.manage")||t("packages.manage"))&&M.get("/models").then(i=>r(l=>({...l,models:i.length}))),t("packages.manage")&&M.get("/packages").then(i=>r(l=>({...l,packages:i.length}))),t("contact.manage")&&M.get("/contact").then(i=>r(l=>({...l,newContacts:i.filter(o=>o.status==="new").length})))},[]);const s=[{key:"brands",label:"Marken",icon:"tag",hint:"Die Hersteller, z. B. Audi oder BMW.",value:n.brands,to:"/admin/brands",show:t("brands.manage")},{key:"models",label:"Modelle",icon:"car",hint:"Die Fahrzeuge einer Marke, z. B. A4.",value:n.models,to:"/admin/models",show:t("models.manage")},{key:"packages",label:"Pakete",icon:"box",hint:"Die Sound-Pakete für ein Modell.",value:n.packages,to:"/admin/packages",show:t("packages.manage")},{key:"contacts",label:"Neue Anfragen",icon:"mail",hint:"Kunden, die noch auf Antwort warten.",value:n.newContacts,to:"/admin/contact-requests",show:t("contact.manage"),highlight:!0}].filter(i=>i.show);return a.jsxs("div",{children:[a.jsxs("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:["Willkommen, ",e==null?void 0:e.username,"!"]}),a.jsx("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:"Hier siehst du auf einen Blick, wie viel in deinem Shop hinterlegt ist. Klicke auf eine Kachel, um dorthin zu gelangen."}),s.length===0?a.jsx("p",{className:"text-neutral-500 dark:text-neutral-400",children:"Für deinen Account sind noch keine Bereiche freigeschaltet. Bitte wende dich an einen Administrator."}):a.jsx("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-4",children:s.map(i=>a.jsxs(U,{to:i.to,className:`rounded-xl border p-5 shadow-sm transition hover:-translate-y-0.5 hover:shadow-md ${i.highlight&&i.value>0?"border-brand-300 bg-brand-50 dark:border-brand-900 dark:bg-brand-900/20":"border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900"}`,children:[a.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:a.jsx(gP,{path:pP[i.icon]})}),a.jsx("p",{className:"text-sm font-semibold text-neutral-700 dark:text-neutral-200",children:i.label}),a.jsx("p",{className:"mt-1 text-3xl font-extrabold text-brand-600 dark:text-brand-400",children:i.value??"…"}),a.jsx("p",{className:"mt-2 text-xs text-neutral-500 dark:text-neutral-400",children:i.hint})]},i.key))}),t("settings.manage")&&a.jsx(xP,{})]})}const Lf={name:"",sort_order:0};function yP(){const[e,t]=g.useState([]),[n,r]=g.useState(Lf),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/brands").then(t);g.useEffect(()=>{u()},[]);const c=f=>{i(f.id),r({name:f.name,sort_order:f.sort_order})},d=()=>{i(null),r(Lf)},h=async f=>{f.preventDefault(),o("");try{s?await M.put(`/brands/${s}`,n):await M.post("/brands",n),d(),u()}catch(x){o(x.message)}},m=async f=>{confirm("Marke inkl. aller Modelle/Pakete/Produkte wirklich löschen?")&&(await M.delete(`/brands/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Marken"}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:a.jsx(U,{to:`/marken/${f.slug}`,target:"_blank",className:"hover:text-brand-500",children:f.name})}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Marken angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:n.name,onChange:f=>r({...n,name:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Df={name:"",brand_id:"",sort_order:0};function vP(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(Df),[l,o]=g.useState(null),[u,c]=g.useState(""),[d,h]=g.useState("all"),m=g.useMemo(()=>d==="all"?e:e.filter(p=>String(p.brand_id)===d),[e,d]),f=()=>{M.get("/models").then(t),M.get("/brands").then(r)};g.useEffect(f,[]);const x=p=>{o(p.id),i({name:p.name,brand_id:p.brand_id,sort_order:p.sort_order})},v=()=>{o(null),i(Df)},k=async p=>{p.preventDefault(),c("");const y={...s,brand_id:Number(s.brand_id)};try{l?await M.put(`/models/${l}`,y):await M.post("/models",y),v(),f()}catch(w){c(w.message)}},b=async p=>{confirm("Modell inkl. aller Pakete/Produkte wirklich löschen?")&&(await M.delete(`/models/${p}`),f())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Modelle"}),a.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[a.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),a.jsxs("select",{value:d,onChange:p=>h(p.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Marken"}),n.map(p=>a.jsx("option",{value:String(p.id),children:p.name},p.id))]}),d!=="all"&&a.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[m.length," von ",e.length]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Marke"}),a.jsx("th",{className:"px-4 py-2",children:"Modell"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[m.map(p=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:p.brand_name}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.name}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>x(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>b(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),m.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:e.length===0?"Noch keine Modelle angelegt.":"Keine Modelle für diese Marke."})})]})]})})]}),a.jsxs("form",{onSubmit:k,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Modell bearbeiten":"Neues Modell"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),a.jsxs("select",{required:!0,value:s.brand_id,onChange:p=>i({...s,brand_id:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(p=>a.jsx("option",{value:p.id,children:p.name},p.id))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Modellname *"}),a.jsx("input",{required:!0,value:s.name,onChange:p=>i({...s,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:s.sort_order,onChange:p=>i({...s,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:l?"Speichern":"Anlegen"}),l&&a.jsx("button",{type:"button",onClick:v,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}function gl({value:e,onChange:t,label:n="Bild"}){const[r,s]=g.useState(!1),[i,l]=g.useState(""),o=async u=>{var d;const c=(d=u.target.files)==null?void 0:d[0];if(c){s(!0),l("");try{const h=new FormData;h.append("file",c);const m=await M.post("/uploads",h);t(m.path)}catch(h){l(h.message)}finally{s(!1)}}};return a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:n}),a.jsxs("div",{className:"flex items-center gap-3",children:[e&&a.jsx("img",{src:e,alt:"",className:"h-12 w-12 rounded-md object-cover"}),a.jsx("input",{type:"file",accept:"image/png,image/jpeg,image/webp",onChange:o,className:"text-sm"}),r&&a.jsx("span",{className:"text-sm text-neutral-500",children:"Lädt hoch…"})]}),i&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:i})]})}const Bf={name:"",cover_image_path:"",sort_order:0};function kP(){const[e,t]=g.useState([]),[n,r]=g.useState(Bf),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/gallery-brands").then(t);g.useEffect(()=>{u()},[]);const c=f=>{i(f.id),r({name:f.name,cover_image_path:f.cover_image_path||"",sort_order:f.sort_order})},d=()=>{i(null),r(Bf)},h=async f=>{f.preventDefault(),o("");try{s?await M.put(`/gallery-brands/${s}`,n):await M.post("/gallery-brands",n),d(),u()}catch(x){o(x.message)}},m=async f=>{confirm("Marke inkl. aller Projekte/Fotos wirklich löschen?")&&(await M.delete(`/gallery-brands/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Marken"}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Bild"}),a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:f.cover_image_path?a.jsx("img",{src:f.cover_image_path,alt:"",className:"h-10 w-10 rounded-md object-cover"}):a.jsx("span",{className:"flex h-10 w-10 items-center justify-center rounded-md bg-neutral-100 text-xs text-neutral-400 dark:bg-neutral-800",children:"–"})}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:a.jsx(U,{to:`/galerie/${f.slug}`,target:"_blank",className:"hover:text-brand-500",children:f.name})}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Galerie-Marken angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Marke bearbeiten":"Neue Marke"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:n.name,onChange:f=>r({...n,name:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx(gl,{value:n.cover_image_path,onChange:f=>r({...n,cover_image_path:f}),label:"Titelbild (optional)"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const zf={name:"",gallery_brand_id:"",cover_image_path:"",sort_order:0};function wP(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(zf),[l,o]=g.useState(null),[u,c]=g.useState(""),[d,h]=g.useState("all"),m=g.useMemo(()=>d==="all"?e:e.filter(p=>String(p.gallery_brand_id)===d),[e,d]),f=()=>{M.get("/gallery-projects").then(t),M.get("/gallery-brands").then(r)};g.useEffect(f,[]);const x=p=>{o(p.id),i({name:p.name,gallery_brand_id:p.gallery_brand_id,cover_image_path:p.cover_image_path||"",sort_order:p.sort_order})},v=()=>{o(null),i(zf)},k=async p=>{p.preventDefault(),c("");const y={...s,gallery_brand_id:Number(s.gallery_brand_id)};try{l?await M.put(`/gallery-projects/${l}`,y):await M.post("/gallery-projects",y),v(),f()}catch(w){c(w.message)}},b=async p=>{confirm("Projekt inkl. aller Fotos wirklich löschen?")&&(await M.delete(`/gallery-projects/${p}`),f())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Galerie-Projekte"}),a.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[a.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Nach Marke filtern:"}),a.jsxs("select",{value:d,onChange:p=>h(p.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Marken"}),n.map(p=>a.jsx("option",{value:String(p.id),children:p.name},p.id))]}),d!=="all"&&a.jsx("button",{onClick:()=>h("all"),className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[m.length," von ",e.length]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Marke"}),a.jsx("th",{className:"px-4 py-2",children:"Projekt"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[m.map(p=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:p.brand_name}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:p.name}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx(U,{to:`/admin/gallery-projects/${p.id}/photos`,className:"mr-3 text-brand-600 hover:underline",children:"Fotos"}),a.jsx("button",{onClick:()=>x(p),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>b(p.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},p.id)),m.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:e.length===0?"Noch keine Projekte angelegt.":"Keine Projekte für diese Marke."})})]})]})})]}),a.jsxs("form",{onSubmit:k,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Projekt bearbeiten":"Neues Projekt"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Marke *"}),a.jsxs("select",{required:!0,value:s.gallery_brand_id,onChange:p=>i({...s,gallery_brand_id:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Bitte wählen…"}),n.map(p=>a.jsx("option",{value:p.id,children:p.name},p.id))]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Projektname *"}),a.jsx("input",{required:!0,placeholder:"z. B. Audi TT",value:s.name,onChange:p=>i({...s,name:p.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx(gl,{value:s.cover_image_path,onChange:p=>i({...s,cover_image_path:p}),label:"Titelbild (optional)"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:s.sort_order,onChange:p=>i({...s,sort_order:Number(p.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:l?"Speichern":"Anlegen"}),l&&a.jsx("button",{type:"button",onClick:v,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}function jP(){const{projectId:e}=Gn(),[t,n]=g.useState([]),[r,s]=g.useState(""),[i,l]=g.useState(!1),[o,u]=g.useState(""),c=g.useRef(null),d=()=>M.get(`/gallery-projects/${e}/photos`).then(n);g.useEffect(()=>{d()},[e]);const h=async k=>{const b=Array.from(k.target.files||[]);if(b.length!==0){s(""),l(!0);try{for(let p=0;p{n(p=>p.map(y=>y.id===k.id?{...y,caption:b}:y))},f=(k,b)=>{n(p=>p.map(y=>y.id===k.id?{...y,sort_order:b}:y))},x=async k=>{await M.put(`/gallery-photos/${k.id}`,{caption:k.caption,sort_order:k.sort_order}),d()},v=async k=>{confirm("Foto wirklich entfernen?")&&(await M.delete(`/gallery-photos/${k}`),d())};return a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 text-sm",children:a.jsx(U,{to:"/admin/gallery-projects",className:"text-brand-600 hover:underline",children:"← Zurück zu den Projekten"})}),a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Fotos im Projekt"}),a.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Fotos hinzufügen (Mehrfachauswahl möglich)"}),a.jsx("input",{ref:c,type:"file",multiple:!0,accept:"image/png,image/jpeg,image/webp",onChange:h,disabled:i,className:"text-sm"}),i&&a.jsx("p",{className:"mt-2 text-sm text-neutral-500",children:o})]}),r&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:r}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-3 md:grid-cols-4",children:[t.map(k=>a.jsxs("div",{className:"overflow-hidden rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("img",{src:k.image_path,alt:k.caption||"",className:"aspect-square w-full object-cover"}),a.jsxs("div",{className:"space-y-2 p-3",children:[a.jsx("input",{value:k.caption||"",onChange:b=>m(k,b.target.value),onBlur:()=>x(k),placeholder:"Bildunterschrift (optional)",className:"w-full rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("input",{type:"number",value:k.sort_order,onChange:b=>f(k,Number(b.target.value)),onBlur:()=>x(k),className:"w-16 rounded-md border border-neutral-300 bg-white px-2 py-1 text-xs dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("button",{onClick:()=>v(k.id),className:"text-xs text-red-600 hover:underline",children:"Entfernen"})]})]})]},k.id)),t.length===0&&a.jsx("p",{className:"col-span-full py-6 text-center text-neutral-400",children:"Noch keine Fotos in diesem Projekt."})]})]})}const NP=["Base","Clear","Drive","Prime","Elite","Apex","The Statement","Limitless"],SP=e=>(e+1)*10,Ba="w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",Yu=e=>({description:e.description||"",markup_type:e.markup_type||"none",markup_value:e.markup_value||0,icon_name:e.icon_name||"",tagline:e.tagline||"",price_text:e.price_text||"",is_featured:!!e.is_featured,sort_order:e.sort_order??0}),CP=e=>({description:"",markup_type:"none",markup_value:0,icon_name:"",tagline:"",price_text:"",is_featured:!1,sort_order:SP(e)}),PP=["description","markup_type","markup_value","icon_name","tagline","price_text","is_featured","sort_order"],xo=e=>{if(!e.existing)return e.checked;const t=Yu(e.existing);return PP.some(n=>n==="is_featured"?!!t[n]!=!!e.form[n]:String(t[n])!==String(e.form[n]))},ts=(e,t)=>{const n=t.filter(l=>l.car_model_id===e).slice().sort((l,o)=>l.sort_order-o.sort_order||l.name.localeCompare(o.name)),r=new Set,s=NP.map((l,o)=>{const u=n.find(c=>!r.has(c.id)&&c.name.trim().toLowerCase()===l.toLowerCase());return u&&r.add(u.id),{key:`tier-${o}`,tierName:l,existing:u||null,checked:!!u,form:u?Yu(u):CP(o)}}),i=n.filter(l=>!r.has(l.id)).map(l=>({key:`legacy-${l.id}`,tierName:null,existing:l,checked:!0,form:Yu(l)}));return[...s,...i]},EP=e=>{e.target.style.height="auto",e.target.style.height=`${e.target.scrollHeight}px`};function TP(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState(""),[l,o]=g.useState(""),[u,c]=g.useState([]),[d,h]=g.useState({}),[m,f]=g.useState(!1),[x,v]=g.useState(null),[k,b]=g.useState(""),[p,y]=g.useState(!1),[w,j]=g.useState(null),[C,S]=g.useState("all"),[P,T]=g.useState("all"),N=async()=>{const[A,W]=await Promise.all([M.get("/packages"),M.get("/models")]);return t(A),r(W),A};g.useEffect(()=>{N()},[]);const E=g.useMemo(()=>new Map(n.map(A=>[A.id,A])),[n]),B=g.useMemo(()=>{const A=new Map;return n.forEach(W=>{A.has(W.brand_id)||A.set(W.brand_id,W.brand_name)}),Array.from(A,([W,q])=>({id:W,name:q})).sort((W,q)=>W.name.localeCompare(q.name))},[n]),V=g.useMemo(()=>n.filter(A=>!s||String(A.brand_id)===s).sort((A,W)=>A.name.localeCompare(W.name)),[n,s]),$=l?E.get(Number(l)):null,Q=g.useMemo(()=>u.some(xo),[u]),R=()=>!Q||confirm("Ungespeicherte Änderungen verwerfen?"),K=(A,W,q=e)=>{i(String(A)),o(String(W)),c(ts(Number(W),q)),h({}),v(null),b(""),j(null)},_=A=>{R()&&(i(A),o(""),c([]),h({}),v(null),j(null))},D=A=>{if(!R())return;if(!A){o(""),c([]);return}const W=E.get(Number(A));K(W?W.brand_id:s,A)},z=(A,W)=>c(q=>q.map(Re=>Re.key===A?{...Re,checked:W}:Re)),O=(A,W)=>c(q=>q.map(Re=>Re.key===A?{...Re,form:{...Re.form,...W}}:Re)),G=A=>({name:A.tierName??A.existing.name,car_model_id:Number(l),...A.form,markup_value:Number(A.form.markup_value),sort_order:Number(A.form.sort_order)}),Z=async()=>{f(!0),v(null);const A={},W=u;let q=0,Re=0;for(const Ke of u)try{Ke.existing?xo(Ke)&&(await M.put(`/packages/${Ke.existing.id}`,G(Ke)),Re+=1):Ke.checked&&(await M.post("/packages",G(Ke)),q+=1)}catch(Hr){A[Ke.key]=Hr.message}const da=await N(),wl=ts(Number(l),da).map(Ke=>{if(!A[Ke.key])return Ke;const Hr=W.find(Lb=>Lb.key===Ke.key);return Hr?{...Ke,checked:Hr.checked,form:Hr.form}:Ke});c(wl),h(A);const Wr=Object.keys(A).length,qt=[];q&&qt.push(`${q} neu angelegt`),Re&&qt.push(`${Re} aktualisiert`),!qt.length&&!Wr&&qt.push("Keine Änderungen"),v(Wr?{kind:"error",text:`${qt.join(", ")||"Nichts gespeichert"} – ${Wr} Paket(e) fehlgeschlagen (Details an der Zeile).`}:{kind:"ok",text:`${qt.join(", ")}.`}),f(!1)},J=async A=>{if(!confirm(`Paket "${A.tierName??A.existing.name}" inkl. aller Produkte wirklich löschen?`))return;await M.delete(`/packages/${A.existing.id}`);const W=await N();c(ts(Number(l),W)),v(null)},Me=async A=>{if(!confirm("Paket inkl. aller Produkte wirklich löschen?"))return;await M.delete(`/packages/${A.id}`);const W=await N();l&&c(ts(Number(l),W))},Ie=async()=>{if(!k||!R())return;const A=E.get(Number(k)),W=E.get(Number(l));if(confirm(`Alle Pakete von "${A.brand_name} ${A.name}" inkl. verknüpfter Produkte nach "${W.brand_name} ${W.name}" kopieren? Bereits vorhandene Paketstufen werden übersprungen. Upgrades werden nicht mitkopiert.`)){y(!0),j(null);try{const q=await M.post(`/models/${l}/copy-packages`,{source_model_id:Number(k)}),Re=q.copied.reduce((Wr,qt)=>Wr+qt.products,0),da=[`${q.copied.length} Paket(e) kopiert (${Re} Produkte)`];q.skipped.length&&da.push(`übersprungen: ${q.skipped.join(", ")}`),j({text:`${da.join(" – ")}.`});const wl=await N();c(ts(Number(l),wl)),h({})}catch(q){j({error:q.message})}y(!1)}},Kn=u.filter(A=>!A.existing&&A.checked).length,Mb=u.filter(A=>A.existing&&xo(A)).length,_b=g.useMemo(()=>n.filter(A=>C==="all"||String(A.brand_id)===C).sort((A,W)=>A.name.localeCompare(W.name)),[n,C]),kl=g.useMemo(()=>e.filter(A=>{const W=E.get(A.car_model_id);return!(C!=="all"&&String(W==null?void 0:W.brand_id)!==C||P!=="all"&&String(A.car_model_id)!==P)}),[e,E,C,P]),Ad=a.jsxs("div",{children:[a.jsxs("div",{className:"mb-3 flex flex-wrap items-center gap-2",children:[a.jsx("label",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Filtern:"}),a.jsxs("select",{value:C,onChange:A=>{S(A.target.value),T("all")},className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Marken"}),B.map(A=>a.jsx("option",{value:String(A.id),children:A.name},A.id))]}),a.jsxs("select",{value:P,onChange:A=>T(A.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"all",children:"Alle Modelle"}),_b.map(A=>a.jsxs("option",{value:String(A.id),children:[A.brand_name," ",A.name]},A.id))]}),(C!=="all"||P!=="all")&&a.jsx("button",{onClick:()=>{S("all"),T("all")},className:"text-sm text-brand-600 hover:underline",children:"Filter zurücksetzen"}),a.jsxs("span",{className:"text-sm text-neutral-400",children:[kl.length," von ",e.length]})]}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Marke / Modell"}),a.jsx("th",{className:"px-4 py-2",children:"Paket"}),a.jsx("th",{className:"px-4 py-2",children:"Aufschlag"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[kl.map(A=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[A.brand_name," ",A.model_name]}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[A.name,A.is_featured&&a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"})]})}),a.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[A.markup_type==="fixed"&&`+${A.markup_value} €`,A.markup_type==="percent"&&`+${A.markup_value} %`,(!A.markup_type||A.markup_type==="none")&&"–"]}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx(U,{to:`/admin/packages/${A.id}/products`,className:"mr-3 text-brand-600 hover:underline",children:"Produkte"}),a.jsx(U,{to:`/admin/packages/${A.id}/upgrades`,className:"mr-3 text-brand-600 hover:underline",children:"Upgrades"}),a.jsx("button",{onClick:()=>{if(!R())return;const W=E.get(A.car_model_id);K(W.brand_id,A.car_model_id),window.scrollTo({top:0,behavior:"smooth"})},className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>Me(A),className:"text-red-600 hover:underline",children:"Löschen"})]})]},A.id)),kl.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:e.length===0?"Noch keine Pakete angelegt.":"Keine Pakete für diesen Filter."})})]})]})})]});return a.jsxs("div",{className:"space-y-6",children:[a.jsx("h1",{className:"text-xl font-bold text-neutral-900 dark:text-white",children:"Pakete"}),a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-3 font-bold text-neutral-900 dark:text-white",children:"Modell wählen"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs("select",{value:s,onChange:A=>_(A.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Marke wählen…"}),B.map(A=>a.jsx("option",{value:String(A.id),children:A.name},A.id))]}),a.jsxs("select",{value:l,onChange:A=>D(A.target.value),className:"min-w-[220px] rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Modell wählen…"}),V.map(A=>a.jsxs("option",{value:String(A.id),children:[A.brand_name," ",A.name]},A.id))]})]}),!l&&a.jsx("p",{className:"mt-2 text-sm text-neutral-500 dark:text-neutral-400",children:"Modell auswählen, um dessen Pakete anzulegen oder zu bearbeiten – die Standard-Paketstufen stehen dann als Checkliste bereit."})]}),$&&a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"border-b border-neutral-200 px-5 py-4 dark:border-neutral-800",children:[a.jsxs("h2",{className:"font-bold text-neutral-900 dark:text-white",children:["Pakete für ",$.brand_name," ",$.name]}),a.jsx("p",{className:"mt-1 text-sm text-neutral-500 dark:text-neutral-400",children:"Paketstufen anhaken, Beschreibung und Aufschlag ausfüllen, unten alles auf einmal speichern."}),a.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 rounded-lg border border-neutral-200 bg-neutral-50 px-3 py-2.5 dark:border-neutral-800 dark:bg-neutral-950",children:[a.jsx("span",{className:"text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Pakete von anderem Modell kopieren:"}),a.jsxs("select",{value:k,onChange:A=>b(A.target.value),className:"rounded-md border border-neutral-300 bg-white px-3 py-1.5 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"",children:"Quellmodell wählen…"}),n.filter(A=>String(A.id)!==l).sort((A,W)=>`${A.brand_name} ${A.name}`.localeCompare(`${W.brand_name} ${W.name}`)).map(A=>a.jsxs("option",{value:String(A.id),children:[A.brand_name," ",A.name]},A.id))]}),a.jsx("button",{type:"button",onClick:Ie,disabled:!k||p,className:"rounded-md border border-brand-500 px-3 py-1.5 text-sm font-semibold text-brand-600 hover:bg-brand-50 disabled:opacity-50 dark:hover:bg-brand-900/20",children:p?"Kopiert…":"Kopieren"}),a.jsx("span",{className:"text-xs text-neutral-400",children:"inkl. Produkte, ohne Upgrades"}),w&&a.jsx("span",{className:`w-full text-sm ${w.error?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:w.error||w.text})]})]}),a.jsx("div",{children:u.map((A,W)=>a.jsxs("div",{children:[A.tierName===null&&W>0&&u[W-1].tierName!==null&&a.jsx("div",{className:"border-t border-neutral-200 bg-neutral-50 px-5 py-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-400",children:"Weitere Pakete (alte Namen)"}),a.jsxs("div",{className:`border-t border-neutral-100 dark:border-neutral-800 ${A.checked?"":"opacity-70"}`,children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-3 px-5 py-3",children:[a.jsxs("label",{className:"flex cursor-pointer items-center gap-3",children:[a.jsx("input",{type:"checkbox",checked:A.checked,disabled:!!A.existing||m,onChange:q=>z(A.key,q.target.checked),className:"h-5 w-5 rounded border-neutral-300 text-brand-600 focus:ring-brand-500 disabled:opacity-60"}),a.jsx("span",{className:"font-semibold text-neutral-900 dark:text-white",children:A.tierName??A.existing.name})]}),A.tierName===null&&a.jsx("span",{className:"text-xs text-neutral-400",children:"(alter Name)"}),A.existing?a.jsx("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-xs font-semibold text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:"Vorhanden"}):A.checked&&a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Neu"}),A.form.is_featured&&a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-semibold text-brand-700 dark:bg-brand-900/40 dark:text-brand-400",children:"Empfohlen"}),A.existing&&a.jsxs("span",{className:"ml-auto flex items-center gap-3 text-sm",children:[a.jsx(U,{to:`/admin/packages/${A.existing.id}/products`,className:"text-brand-600 hover:underline",children:"Produkte"}),a.jsx(U,{to:`/admin/packages/${A.existing.id}/upgrades`,className:"text-brand-600 hover:underline",children:"Upgrades"}),a.jsx("button",{type:"button",onClick:()=>J(A),className:"text-red-600 hover:underline",children:"Löschen"})]})]}),A.checked&&a.jsxs("div",{className:"space-y-4 px-5 pb-5 sm:pl-[52px]",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),a.jsx("p",{className:"mb-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Jede Zeile erscheint als eigener Stichpunkt zusammen mit den Bauteilen."}),a.jsx("textarea",{rows:10,value:A.form.description,onChange:q=>O(A.key,{description:q.target.value}),onInput:EP,className:Ba})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aufschlag"}),a.jsxs("div",{className:"flex max-w-md gap-2",children:[a.jsxs("select",{value:A.form.markup_type,onChange:q=>O(A.key,{markup_type:q.target.value}),className:"w-40 rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"none",children:"Kein Aufschlag"}),a.jsx("option",{value:"fixed",children:"Fester Betrag (€)"}),a.jsx("option",{value:"percent",children:"Prozent (%)"})]}),a.jsx("input",{type:"number",step:"0.01",min:"0",disabled:A.form.markup_type==="none",value:A.form.markup_value,onChange:q=>O(A.key,{markup_value:q.target.value}),className:`${Ba} disabled:opacity-50`})]}),a.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:"Wird auf die Summe der Bauteilpreise aufgeschlagen und ergibt den Gesamtpreis für den Kunden."})]}),a.jsxs("details",{className:"rounded-lg border border-neutral-200 dark:border-neutral-800",children:[a.jsx("summary",{className:"cursor-pointer select-none px-3 py-2 text-sm font-medium text-neutral-600 dark:text-neutral-300",children:"Weitere Optionen (Preis-Text, Empfohlen, Sortierung)"}),a.jsxs("div",{className:"space-y-4 border-t border-neutral-200 p-3 dark:border-neutral-800",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis-Text (optional)"}),a.jsx("input",{value:A.form.price_text,onChange:q=>O(A.key,{price_text:q.target.value}),placeholder:'z. B. "Coming soon" oder "Preis auf Anfrage"',className:Ba}),a.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Ersetzt auf der Kachel den berechneten Preis, solange ausgefüllt."})]}),a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:A.form.is_featured,onChange:q=>O(A.key,{is_featured:q.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Als empfohlen hervorheben"]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:A.form.sort_order,onChange:q=>O(A.key,{sort_order:q.target.value}),className:`${Ba} max-w-[160px]`})]})]})]}),d[A.key]&&a.jsx("p",{className:"text-sm text-red-600",children:d[A.key]})]})]})]},A.key))}),a.jsxs("div",{className:"sticky bottom-0 flex flex-wrap items-center gap-3 rounded-b-xl border-t border-neutral-200 bg-white px-5 py-3 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("button",{type:"button",onClick:Z,disabled:m||!Q,className:"rounded-md bg-brand-500 px-5 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:m?"Speichert…":"Alle speichern"}),a.jsxs("span",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:[Kn," neu, ",Mb," geändert"]}),x&&a.jsx("span",{className:`text-sm ${x.kind==="error"?"text-red-600":"text-brand-600 dark:text-brand-400"}`,children:x.text})]})]}),$?a.jsxs("details",{className:"rounded-xl border border-neutral-200 bg-white dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("summary",{className:"cursor-pointer select-none px-5 py-3 font-bold text-neutral-900 dark:text-white",children:"Alle Pakete (Übersicht)"}),a.jsx("div",{className:"border-t border-neutral-200 p-5 dark:border-neutral-800",children:Ad})]}):Ad]})}const za=[...$b].sort(),AP=120,MP=200;function _P({value:e,onChange:t}){const[n,r]=g.useState(""),s=g.useMemo(()=>{const i=n.trim().toLowerCase();return i?za.filter(l=>l.includes(i)).slice(0,MP):za.slice(0,AP)},[n]);return a.jsxs("div",{children:[a.jsxs("div",{className:"mb-2 flex items-center gap-3 rounded-md border border-neutral-300 p-2 dark:border-neutral-700",children:[a.jsx("div",{className:"flex h-10 w-10 shrink-0 items-center justify-center rounded-md bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:e?a.jsx(Ue,{name:e,className:"h-6 w-6"}):a.jsx("span",{className:"text-xs text-neutral-400",children:"?"})}),a.jsxs("div",{className:"text-sm",children:[a.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:e||"Kein Icon gewählt"}),a.jsxs("p",{className:"text-xs text-neutral-400",children:[za.length," Icons verfügbar"]})]})]}),a.jsx("input",{value:n,onChange:i=>r(i.target.value),placeholder:"Icon suchen (z. B. car, shield, zap)…",className:"mb-2 w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsxs("div",{className:"grid max-h-64 grid-cols-6 gap-1 overflow-y-auto rounded-md border border-neutral-200 p-2 sm:grid-cols-8 dark:border-neutral-700",children:[s.map(i=>a.jsx("button",{type:"button",title:i,onClick:()=>t(i),className:`flex h-10 w-10 items-center justify-center rounded-md transition ${e===i?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`,children:a.jsx(Ue,{name:i,className:"h-5 w-5"})},i)),s.length===0&&a.jsx("p",{className:"col-span-full py-4 text-center text-sm text-neutral-400",children:"Keine Icons gefunden."})]}),!n&&a.jsxs("p",{className:"mt-1 text-xs text-neutral-400",children:["Tipp: Tippe einen Suchbegriff ein, um alle ",za.length," Icons zu durchsuchen."]})]})}const If={icon_name:"",title:"",description:"",image_path:"",cta_label:"",cta_url:"",sort_order:0};function LP(){const[e,t]=g.useState([]),[n,r]=g.useState(If),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/services").then(t);g.useEffect(u,[]);const c=f=>{i(f.id),r({icon_name:f.icon_name,title:f.title,description:f.description,image_path:f.image_path||"",cta_label:f.cta_label||"",cta_url:f.cta_url||"",sort_order:f.sort_order})},d=()=>{i(null),r(If)},h=async f=>{if(f.preventDefault(),o(""),!n.icon_name){o("Bitte ein Icon auswählen");return}const x={...n,sort_order:Number(n.sort_order)};try{s?await M.put(`/services/${s}`,x):await M.post("/services",x),d(),u()}catch(v){o(v.message)}},m=async f=>{confirm("Diese Leistung wirklich löschen?")&&(await M.delete(`/services/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Leistungen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Karten erscheinen auf der öffentlichen Leistungen-Seite. Die 8 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Icon"}),a.jsx("th",{className:"px-4 py-2",children:"Titel"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2",children:a.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-full bg-brand-100 text-brand-600 dark:bg-brand-900/40 dark:text-brand-400",children:a.jsx(Ue,{name:f.icon_name,className:"h-5 w-5"})})}),a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:f.title}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Leistungen angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Leistung bearbeiten":"Neue Leistung"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Icon *"}),a.jsx(_P,{value:n.icon_name,onChange:f=>r({...n,icon_name:f})})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:n.title,onChange:f=>r({...n,title:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung *"}),a.jsx("textarea",{required:!0,rows:4,value:n.description,onChange:f=>r({...n,description:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx(gl,{value:n.image_path,onChange:f=>r({...n,image_path:f}),label:"Bild"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Text (optional)"}),a.jsx("input",{value:n.cta_label,onChange:f=>r({...n,cta_label:f.target.value}),placeholder:"z. B. Fahrzeug konfigurieren",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Button-Link (optional)"}),a.jsx("input",{value:n.cta_url,onChange:f=>r({...n,cta_url:f.target.value}),placeholder:"z. B. /fahrzeuge",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const Rf={question_de:"",answer_de:"",question_en:"",answer_en:"",sort_order:0};function DP(){const[e,t]=g.useState([]),[n,r]=g.useState(Rf),[s,i]=g.useState(null),[l,o]=g.useState(""),u=()=>M.get("/faqs").then(t);g.useEffect(u,[]);const c=f=>{i(f.id),r({question_de:f.question_de,answer_de:f.answer_de,question_en:f.question_en,answer_en:f.answer_en,sort_order:f.sort_order})},d=()=>{i(null),r(Rf)},h=async f=>{f.preventDefault(),o("");const x={...n,sort_order:Number(n.sort_order)};try{s?await M.put(`/faqs/${s}`,x):await M.post("/faqs",x),d(),u()}catch(v){o(v.message)}},m=async f=>{confirm("Diese Frage wirklich löschen?")&&(await M.delete(`/faqs/${f}`),u())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Häufig gestellte Fragen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Fragen erscheinen im FAQ-Bereich der Startseite, jeweils in der aktuell gewählten Sprache. Die 6 mitgelieferten Einträge sind die Standard-Einstellung – du kannst sie bearbeiten, löschen und beliebig neue hinzufügen."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Frage (DE)"}),a.jsx("th",{className:"px-4 py-2",children:"Sortierung"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(f=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsx("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:f.question_de}),a.jsx("td",{className:"px-4 py-2",children:f.sort_order}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>c(f),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>m(f.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},f.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Fragen angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:h,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:s?"Frage bearbeiten":"Neue Frage"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Deutsch) *"}),a.jsx("input",{required:!0,value:n.question_de,onChange:f=>r({...n,question_de:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Deutsch) *"}),a.jsx("textarea",{required:!0,rows:3,value:n.answer_de,onChange:f=>r({...n,answer_de:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Frage (Englisch) *"}),a.jsx("input",{required:!0,value:n.question_en,onChange:f=>r({...n,question_en:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Antwort (Englisch) *"}),a.jsx("textarea",{required:!0,rows:3,value:n.answer_en,onChange:f=>r({...n,answer_en:f.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:n.sort_order,onChange:f=>r({...n,sort_order:Number(f.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),l&&a.jsx("p",{className:"text-sm text-red-600",children:l}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:s?"Speichern":"Anlegen"}),s&&a.jsx("button",{type:"button",onClick:d,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const BP=e=>e==null?"–":new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e),zP={ok:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",error:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"};function IP(){const{packageId:e}=Gn(),[t,n]=g.useState([]),[r,s]=g.useState(""),[i,l]=g.useState(""),[o,u]=g.useState(""),[c,d]=g.useState(!1),h=()=>M.get(`/packages/${e}/products`).then(n);g.useEffect(()=>{h()},[e]);const m=async v=>{v.preventDefault(),u(""),d(!0);try{await M.post("/products",{package_id:Number(e),source_url:r,name_override:i||null}),s(""),l(""),h()}catch(k){u(k.message)}finally{d(!1)}},f=async v=>{d(!0);try{await M.post(`/products/${v}/refresh-price`,{}),h()}finally{d(!1)}},x=async v=>{confirm("Produkt wirklich entfernen?")&&(await M.delete(`/products/${v}`),h())};return a.jsxs("div",{children:[a.jsx("p",{className:"mb-2 text-sm",children:a.jsx(U,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),a.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Produkte im Paket"}),a.jsxs("form",{onSubmit:m,className:"mb-6 flex flex-wrap items-end gap-3 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"flex-1 min-w-[240px]",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"audio4cars.de Produkt-URL *"}),a.jsx("input",{required:!0,type:"url",placeholder:"https://www.audio4cars.de/produkt/...",value:r,onChange:v=>s(v.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{className:"w-56",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name überschreiben (optional)"}),a.jsx("input",{value:i,onChange:v=>l(v.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsx("button",{disabled:c,type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Hinzufügen"})]}),o&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:o}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Produkt"}),a.jsx("th",{className:"px-4 py-2",children:"Preis"}),a.jsx("th",{className:"px-4 py-2",children:"Status"}),a.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktualisiert"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(v=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[a.jsx("a",{href:v.source_url,target:"_blank",rel:"noreferrer",className:"font-medium text-neutral-800 hover:underline dark:text-neutral-100",children:v.name_override||v.scraped_name||v.source_url}),v.scrape_status==="error"&&a.jsx("p",{className:"text-xs text-red-500",children:v.scrape_error})]}),a.jsx("td",{className:"px-4 py-2",children:BP(v.scraped_price)}),a.jsx("td",{className:"px-4 py-2",children:a.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${zP[v.scrape_status]}`,children:v.scrape_status})}),a.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:v.price_updated_at?new Date(v.price_updated_at.replace(" ","T")).toLocaleString("de-DE"):"–"}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{disabled:c,onClick:()=>f(v.id),className:"mr-3 text-brand-600 hover:underline disabled:opacity-60",children:"Preis aktualisieren"}),a.jsx("button",{onClick:()=>x(v.id),className:"text-red-600 hover:underline",children:"Entfernen"})]})]},v.id)),t.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Produkte im Paket."})})]})]})})]})}const RP=e=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e),Ff={name:"",description:"",price:0,sort_order:0};function FP(){const{packageId:e}=Gn(),[t,n]=g.useState([]),[r,s]=g.useState(Ff),[i,l]=g.useState(null),[o,u]=g.useState(""),c=()=>M.get(`/packages/${e}/upgrades`).then(n);g.useEffect(()=>{c()},[e]);const d=x=>{l(x.id),s({name:x.name,description:x.description||"",price:x.price,sort_order:x.sort_order})},h=()=>{l(null),s(Ff)},m=async x=>{x.preventDefault(),u("");const v={...r,package_id:Number(e),price:Number(r.price)};try{i?await M.put(`/package-upgrades/${i}`,v):await M.post("/package-upgrades",v),h(),c()}catch(k){u(k.message)}},f=async x=>{confirm("Upgrade wirklich löschen?")&&(await M.delete(`/package-upgrades/${x}`),c())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("p",{className:"mb-2 text-sm",children:a.jsx(U,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Optionale Upgrades"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Diese Upgrades erscheinen nicht in der öffentlichen Paketübersicht, sondern erst als Auswahl im Kontaktformular."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Preis"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[t.map(x=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[a.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:x.name}),x.description&&a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:x.description})]}),a.jsx("td",{className:"px-4 py-2",children:RP(x.price)}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>d(x),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>f(x.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},x.id)),t.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Upgrades hinterlegt."})})]})]})})]}),a.jsxs("form",{onSubmit:m,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:i?"Upgrade bearbeiten":"Neues Upgrade"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:r.name,onChange:x=>s({...r,name:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),a.jsx("textarea",{rows:2,value:r.description,onChange:x=>s({...r,description:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Preis (€) *"}),a.jsx("input",{required:!0,type:"number",step:"0.01",min:"0",value:r.price,onChange:x=>s({...r,price:x.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Sortierung"}),a.jsx("input",{type:"number",value:r.sort_order,onChange:x=>s({...r,sort_order:Number(x.target.value)}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),o&&a.jsx("p",{className:"text-sm text-red-600",children:o}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:i?"Speichern":"Anlegen"}),i&&a.jsx("button",{type:"button",onClick:h,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const VP=e=>new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(e),OP={new:"Neu",in_progress:"In Bearbeitung",done:"Erledigt"},UP={new:"bg-brand-100 text-brand-700 dark:bg-brand-900/40 dark:text-brand-300",in_progress:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",done:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300"},WP=()=>a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.75",className:"h-4 w-4",children:a.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4 7h16M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2m3 0-.8 12.1a1 1 0 0 1-1 .9H7.8a1 1 0 0 1-1-.9L6 7h12ZM10 11v6M14 11v6"})});function HP(){const{hasPermission:e}=Lt(),[t,n]=g.useState([]),[r,s]=g.useState("all"),i=()=>M.get("/contact").then(n);g.useEffect(()=>{i()},[]);const l=async(h,m)=>{await M.patch(`/contact/${h}`,{status:m}),i()},o=async h=>{confirm("Diese Kontaktanfrage wirklich unwiderruflich löschen?")&&(await M.delete(`/contact/${h}`),i())},u=g.useMemo(()=>({all:t.length,new:t.filter(h=>h.status==="new").length,in_progress:t.filter(h=>h.status==="in_progress").length,done:t.filter(h=>h.status==="done").length}),[t]),c=r==="all"?t:t.filter(h=>h.status===r),d=[{value:"all",label:"Alle"},{value:"new",label:"Neu"},{value:"in_progress",label:"In Bearbeitung"},{value:"done",label:"Erledigt"}];return a.jsxs("div",{children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Kontaktanfragen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Alle Anfragen deiner Kunden. Wähle oben einen Reiter, um nur bestimmte Anfragen zu sehen."}),a.jsx("div",{className:"mb-5 flex flex-wrap gap-2",children:d.map(h=>a.jsxs("button",{onClick:()=>s(h.value),className:`rounded-full px-4 py-1.5 text-sm font-medium transition ${r===h.value?"bg-brand-500 text-white":"bg-neutral-100 text-neutral-600 hover:bg-neutral-200 dark:bg-neutral-800 dark:text-neutral-300 dark:hover:bg-neutral-700"}`,children:[h.label," (",u[h.value],")"]},h.value))}),a.jsxs("div",{className:"space-y-3",children:[c.map(h=>{var m;return a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-2 flex flex-wrap items-start justify-between gap-2",children:[a.jsxs("div",{children:[a.jsxs("p",{className:"font-semibold text-neutral-800 dark:text-neutral-100",children:[h.name," · ",h.email,h.phone?` · ${h.phone}`:""]}),h.vin&&a.jsxs("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:["FIN: ",a.jsx("span",{className:"font-mono",children:h.vin})]}),a.jsx("p",{className:"text-xs text-neutral-400",children:new Date(h.created_at.replace(" ","T")).toLocaleString("de-DE")})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("select",{value:h.status,onChange:f=>l(h.id,f.target.value),className:`rounded-full border-0 px-3 py-1 text-xs font-medium ${UP[h.status]}`,children:Object.entries(OP).map(([f,x])=>a.jsx("option",{value:f,children:x},f))}),e("contact.delete")&&a.jsx("button",{onClick:()=>o(h.id),"aria-label":"Anfrage löschen",title:"Anfrage löschen",className:"rounded-md p-1.5 text-neutral-400 hover:bg-red-50 hover:text-red-600 dark:hover:bg-red-900/20",children:a.jsx(WP,{})})]})]}),(h.brand_name||h.model_name||h.package_name||h.product_name)&&a.jsx("p",{className:"mb-2 text-sm text-neutral-500 dark:text-neutral-400",children:[h.brand_name,h.model_name,h.package_name,h.product_name].filter(Boolean).join(" · ")}),((m=h.selected_upgrades)==null?void 0:m.length)>0&&a.jsxs("div",{className:"mb-2 rounded-md bg-brand-50 p-2 text-sm text-brand-800 dark:bg-brand-900/20 dark:text-brand-200",children:[a.jsx("p",{className:"font-semibold",children:"Gewünschte Upgrades:"}),a.jsx("ul",{className:"list-disc pl-5",children:h.selected_upgrades.map(f=>a.jsxs("li",{children:[f.name," – ",VP(f.price)]},f.id))})]}),h.message&&a.jsx("p",{className:"text-sm text-neutral-700 dark:text-neutral-300",children:h.message})]},h.id)}),c.length===0&&a.jsx("p",{className:"text-neutral-400",children:r==="all"?"Noch keine Kontaktanfragen eingegangen.":"Keine Anfragen mit diesem Status."})]})]})}var ua={},$P=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},fb={},nt={};let Sd;const GP=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];nt.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};nt.getSymbolTotalCodewords=function(t){return GP[t]};nt.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};nt.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');Sd=t};nt.isKanjiModeEnabled=function(){return typeof Sd<"u"};nt.toSJIS=function(t){return Sd(t)};var xl={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,s){if(e.isValid(r))return r;try{return t(r)}catch{return s}}})(xl);function pb(){this.buffer=[],this.length=0}pb.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var KP=pb;function ca(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}ca.prototype.set=function(e,t,n,r){const s=e*this.size+t;this.data[s]=n,r&&(this.reservedBit[s]=!0)};ca.prototype.get=function(e,t){return this.data[e*this.size+t]};ca.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};ca.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var qP=ca,gb={};(function(e){const t=nt.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const s=Math.floor(r/7)+2,i=t(r),l=i===145?26:Math.ceil((i-13)/(2*s-2))*2,o=[i-7];for(let u=1;u=0&&s<=7},e.from=function(s){return e.isValid(s)?parseInt(s,10):void 0},e.getPenaltyN1=function(s){const i=s.size;let l=0,o=0,u=0,c=null,d=null;for(let h=0;h=5&&(l+=t.N1+(o-5)),c=f,o=1),f=s.get(m,h),f===d?u++:(u>=5&&(l+=t.N1+(u-5)),d=f,u=1)}o>=5&&(l+=t.N1+(o-5)),u>=5&&(l+=t.N1+(u-5))}return l},e.getPenaltyN2=function(s){const i=s.size;let l=0;for(let o=0;o=10&&(o===1488||o===93)&&l++,u=u<<1&2047|s.get(d,c),d>=10&&(u===1488||u===93)&&l++}return l*t.N3},e.getPenaltyN4=function(s){let i=0;const l=s.data.length;for(let u=0;u=0;){const l=i[0];for(let u=0;u0){const i=new Uint8Array(this.degree);return i.set(r,s),i}return r};var XP=Cd,kb={},Sn={},Pd={};Pd.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var Dt={};const wb="[0-9]+",ZP="[A-Z $%*+\\-./:]+";let Ys="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ys=Ys.replace(/u/g,"\\u");const QP="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ys+`)(?:.|[\r ]))+`;Dt.KANJI=new RegExp(Ys,"g");Dt.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");Dt.BYTE=new RegExp(QP,"g");Dt.NUMERIC=new RegExp(wb,"g");Dt.ALPHANUMERIC=new RegExp(ZP,"g");const JP=new RegExp("^"+Ys+"$"),e4=new RegExp("^"+wb+"$"),t4=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");Dt.testKanji=function(t){return JP.test(t)};Dt.testNumeric=function(t){return e4.test(t)};Dt.testAlphanumeric=function(t){return t4.test(t)};(function(e){const t=Pd,n=Dt;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(i,l){if(!i.ccBits)throw new Error("Invalid mode: "+i);if(!t.isValid(l))throw new Error("Invalid version: "+l);return l>=1&&l<10?i.ccBits[0]:l<27?i.ccBits[1]:i.ccBits[2]},e.getBestModeForData=function(i){return n.testNumeric(i)?e.NUMERIC:n.testAlphanumeric(i)?e.ALPHANUMERIC:n.testKanji(i)?e.KANJI:e.BYTE},e.toString=function(i){if(i&&i.id)return i.id;throw new Error("Invalid mode")},e.isValid=function(i){return i&&i.bit&&i.ccBits};function r(s){if(typeof s!="string")throw new Error("Param is not a string");switch(s.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+s)}}e.from=function(i,l){if(e.isValid(i))return i;try{return r(i)}catch{return l}}})(Sn);(function(e){const t=nt,n=bl,r=xl,s=Sn,i=Pd,l=7973,o=t.getBCHDigit(l);function u(m,f,x){for(let v=1;v<=40;v++)if(f<=e.getCapacity(v,x,m))return v}function c(m,f){return s.getCharCountIndicator(m,f)+4}function d(m,f){let x=0;return m.forEach(function(v){const k=c(v.mode,f);x+=k+v.getBitsLength()}),x}function h(m,f){for(let x=1;x<=40;x++)if(d(m,x)<=e.getCapacity(x,f,s.MIXED))return x}e.from=function(f,x){return i.isValid(f)?parseInt(f,10):x},e.getCapacity=function(f,x,v){if(!i.isValid(f))throw new Error("Invalid QR Code version");typeof v>"u"&&(v=s.BYTE);const k=t.getSymbolTotalCodewords(f),b=n.getTotalCodewordsCount(f,x),p=(k-b)*8;if(v===s.MIXED)return p;const y=p-c(v,f);switch(v){case s.NUMERIC:return Math.floor(y/10*3);case s.ALPHANUMERIC:return Math.floor(y/11*2);case s.KANJI:return Math.floor(y/13);case s.BYTE:default:return Math.floor(y/8)}},e.getBestVersionForData=function(f,x){let v;const k=r.from(x,r.M);if(Array.isArray(f)){if(f.length>1)return h(f,k);if(f.length===0)return 1;v=f[0]}else v=f;return u(v.mode,v.getLength(),k)},e.getEncodedBits=function(f){if(!i.isValid(f)||f<7)throw new Error("Invalid QR Code version");let x=f<<12;for(;t.getBCHDigit(x)-o>=0;)x^=l<=0;)s^=Nb<0&&(r=this.data.substr(n),s=parseInt(r,10),t.put(s,i*3+1))};var s4=Ar;const a4=Sn,bo=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Mr(e){this.mode=a4.ALPHANUMERIC,this.data=e}Mr.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};Mr.prototype.getLength=function(){return this.data.length};Mr.prototype.getBitsLength=function(){return Mr.getBitsLength(this.data.length)};Mr.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let r=bo.indexOf(this.data[n])*45;r+=bo.indexOf(this.data[n+1]),t.put(r,11)}this.data.length%2&&t.put(bo.indexOf(this.data[n]),6)};var i4=Mr;const l4=Sn;function _r(e){this.mode=l4.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}_r.getBitsLength=function(t){return t*8};_r.prototype.getLength=function(){return this.data.length};_r.prototype.getBitsLength=function(){return _r.getBitsLength(this.data.length)};_r.prototype.write=function(e){for(let t=0,n=this.data.length;t=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var d4=Lr,Cb={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,r,s){var i={},l={};l[r]=0;var o=t.PriorityQueue.make();o.push(r,0);for(var u,c,d,h,m,f,x,v,k;!o.empty();){u=o.pop(),c=u.value,h=u.cost,m=n[c]||{};for(d in m)m.hasOwnProperty(d)&&(f=m[d],x=h+f,v=l[d],k=typeof l[d]>"u",(k||v>x)&&(l[d]=x,o.push(d,x),i[d]=c))}if(typeof s<"u"&&typeof l[s]>"u"){var b=["Could not find a path from ",r," to ",s,"."].join("");throw new Error(b)}return i},extract_shortest_path_from_predecessor_list:function(n,r){for(var s=[],i=r;i;)s.push(i),n[i],i=n[i];return s.reverse(),s},find_path:function(n,r,s){var i=t.single_source_shortest_paths(n,r,s);return t.extract_shortest_path_from_predecessor_list(i,s)},PriorityQueue:{make:function(n){var r=t.PriorityQueue,s={},i;n=n||{};for(i in r)r.hasOwnProperty(i)&&(s[i]=r[i]);return s.queue=[],s.sorter=n.sorter||r.default_sorter,s},default_sorter:function(n,r){return n.cost-r.cost},push:function(n,r){var s={value:n,cost:r};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Cb);var h4=Cb.exports;(function(e){const t=Sn,n=s4,r=i4,s=o4,i=d4,l=Dt,o=nt,u=h4;function c(b){return unescape(encodeURIComponent(b)).length}function d(b,p,y){const w=[];let j;for(;(j=b.exec(y))!==null;)w.push({data:j[0],index:j.index,mode:p,length:j[0].length});return w}function h(b){const p=d(l.NUMERIC,t.NUMERIC,b),y=d(l.ALPHANUMERIC,t.ALPHANUMERIC,b);let w,j;return o.isKanjiModeEnabled()?(w=d(l.BYTE,t.BYTE,b),j=d(l.KANJI,t.KANJI,b)):(w=d(l.BYTE_KANJI,t.BYTE,b),j=[]),p.concat(y,w,j).sort(function(S,P){return S.index-P.index}).map(function(S){return{data:S.data,mode:S.mode,length:S.length}})}function m(b,p){switch(p){case t.NUMERIC:return n.getBitsLength(b);case t.ALPHANUMERIC:return r.getBitsLength(b);case t.KANJI:return i.getBitsLength(b);case t.BYTE:return s.getBitsLength(b)}}function f(b){return b.reduce(function(p,y){const w=p.length-1>=0?p[p.length-1]:null;return w&&w.mode===y.mode?(p[p.length-1].data+=y.data,p):(p.push(y),p)},[])}function x(b){const p=[];for(let y=0;y=0&&o<=6&&(u===0||u===6)||u>=0&&u<=6&&(o===0||o===6)||o>=2&&o<=4&&u>=2&&u<=4?e.set(i+o,l+u,!0,!0):e.set(i+o,l+u,!1,!0))}}function k4(e){const t=e.size;for(let n=8;n>o&1)===1,e.set(s,i,l,!0),e.set(i,s,l,!0)}function ko(e,t,n){const r=e.size,s=b4.getEncodedBits(t,n);let i,l;for(i=0;i<15;i++)l=(s>>i&1)===1,i<6?e.set(i,8,l,!0):i<8?e.set(i+1,8,l,!0):e.set(r-15+i,8,l,!0),i<8?e.set(8,r-i-1,l,!0):i<9?e.set(8,15-i-1+1,l,!0):e.set(8,15-i-1,l,!0);e.set(r-8,8,1,!0)}function N4(e,t){const n=e.size;let r=-1,s=n-1,i=7,l=0;for(let o=n-1;o>0;o-=2)for(o===6&&o--;;){for(let u=0;u<2;u++)if(!e.isReserved(s,o-u)){let c=!1;l>>i&1)===1),e.set(s,o-u,c),i--,i===-1&&(l++,i=7)}if(s+=r,s<0||n<=s){s-=r,r=-r;break}}}function S4(e,t,n){const r=new m4;n.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),y4.getCharCountIndicator(u.mode,e)),u.write(r)});const s=vl.getSymbolTotalCodewords(e),i=Qu.getTotalCodewordsCount(e,t),l=(s-i)*8;for(r.getLengthInBits()+4<=l&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const o=(l-r.getLengthInBits())/8;for(let u=0;u=7&&j4(u,t),N4(u,l),isNaN(r)&&(r=Zu.getBestMask(u,ko.bind(null,u,n))),Zu.applyMask(r,u),ko(u,n,r),{modules:u,version:t,errorCorrectionLevel:n,maskPattern:r,segments:s}}fb.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let r=yo.M,s,i;return typeof n<"u"&&(r=yo.from(n.errorCorrectionLevel,yo.M),s=Wi.from(n.version),i=Zu.from(n.maskPattern),n.toSJISFunc&&vl.setToSJISFunction(n.toSJISFunc)),P4(t,s,r,i)};var Pb={},Ed={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let r=n.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+n);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const s=parseInt(r.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+r.slice(0,6).join("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const s=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,i=r.width&&r.width>=21?r.width:void 0,l=r.scale||4;return{width:i,scale:i?4:l,margin:s,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,s){return s.width&&s.width>=r+s.margin*2?s.width/(r+s.margin*2):s.scale},e.getImageWidth=function(r,s){const i=e.getScale(r,s);return Math.floor((r+s.margin*2)*i)},e.qrToImageData=function(r,s,i){const l=s.modules.size,o=s.modules.data,u=e.getScale(l,i),c=Math.floor((l+i.margin*2)*u),d=i.margin*u,h=[i.color.light,i.color.dark];for(let m=0;m=d&&f>=d&&m"u"&&(!l||!l.getContext)&&(u=l,l=void 0),l||(c=r()),u=t.getOptions(u);const d=t.getImageWidth(i.modules.size,u),h=c.getContext("2d"),m=h.createImageData(d,d);return t.qrToImageData(m.data,i,u),n(h,c,d),h.putImageData(m,0,0),c},e.renderToDataURL=function(i,l,o){let u=o;typeof u>"u"&&(!l||!l.getContext)&&(u=l,l=void 0),u||(u={});const c=e.render(i,l,u),d=u.type||"image/png",h=u.rendererOpts||{};return c.toDataURL(d,h.quality)}})(Pb);var Eb={};const E4=Ed;function Uf(e,t){const n=e.a/255,r=t+'="'+e.hex+'"';return n<1?r+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':r}function wo(e,t,n){let r=e+t;return typeof n<"u"&&(r+=" "+n),r}function T4(e,t,n){let r="",s=0,i=!1,l=0;for(let o=0;o0&&u>0&&e[o-1]||(r+=i?wo("M",u+n,.5+c+n):wo("m",s,0),s=0,i=!1),u+1':"",c="',d='viewBox="0 0 '+o+" "+o+'"',m=''+u+c+` `;return typeof r=="function"&&r(null,m),m};const A4=$P,Ju=fb,Tb=Pb,M4=Eb;function Td(e,t,n,r,s){const i=[].slice.call(arguments,1),l=i.length,o=typeof i[l-1]=="function";if(!o&&!A4())throw new Error("Callback required as last argument");if(o){if(l<2)throw new Error("Too few arguments provided");l===2?(s=n,n=t,t=r=void 0):l===3&&(t.getContext&&typeof s>"u"?(s=r,r=void 0):(s=r,r=n,n=t,t=void 0))}else{if(l<1)throw new Error("Too few arguments provided");return l===1?(n=t,t=r=void 0):l===2&&!t.getContext&&(r=n,n=t,t=void 0),new Promise(function(u,c){try{const d=Ju.create(n,r);u(e(d,t,r))}catch(d){c(d)}})}try{const u=Ju.create(n,r);s(null,e(u,t,r))}catch(u){s(u)}}ua.create=Ju.create;ua.toCanvas=Td.bind(null,Tb.render);ua.toDataURL=Td.bind(null,Tb.renderToDataURL);ua.toString=Td.bind(null,function(e,t,n){return M4.render(e,n)});const Wf={current_password:"",new_password:"",new_password_confirmation:"",two_factor_code:""};function _4(){const{user:e,refreshUser:t}=Lt(),[n,r]=g.useState("idle"),[s,i]=g.useState(""),[l,o]=g.useState(""),[u,c]=g.useState(""),[d,h]=g.useState(""),[m,f]=g.useState([]),[x,v]=g.useState(""),[k,b]=g.useState(!1),[p,y]=g.useState(Wf),[w,j]=g.useState(""),[C,S]=g.useState(""),[P,T]=g.useState(!1),N=async R=>{if(R.preventDefault(),j(""),S(""),p.new_password!==p.new_password_confirmation){j("Die neuen Passwörter stimmen nicht überein");return}T(!0);try{await M.post("/auth/change-password",p),y(Wf),S("Passwort erfolgreich geändert.")}catch(K){j(K.message)}finally{T(!1)}},E=async()=>{v(""),b(!0);try{const R=await M.get("/auth/2fa/setup");o(R.secret),i(await ua.toDataURL(R.otpauth_url)),c(""),r("setup")}catch(R){v(R.message)}finally{b(!1)}},B=async R=>{R.preventDefault(),v(""),b(!0);try{const K=await M.post("/auth/2fa/enable",{code:u});f(K.recovery_codes),r("recovery-codes"),await t()}catch(K){v(K.message)}finally{b(!1)}},V=()=>{r("idle"),f([]),h("")},$=async R=>{R.preventDefault(),v(""),b(!0);try{await M.post("/auth/2fa/disable",{password:d}),h(""),r("idle"),await t()}catch(K){v(K.message)}finally{b(!1)}},Q=async R=>{R.preventDefault(),v(""),b(!0);try{const K=await M.post("/auth/2fa/recovery-codes",{password:d});f(K.recovery_codes),r("recovery-codes")}catch(K){v(K.message)}finally{b(!1)}};return a.jsxs("div",{className:"max-w-xl",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Mein Konto"}),a.jsxs("p",{className:"mb-6 text-sm text-neutral-500 dark:text-neutral-400",children:["Angemeldet als ",a.jsx("strong",{children:e==null?void 0:e.username}),e!=null&&e.is_super_admin?" (Super-Admin)":"","."]}),a.jsxs("div",{className:"mb-6 rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Passwort ändern"}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Vergib ein neues Passwort für dein Konto.",(e==null?void 0:e.two_factor_enabled)&&" Da 2FA aktiv ist, musst du die Änderung zusätzlich mit deinem Code bestätigen."]}),a.jsxs("form",{onSubmit:N,children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Aktuelles Passwort"}),a.jsx("input",{type:"password",value:p.current_password,onChange:R=>y({...p,current_password:R.target.value}),required:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort"}),a.jsx("input",{type:"password",value:p.new_password,onChange:R=>y({...p,new_password:R.target.value}),required:!0,minLength:8,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Neues Passwort wiederholen"}),a.jsx("input",{type:"password",value:p.new_password_confirmation,onChange:R=>y({...p,new_password_confirmation:R.target.value}),required:!0,minLength:8,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),(e==null?void 0:e.two_factor_enabled)&&a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"2FA-Code zur Bestätigung"}),a.jsx("input",{value:p.two_factor_code,onChange:R=>y({...p,two_factor_code:R.target.value}),required:!0,inputMode:"numeric",placeholder:"123456 oder Wiederherstellungscode",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),w&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:w}),C&&a.jsx("p",{className:"mb-4 text-sm text-green-600 dark:text-green-400",children:C}),a.jsx("button",{type:"submit",disabled:P,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:P?"Wird geändert…":"Passwort ändern"})]})]}),a.jsxs("div",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Zwei-Faktor-Authentifizierung"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Schützt dein Konto zusätzlich mit einem Code aus der Google Authenticator App."}),n==="idle"&&a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"mb-4 text-sm",children:["Status:"," ",e!=null&&e.two_factor_enabled?a.jsx("span",{className:"font-semibold text-green-600 dark:text-green-400",children:"Aktiv"}):a.jsx("span",{className:"font-semibold text-neutral-500 dark:text-neutral-400",children:"Nicht aktiv"})]}),e!=null&&e.two_factor_enabled?a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("button",{onClick:()=>{r("regenerate"),v("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Neue Wiederherstellungscodes erzeugen"}),a.jsx("button",{onClick:()=>{r("disable"),v("")},className:"rounded-md border border-red-300 px-4 py-2 text-sm font-medium text-red-600 hover:bg-red-50 dark:border-red-900 dark:hover:bg-red-900/20",children:"2FA deaktivieren"})]}):a.jsx("button",{onClick:E,disabled:k,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"2FA aktivieren"})]}),n==="setup"&&a.jsxs("form",{onSubmit:B,children:[a.jsxs("ol",{className:"mb-4 list-decimal space-y-2 pl-5 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("li",{children:"Öffne die Google Authenticator App (oder eine kompatible App)."}),a.jsx("li",{children:"Scanne den folgenden QR-Code:"})]}),a.jsx("div",{className:"mb-4 flex justify-center",children:s&&a.jsx("img",{src:s,alt:"QR-Code für Zwei-Faktor-Authentifizierung",className:"h-48 w-48 rounded-lg border border-neutral-200 dark:border-neutral-700"})}),a.jsxs("p",{className:"mb-4 text-center text-xs text-neutral-500 dark:text-neutral-400",children:["Geht das Scannen nicht? Gib diesen Code manuell ein: ",a.jsx("br",{}),a.jsx("code",{className:"mt-1 inline-block rounded bg-neutral-100 px-2 py-1 font-mono tracking-wider dark:bg-neutral-800",children:l})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Bestätigungscode aus der App"}),a.jsx("input",{value:u,onChange:R=>c(R.target.value),required:!0,autoFocus:!0,inputMode:"numeric",placeholder:"123456",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-center text-lg tracking-widest dark:border-neutral-700 dark:bg-neutral-900"})]}),x&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:x}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",disabled:k,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Bestätigen & aktivieren"}),a.jsx("button",{type:"button",onClick:()=>r("idle"),className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="recovery-codes"&&a.jsxs("div",{children:[a.jsx("p",{className:"mb-3 text-sm font-semibold text-neutral-900 dark:text-white",children:"Wiederherstellungscodes – jetzt sicher speichern!"}),a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Jeder Code funktioniert einmalig, falls du keinen Zugriff mehr auf die Authenticator-App hast. Diese Codes werden nur jetzt angezeigt."}),a.jsx("div",{className:"mb-4 grid grid-cols-2 gap-2 rounded-md bg-neutral-100 p-4 font-mono text-sm dark:bg-neutral-800",children:m.map(R=>a.jsx("span",{children:R},R))}),a.jsx("button",{onClick:V,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Ich habe die Codes gespeichert"})]}),n==="disable"&&a.jsxs("form",{onSubmit:$,children:[a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),a.jsx("input",{type:"password",value:d,onChange:R=>h(R.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),x&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:x}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",disabled:k,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-60",children:"2FA jetzt deaktivieren"}),a.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]}),n==="regenerate"&&a.jsxs("form",{onSubmit:Q,children:[a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Die bisherigen Wiederherstellungscodes werden ungültig."}),a.jsxs("div",{className:"mb-4",children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Passwort zur Bestätigung"}),a.jsx("input",{type:"password",value:d,onChange:R=>h(R.target.value),required:!0,autoFocus:!0,className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),x&&a.jsx("p",{className:"mb-4 text-sm text-red-600",children:x}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",disabled:k,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Neue Codes erzeugen"}),a.jsx("button",{type:"button",onClick:()=>{r("idle"),h("")},className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})]})}const Hf={username:"",password:"",is_super_admin:!1,permissions:[],group_ids:[]};function L4(){const{user:e,hasPermission:t}=Lt(),[n,r]=g.useState([]),[s,i]=g.useState([]),[l,o]=g.useState([]),[u,c]=g.useState(Hf),[d,h]=g.useState(null),[m,f]=g.useState(""),x=()=>{M.get("/admin-users").then(r),M.get("/permissions/catalog").then(i),(t("permission_groups.manage")||t("users.manage"))&&M.get("/permission-groups").then(o)};g.useEffect(x,[]);const v=j=>{h(j.id),c({username:j.username,password:"",is_super_admin:j.is_super_admin,permissions:j.permissions,group_ids:j.groups.map(C=>C.id)})},k=()=>{h(null),c(Hf)},b=j=>{c(C=>({...C,permissions:C.permissions.includes(j)?C.permissions.filter(S=>S!==j):[...C.permissions,j]}))},p=j=>{c(C=>({...C,group_ids:C.group_ids.includes(j)?C.group_ids.filter(S=>S!==j):[...C.group_ids,j]}))},y=async j=>{j.preventDefault(),f("");try{if(d)await M.put(`/admin-users/${d}`,u);else{if(u.password.length<8){f("Passwort muss mindestens 8 Zeichen lang sein");return}await M.post("/admin-users",u)}k(),x()}catch(C){f(C.message)}},w=async j=>{if(confirm("Diesen Benutzer wirklich löschen?"))try{await M.delete(`/admin-users/${j}`),x()}catch(C){alert(C.message)}};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Benutzer"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Jeder Mitarbeiter bekommt ein eigenes Konto mit genau den Rechten, die er braucht."}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Benutzername"}),a.jsx("th",{className:"px-4 py-2",children:"Rolle"}),a.jsx("th",{className:"px-4 py-2",children:"Berechtigungsgruppen"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[n.map(j=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2 font-medium text-neutral-800 dark:text-neutral-100",children:[j.username,j.id===(e==null?void 0:e.id)&&a.jsx("span",{className:"ml-1 text-xs text-neutral-400",children:"(du)"})]}),a.jsx("td",{className:"px-4 py-2",children:j.is_super_admin?a.jsx("span",{className:"rounded-full bg-brand-100 px-2 py-0.5 text-xs font-medium text-brand-700 dark:bg-brand-900/40 dark:text-brand-300",children:"Super-Admin"}):a.jsxs("span",{className:"text-neutral-500 dark:text-neutral-400",children:[j.permissions.length," Einzelrechte"]})}),a.jsx("td",{className:"px-4 py-2",children:a.jsxs("div",{className:"flex flex-wrap gap-1",children:[j.groups.map(C=>a.jsx("span",{className:"rounded-full bg-neutral-100 px-2 py-0.5 text-xs text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:C.name},C.id)),j.groups.length===0&&"–"]})}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>v(j),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),j.id!==(e==null?void 0:e.id)&&a.jsx("button",{onClick:()=>w(j.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},j.id)),n.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:4,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Benutzer angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:y,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:d?"Benutzer bearbeiten":"Neuer Benutzer"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername *"}),a.jsx("input",{required:!0,value:u.username,onChange:j=>c({...u,username:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",d?"(leer lassen = unverändert)":"*"]}),a.jsx("input",{type:"password",required:!d,value:u.password,onChange:j=>c({...u,password:j.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),(e==null?void 0:e.is_super_admin)&&a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u.is_super_admin,onChange:j=>c({...u,is_super_admin:j.target.checked}),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Super-Admin (hat automatisch alle Rechte)"]}),!u.is_super_admin&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Einzelne Berechtigungen"}),a.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:s.map(j=>a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u.permissions.includes(j.key),onChange:()=>b(j.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),j.label]},j.key))})]}),a.jsxs("div",{children:[a.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungsgruppen"}),a.jsxs("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:[l.map(j=>a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u.group_ids.includes(j.id),onChange:()=>p(j.id),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),j.name]},j.id)),l.length===0&&a.jsx("p",{className:"text-sm text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})]})]})]}),m&&a.jsx("p",{className:"text-sm text-red-600",children:m}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:d?"Speichern":"Anlegen"}),d&&a.jsx("button",{type:"button",onClick:k,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const $f={name:"",description:"",permissions:[]};function D4(){const[e,t]=g.useState([]),[n,r]=g.useState([]),[s,i]=g.useState($f),[l,o]=g.useState(null),[u,c]=g.useState(""),d=()=>{M.get("/permission-groups").then(t),M.get("/permissions/catalog").then(r)};g.useEffect(d,[]);const h=k=>{o(k.id),i({name:k.name,description:k.description||"",permissions:k.permissions})},m=()=>{o(null),i($f)},f=k=>{i(b=>({...b,permissions:b.permissions.includes(k)?b.permissions.filter(p=>p!==k):[...b.permissions,k]}))},x=async k=>{k.preventDefault(),c("");try{l?await M.put(`/permission-groups/${l}`,s):await M.post("/permission-groups",s),m(),d()}catch(b){c(b.message)}},v=async k=>{confirm("Diese Berechtigungsgruppe wirklich löschen? Benutzer behalten ihre sonstigen Rechte.")&&(await M.delete(`/permission-groups/${k}`),d())};return a.jsxs("div",{className:"grid gap-6 lg:grid-cols-3",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Berechtigungsgruppen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:'Fasse mehrere Berechtigungen zu einer Gruppe zusammen (z. B. „Werkstatt"), die du dann bequem einem oder mehreren Benutzern zuweisen kannst.'}),a.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:a.jsxs("table",{className:"w-full text-left text-sm",children:[a.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-4 py-2",children:"Name"}),a.jsx("th",{className:"px-4 py-2",children:"Berechtigungen"}),a.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),a.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[e.map(k=>a.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[a.jsxs("td",{className:"px-4 py-2",children:[a.jsx("p",{className:"font-medium text-neutral-800 dark:text-neutral-100",children:k.name}),k.description&&a.jsx("p",{className:"text-xs text-neutral-500 dark:text-neutral-400",children:k.description})]}),a.jsxs("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:[k.permissions.length," von ",n.length]}),a.jsxs("td",{className:"px-4 py-2 text-right",children:[a.jsx("button",{onClick:()=>h(k),className:"mr-3 text-brand-600 hover:underline",children:"Bearbeiten"}),a.jsx("button",{onClick:()=>v(k.id),className:"text-red-600 hover:underline",children:"Löschen"})]})]},k.id)),e.length===0&&a.jsx("tr",{children:a.jsx("td",{colSpan:3,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Berechtigungsgruppen angelegt."})})]})]})})]}),a.jsxs("form",{onSubmit:x,className:"h-fit space-y-4 rounded-xl border border-neutral-200 bg-white p-5 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"font-bold text-neutral-900 dark:text-white",children:l?"Gruppe bearbeiten":"Neue Gruppe"}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name *"}),a.jsx("input",{required:!0,value:s.name,onChange:k=>i({...s,name:k.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Beschreibung"}),a.jsx("textarea",{rows:2,value:s.description,onChange:k=>i({...s,description:k.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("p",{className:"mb-1 text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Berechtigungen"}),a.jsx("div",{className:"space-y-1.5 rounded-md border border-neutral-200 p-3 dark:border-neutral-700",children:n.map(k=>a.jsxs("label",{className:"flex items-center gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:s.permissions.includes(k.key),onChange:()=>f(k.key),className:"h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),k.label]},k.key))})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("button",{type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:l?"Speichern":"Anlegen"}),l&&a.jsx("button",{type:"button",onClick:m,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm dark:border-neutral-700",children:"Abbrechen"})]})]})]})}const B4=[{to:"/admin/settings/website",label:"Website"},{to:"/admin/settings/email",label:"E-Mail"},{to:"/admin/settings/database",label:"Datenbank"},{to:"/admin/settings/export-import",label:"Export & Import"},{to:"/admin/settings/maintenance",label:"Wartungsmodus"},{to:"/admin/settings/reset",label:"Zurücksetzen"}];function z4(){const e=({isActive:t})=>`rounded-md px-4 py-2 text-sm font-medium transition ${t?"bg-brand-500 text-white":"text-neutral-600 hover:bg-neutral-100 dark:text-neutral-300 dark:hover:bg-neutral-800"}`;return a.jsxs("div",{children:[a.jsx("h1",{className:"mb-1 text-xl font-bold text-neutral-900 dark:text-white",children:"Einstellungen"}),a.jsx("p",{className:"mb-5 text-sm text-neutral-500 dark:text-neutral-400",children:"Werkzeuge rund um Datenbank, Server-Umzug und Zurücksetzen dieser Seite."}),a.jsx("nav",{className:"mb-6 flex flex-wrap gap-2",children:B4.map(t=>a.jsx(lg,{to:t.to,className:e,children:t.label},t.to))}),a.jsx(ul,{})]})}const I4={phone:"",whatsapp:"",contact_email:"",hero_image_path:"",ga_measurement_id:"",package_card_theme:"graphite",package_card_layout:"strip"},R4=[{value:"graphite",label:"Graphite Green",description:"Graphit über Bronze/Silber/Gold/Platin bis zur Onyx-Krönung."},{value:"deep-blue",label:"Deep Blue Luxury",description:"Kühles Blau, das sich über Grün zu Gold erwärmt."},{value:"warm-bronze",label:"Warm Bronze",description:"Durchgehend warmes Kupfer/Bronze/Amber bis zum Gold."}],F4=[{value:"grid",label:"Raster",description:"Breite Kacheln, die responsiv in mehrere Zeilen umbrechen."},{value:"strip",label:"Scroll-Band",description:"Schmale, hochkant Kacheln in einer horizontal scrollbaren Reihe."},{value:"coverflow",label:"3D-Coverflow",description:"Kacheln drehen sich beim Wischen räumlich – die mittlere steht im Fokus."}];function V4(){const[e,t]=g.useState(I4),[n,r]=g.useState(!0),[s,i]=g.useState(!1),[l,o]=g.useState(!1),[u,c]=g.useState(""),[d,h]=g.useState(""),[m,f]=g.useState(""),[x,v]=g.useState(!1),[k,b]=g.useState(!1),[p,y]=g.useState(""),[w,j]=g.useState(!1);g.useEffect(()=>{M.get("/site-settings").then(T=>t({phone:T.phone||"",whatsapp:T.whatsapp||"",contact_email:T.contact_email||"",hero_image_path:T.hero_image_path||"",ga_measurement_id:T.ga_measurement_id||"",package_card_theme:T.package_card_theme||"graphite",package_card_layout:T.package_card_layout||"strip"})).finally(()=>r(!1)),M.get("/settings/analytics").then(T=>{h(T.ga_property_id||""),v(T.has_credentials)})},[]);const C=async()=>{b(!0),y(""),j(!1);try{const T=await M.post("/settings/analytics",{ga_property_id:d,service_account_json:m});v(T.has_credentials),f(""),j(!0)}catch(T){y(T.message)}finally{b(!1)}},S=(T,N)=>{t(E=>({...E,[T]:N})),o(!1)},P=async T=>{T.preventDefault(),i(!0),c(""),o(!1);try{await M.post("/site-settings",e),o(!0)}catch(N){c(N.message)}finally{i(!1)}};return n?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:P,className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Startseiten-Bild"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Das große Hero-Bild ganz oben auf der Startseite. Ohne eigenes Bild wird das Standardbild verwendet."}),a.jsx(gl,{value:e.hero_image_path,onChange:T=>S("hero_image_path",T),label:"Bild"})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kontaktdaten"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird im Header, Footer und auf der Kontaktseite angezeigt."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Telefon"}),a.jsx("input",{value:e.phone,onChange:T=>S("phone",T.target.value),placeholder:"09373 20 62 390",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"WhatsApp Business Nummer"}),a.jsx("input",{value:e.whatsapp,onChange:T=>S("whatsapp",T.target.value),placeholder:"z. B. 09373 20 62 390",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Leer lassen, um den WhatsApp-Link im Header auszublenden."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"E-Mail"}),a.jsx("input",{type:"email",value:e.contact_email,onChange:T=>S("contact_email",T.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Paket-Kachel-Design"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Bestimmt die Farbgebung der Paket-Stufen auf jeder Fahrzeug-Modell-Seite (von der günstigsten bis zur teuersten Option)."}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:R4.map(T=>a.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${e.package_card_theme===T.value?"border-brand-500 ring-2 ring-brand-500/40":"border-neutral-300 hover:border-neutral-400 dark:border-neutral-700 dark:hover:border-neutral-600"}`,children:[a.jsx("input",{type:"radio",name:"package_card_theme",value:T.value,checked:e.package_card_theme===T.value,onChange:N=>S("package_card_theme",N.target.value),className:"sr-only"}),a.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:T.label}),a.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:T.description})]},T.value))})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Kachel-Layout"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Bestimmt, wie die Paket-Stufen auf jeder Fahrzeug-Modell-Seite angeordnet werden."}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-3",children:F4.map(T=>a.jsxs("label",{className:`cursor-pointer rounded-lg border p-3 text-sm transition ${e.package_card_layout===T.value?"border-brand-500 ring-2 ring-brand-500/40":"border-neutral-300 hover:border-neutral-400 dark:border-neutral-700 dark:hover:border-neutral-600"}`,children:[a.jsx("input",{type:"radio",name:"package_card_layout",value:T.value,checked:e.package_card_layout===T.value,onChange:N=>S("package_card_layout",N.target.value),className:"sr-only"}),a.jsx("p",{className:"font-semibold text-neutral-900 dark:text-white",children:T.label}),a.jsx("p",{className:"mt-1 text-xs text-neutral-500 dark:text-neutral-400",children:T.description})]},T.value))})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Google Analytics"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wird erst geladen, nachdem ein Besucher der Statistik-Kategorie im Cookie-Banner zugestimmt hat. Leer lassen, um Google Analytics zu deaktivieren."}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Measurement-ID"}),a.jsx("input",{value:e.ga_measurement_id,onChange:T=>S("ga_measurement_id",T.target.value),placeholder:"G-XXXXXXXXXX",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{className:"mt-5 border-t border-neutral-200 pt-5 dark:border-neutral-800",children:[a.jsx("h3",{className:"mb-1 text-sm font-semibold text-neutral-900 dark:text-white",children:"Dashboard-Anbindung (optional)"}),a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:"Zeigt Besucherzahlen direkt in deinem Admin-Dashboard an. Braucht ein Google-Cloud-Service-Account mit Lesezugriff auf diese GA4-Property."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Property-ID"}),a.jsx("input",{value:d,onChange:T=>{h(T.target.value),j(!1)},placeholder:"z. B. 123456789",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("p",{className:"mt-1 text-xs text-neutral-400",children:"Nicht die Measurement-ID (G-...) - zu finden unter GA4 → Verwaltung → Property-Details."})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Service-Account-JSON-Schlüssel ",x?"(leer lassen = unverändert)":""]}),a.jsx("textarea",{rows:4,value:m,onChange:T=>{f(T.target.value),j(!1)},placeholder:x?'{ "type": "service_account", ... } (bereits hinterlegt)':'{ "type": "service_account", ... }',className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 font-mono text-xs dark:border-neutral-700 dark:bg-neutral-900"})]})]}),p&&a.jsx("p",{className:"mt-2 text-sm text-red-600",children:p}),w&&a.jsx("p",{className:"mt-2 text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"button",onClick:C,disabled:k,className:"mt-3 rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:k?"Speichere…":"Dashboard-Anbindung speichern"})]})]}),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),l&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}const O4={mail_host:"",mail_port:587,mail_username:"",mail_password:"",mail_encryption:"tls",mail_from_email:"",mail_from_name:"",mail_notify_email:"",mail_customer_subject:"",mail_customer_body:"",mail_owner_subject:"",mail_owner_body:""},U4=[["{{name}}","Name des Kunden"],["{{email}}","E-Mail des Kunden"],["{{phone}}","Telefonnummer"],["{{vin}}","Fahrgestellnummer (FIN)"],["{{message}}","Nachricht des Kunden"],["{{brand}}","Marke"],["{{model}}","Modell"],["{{package}}","Paket"],["{{product}}","Produkt"],["{{upgrades}}","Gewählte Upgrades"]];function Gf(){return a.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:U4.map(([e,t])=>a.jsx("span",{title:t,className:"rounded-md bg-neutral-100 px-2 py-1 font-mono text-xs text-neutral-600 dark:bg-neutral-800 dark:text-neutral-300",children:e},e))})}function W4(){const[e,t]=g.useState(O4),[n,r]=g.useState(!1),[s,i]=g.useState(!0),[l,o]=g.useState(!1),[u,c]=g.useState(!1),[d,h]=g.useState(""),[m,f]=g.useState(!1),[x,v]=g.useState(!1),[k,b]=g.useState(""),[p,y]=g.useState(""),[w,j]=g.useState(""),[C,S]=g.useState(null);g.useEffect(()=>{M.get("/settings/mail").then(E=>{t({...E,mail_password:""}),r(E.has_password)}).finally(()=>i(!1))},[]);const P=(E,B)=>{t(V=>({...V,[E]:B})),f(!1)},T=async E=>{E.preventDefault(),c(!0),h(""),f(!1);try{const B=await M.post("/settings/mail",e);t({...B,mail_password:""}),r(B.has_password),f(!0)}catch(B){h(B.message)}finally{c(!1)}},N=async()=>{v(!0),b(""),y(""),j(""),S(null);try{const E=await M.post("/settings/mail/test",e);y(`Testmail gesendet an ${E.sent_to}. Der Server hat die Mail angenommen - prüfe auch den Spam-Ordner, das ist noch keine Garantie für die Zustellung.`),j(E.warning||""),S(E.smtp_log||null)}catch(E){b(E.message)}finally{v(!1)}};return s?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:T,className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"SMTP-Server"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Zugangsdaten deines Mail-Postfachs oder Transactional-Mail-Anbieters. Solange kein Server eingetragen ist, werden keine E-Mails verschickt (Kontaktanfragen werden trotzdem in der Datenbank gespeichert)."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[1fr_120px]",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Server (Host)"}),a.jsx("input",{value:e.mail_host,onChange:E=>P("mail_host",E.target.value),placeholder:"smtp.beispiel.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Port"}),a.jsx("input",{type:"number",value:e.mail_port,onChange:E=>P("mail_port",E.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Verschlüsselung"}),a.jsxs("select",{value:e.mail_encryption,onChange:E=>P("mail_encryption",E.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900",children:[a.jsx("option",{value:"tls",children:"STARTTLS"}),a.jsx("option",{value:"ssl",children:"SSL"}),a.jsx("option",{value:"none",children:"Keine"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzername"}),a.jsx("input",{value:e.mail_username,onChange:E=>P("mail_username",E.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:l?"text":"password",value:e.mail_password,onChange:E=>P("mail_password",E.target.value),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("button",{type:"button",onClick:()=>o(E=>!E),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:l?"Verbergen":"Anzeigen"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-E-Mail"}),a.jsx("input",{type:"email",value:e.mail_from_email,onChange:E=>P("mail_from_email",E.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Absender-Name"}),a.jsx("input",{value:e.mail_from_name,onChange:E=>P("mail_from_name",E.target.value),placeholder:"HifiPlanet",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),a.jsxs("div",{className:"mt-4 border-t border-neutral-200 pt-4 dark:border-neutral-800",children:[k&&a.jsx("p",{className:"mb-2 whitespace-pre-wrap text-sm text-red-600",children:k}),p&&a.jsx("p",{className:"mb-2 text-sm text-green-600 dark:text-green-400",children:p}),w&&a.jsx("p",{className:"mb-2 rounded-md bg-amber-50 p-2 text-sm text-amber-800 dark:bg-amber-900/20 dark:text-amber-300",children:w}),a.jsx("button",{type:"button",onClick:N,disabled:x,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:x?"Sende Testmail…":"Verbindung testen"}),C&&C.length>0&&a.jsxs("details",{className:"mt-3",children:[a.jsx("summary",{className:"cursor-pointer text-xs text-neutral-500 dark:text-neutral-400",children:"SMTP-Protokoll anzeigen"}),a.jsx("pre",{className:"mt-2 max-h-64 overflow-auto rounded-md bg-neutral-900 p-3 text-xs text-neutral-200",children:C.join(` `)})]})]})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Empfänger"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"An diese Adresse geht die Benachrichtigung bei jeder neuen Kontaktanfrage."}),a.jsx("input",{type:"email",value:e.mail_notify_email,onChange:E=>P("mail_notify_email",E.target.value),placeholder:"info@hifi-planet-amorbach.de",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Kunden (Bestätigung)"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Geht automatisch an den Kunden, sobald er eine Kontaktanfrage abschickt."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),a.jsx("input",{value:e.mail_customer_subject,onChange:E=>P("mail_customer_subject",E.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Text"}),a.jsx("textarea",{rows:8,value:e.mail_customer_body,onChange:E=>P("mail_customer_body",E.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),a.jsx(Gf,{})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"E-Mail an den Shop (Benachrichtigung)"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Geht an die oben eingestellte Empfänger-Adresse, sobald eine neue Kontaktanfrage eingeht."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Betreff"}),a.jsx("input",{value:e.mail_owner_subject,onChange:E=>P("mail_owner_subject",E.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Text"}),a.jsx("textarea",{rows:8,value:e.mail_owner_body,onChange:E=>P("mail_owner_body",E.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]})]}),a.jsx(Gf,{})]}),d&&a.jsx("p",{className:"text-sm text-red-600",children:d}),m&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:u,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:u?"Speichere…":"Speichern"})]})}function H4(){const[e,t]=g.useState({host:"",name:"",user:"",password:"",charset:"utf8mb4"}),[n,r]=g.useState(!1),[s,i]=g.useState(!0),[l,o]=g.useState(!1),[u,c]=g.useState(!1),[d,h]=g.useState(""),[m,f]=g.useState(!1),[x,v]=g.useState(null),[k,b]=g.useState(!0),[p,y]=g.useState(!1),[w,j]=g.useState(null),C=()=>{i(!0),M.get("/settings/database").then(N=>{t({...N.config,password:""}),r(N.has_password)}).finally(()=>i(!1))},S=()=>{b(!0),M.get("/settings/schema-check").then(v).catch(N=>v({ok:!1,error:N.message,tables:[]})).finally(()=>b(!1))};g.useEffect(()=>{C(),S()},[]);const P=async()=>{y(!0),j(null);try{const N=await M.post("/settings/schema-migrate",{});j(N.actions),v(N.report)}catch(N){j(["Fehler: "+N.message])}finally{y(!1)}},T=async N=>{N.preventDefault(),c(!0),h(""),f(!1);try{await M.post("/settings/database",e),f(!0),t(E=>({...E,password:""})),r(!0),S()}catch(E){h(E.message)}finally{c(!1)}};return a.jsxs("div",{className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Datenbank-Zugangsdaten"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Wichtig für einen Umzug auf einen anderen Server/Webspace: Trage hier die Zugangsdaten der dortigen Datenbank ein. Die Verbindung wird vor dem Speichern getestet, damit du dich nicht aussperrst."}),s?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:T,className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Host *"}),a.jsx("input",{required:!0,value:e.host,onChange:N=>t({...e,host:N.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Datenbankname *"}),a.jsx("input",{required:!0,value:e.name,onChange:N=>t({...e,name:N.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Benutzer *"}),a.jsx("input",{required:!0,value:e.user,onChange:N=>t({...e,user:N.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:["Passwort ",n?"(leer lassen = unverändert)":""]}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:l?"text":"password",value:e.password,onChange:N=>t({...e,password:N.target.value}),placeholder:n?"••••••••":"",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"}),a.jsx("button",{type:"button",onClick:()=>o(N=>!N),className:"shrink-0 rounded-md border border-neutral-300 px-3 text-sm dark:border-neutral-700",children:l?"Verbergen":"Anzeigen"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Zeichensatz"}),a.jsx("input",{value:e.charset,onChange:N=>t({...e,charset:N.target.value}),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),d&&a.jsx("p",{className:"text-sm text-red-600",children:d}),m&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Verbindung erfolgreich getestet und gespeichert."}),a.jsx("button",{type:"submit",disabled:u,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:u?"Teste & speichere…":"Verbindung testen & speichern"})]})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[a.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:"Datenbankstruktur"}),!k&&x&&a.jsx("span",{className:`rounded-full px-3 py-1 text-xs font-semibold ${x.ok?"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300":"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"}`,children:x.ok?"Datenbank OK":"Datenbank nicht OK"})]}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Prüft, ob diese Datenbank alle Tabellen und Spalten hat, die der aktuelle Code-Stand braucht – wichtig, wenn deine Live-Version auf einem anderen Server einen älteren Stand hat."}),k&&a.jsx("p",{className:"text-sm text-neutral-400",children:"Prüfe…"}),!k&&x&&!x.ok&&a.jsx("ul",{className:"mb-4 space-y-1 rounded-md bg-red-50 p-3 text-sm text-red-800 dark:bg-red-900/20 dark:text-red-300",children:x.tables.filter(N=>!N.ok).map(N=>a.jsx("li",{children:N.exists?a.jsxs(a.Fragment,{children:["Tabelle ",a.jsx("code",{className:"font-mono",children:N.table}),": Spalte(n) fehlen – ",N.missing_columns.join(", ")]}):a.jsxs(a.Fragment,{children:["Tabelle ",a.jsx("code",{className:"font-mono",children:N.table})," fehlt komplett"]})},N.table))}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx("button",{onClick:S,disabled:k,className:"rounded-md border border-neutral-300 px-4 py-2 text-sm font-medium hover:bg-neutral-50 disabled:opacity-50 dark:border-neutral-700 dark:hover:bg-neutral-800",children:"Erneut prüfen"}),x&&!x.ok&&a.jsx("button",{onClick:P,disabled:p,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:p?"Aktualisiere…":"Datenbankstruktur aktualisieren"})]}),w&&a.jsx("ul",{className:"mt-3 space-y-1 rounded-md bg-neutral-50 p-3 text-sm text-neutral-700 dark:bg-neutral-800 dark:text-neutral-300",children:w.map((N,E)=>a.jsx("li",{children:N},E))})]})]})}const Fa=[{key:"catalog",label:"Fahrzeug-Katalog",hint:"Marken, Modelle, Pakete, Produkte, Upgrades",tables:["brands","car_models","packages","package_products","package_upgrades"]},{key:"services",label:"Leistungen",hint:"Die Leistungen-Übersicht",tables:["services"]},{key:"faqs",label:"FAQs",hint:"Häufig gestellte Fragen",tables:["faqs"]},{key:"gallery",label:"Bildergalerie",hint:"Galerie-Marken, Projekte und Fotos (inkl. Bilder)",tables:["gallery_brands","gallery_projects","gallery_photos"]}],Ab={brands:"Marken",car_models:"Modelle",packages:"Pakete",package_products:"Produkte",package_upgrades:"Upgrades",services:"Leistungen",faqs:"FAQs",gallery_brands:"Galerie-Marken",gallery_projects:"Galerie-Projekte",gallery_photos:"Galerie-Fotos"},$4=(e,t)=>{if(!e)return null;const n=t.map(r=>[r,Array.isArray(e[r])?e[r].length:0]).filter(([,r])=>r>0).map(([r,s])=>`${s} ${Ab[r]||r}`);return n.length?n.join(", "):"leer in dieser Datei"};function G4(){const[e,t]=g.useState(null),[n,r]=g.useState(null),[s,i]=g.useState(""),[l,o]=g.useState(()=>new Set(Fa.map(w=>w.key))),[u,c]=g.useState(!1),[d,h]=g.useState(!1),[m,f]=g.useState(null),[x,v]=g.useState(""),k=async w=>{var C;const j=((C=w.target.files)==null?void 0:C[0])||null;if(t(j),f(null),v(""),r(null),i(""),o(new Set(Fa.map(S=>S.key))),!!j)try{const S=await j.text(),P=JSON.parse(S);if(!P||typeof P.data!="object")throw new Error("kein gültiges Export-Format");r(P.data)}catch{i("Datei konnte nicht gelesen werden – Vorschau der Inhalte nicht möglich. Import würde trotzdem versucht (alle Bereiche).")}},b=w=>{o(j=>{const C=new Set(j);return C.has(w)?C.delete(w):C.add(w),C})},p=async w=>{if(w.preventDefault(),!(!e||!u||l.size===0)){h(!0),v(""),f(null);try{const j=new FormData;j.append("file",e),j.append("sections",JSON.stringify([...l]));const C=await M.post("/settings/import",j);f(C),t(null),r(null),c(!1),w.target.reset()}catch(j){v(j.message)}finally{h(!1)}}},y=Fa.filter(w=>l.has(w.key)).map(w=>w.label);return a.jsxs("div",{className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten exportieren"}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:["Lädt eine Datei mit allen Marken, Modellen, Paketen, Produkten, Upgrades, Leistungen, FAQs und der kompletten Bildergalerie (inkl. Bilder) herunter. Benutzerkonten und Kontaktanfragen sind bewusst",a.jsx("strong",{children:" nicht"})," enthalten."]}),a.jsx("a",{href:`${og}/settings/export`,className:"inline-block rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600",children:"Jetzt exportieren"})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Daten importieren"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Lädt eine zuvor exportierte Datei auf diesen Server. Ersetzt dabei die ausgewählten Bereiche komplett durch den Inhalt der Datei – das kann nicht rückgängig gemacht werden. Kontaktanfragen und Benutzerkonten bleiben immer unangetastet."}),a.jsxs("form",{onSubmit:p,className:"space-y-4",children:[a.jsx("input",{type:"file",accept:"application/json,.json",onChange:k,className:"text-sm"}),e&&a.jsxs("div",{className:"rounded-lg border border-neutral-200 dark:border-neutral-700",children:[a.jsx("div",{className:"border-b border-neutral-200 px-4 py-2 text-xs font-semibold uppercase tracking-wide text-neutral-500 dark:border-neutral-700 dark:text-neutral-400",children:"Was soll importiert werden?"}),s&&a.jsx("p",{className:"px-4 pt-3 text-sm text-amber-600 dark:text-amber-400",children:s}),a.jsx("div",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:Fa.map(w=>a.jsxs("label",{className:"flex cursor-pointer items-start gap-3 px-4 py-3 hover:bg-neutral-50 dark:hover:bg-neutral-800/50",children:[a.jsx("input",{type:"checkbox",checked:l.has(w.key),onChange:()=>b(w.key),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),a.jsxs("span",{className:"flex-1",children:[a.jsx("span",{className:"block text-sm font-medium text-neutral-800 dark:text-neutral-100",children:w.label}),a.jsx("span",{className:"block text-xs text-neutral-500 dark:text-neutral-400",children:n?$4(n,w.tables):w.hint})]})]},w.key))})]}),a.jsxs("label",{className:"flex items-start gap-2 text-sm text-neutral-700 dark:text-neutral-300",children:[a.jsx("input",{type:"checkbox",checked:u,onChange:w=>c(w.target.checked),className:"mt-0.5 h-4 w-4 rounded border-neutral-300 text-brand-600 focus:ring-brand-500"}),"Mir ist bewusst, dass dies"," ",y.length?a.jsx("strong",{children:y.join(", ")}):"die ausgewählten Bereiche"," auf diesem Server unwiderruflich ersetzt."]}),a.jsx("button",{type:"submit",disabled:!e||!u||d||l.size===0,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:d?"Importiere…":"Importieren"})]}),x&&a.jsx("p",{className:"mt-3 text-sm text-red-600",children:x}),m&&a.jsxs("div",{className:"mt-3 rounded-md bg-green-50 p-3 text-sm text-green-800 dark:bg-green-900/20 dark:text-green-300",children:[a.jsx("p",{className:"mb-1 font-semibold",children:"Import erfolgreich:"}),a.jsxs("ul",{className:"list-disc pl-5",children:[Object.entries(m.counts).map(([w,j])=>a.jsxs("li",{children:[j," ",Ab[w]||w]},w)),m.images_restored>0&&a.jsxs("li",{children:[m.images_restored," Bilder wiederhergestellt"]})]})]})]})]})}const K4={global:{enabled:!1,message:""},services:{enabled:!1,message:""},vehicles:{enabled:!1,message:""}};function q4(){const[e,t]=g.useState(K4),[n,r]=g.useState(!0),[s,i]=g.useState(!1),[l,o]=g.useState(!1),[u,c]=g.useState("");g.useEffect(()=>{M.get("/maintenance").then(f=>{t({global:{enabled:f.global.enabled,message:f.global.message||""},services:{enabled:f.services.enabled,message:f.services.message||""},vehicles:{enabled:f.vehicles.enabled,message:f.vehicles.message||""}})}).finally(()=>r(!1))},[]);const d=(f,x,v)=>{t(k=>({...k,[f]:{...k[f],[x]:v}})),o(!1)},h=async f=>{f.preventDefault(),i(!0),c(""),o(!1);try{const x=await M.post("/maintenance",e);t({global:{enabled:x.global.enabled,message:x.global.message||""},services:{enabled:x.services.enabled,message:x.services.message||""},vehicles:{enabled:x.vehicles.enabled,message:x.vehicles.message||""}}),o(!0)}catch(x){c(x.message)}finally{i(!1)}},m=[{key:"global",title:"Gesamte Seite",hint:"Besucher sehen nur noch eine Wartungsmeldung – egal welche Seite sie aufrufen. Das Admin-Panel bleibt für dich erreichbar."},{key:"services",title:"Nur Leistungen",hint:"Nur die Leistungen-Seite zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."},{key:"vehicles",title:"Nur Fahrzeugkatalog",hint:"Nur die Fahrzeugauswahl (Marke → Modell → Pakete) zeigt eine Wartungsmeldung, der Rest der Website funktioniert normal."}];return n?a.jsx("p",{className:"text-sm text-neutral-400",children:"Lädt…"}):a.jsxs("form",{onSubmit:h,className:"max-w-2xl space-y-6",children:[a.jsx("p",{className:"text-sm text-neutral-500 dark:text-neutral-400",children:'Ist "Gesamte Seite" aktiv, gewinnt das immer – die beiden anderen Schalter spielen dann keine Rolle mehr.'}),m.map(f=>a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsxs("div",{className:"mb-1 flex items-center justify-between gap-3",children:[a.jsx("h2",{className:"font-semibold text-neutral-900 dark:text-white",children:f.title}),a.jsxs("label",{className:"relative inline-flex cursor-pointer items-center",children:[a.jsx("input",{type:"checkbox",checked:e[f.key].enabled,onChange:x=>d(f.key,"enabled",x.target.checked),className:"peer sr-only"}),a.jsx("div",{className:"h-6 w-11 rounded-full bg-neutral-200 transition peer-checked:bg-brand-500 dark:bg-neutral-700"}),a.jsx("div",{className:"absolute left-1 top-1 h-4 w-4 rounded-full bg-white transition peer-checked:translate-x-5"})]})]}),a.jsx("p",{className:"mb-3 text-sm text-neutral-500 dark:text-neutral-400",children:f.hint}),a.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Eigene Nachricht (optional)"}),a.jsx("textarea",{rows:2,value:e[f.key].message,onChange:x=>d(f.key,"message",x.target.value),placeholder:"z. B. Wir aktualisieren gerade unser Angebot. Schau bald wieder vorbei!",className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]},f.key)),u&&a.jsx("p",{className:"text-sm text-red-600",children:u}),l&&a.jsx("p",{className:"text-sm text-green-600 dark:text-green-400",children:"Gespeichert."}),a.jsx("button",{type:"submit",disabled:s,className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-50",children:s?"Speichere…":"Speichern"})]})}function Y4(){const[e,t]=g.useState(!1),[n,r]=g.useState(""),[s,i]=g.useState(!1),[l,o]=g.useState(""),[u,c]=g.useState(!1),[d,h]=g.useState(""),[m,f]=g.useState(!1),[x,v]=g.useState(""),[k,b]=g.useState(!1),[p,y]=g.useState(""),w=async()=>{if(confirm("Alle aktuellen Leistungen werden gelöscht und durch die 8 Standard-Leistungen ersetzt. Fortfahren?")){t(!0),r("");try{const T=await M.post("/settings/reset-services",{});r(`${T.count} Standard-Leistungen wiederhergestellt.`)}catch(T){r("Fehler: "+T.message)}finally{t(!1)}}},j=async()=>{if(confirm("Alle aktuellen FAQ-Einträge werden gelöscht und durch die 6 Standard-Fragen ersetzt. Fortfahren?")){i(!0),o("");try{const T=await M.post("/settings/reset-faqs",{});o(`${T.count} Standard-Fragen wiederhergestellt.`)}catch(T){o("Fehler: "+T.message)}finally{i(!1)}}},C=async()=>{if(confirm("Die komplette Bildergalerie wird gelöscht und durch die 13 Marken/29 Projekte/207 Fotos der alten hifi-planet.de-Seite ersetzt. Fortfahren?")){c(!0),h("");try{const T=await M.post("/settings/reset-gallery",{});h(`${T.photos} Fotos wiederhergestellt.`)}catch(T){h("Fehler: "+T.message)}finally{c(!1)}}},S=async()=>{if(confirm("Alle Marken, Modelle, Pakete, Produkte und Upgrades werden unwiderruflich gelöscht. Leistungen und Kontaktanfragen bleiben erhalten. Fortfahren?")){f(!0),v("");try{const T=await M.post("/settings/reset-catalog",{});v(`Fahrzeugkatalog geleert (${T.brands_removed} Marken entfernt).`)}catch(T){v("Fehler: "+T.message)}finally{f(!1)}}},P=async()=>{if(confirm("WIRKLICH ALLES zurücksetzen? Marken, Modelle, Pakete, Produkte und Upgrades werden gelöscht, Leistungen, FAQs und die Bildergalerie auf Standard zurückgesetzt. Kontaktanfragen und Benutzerkonten bleiben erhalten. Das kann nicht rückgängig gemacht werden!")){b(!0),y("");try{const T=await M.post("/settings/reset-all",{});y(`Erledigt: ${T.brands_removed} Marken entfernt, ${T.services_reset} Standard-Leistungen, ${T.faqs_reset} Standard-Fragen und ${T.gallery_photos_reset} Galerie-Fotos wiederhergestellt.`)}catch(T){y("Fehler: "+T.message)}finally{b(!1)}}};return a.jsxs("div",{className:"max-w-2xl space-y-6",children:[a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Leistungen zurücksetzen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle aktuellen Leistungen-Karten und stellt die 8 mitgelieferten Standard-Leistungen wieder her. Marken, Modelle und Pakete bleiben unangetastet."}),a.jsx("button",{onClick:w,disabled:e,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:e?"Setze zurück…":"Leistungen auf Standard zurücksetzen"}),n&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:n})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur FAQs zurücksetzen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle aktuellen Fragen und stellt die 6 mitgelieferten Standard-Fragen (Deutsch & Englisch) wieder her. Leistungen, Marken, Modelle und Pakete bleiben unangetastet."}),a.jsx("button",{onClick:j,disabled:s,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:s?"Setze zurück…":"FAQs auf Standard zurücksetzen"}),l&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:l})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Bildergalerie zurücksetzen"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle aktuellen Galerie-Marken, -Projekte und -Fotos und stellt die komplette Galerie der alten hifi-planet.de-Seite wieder her (13 Marken, 29 Projekte, 207 Fotos). Fahrzeugkatalog, Leistungen und FAQs bleiben unangetastet."}),a.jsx("button",{onClick:C,disabled:u,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:u?"Setze zurück…":"Galerie auf Standard zurücksetzen"}),d&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:d})]}),a.jsxs("section",{className:"rounded-xl border border-neutral-200 bg-white p-6 dark:border-neutral-800 dark:bg-neutral-900",children:[a.jsx("h2",{className:"mb-1 font-semibold text-neutral-900 dark:text-white",children:"Nur Fahrzeugkatalog leeren"}),a.jsx("p",{className:"mb-4 text-sm text-neutral-500 dark:text-neutral-400",children:"Löscht alle Marken, Modelle, Pakete, Produkte und Upgrades unwiderruflich. Leistungen, Kontaktanfragen und Benutzerkonten bleiben erhalten."}),a.jsx("button",{onClick:S,disabled:m,className:"rounded-md border border-red-300 px-4 py-2 text-sm font-semibold text-red-600 hover:bg-red-50 disabled:opacity-50 dark:border-red-900 dark:hover:bg-red-900/20",children:m?"Leere…":"Fahrzeugkatalog leeren"}),x&&a.jsx("p",{className:"mt-3 text-sm text-neutral-600 dark:text-neutral-300",children:x})]}),a.jsxs("section",{className:"rounded-xl border border-red-300 bg-red-50/40 p-6 dark:border-red-900 dark:bg-red-900/10",children:[a.jsx("h2",{className:"mb-1 font-semibold text-red-700 dark:text-red-300",children:"Alles zurücksetzen"}),a.jsxs("p",{className:"mb-4 text-sm text-neutral-600 dark:text-neutral-300",children:["Kombiniert alles: Fahrzeugkatalog wird komplett geleert ",a.jsx("strong",{children:"und"})," Leistungen, FAQs sowie die Bildergalerie werden auf Standard zurückgesetzt. Kontaktanfragen und Benutzerkonten bleiben erhalten. Nicht rückgängig zu machen."]}),a.jsx("button",{onClick:P,disabled:k,className:"rounded-md bg-red-600 px-4 py-2 text-sm font-semibold text-white hover:bg-red-700 disabled:opacity-50",children:k?"Setze zurück…":"Wirklich alles zurücksetzen"}),p&&a.jsx("p",{className:"mt-3 text-sm text-neutral-700 dark:text-neutral-300",children:p})]})]})}function X4(){return a.jsxs(a.Fragment,{children:[a.jsx(cw,{}),a.jsx(mw,{}),a.jsx(fw,{children:a.jsxs(qk,{children:[a.jsx(H,{path:"/setup",element:a.jsx(mP,{})}),a.jsxs(H,{element:a.jsx(mC,{}),children:[a.jsx(H,{path:"/",element:a.jsx(DC,{})}),a.jsx(H,{path:"/fahrzeuge",element:a.jsx(BC,{})}),a.jsx(H,{path:"/fahrzeuge/:brandSlug",element:a.jsx(zC,{})}),a.jsx(H,{path:"/fahrzeuge/:brandSlug/:modelSlug",element:a.jsx(XC,{})}),a.jsx(H,{path:"/galerie",element:a.jsx(ZC,{})}),a.jsx(H,{path:"/galerie/:brandSlug",element:a.jsx(QC,{})}),a.jsx(H,{path:"/galerie/:brandSlug/:projectSlug",element:a.jsx(eP,{})}),a.jsx(H,{path:"/leistungen",element:a.jsx(tP,{})}),a.jsx(H,{path:"/kontakt",element:a.jsx(lP,{})}),a.jsx(H,{path:"/impressum",element:a.jsx(oP,{})}),a.jsx(H,{path:"/datenschutz",element:a.jsx(uP,{})}),a.jsx(H,{path:"/agb",element:a.jsx(cP,{})})]}),a.jsx(H,{path:"/admin/login",element:a.jsx(fP,{})}),a.jsx(H,{path:"/admin",element:a.jsx(xC,{}),children:a.jsxs(H,{element:a.jsx(gC,{}),children:[a.jsx(H,{index:!0,element:a.jsx(bP,{})}),a.jsx(H,{path:"account",element:a.jsx(_4,{})}),a.jsx(H,{path:"brands",element:a.jsx(Fe,{permission:"brands.manage",children:a.jsx(yP,{})})}),a.jsx(H,{path:"models",element:a.jsx(Fe,{permission:"models.manage",children:a.jsx(vP,{})})}),a.jsx(H,{path:"gallery-brands",element:a.jsx(Fe,{permission:"gallery.manage",children:a.jsx(kP,{})})}),a.jsx(H,{path:"gallery-projects",element:a.jsx(Fe,{permission:"gallery.manage",children:a.jsx(wP,{})})}),a.jsx(H,{path:"gallery-projects/:projectId/photos",element:a.jsx(Fe,{permission:"gallery.manage",children:a.jsx(jP,{})})}),a.jsx(H,{path:"packages",element:a.jsx(Fe,{permission:"packages.manage",children:a.jsx(TP,{})})}),a.jsx(H,{path:"packages/:packageId/products",element:a.jsx(Fe,{permission:"packages.manage",children:a.jsx(IP,{})})}),a.jsx(H,{path:"packages/:packageId/upgrades",element:a.jsx(Fe,{permission:"packages.manage",children:a.jsx(FP,{})})}),a.jsx(H,{path:"services",element:a.jsx(Fe,{permission:"services.manage",children:a.jsx(LP,{})})}),a.jsx(H,{path:"faqs",element:a.jsx(Fe,{permission:"content.manage",children:a.jsx(DP,{})})}),a.jsx(H,{path:"contact-requests",element:a.jsx(Fe,{permission:"contact.manage",children:a.jsx(HP,{})})}),a.jsx(H,{path:"users",element:a.jsx(Fe,{permission:"users.manage",children:a.jsx(L4,{})})}),a.jsx(H,{path:"permission-groups",element:a.jsx(Fe,{permission:"permission_groups.manage",children:a.jsx(D4,{})})}),a.jsxs(H,{path:"settings",element:a.jsx(Fe,{permission:"settings.manage",children:a.jsx(z4,{})}),children:[a.jsx(H,{index:!0,element:a.jsx(Ws,{to:"website",replace:!0})}),a.jsx(H,{path:"website",element:a.jsx(V4,{})}),a.jsx(H,{path:"email",element:a.jsx(W4,{})}),a.jsx(H,{path:"database",element:a.jsx(H4,{})}),a.jsx(H,{path:"export-import",element:a.jsx(G4,{})}),a.jsx(H,{path:"maintenance",element:a.jsx(q4,{})}),a.jsx(H,{path:"reset",element:a.jsx(Y4,{})})]})]})})]})})]})}jo.createRoot(document.getElementById("root")).render(a.jsx(Gb.StrictMode,{children:a.jsx(rw,{basename:"/".replace(/\/$/,"")||"/",children:a.jsx(gw,{children:a.jsx(kw,{children:a.jsx(Tw,{children:a.jsx(X4,{})})})})})}));