vendor: 5,407 bytes, lines 1-9
1var KP=Object.defineProperty;var JP=(t,e,s)=>e in t?KP(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var xe=(t,e,s)=>JP(t,typeof e!="symbol"?e+"":e,s);function QP(t,e){for(var s=0;s<e.length;s++){const n=e[s];if(typeof n!="string"&&!Array.isArray(n)){for(const a in n)if(a!=="default"&&!(a in t)){const i=Object.getOwnPropertyDescriptor(n,a);i&&Object.defineProperty(t,a,i.get?i:{enumerable:!0,get:()=>n[a]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function s(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=s(a);fetch(a.href,i)}})();function __(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var T_={exports:{}},$p={},E_={exports:{}},We={};/** 2 * @license React 3 * react.production.min.js 4 * 5 * Copyright (c) Facebook, Inc. and its affiliates. 6 * 7 * This source code is licensed under the MIT license found in the 8 * LICENSE file in the root directory of this source tree. 9 */var Xu=Symbol.for("react.element"),XP=Symbol.for("react.portal"),ZP=Symbol.for("react.fragment"),eD=Symbol.for("react.strict_mode"),tD=Symbol.for("react.profiler"),sD=Symbol.for("react.provider"),nD=Symbol.for("react.context"),rD=Symbol.for("react.forward_ref"),aD=Symbol.for("react.suspense"),iD=Symbol.for("react.memo"),oD=Symbol.for("react.lazy"),mj=Symbol.iterator;function lD(t){return t===null||typeof t!="object"?null:(t=mj&&t[mj]||t["@@iterator"],typeof t=="function"?t:null)}var M_={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A_=Object.assign,P_={};function Fc(t,e,s){this.props=t,this.context=e,this.refs=P_,this.updater=s||M_}Fc.prototype.isReactComponent={};Fc.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};Fc.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function D_(){}D_.prototype=Fc.prototype;function iv(t,e,s){this.props=t,this.context=e,this.refs=P_,this.updater=s||M_}var ov=iv.prototype=new D_;ov.constructor=iv;A_(ov,Fc.prototype);ov.isPureReactComponent=!0;var fj=Array.isArray,R_=Object.prototype.hasOwnProperty,lv={current:null},L_={key:!0,ref:!0,__self:!0,__source:!0};function O_(t,e,s){var n,a={},i=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)R_.call(e,n)&&!L_.hasOwnProperty(n)&&(a[n]=e[n]);var l=arguments.length-2;if(l===1)a.children=s;else if(1<l){for(var c=Array(l),d=0;d<l;d++)c[d]=arguments[d+2];a.children=c}if(t&&t.defaultProps)for(n in l=t.defaultProps,l)a[n]===void 0&&(a[n]=l[n]);return{$$typeof:Xu,type:t,key:i,ref:o,props:a,_owner:lv.current}}function cD(t,e){return{$$typeof:Xu,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function cv(t){return typeof t=="object"&&t!==null&&t.$$typeof===Xu}function dD(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(s){return e[s]})}var pj=/\/+/g;function Zx(t,e){return typeof t=="object"&&t!==null&&t.key!=null?dD(""+t.key):e.toString(36)}function jm(t,e,s,n,a){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case Xu:case XP:o=!0}}if(o)return o=t,a=a(o),t=n===""?"."+Zx(o,0):n,fj(a)?(s="",t!=null&&(s=t.replace(pj,"$&/")+"/"),jm(a,e,s,"",function(d){return d})):a!=null&&(cv(a)&&(a=cD(a,s+(!a.key||o&&o.key===a.key?"":(""+a.key).replace(pj,"$&/")+"/")+t)),e.push(a)),1;if(o=0,n=n===""?".":n+":",fj(t))for(var l=0;l<t.length;l++){i=t[l];var c=n+Zx(i,l);o+=jm(i,e,s,c,a)}else if(c=lD(t),typeof c=="function")for(t=c.call(t),l=0;!(i=t.next()).done;)i=i.value,c=n+Zx(i,l++),o+=jm(i,e,s,c,a);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function wh(t,e,s){if(t==null)return t;var n=[],a=0;return jm(t,n,"","",function(i){return e.call(s,i,a++)}),n}function uD(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(s){(t._status===0||t._status===-1)&&(t._status=1,t._result=s)},function(s){(t._status===0||t._status===-1)&&(t._status=2,t._result=s)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var Xs={current:null},Nm={transition:null},hD={ReactCurrentDispatcher:Xs,ReactCurrentBatchConfig:Nm,ReactCurrentOwner:lv};function I_(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 9,463 bytes, lines 9-33
9We.Children={map:wh,forEach:function(t,e,s){wh(t,function(){e.apply(this,arguments)},s)},count:function(t){var e=0;return wh(t,function(){e++}),e},toArray:function(t){return wh(t,function(e){return e})||[]},only:function(t){if(!cv(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};We.Component=Fc;We.Fragment=ZP;We.Profiler=tD;We.PureComponent=iv;We.StrictMode=eD;We.Suspense=aD;We.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=hD;We.act=I_;We.cloneElement=function(t,e,s){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=A_({},t.props),a=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=lv.current),e.key!==void 0&&(a=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(c in e)R_.call(e,c)&&!L_.hasOwnProperty(c)&&(n[c]=e[c]===void 0&&l!==void 0?l[c]:e[c])}var c=arguments.length-2;if(c===1)n.children=s;else if(1<c){l=Array(c);for(var d=0;d<c;d++)l[d]=arguments[d+2];n.children=l}return{$$typeof:Xu,type:t.type,key:a,ref:i,props:n,_owner:o}};We.createContext=function(t){return t={$$typeof:nD,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:sD,_context:t},t.Consumer=t};We.createElement=O_;We.createFactory=function(t){var e=O_.bind(null,t);return e.type=t,e};We.createRef=function(){return{current:null}};We.forwardRef=function(t){return{$$typeof:rD,render:t}};We.isValidElement=cv;We.lazy=function(t){return{$$typeof:oD,_payload:{_status:-1,_result:t},_init:uD}};We.memo=function(t,e){return{$$typeof:iD,type:t,compare:e===void 0?null:e}};We.startTransition=function(t){var e=Nm.transition;Nm.transition={};try{t()}finally{Nm.transition=e}};We.unstable_act=I_;We.useCallback=function(t,e){return Xs.current.useCallback(t,e)};We.useContext=function(t){return Xs.current.useContext(t)};We.useDebugValue=function(){};We.useDeferredValue=function(t){return Xs.current.useDeferredValue(t)};We.useEffect=function(t,e){return Xs.current.useEffect(t,e)};We.useId=function(){return Xs.current.useId()};We.useImperativeHandle=function(t,e,s){return Xs.current.useImperativeHandle(t,e,s)};We.useInsertionEffect=function(t,e){return Xs.current.useInsertionEffect(t,e)};We.useLayoutEffect=function(t,e){return Xs.current.useLayoutEffect(t,e)};We.useMemo=function(t,e){return Xs.current.useMemo(t,e)};We.useReducer=function(t,e,s){return Xs.current.useReducer(t,e,s)};We.useRef=function(t){return Xs.current.useRef(t)};We.useState=function(t){return Xs.current.useState(t)};We.useSyncExternalStore=function(t,e,s){return Xs.current.useSyncExternalStore(t,e,s)};We.useTransition=function(){return Xs.current.useTransition()};We.version="18.3.1";E_.exports=We;var M=E_.exports;const v=__(M),dv=QP({__proto__:null,default:v},[M]);/** 10 * @license React 11 * react-jsx-runtime.production.min.js 12 * 13 * Copyright (c) Facebook, Inc. and its affiliates. 14 * 15 * This source code is licensed under the MIT license found in the 16 * LICENSE file in the root directory of this source tree. 17 */var mD=M,fD=Symbol.for("react.element"),pD=Symbol.for("react.fragment"),xD=Object.prototype.hasOwnProperty,gD=mD.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,bD={key:!0,ref:!0,__self:!0,__source:!0};function F_(t,e,s){var n,a={},i=null,o=null;s!==void 0&&(i=""+s),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)xD.call(e,n)&&!bD.hasOwnProperty(n)&&(a[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)a[n]===void 0&&(a[n]=e[n]);return{$$typeof:fD,type:t,key:i,ref:o,props:a,_owner:gD.current}}$p.Fragment=pD;$p.jsx=F_;$p.jsxs=F_;T_.exports=$p;var r=T_.exports,Y0={},$_={exports:{}},$n={},z_={exports:{}},B_={};/** 18 * @license React 19 * scheduler.production.min.js 20 * 21 * Copyright (c) Facebook, Inc. and its affiliates. 22 * 23 * This source code is licensed under the MIT license found in the 24 * LICENSE file in the root directory of this source tree. 25 */(function(t){function e(_,B){var J=_.length;_.push(B);e:for(;0<J;){var Q=J-1>>>1,ce=_[Q];if(0<a(ce,B))_[Q]=B,_[J]=ce,J=Q;else break e}}function s(_){return _.length===0?null:_[0]}function n(_){if(_.length===0)return null;var B=_[0],J=_.pop();if(J!==B){_[0]=J;e:for(var Q=0,ce=_.length,fe=ce>>>1;Q<fe;){var X=2*(Q+1)-1,pe=_[X],be=X+1,q=_[be];if(0>a(pe,J))be<ce&&0>a(q,pe)?(_[Q]=q,_[be]=J,Q=be):(_[Q]=pe,_[X]=J,Q=X);else if(be<ce&&0>a(q,J))_[Q]=q,_[be]=J,Q=be;else break e}}return B}function a(_,B){var J=_.sortIndex-B.sortIndex;return J!==0?J:_.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],d=[],u=1,h=null,m=3,f=!1,p=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var B=s(d);B!==null;){if(B.callback===null)n(d);else if(B.startTime<=_)n(d),B.sortIndex=B.expirationTime,e(c,B);else break;B=s(d)}}function N(_){if(g=!1,w(_),!p)if(s(c)!==null)p=!0,$(j);else{var B=s(d);B!==null&&O(N,B.startTime-_)}}function j(_,B){p=!1,g&&(g=!1,b(C),C=-1),f=!0;var J=m;try{for(w(B),h=s(c);h!==null&&(!(h.expirationTime>B)||_&&!E());){var Q=h.callback;if(typeof Q=="function"){h.callback=null,m=h.priorityLevel;var ce=Q(h.expirationTime<=B);B=t.unstable_now(),typeof ce=="function"?h.callback=ce:h===s(c)&&n(c),w(B)}else n(c);h=s(c)}if(h!==null)var fe=!0;else{var X=s(d);X!==null&&O(N,X.startTime-B),fe=!1}return fe}finally{h=null,m=J,f=!1}}var S=!1,k=null,C=-1,T=5,A=-1;function E(){return!(t.unstable_now()-A<T)}function L(){if(k!==null){var _=t.unstable_now();A=_;var B=!0;try{B=k(!0,_)}finally{B?D():(S=!1,k=null)}}else S=!1}var D;if(typeof y=="function")D=function(){y(L)};else if(typeof MessageChannel<"u"){var P=new MessageChannel,R=P.port2;P.port1.onmessage=L,D=function(){R.postMessage(null)}}else D=function(){x(L,0)};function $(_){k=_,S||(S=!0,D())}function O(_,B){C=x(function(){_(t.unstable_now())},B)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(_){_.callback=null},t.unstable_continueExecution=function(){p||f||(p=!0,$(j))},t.unstable_forceFrameRate=function(_){0>_||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},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return s(c)},t.unstable_next=function(_){switch(m){case 1:case 2:case 3:var B=3;break;default:B=m}var J=m;m=B;try{return _()}finally{m=J}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(_,B){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var J=m;m=_;try{return B()}finally{m=J}},t.unstable_scheduleCallback=function(_,B,J){var Q=t.unstable_now();switch(typeof J=="object"&&J!==null?(J=J.delay,J=typeof J=="number"&&0<J?Q+J:Q):J=Q,_){case 1:var ce=-1;break;case 2:ce=250;break;case 5:ce=1073741823;break;case 4:ce=1e4;break;default:ce=5e3}return ce=J+ce,_={id:u++,callback:B,priorityLevel:_,startTime:J,expirationTime:ce,sortIndex:-1},J>Q?(_.sortIndex=J,e(d,_),s(c)===null&&_===s(d)&&(g?(b(C),C=-1):g=!0,O(N,J-Q))):(_.sortIndex=ce,e(c,_),p||f||(p=!0,$(j))),_},t.unstable_shouldYield=E,t.unstable_wrapCallback=function(_){var B=m;return function(){var J=m;m=B;try{return _.apply(this,arguments)}finally{m=J}}}})(B_);z_.exports=B_;var yD=z_.exports;/** 26 * @license React 27 * react-dom.production.min.js 28 * 29 * Copyright (c) Facebook, Inc. and its affiliates. 30 * 31 * This source code is licensed under the MIT license found in the 32 * LICENSE file in the root directory of this source tree. 33 */var vD=M,Rn=yD;function ie(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,s=1;s<arguments.length;s++)e+="&args[]="+encodeURIComponent(arguments[s]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var V_=new Set,cu={};function nl(t,e){hc(t,e),hc(t+"Capture",e)}function hc(t,e){for(cu[t]=e,t=0;t<e.length;t++)V_.add(e[t])}var La=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),q0=Object.prototype.hasOwnProperty,wD=/^[: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]*$/,xj={},gj={};function jD(t){return q0.call(gj,t)?!0:q0.call(xj,t)?!1:wD.test(t)?gj[t]=!0:(xj[t]=!0,!1)}function ND(t,e,s,n){if(s!==null&&s.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:s!==null?!s.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function kD(t,e,s,n){if(e===null||typeof e>"u"||ND(t,e,s,n))return!0;
vendor: 5,200 bytes, lines 33-34
33if(n)return!1;if(s!==null)switch(s.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function Zs(t,e,s,n,a,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=s,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var ws={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ws[t]=new Zs(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ws[e]=new Zs(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ws[t]=new Zs(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ws[t]=new Zs(t,2,!1,t,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(t){ws[t]=new Zs(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ws[t]=new Zs(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ws[t]=new Zs(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ws[t]=new Zs(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ws[t]=new Zs(t,5,!1,t.toLowerCase(),null,!1,!1)});var uv=/[\-:]([a-z])/g;function hv(t){return t[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(t){var e=t.replace(uv,hv);ws[e]=new Zs(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(uv,hv);ws[e]=new Zs(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(uv,hv);ws[e]=new Zs(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ws[t]=new Zs(t,1,!1,t.toLowerCase(),null,!1,!1)});ws.xlinkHref=new Zs("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ws[t]=new Zs(t,1,!1,t.toLowerCase(),null,!0,!0)});function mv(t,e,s,n){var a=ws.hasOwnProperty(e)?ws[e]:null;(a!==null?a.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(kD(e,s,a,n)&&(s=null),n||a===null?jD(e)&&(s===null?t.removeAttribute(e):t.setAttribute(e,""+s)):a.mustUseProperty?t[a.propertyName]=s===null?a.type===3?!1:"":s:(e=a.attributeName,n=a.attributeNamespace,s===null?t.removeAttribute(e):(a=a.type,s=a===3||a===4&&s===!0?"":""+s,n?t.setAttributeNS(n,e,s):t.setAttribute(e,s))))}var Ba=vD.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,jh=Symbol.for("react.element"),Ll=Symbol.for("react.portal"),Ol=Symbol.for("react.fragment"),fv=Symbol.for("react.strict_mode"),K0=Symbol.for("react.profiler"),U_=Symbol.for("react.provider"),H_=Symbol.for("react.context"),pv=Symbol.for("react.forward_ref"),J0=Symbol.for("react.suspense"),Q0=Symbol.for("react.suspense_list"),xv=Symbol.for("react.memo"),ri=Symbol.for("react.lazy"),W_=Symbol.for("react.offscreen"),bj=Symbol.iterator;function Kc(t){return t===null||typeof t!="object"?null:(t=bj&&t[bj]||t["@@iterator"],typeof t=="function"?t:null)}var Nt=Object.assign,eg;function wd(t){if(eg===void 0)try{throw Error()}catch(s){var e=s.stack.trim().match(/\n( *(at )?)/);eg=e&&e[1]||""}return` 34`+eg+t}var tg=!1;function sg(t,e){if(!t||tg)return"";tg=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(d){var n=d}Reflect.construct(t,[],e)}else{try{e.call()}catch(d){n=d}t.call(e.prototype)}else{try{throw Error()}catch(d){n=d}t()}}
vendor: 5,219 bytes, lines 34-37
34catch(d){if(d&&n&&typeof d.stack=="string"){for(var a=d.stack.split(` 35`),i=n.stack.split(` 36`),o=a.length-1,l=i.length-1;1<=o&&0<=l&&a[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(a[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||a[o]!==i[l]){var c=` 37`+a[o].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=o&&0<=l);break}}}finally{tg=!1,Error.prepareStackTrace=s}return(t=t?t.displayName||t.name:"")?wd(t):""}function CD(t){switch(t.tag){case 5:return wd(t.type);case 16:return wd("Lazy");case 13:return wd("Suspense");case 19:return wd("SuspenseList");case 0:case 2:case 15:return t=sg(t.type,!1),t;case 11:return t=sg(t.type.render,!1),t;case 1:return t=sg(t.type,!0),t;default:return""}}function X0(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case Ol:return"Fragment";case Ll:return"Portal";case K0:return"Profiler";case fv:return"StrictMode";case J0:return"Suspense";case Q0:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case H_:return(t.displayName||"Context")+".Consumer";case U_:return(t._context.displayName||"Context")+".Provider";case pv:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case xv:return e=t.displayName||null,e!==null?e:X0(t.type)||"Memo";case ri:e=t._payload,t=t._init;try{return X0(t(e))}catch{}}return null}function SD(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return X0(e);case 8:return e===fv?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function $i(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function G_(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function _D(t){var e=G_(t)?"checked":"value",s=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var a=s.get,i=s.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Nh(t){t._valueTracker||(t._valueTracker=_D(t))}function Y_(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var s=e.getValue(),n="";return t&&(n=G_(t)?t.checked?"true":"false":t.value),t=n,t!==s?(e.setValue(t),!0):!1}function Km(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Z0(t,e){var s=e.checked;return Nt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:s??t._wrapperState.initialChecked})}function yj(t,e){var s=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;s=$i(e.value!=null?e.value:s),t._wrapperState={initialChecked:n,initialValue:s,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function q_(t,e){e=e.checked,e!=null&&mv(t,"checked",e,!1)}function eb(t,e){q_(t,e);var s=$i(e.value),n=e.type;if(s!=null)n==="number"?(s===0&&t.value===""||t.value!=s)&&(t.value=""+s):t.value!==""+s&&(t.value=""+s);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?tb(t,e.type,s):e.hasOwnProperty("defaultValue")&&tb(t,e.type,$i(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function vj(t,e,s){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,s||e===t.value||(t.value=e),t.defaultValue=e}s=t.name,s!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,s!==""&&(t.name=s)}function tb(t,e,s){(e!=="number"||Km(t.ownerDocument)!==t)&&(s==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+s&&(t.defaultValue=""+s))}var jd=Array.isArray;function tc(t,e,s,n){if(t=t.options,e){e={};for(var a=0;a<s.length;a++)e["$"+s[a]]=!0;for(s=0;s<t.length;s++)a=e.hasOwnProperty("$"+t[s].value),t[s].selected!==a&&(t[s].selected=a),a&&n&&(t[s].defaultSelected=!0)}else{for(s=""+$i(s),e=null,a=0;a<t.length;a++){if(t[a].value===s){t[a].selected=!0,n&&(t[a].defaultSelected=!0);return}e!==null||t[a].disabled||(e=t[a])}e!==null&&(e.selected=!0)}}
vendor: 12,974 bytes, line 37
37function sb(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(ie(91));return Nt({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function wj(t,e){var s=e.value;if(s==null){if(s=e.children,e=e.defaultValue,s!=null){if(e!=null)throw Error(ie(92));if(jd(s)){if(1<s.length)throw Error(ie(93));s=s[0]}e=s}e==null&&(e=""),s=e}t._wrapperState={initialValue:$i(s)}}function K_(t,e){var s=$i(e.value),n=$i(e.defaultValue);s!=null&&(s=""+s,s!==t.value&&(t.value=s),e.defaultValue==null&&t.defaultValue!==s&&(t.defaultValue=s)),n!=null&&(t.defaultValue=""+n)}function jj(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function J_(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function nb(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?J_(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var kh,Q_=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,s,n,a){MSApp.execUnsafeLocalFunction(function(){return t(e,s,n,a)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(kh=kh||document.createElement("div"),kh.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=kh.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function du(t,e){if(e){var s=t.firstChild;if(s&&s===t.lastChild&&s.nodeType===3){s.nodeValue=e;return}}t.textContent=e}var Od={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},TD=["Webkit","ms","Moz","O"];Object.keys(Od).forEach(function(t){TD.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Od[e]=Od[t]})});function X_(t,e,s){return e==null||typeof e=="boolean"||e===""?"":s||typeof e!="number"||e===0||Od.hasOwnProperty(t)&&Od[t]?(""+e).trim():e+"px"}function Z_(t,e){t=t.style;for(var s in e)if(e.hasOwnProperty(s)){var n=s.indexOf("--")===0,a=X_(s,e[s],n);s==="float"&&(s="cssFloat"),n?t.setProperty(s,a):t[s]=a}}var ED=Nt({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 rb(t,e){if(e){if(ED[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(ie(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(ie(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(ie(61))}if(e.style!=null&&typeof e.style!="object")throw Error(ie(62))}}function ab(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 ib=null;function gv(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ob=null,sc=null,nc=null;function Nj(t){if(t=th(t)){if(typeof ob!="function")throw Error(ie(280));var e=t.stateNode;e&&(e=Hp(e),ob(t.stateNode,t.type,e))}}function eT(t){sc?nc?nc.push(t):nc=[t]:sc=t}function tT(){if(sc){var t=sc,e=nc;if(nc=sc=null,Nj(t),e)for(t=0;t<e.length;t++)Nj(e[t])}}function sT(t,e){return t(e)}function nT(){}var ng=!1;function rT(t,e,s){if(ng)return t(e,s);ng=!0;try{return sT(t,e,s)}finally{ng=!1,(sc!==null||nc!==null)&&(nT(),tT())}}function uu(t,e){var s=t.stateNode;if(s===null)return null;var n=Hp(s);if(n===null)return null;s=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(s&&typeof s!="function")throw Error(ie(231,e,typeof s));return s}var lb=!1;if(La)try{var Jc={};Object.defineProperty(Jc,"passive",{get:function(){lb=!0}}),window.addEventListener("test",Jc,Jc),window.removeEventListener("test",Jc,Jc)}catch{lb=!1}function MD(t,e,s,n,a,i,o,l,c){var d=Array.prototype.slice.call(arguments,3);try{e.apply(s,d)}catch(u){this.onError(u)}}var Id=!1,Jm=null,Qm=!1,cb=null,AD={onError:function(t){Id=!0,Jm=t}};function PD(t,e,s,n,a,i,o,l,c){Id=!1,Jm=null,MD.apply(AD,arguments)}function DD(t,e,s,n,a,i,o,l,c){if(PD.apply(this,arguments),Id){if(Id){var d=Jm;Id=!1,Jm=null}else throw Error(ie(198));Qm||(Qm=!0,cb=d)}}function rl(t){var e=t,s=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(s=e.return),t=e.return;while(t)}return e.tag===3?s:null}function aT(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function kj(t){if(rl(t)!==t)throw Error(ie(188))}function RD(t){var e=t.alternate;if(!e){if(e=rl(t),e===null)throw Error(ie(188));return e!==t?null:t}for(var s=t,n=e;;){var a=s.return;if(a===null)break;var i=a.alternate;if(i===null){if(n=a.return,n!==null){s=n;continue}break}if(a.child===i.child){for(i=a.child;i;){if(i===s)return kj(a),t;if(i===n)return kj(a),e;i=i.sibling}throw Error(ie(188))}if(s.return!==n.return)s=a,n=i;else{for(var o=!1,l=a.child;l;){if(l===s){o=!0,s=a,n=i;break}if(l===n){o=!0,n=a,s=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===s){o=!0,s=i,n=a;break}if(l===n){o=!0,n=i,s=a;break}l=l.sibling}if(!o)throw Error(ie(189))}}if(s.alternate!==n)throw Error(ie(190))}if(s.tag!==3)throw Error(ie(188));return s.stateNode.current===s?t:e}function iT(t){return t=RD(t),t!==null?oT(t):null}function oT(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=oT(t);if(e!==null)return e;t=t.sibling}return null}var lT=Rn.unstable_scheduleCallback,Cj=Rn.unstable_cancelCallback,LD=Rn.unstable_shouldYield,OD=Rn.unstable_requestPaint,Rt=Rn.unstable_now,ID=Rn.unstable_getCurrentPriorityLevel,bv=Rn.unstable_ImmediatePriority,cT=Rn.unstable_UserBlockingPriority,Xm=Rn.unstable_NormalPriority,FD=Rn.unstable_LowPriority,dT=Rn.unstable_IdlePriority,zp=null,Xr=null;function $D(t){if(Xr&&typeof Xr.onCommitFiberRoot=="function")try{Xr.onCommitFiberRoot(zp,t,void 0,(t.current.flags&128)===128)}catch{}}var Cr=Math.clz32?Math.clz32:VD,zD=Math.log,BD=Math.LN2;function VD(t){return t>>>=0,t===0?32:31-(zD(t)/BD|0)|0}var Ch=64,Sh=4194304;function Nd(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Zm(t,e){var s=t.pendingLanes;if(s===0)return 0;var n=0,a=t.suspendedLanes,i=t.pingedLanes,o=s&268435455;if(o!==0){var l=o&~a;l!==0?n=Nd(l):(i&=o,i!==0&&(n=Nd(i)))}else o=s&~a,o!==0?n=Nd(o):i!==0&&(n=Nd(i));if(n===0)return 0;if(e!==0&&e!==n&&!(e&a)&&(a=n&-n,i=e&-e,a>=i||a===16&&(i&4194240)!==0))return e;if(n&4&&(n|=s&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)s=31-Cr(e),a=1<<s,n|=t[s],e&=~a;return n}function UD(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 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+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function HD(t,e){for(var s=t.suspendedLanes,n=t.pingedLanes,a=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-Cr(i),l=1<<o,c=a[o];c===-1?(!(l&s)||l&n)&&(a[o]=UD(l,e)):c<=e&&(t.expiredLanes|=l),i&=~l}}function db(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function uT(){var t=Ch;return Ch<<=1,!(Ch&4194240)&&(Ch=64),t}function rg(t){for(var e=[],s=0;31>s;s++)e.push(t);return e}function Zu(t,e,s){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Cr(e),t[e]=s}function WD(t,e){var s=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0<s;){var a=31-Cr(s),i=1<<a;e[a]=0,n[a]=-1,t[a]=-1,s&=~i}}function yv(t,e){var s=t.entangledLanes|=e;for(t=t.entanglements;s;){var n=31-Cr(s),a=1<<n;a&e|t[n]&e&&(t[n]|=e),s&=~a}}var et=0;function hT(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var mT,vv,fT,pT,xT,ub=!1,_h=[],ji=null,Ni=null,ki=null,hu=new Map,mu=new Map,ci=[],GD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Sj(t,e){switch(t){case"focusin":case"focusout":ji=null;break;case"dragenter":case"dragleave":Ni=null;break;case"mouseover":case"mouseout":ki=null;break;case"pointerover":case"pointerout":hu.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":mu.delete(e.pointerId)}}function Qc(t,e,s,n,a,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:s,eventSystemFlags:n,nativeEvent:i,targetContainers:[a]},e!==null&&(e=th(e),e!==null&&vv(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,a!==null&&e.indexOf(a)===-1&&e.push(a),t)}function YD(t,e,s,n,a){switch(e){case"focusin":return ji=Qc(ji,t,e,s,n,a),!0;case"dragenter":return Ni=Qc(Ni,t,e,s,n,a),!0;case"mouseover":return ki=Qc(ki,t,e,s,n,a),!0;case"pointerover":var i=a.pointerId;return hu.set(i,Qc(hu.get(i)||null,t,e,s,n,a)),!0;case"gotpointercapture":return i=a.pointerId,mu.set(i,Qc(mu.get(i)||null,t,e,s,n,a)),!0}return!1}function gT(t){var e=jo(t.target);if(e!==null){var s=rl(e);if(s!==null){if(e=s.tag,e===13){if(e=aT(s),e!==null){t.blockedOn=e,xT(t.priority,function(){fT(s)});return}}else if(e===3&&s.stateNode.current.memoizedState.isDehydrated){t.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}t.blockedOn=null}function km(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var s=hb(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(s===null){s=t.nativeEvent;var n=new s.constructor(s.type,s);ib=n,s.target.dispatchEvent(n),ib=null}else return e=th(s),e!==null&&vv(e),t.blockedOn=s,!1;e.shift()}return!0}function _j(t,e,s){km(t)&&s.delete(e)}function qD(){ub=!1,ji!==null&&km(ji)&&(ji=null),Ni!==null&&km(Ni)&&(Ni=null),ki!==null&&km(ki)&&(ki=null),hu.forEach(_j),mu.forEach(_j)}function Xc(t,e){t.blockedOn===e&&(t.blockedOn=null,ub||(ub=!0,Rn.unstable_scheduleCallback(Rn.unstable_NormalPriority,qD)))}function fu(t){function e(a){return Xc(a,t)}if(0<_h.length){Xc(_h[0],t);for(var s=1;s<_h.length;s++){var n=_h[s];n.blockedOn===t&&(n.blockedOn=null)}}for(ji!==null&&Xc(ji,t),Ni!==null&&Xc(Ni,t),ki!==null&&Xc(ki,t),hu.forEach(e),mu.forEach(e),s=0;s<ci.length;s++)n=ci[s],n.blockedOn===t&&(n.blockedOn=null);for(;0<ci.length&&(s=ci[0],s.blockedOn===null);)gT(s),s.blockedOn===null&&ci.shift()}var rc=Ba.ReactCurrentBatchConfig,ef=!0;function KD(t,e,s,n){var a=et,i=rc.transition;rc.transition=null;try{et=1,wv(t,e,s,n)}finally{et=a,rc.transition=i}}function JD(t,e,s,n){var a=et,i=rc.transition;rc.transition=null;try{et=4,wv(t,e,s,n)}finally{et=a,rc.transition=i}}function wv(t,e,s,n){if(ef){var a=hb(t,e,s,n);if(a===null)fg(t,e,n,tf,s),Sj(t,n);else if(YD(a,t,e,s,n))n.stopPropagation();else if(Sj(t,n),e&4&&-1<GD.indexOf(t)){for(;a!==null;){var i=th(a);if(i!==null&&mT(i),i=hb(t,e,s,n),i===null&&fg(t,e,n,tf,s),i===a)break;a=i}a!==null&&n.stopPropagation()}else fg(t,e,n,null,s)}}var tf=null;function hb(t,e,s,n){if(tf=null,t=gv(n),t=jo(t),t!==null)if(e=rl(t),e===null)t=null;else if(s=e.tag,s===13){if(t=aT(e),t!==null)return t;t=null}else if(s===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return tf=t,null}
vendor: 10,401 bytes, line 37
37function bT(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ID()){case bv:return 1;case cT:return 4;case Xm:case FD:return 16;case dT:return 536870912;default:return 16}default:return 16}}var fi=null,jv=null,Cm=null;function yT(){if(Cm)return Cm;var t,e=jv,s=e.length,n,a="value"in fi?fi.value:fi.textContent,i=a.length;for(t=0;t<s&&e[t]===a[t];t++);var o=s-t;for(n=1;n<=o&&e[s-n]===a[i-n];n++);return Cm=a.slice(t,1<n?1-n:void 0)}function Sm(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Th(){return!0}function Tj(){return!1}function zn(t){function e(s,n,a,i,o){this._reactName=s,this._targetInst=a,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(s=t[l],this[l]=s?s(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Th:Tj,this.isPropagationStopped=Tj,this}return Nt(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Th)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Th)},persist:function(){},isPersistent:Th}),e}var $c={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Nv=zn($c),eh=Nt({},$c,{view:0,detail:0}),QD=zn(eh),ag,ig,Zc,Bp=Nt({},eh,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:kv,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Zc&&(Zc&&t.type==="mousemove"?(ag=t.screenX-Zc.screenX,ig=t.screenY-Zc.screenY):ig=ag=0,Zc=t),ag)},movementY:function(t){return"movementY"in t?t.movementY:ig}}),Ej=zn(Bp),XD=Nt({},Bp,{dataTransfer:0}),ZD=zn(XD),eR=Nt({},eh,{relatedTarget:0}),og=zn(eR),tR=Nt({},$c,{animationName:0,elapsedTime:0,pseudoElement:0}),sR=zn(tR),nR=Nt({},$c,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),rR=zn(nR),aR=Nt({},$c,{data:0}),Mj=zn(aR),iR={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oR={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},lR={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function cR(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=lR[t])?!!e[t]:!1}function kv(){return cR}var dR=Nt({},eh,{key:function(t){if(t.key){var e=iR[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Sm(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?oR[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:kv,charCode:function(t){return t.type==="keypress"?Sm(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Sm(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),uR=zn(dR),hR=Nt({},Bp,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Aj=zn(hR),mR=Nt({},eh,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:kv}),fR=zn(mR),pR=Nt({},$c,{propertyName:0,elapsedTime:0,pseudoElement:0}),xR=zn(pR),gR=Nt({},Bp,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),bR=zn(gR),yR=[9,13,27,32],Cv=La&&"CompositionEvent"in window,Fd=null;La&&"documentMode"in document&&(Fd=document.documentMode);var vR=La&&"TextEvent"in window&&!Fd,vT=La&&(!Cv||Fd&&8<Fd&&11>=Fd),Pj=" ",Dj=!1;function wT(t,e){switch(t){case"keyup":return yR.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function jT(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Il=!1;function wR(t,e){switch(t){case"compositionend":return jT(e);case"keypress":return e.which!==32?null:(Dj=!0,Pj);case"textInput":return t=e.data,t===Pj&&Dj?null:t;default:return null}}function jR(t,e){if(Il)return t==="compositionend"||!Cv&&wT(t,e)?(t=yT(),Cm=jv=fi=null,Il=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return vT&&e.locale!=="ko"?null:e.data;default:return null}}var NR={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rj(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!NR[t.type]:e==="textarea"}function NT(t,e,s,n){eT(n),e=sf(e,"onChange"),0<e.length&&(s=new Nv("onChange","change",null,s,n),t.push({event:s,listeners:e}))}var $d=null,pu=null;function kR(t){RT(t,0)}function Vp(t){var e=zl(t);if(Y_(e))return t}function CR(t,e){if(t==="change")return e}var kT=!1;if(La){var lg;if(La){var cg="oninput"in document;if(!cg){var Lj=document.createElement("div");Lj.setAttribute("oninput","return;"),cg=typeof Lj.oninput=="function"}lg=cg}else lg=!1;kT=lg&&(!document.documentMode||9<document.documentMode)}function Oj(){$d&&($d.detachEvent("onpropertychange",CT),pu=$d=null)}function CT(t){if(t.propertyName==="value"&&Vp(pu)){var e=[];NT(e,pu,t,gv(t)),rT(kR,e)}}function SR(t,e,s){t==="focusin"?(Oj(),$d=e,pu=s,$d.attachEvent("onpropertychange",CT)):t==="focusout"&&Oj()}function _R(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Vp(pu)}function TR(t,e){if(t==="click")return Vp(e)}function ER(t,e){if(t==="input"||t==="change")return Vp(e)}function MR(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Mr=typeof Object.is=="function"?Object.is:MR;function xu(t,e){if(Mr(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var s=Object.keys(t),n=Object.keys(e);if(s.length!==n.length)return!1;for(n=0;n<s.length;n++){var a=s[n];if(!q0.call(e,a)||!Mr(t[a],e[a]))return!1}return!0}function Ij(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Fj(t,e){var s=Ij(t);t=0;for(var n;s;){if(s.nodeType===3){if(n=t+s.textContent.length,t<=e&&n>=e)return{node:s,offset:e-t};t=n}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ij(s)}}function ST(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?ST(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function _T(){for(var t=window,e=Km();e instanceof t.HTMLIFrameElement;){try{var s=typeof e.contentWindow.location.href=="string"}catch{s=!1}if(s)t=e.contentWindow;else break;e=Km(t.document)}return e}function Sv(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function AR(t){var e=_T(),s=t.focusedElem,n=t.selectionRange;if(e!==s&&s&&s.ownerDocument&&ST(s.ownerDocument.documentElement,s)){if(n!==null&&Sv(s)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in s)s.selectionStart=e,s.selectionEnd=Math.min(t,s.value.length);else if(t=(e=s.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var a=s.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!t.extend&&i>n&&(a=n,n=i,i=a),a=Fj(s,i);var o=Fj(s,n);a&&o&&(t.rangeCount!==1||t.anchorNode!==a.node||t.anchorOffset!==a.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(a.node,a.offset),t.removeAllRanges(),i>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=s;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof s.focus=="function"&&s.focus(),s=0;s<e.length;s++)t=e[s],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var PR=La&&"documentMode"in document&&11>=document.documentMode,Fl=null,mb=null,zd=null,fb=!1;function $j(t,e,s){var n=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;fb||Fl==null||Fl!==Km(n)||(n=Fl,"selectionStart"in n&&Sv(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,228 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),zd&&xu(zd,n)||(zd=n,n=sf(mb,"onSelect"),0<n.length&&(e=new Nv("onSelect","select",null,e,s),t.push({event:e,listeners:n}),e.target=Fl)))}function Eh(t,e){var s={};return s[t.toLowerCase()]=e.toLowerCase(),s["Webkit"+t]="webkit"+e,s["Moz"+t]="moz"+e,s}var $l={animationend:Eh("Animation","AnimationEnd"),animationiteration:Eh("Animation","AnimationIteration"),animationstart:Eh("Animation","AnimationStart"),transitionend:Eh("Transition","TransitionEnd")},dg={},TT={};La&&(TT=document.createElement("div").style,"AnimationEvent"in window||(delete $l.animationend.animation,delete $l.animationiteration.animation,delete $l.animationstart.animation),"TransitionEvent"in window||delete $l.transitionend.transition);function Up(t){if(dg[t])return dg[t];if(!$l[t])return t;var e=$l[t],s;for(s in e)if(e.hasOwnProperty(s)&&s in TT)return dg[t]=e[s];return t}var ET=Up("animationend"),MT=Up("animationiteration"),AT=Up("animationstart"),PT=Up("transitionend"),DT=new Map,zj="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Qi(t,e){DT.set(t,e),nl(e,[t])}for(var ug=0;ug<zj.length;ug++){var hg=zj[ug],DR=hg.toLowerCase(),RR=hg[0].toUpperCase()+hg.slice(1);Qi(DR,"on"+RR)}Qi(ET,"onAnimationEnd");Qi(MT,"onAnimationIteration");Qi(AT,"onAnimationStart");Qi("dblclick","onDoubleClick");Qi("focusin","onFocus");Qi("focusout","onBlur");Qi(PT,"onTransitionEnd");hc("onMouseEnter",["mouseout","mouseover"]);hc("onMouseLeave",["mouseout","mouseover"]);hc("onPointerEnter",["pointerout","pointerover"]);hc("onPointerLeave",["pointerout","pointerover"]);nl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));nl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));nl("onBeforeInput",["compositionend","keypress","textInput","paste"]);nl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));nl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));nl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var kd="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),LR=new Set("cancel close invalid load scroll toggle".split(" ").concat(kd));function Bj(t,e,s){var n=t.type||"unknown-event";t.currentTarget=s,DD(n,e,void 0,t),t.currentTarget=null}function RT(t,e){e=(e&4)!==0;for(var s=0;s<t.length;s++){var n=t[s],a=n.event;n=n.listeners;e:{var i=void 0;if(e)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,d=l.currentTarget;if(l=l.listener,c!==i&&a.isPropagationStopped())break e;Bj(a,l,d),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,d=l.currentTarget,l=l.listener,c!==i&&a.isPropagationStopped())break e;Bj(a,l,d),i=c}}}if(Qm)throw t=cb,Qm=!1,cb=null,t}function lt(t,e){var s=e[yb];s===void 0&&(s=e[yb]=new Set);var n=t+"__bubble";s.has(n)||(LT(e,t,2,!1),s.add(n))}function mg(t,e,s){var n=0;e&&(n|=4),LT(s,t,n,e)}var Mh="_reactListening"+Math.random().toString(36).slice(2);function gu(t){if(!t[Mh]){t[Mh]=!0,V_.forEach(function(s){s!=="selectionchange"&&(LR.has(s)||mg(s,!1,t),mg(s,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Mh]||(e[Mh]=!0,mg("selectionchange",!1,e))}}function LT(t,e,s,n){switch(bT(e)){case 1:var a=KD;break;case 4:a=JD;break;default:a=wv}s=a.bind(null,e,s,t),a=void 0,!lb||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(a=!0),n?a!==void 0?t.addEventListener(e,s,{
vendor: 2,800 bytes, line 37
37capture:!0,passive:a}):t.addEventListener(e,s,!0):a!==void 0?t.addEventListener(e,s,{passive:a}):t.addEventListener(e,s,!1)}function fg(t,e,s,n,a){var i=n;if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===a||l.nodeType===8&&l.parentNode===a)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===a||c.nodeType===8&&c.parentNode===a))return;o=o.return}for(;l!==null;){if(o=jo(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}rT(function(){var d=i,u=gv(s),h=[];e:{var m=DT.get(t);if(m!==void 0){var f=Nv,p=t;switch(t){case"keypress":if(Sm(s)===0)break e;case"keydown":case"keyup":f=uR;break;case"focusin":p="focus",f=og;break;case"focusout":p="blur",f=og;break;case"beforeblur":case"afterblur":f=og;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":f=Ej;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":f=ZD;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":f=fR;break;case ET:case MT:case AT:f=sR;break;case PT:f=xR;break;case"scroll":f=QD;break;case"wheel":f=bR;break;case"copy":case"cut":case"paste":f=rR;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":f=Aj}var g=(e&4)!==0,x=!g&&t==="scroll",b=g?m!==null?m+"Capture":null:m;g=[];for(var y=d,w;y!==null;){w=y;var N=w.stateNode;if(w.tag===5&&N!==null&&(w=N,b!==null&&(N=uu(y,b),N!=null&&g.push(bu(y,N,w)))),x)break;y=y.return}0<g.length&&(m=new f(m,p,null,s,u),h.push({event:m,listeners:g}))}}if(!(e&7)){e:{if(m=t==="mouseover"||t==="pointerover",f=t==="mouseout"||t==="pointerout",m&&s!==ib&&(p=s.relatedTarget||s.fromElement)&&(jo(p)||p[Oa]))break e;if((f||m)&&(m=u.window===u?u:(m=u.ownerDocument)?m.defaultView||m.parentWindow:window,f?(p=s.relatedTarget||s.toElement,f=d,p=p?jo(p):null,p!==null&&(x=rl(p),p!==x||p.tag!==5&&p.tag!==6)&&(p=null)):(f=null,p=d),f!==p)){if(g=Ej,N="onMouseLeave",b="onMouseEnter",y="mouse",(t==="pointerout"||t==="pointerover")&&(g=Aj,N="onPointerLeave",b="onPointerEnter",y="pointer"),x=f==null?m:zl(f),w=p==null?m:zl(p),m=new g(N,y+"leave",f,s,u),m.target=x,m.relatedTarget=w,N=null,jo(u)===d&&(g=new g(b,y+"enter",p,s,u),g.target=w,g.relatedTarget=x,N=g),x=N,f&&p)t:{for(g=f,b=p,y=0,w=g;w;w=gl(w))y++;for(w=0,N=b;N;N=gl(N))w++;for(;0<y-w;)g=gl(g),y--;for(;0<w-y;)b=gl(b),w--;for(;y--;){if(g===b||b!==null&&g===b.alternate)break t;g=gl(g),b=gl(b)}g=null}else g=null;f!==null&&Vj(h,m,f,g,!1),p!==null&&x!==null&&Vj(h,x,p,g,!0)}}
vendor: 4,576 bytes, lines 37-38
37e:{if(m=d?zl(d):window,f=m.nodeName&&m.nodeName.toLowerCase(),f==="select"||f==="input"&&m.type==="file")var j=CR;else if(Rj(m))if(kT)j=ER;else{j=_R;var S=SR}else(f=m.nodeName)&&f.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(j=TR);if(j&&(j=j(t,d))){NT(h,j,s,u);break e}S&&S(t,m,d),t==="focusout"&&(S=m._wrapperState)&&S.controlled&&m.type==="number"&&tb(m,"number",m.value)}switch(S=d?zl(d):window,t){case"focusin":(Rj(S)||S.contentEditable==="true")&&(Fl=S,mb=d,zd=null);break;case"focusout":zd=mb=Fl=null;break;case"mousedown":fb=!0;break;case"contextmenu":case"mouseup":case"dragend":fb=!1,$j(h,s,u);break;case"selectionchange":if(PR)break;case"keydown":case"keyup":$j(h,s,u)}var k;if(Cv)e:{switch(t){case"compositionstart":var C="onCompositionStart";break e;case"compositionend":C="onCompositionEnd";break e;case"compositionupdate":C="onCompositionUpdate";break e}C=void 0}else Il?wT(t,s)&&(C="onCompositionEnd"):t==="keydown"&&s.keyCode===229&&(C="onCompositionStart");C&&(vT&&s.locale!=="ko"&&(Il||C!=="onCompositionStart"?C==="onCompositionEnd"&&Il&&(k=yT()):(fi=u,jv="value"in fi?fi.value:fi.textContent,Il=!0)),S=sf(d,C),0<S.length&&(C=new Mj(C,t,null,s,u),h.push({event:C,listeners:S}),k?C.data=k:(k=jT(s),k!==null&&(C.data=k)))),(k=vR?wR(t,s):jR(t,s))&&(d=sf(d,"onBeforeInput"),0<d.length&&(u=new Mj("onBeforeInput","beforeinput",null,s,u),h.push({event:u,listeners:d}),u.data=k))}RT(h,e)})}function bu(t,e,s){return{instance:t,listener:e,currentTarget:s}}function sf(t,e){for(var s=e+"Capture",n=[];t!==null;){var a=t,i=a.stateNode;a.tag===5&&i!==null&&(a=i,i=uu(t,s),i!=null&&n.unshift(bu(t,i,a)),i=uu(t,e),i!=null&&n.push(bu(t,i,a))),t=t.return}return n}function gl(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Vj(t,e,s,n,a){for(var i=e._reactName,o=[];s!==null&&s!==n;){var l=s,c=l.alternate,d=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&d!==null&&(l=d,a?(c=uu(s,i),c!=null&&o.unshift(bu(s,c,l))):a||(c=uu(s,i),c!=null&&o.push(bu(s,c,l)))),s=s.return}o.length!==0&&t.push({event:e,listeners:o})}var OR=/\r\n?/g,IR=/\u0000|\uFFFD/g;function Uj(t){return(typeof t=="string"?t:""+t).replace(OR,` 38`).replace(IR,"")}function Ah(t,e,s){if(e=Uj(e),Uj(t)!==e&&s)throw Error(ie(425))}function nf(){}var pb=null,xb=null;function gb(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var bb=typeof setTimeout=="function"?setTimeout:void 0,FR=typeof clearTimeout=="function"?clearTimeout:void 0,Hj=typeof Promise=="function"?Promise:void 0,$R=typeof queueMicrotask=="function"?queueMicrotask:typeof Hj<"u"?function(t){return Hj.resolve(null).then(t).catch(zR)}:bb;function zR(t){setTimeout(function(){throw t})}function pg(t,e){var s=e,n=0;do{var a=s.nextSibling;if(t.removeChild(s),a&&a.nodeType===8)if(s=a.data,s==="/$"){if(n===0){t.removeChild(a),fu(e);return}n--}else s!=="$"&&s!=="$?"&&s!=="$!"||n++;s=a}while(s);fu(e)}function Ci(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function Wj(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var s=t.data;if(s==="$"||s==="$!"||s==="$?"){if(e===0)return t;e--}else s==="/$"&&e++}t=t.previousSibling}return null}var zc=Math.random().toString(36).slice(2),Wr="__reactFiber$"+zc,yu="__reactProps$"+zc,Oa="__reactContainer$"+zc,yb="__reactEvents$"+zc,BR="__reactListeners$"+zc,VR="__reactHandles$"+zc;function jo(t){var e=t[Wr];if(e)return e;for(var s=t.parentNode;s;){if(e=s[Oa]||s[Wr]){if(s=e.alternate,e.child!==null||s!==null&&s.child!==null)for(t=Wj(t);t!==null;){if(s=t[Wr])return s;t=Wj(t)}return e}t=s,s=t.parentNode}return null}function th(t){return t=t[Wr]||t[Oa],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function zl(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(ie(33))}function Hp(t){return t[yu]||null}var vb=[],Bl=-1;function Xi(t){return{current:t}}function dt(t){0>Bl||(t.current=vb[Bl],vb[Bl]=null,Bl--)}function ot(t,e){Bl++,vb[Bl]=t.current,t.current=e}var zi={},Rs=Xi(zi),pn=Xi(!1),Ho=zi;function mc(t,e){var s=t.type.contextTypes;if(!s)return zi;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in s)a[i]=e[i];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=a
vendor: 28,661 bytes, lines 38-40
38),a}function xn(t){return t=t.childContextTypes,t!=null}function rf(){dt(pn),dt(Rs)}function Gj(t,e,s){if(Rs.current!==zi)throw Error(ie(168));ot(Rs,e),ot(pn,s)}function OT(t,e,s){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return s;n=n.getChildContext();for(var a in n)if(!(a in e))throw Error(ie(108,SD(t)||"Unknown",a));return Nt({},s,n)}function af(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||zi,Ho=Rs.current,ot(Rs,t),ot(pn,pn.current),!0}function Yj(t,e,s){var n=t.stateNode;if(!n)throw Error(ie(169));s?(t=OT(t,e,Ho),n.__reactInternalMemoizedMergedChildContext=t,dt(pn),dt(Rs),ot(Rs,t)):dt(pn),ot(pn,s)}var Na=null,Wp=!1,xg=!1;function IT(t){Na===null?Na=[t]:Na.push(t)}function UR(t){Wp=!0,IT(t)}function Zi(){if(!xg&&Na!==null){xg=!0;var t=0,e=et;try{var s=Na;for(et=1;t<s.length;t++){var n=s[t];do n=n(!0);while(n!==null)}Na=null,Wp=!1}catch(a){throw Na!==null&&(Na=Na.slice(t+1)),lT(bv,Zi),a}finally{et=e,xg=!1}}return null}var Vl=[],Ul=0,of=null,lf=0,Kn=[],Jn=0,Wo=null,ka=1,Ca="";function po(t,e){Vl[Ul++]=lf,Vl[Ul++]=of,of=t,lf=e}function FT(t,e,s){Kn[Jn++]=ka,Kn[Jn++]=Ca,Kn[Jn++]=Wo,Wo=t;var n=ka;t=Ca;var a=32-Cr(n)-1;n&=~(1<<a),s+=1;var i=32-Cr(e)+a;if(30<i){var o=a-a%5;i=(n&(1<<o)-1).toString(32),n>>=o,a-=o,ka=1<<32-Cr(e)+a|s<<a|n,Ca=i+t}else ka=1<<i|s<<a|n,Ca=t}function _v(t){t.return!==null&&(po(t,1),FT(t,1,0))}function Tv(t){for(;t===of;)of=Vl[--Ul],Vl[Ul]=null,lf=Vl[--Ul],Vl[Ul]=null;for(;t===Wo;)Wo=Kn[--Jn],Kn[Jn]=null,Ca=Kn[--Jn],Kn[Jn]=null,ka=Kn[--Jn],Kn[Jn]=null}var En=null,Tn=null,ft=!1,jr=null;function $T(t,e){var s=Zn(5,null,null,0);s.elementType="DELETED",s.stateNode=e,s.return=t,e=t.deletions,e===null?(t.deletions=[s],t.flags|=16):e.push(s)}function qj(t,e){switch(t.tag){case 5:var s=t.type;return e=e.nodeType!==1||s.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,En=t,Tn=Ci(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,En=t,Tn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(s=Wo!==null?{id:ka,overflow:Ca}:null,t.memoizedState={dehydrated:e,treeContext:s,retryLane:1073741824},s=Zn(18,null,null,0),s.stateNode=e,s.return=t,t.child=s,En=t,Tn=null,!0):!1;default:return!1}}function wb(t){return(t.mode&1)!==0&&(t.flags&128)===0}function jb(t){if(ft){var e=Tn;if(e){var s=e;if(!qj(t,e)){if(wb(t))throw Error(ie(418));e=Ci(s.nextSibling);var n=En;e&&qj(t,e)?$T(n,s):(t.flags=t.flags&-4097|2,ft=!1,En=t)}}else{if(wb(t))throw Error(ie(418));t.flags=t.flags&-4097|2,ft=!1,En=t}}}function Kj(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;En=t}function Ph(t){if(t!==En)return!1;if(!ft)return Kj(t),ft=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!gb(t.type,t.memoizedProps)),e&&(e=Tn)){if(wb(t))throw zT(),Error(ie(418));for(;e;)$T(t,e),e=Ci(e.nextSibling)}if(Kj(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(ie(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var s=t.data;if(s==="/$"){if(e===0){Tn=Ci(t.nextSibling);break e}e--}else s!=="$"&&s!=="$!"&&s!=="$?"||e++}t=t.nextSibling}Tn=null}}else Tn=En?Ci(t.stateNode.nextSibling):null;return!0}function zT(){for(var t=Tn;t;)t=Ci(t.nextSibling)}function fc(){Tn=En=null,ft=!1}function Ev(t){jr===null?jr=[t]:jr.push(t)}var HR=Ba.ReactCurrentBatchConfig;function ed(t,e,s){if(t=s.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(s._owner){if(s=s._owner,s){if(s.tag!==1)throw Error(ie(309));var n=s.stateNode}if(!n)throw Error(ie(147,t));var a=n,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var l=a.refs;o===null?delete l[i]:l[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(ie(284));if(!s._owner)throw Error(ie(290,t))}return t}function Dh(t,e){throw t=Object.prototype.toString.call(e),Error(ie(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function Jj(t){var e=t._init;return e(t._payload)}function BT(t){function e(b,y){if(t){var w=b.deletions;w===null?(b.deletions=[y],b.flags|=16):w.push(y)}}function s(b,y){if(!t)return null;for(;y!==null;)e(b,y),y=y.sibling;return null}function n(b,y){for(b=new Map;y!==null;)y.key!==null?b.set(y.key,y):b.set(y.index,y),y=y.sibling;return b}function a(b,y){return b=Ei(b,y),b.index=0,b.sibling=null,b}function i(b,y,w){return b.index=w,t?(w=b.alternate,w!==null?(w=w.index,w<y?(b.flags|=2,y):w):(b.flags|=2,y)):(b.flags|=1048576,y)}function o(b){return t&&b.alternate===null&&(b.flags|=2),b}function l(b,y,w,N){return y===null||y.tag!==6?(y=Ng(w,b.mode,N),y.return=b,y):(y=a(y,w),y.return=b,y)}function c(b,y,w,N){var j=w.type;return j===Ol?u(b,y,w.props.children,N,w.key):y!==null&&(y.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ri&&Jj(j)===y.type)?(N=a(y,w.props),N.ref=ed(b,y,w),N.return=b,N):(N=Dm(w.type,w.key,w.props,null,b.mode,N),N.ref=ed(b,y,w),N.return=b,N)}function d(b,y,w,N){return y===null||y.tag!==4||y.stateNode.containerInfo!==w.containerInfo||y.stateNode.implementation!==w.implementation?(y=kg(w,b.mode,N),y.return=b,y):(y=a(y,w.children||[]),y.return=b,y)}function u(b,y,w,N,j){return y===null||y.tag!==7?(y=Ro(w,b.mode,N,j),y.return=b,y):(y=a(y,w),y.return=b,y)}function h(b,y,w){if(typeof y=="string"&&y!==""||typeof y=="number")return y=Ng(""+y,b.mode,w),y.return=b,y;if(typeof y=="object"&&y!==null){switch(y.$$typeof){case jh:return w=Dm(y.type,y.key,y.props,null,b.mode,w),w.ref=ed(b,null,y),w.return=b,w;case Ll:return y=kg(y,b.mode,w),y.return=b,y;case ri:var N=y._init;return h(b,N(y._payload),w)}if(jd(y)||Kc(y))return y=Ro(y,b.mode,w,null),y.return=b,y;Dh(b,y)}return null}function m(b,y,w,N){var j=y!==null?y.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return j!==null?null:l(b,y,""+w,N);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case jh:return w.key===j?c(b,y,w,N):null;case Ll:return w.key===j?d(b,y,w,N):null;case ri:return j=w._init,m(b,y,j(w._payload),N)}if(jd(w)||Kc(w))return j!==null?null:u(b,y,w,N,null);Dh(b,w)}return null}function f(b,y,w,N,j){if(typeof N=="string"&&N!==""||typeof N=="number")return b=b.get(w)||null,l(y,b,""+N,j);if(typeof N=="object"&&N!==null){switch(N.$$typeof){case jh:return b=b.get(N.key===null?w:N.key)||null,c(y,b,N,j);case Ll:return b=b.get(N.key===null?w:N.key)||null,d(y,b,N,j);case ri:var S=N._init;return f(b,y,w,S(N._payload),j)}if(jd(N)||Kc(N))return b=b.get(w)||null,u(y,b,N,j,null);Dh(y,N)}return null}function p(b,y,w,N){for(var j=null,S=null,k=y,C=y=0,T=null;k!==null&&C<w.length;C++){k.index>C?(T=k,k=null):T=k.sibling;var A=m(b,k,w[C],N);if(A===null){k===null&&(k=T);break}t&&k&&A.alternate===null&&e(b,k),y=i(A,y,C),S===null?j=A:S.sibling=A,S=A,k=T}if(C===w.length)return s(b,k),ft&&po(b,C),j;if(k===null){for(;C<w.length;C++)k=h(b,w[C],N),k!==null&&(y=i(k,y,C),S===null?j=k:S.sibling=k,S=k);return ft&&po(b,C),j}for(k=n(b,k);C<w.length;C++)T=f(k,b,C,w[C],N),T!==null&&(t&&T.alternate!==null&&k.delete(T.key===null?C:T.key),y=i(T,y,C),S===null?j=T:S.sibling=T,S=T);return t&&k.forEach(function(E){return e(b,E)}),ft&&po(b,C),j}function g(b,y,w,N){var j=Kc(w);if(typeof j!="function")throw Error(ie(150));if(w=j.call(w),w==null)throw Error(ie(151));for(var S=j=null,k=y,C=y=0,T=null,A=w.next();k!==null&&!A.done;C++,A=w.next()){k.index>C?(T=k,k=null):T=k.sibling;var E=m(b,k,A.value,N);if(E===null){k===null&&(k=T);break}t&&k&&E.alternate===null&&e(b,k),y=i(E,y,C),S===null?j=E:S.sibling=E,S=E,k=T}if(A.done)return s(b,k),ft&&po(b,C),j;if(k===null){for(;!A.done;C++,A=w.next())A=h(b,A.value,N),A!==null&&(y=i(A,y,C),S===null?j=A:S.sibling=A,S=A);return ft&&po(b,C),j}for(k=n(b,k);!A.done;C++,A=w.next())A=f(k,b,C,A.value,N),A!==null&&(t&&A.alternate!==null&&k.delete(A.key===null?C:A.key),y=i(A,y,C),S===null?j=A:S.sibling=A,S=A);return t&&k.forEach(function(L){return e(b,L)}),ft&&po(b,C),j}function x(b,y,w,N){if(typeof w=="object"&&w!==null&&w.type===Ol&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case jh:e:{for(var j=w.key,S=y;S!==null;){if(S.key===j){if(j=w.type,j===Ol){if(S.tag===7){s(b,S.sibling),y=a(S,w.props.children),y.return=b,b=y;break e}}else if(S.elementType===j||typeof j=="object"&&j!==null&&j.$$typeof===ri&&Jj(j)===S.type){s(b,S.sibling),y=a(S,w.props),y.ref=ed(b,S,w),y.return=b,b=y;break e}s(b,S);break}else e(b,S);S=S.sibling}w.type===Ol?(y=Ro(w.props.children,b.mode,N,w.key),y.return=b,b=y):(N=Dm(w.type,w.key,w.props,null,b.mode,N),N.ref=ed(b,y,w),N.return=b,b=N)}return o(b);case Ll:e:{for(S=w.key;y!==null;){if(y.key===S)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){s(b,y.sibling),y=a(y,w.children||[]),y.return=b,b=y;break e}else{s(b,y);break}else e(b,y);y=y.sibling}y=kg(w,b.mode,N),y.return=b,b=y}return o(b);case ri:return S=w._init,x(b,y,S(w._payload),N)}if(jd(w))return p(b,y,w,N);if(Kc(w))return g(b,y,w,N);Dh(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(s(b,y.sibling),y=a(y,w),y.return=b,b=y):(s(b,y),y=Ng(w,b.mode,N),y.return=b,b=y),o(b)):s(b,y)}return x}var pc=BT(!0),VT=BT(!1),cf=Xi(null),df=null,Hl=null,Mv=null;function Av(){Mv=Hl=df=null}function Pv(t){var e=cf.current;dt(cf),t._currentValue=e}function Nb(t,e,s){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===s)break;t=t.return}}function ac(t,e){df=t,Mv=Hl=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(fn=!0),t.firstContext=null)}function rr(t){var e=t._currentValue;if(Mv!==t)if(t={context:t,memoizedValue:e,next:null},Hl===null){if(df===null)throw Error(ie(308));Hl=t,df.dependencies={lanes:0,firstContext:t}}else Hl=Hl.next=t;return e}var No=null;function Dv(t){No===null?No=[t]:No.push(t)}function UT(t,e,s,n){var a=e.interleaved;return a===null?(s.next=s,Dv(e)):(s.next=a.next,a.next=s),e.interleaved=s,Ia(t,n)}function Ia(t,e){t.lanes|=e;var s=t.alternate;for(s!==null&&(s.lanes|=e),s=t,t=t.return;t!==null;)t.childLanes|=e,s=t.alternate,s!==null&&(s.childLanes|=e),s=t,t=t.return;return s.tag===3?s.stateNode:null}var ai=!1;function Rv(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function HT(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function Ta(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Si(t,e,s){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,qe&2){var a=n.pending;return a===null?e.next=e:(e.next=a.next,a.next=e),n.pending=e,Ia(t,s)}return a=n.interleaved,a===null?(e.next=e,Dv(n)):(e.next=a.next,a.next=e),n.interleaved=e,Ia(t,s)}function _m(t,e,s){if(e=e.updateQueue,e!==null&&(e=e.shared,(s&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,s|=n,e.lanes=s,yv(t,s)}}function Qj(t,e){var s=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,s===n)){var a=null,i=null;if(s=s.firstBaseUpdate,s!==null){do{var o={eventTime:s.eventTime,lane:s.lane,tag:s.tag,payload:s.payload,callback:s.callback,next:null};i===null?a=i=o:i=i.next=o,s=s.next}while(s!==null);i===null?a=i=e:i=i.next=e}else a=i=e;s={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},t.updateQueue=s;return}t=s.lastBaseUpdate,t===null?s.firstBaseUpdate=e:t.next=e,s.lastBaseUpdate=e}function uf(t,e,s,n){var a=t.updateQueue;ai=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,l=a.shared.pending;if(l!==null){a.shared.pending=null;var c=l,d=c.next;c.next=null,o===null?i=d:o.next=d,o=c;var u=t.alternate;u!==null&&(u=u.updateQueue,l=u.lastBaseUpdate,l!==o&&(l===null?u.firstBaseUpdate=d:l.next=d,u.lastBaseUpdate=c))}if(i!==null){var h=a.baseState;o=0,u=d=c=null,l=i;do{var m=l.lane,f=l.eventTime;if((n&m)===m){u!==null&&(u=u.next={eventTime:f,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var p=t,g=l;switch(m=e,f=s,g.tag){case 1:if(p=g.payload,typeof p=="function"){h=p.call(f,h,m);break e}h=p;break e;case 3:p.flags=p.flags&-65537|128;case 0:if(p=g.payload,m=typeof p=="function"?p.call(f,h,m):p,m==null)break e;h=Nt({},h,m);break e;case 2:ai=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,m=a.effects,m===null?a.effects=[l]:m.push(l))}else f={eventTime:f,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},u===null?(d=u=f,c=h):u=u.next=f,o|=m;if(l=l.next,l===null){if(l=a.shared.pending,l===null)break;m=l,l=m.next,m.next=null,a.lastBaseUpdate=m,a.shared.pending=null}}while(!0);if(u===null&&(c=h),a.baseState=c,a.firstBaseUpdate=d,a.lastBaseUpdate=u,e=a.shared.interleaved,e!==null){a=e;do o|=a.lane,a=a.next;while(a!==e)}else i===null&&(a.shared.lanes=0);Yo|=o,t.lanes=o,t.memoizedState=h}}function Xj(t,e,s){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],a=n.callback;if(a!==null){if(n.callback=null,n=s,typeof a!="function")throw Error(ie(191,a));a.call(n)}}}var sh={},Zr=Xi(sh),vu=Xi(sh),wu=Xi(sh);function ko(t){if(t===sh)throw Error(ie(174));return t}function Lv(t,e){switch(ot(wu,e),ot(vu,t),ot(Zr,sh),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:nb(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=nb(e,t)}dt(Zr),ot(Zr,e)}function xc(){dt(Zr),dt(vu),dt(wu)}function WT(t){ko(wu.current);var e=ko(Zr.current),s=nb(e,t.type);e!==s&&(ot(vu,t),ot(Zr,s))}function Ov(t){vu.current===t&&(dt(Zr),dt(vu))}var gt=Xi(0);function hf(t){for(var e=t;e!==null;){if(e.tag===13){var s=e.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||s.data==="$?"||s.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var gg=[];function Iv(){for(var t=0;t<gg.length;t++)gg[t]._workInProgressVersionPrimary=null;gg.length=0}var Tm=Ba.ReactCurrentDispatcher,bg=Ba.ReactCurrentBatchConfig,Go=0,wt=null,Qt=null,rs=null,mf=!1,Bd=!1,ju=0,WR=0;function Cs(){throw Error(ie(321))}function Fv(t,e){if(e===null)return!1;for(var s=0;s<e.length&&s<t.length;s++)if(!Mr(t[s],e[s]))return!1;return!0}function $v(t,e,s,n,a,i){if(Go=i,wt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,Tm.current=t===null||t.memoizedState===null?KR:JR,t=s(n,a),Bd){i=0;do{if(Bd=!1,ju=0,25<=i)throw Error(ie(301));i+=1,rs=Qt=null,e.updateQueue=null,Tm.current=QR,t=s(n,a)}while(Bd)}if(Tm.current=ff,e=Qt!==null&&Qt.next!==null,Go=0,rs=Qt=wt=null,mf=!1,e)throw Error(ie(300));return t}function zv(){var t=ju!==0;return ju=0,t}function $r(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return rs===null?wt.memoizedState=rs=t:rs=rs.next=t,rs}function ar(){if(Qt===null){var t=wt.alternate;t=t!==null?t.memoizedState:null}else t=Qt.next;var e=rs===null?wt.memoizedState:rs.next;if(e!==null)rs=e,Qt=t;else{if(t===null)throw Error(ie(310));Qt=t,t={memoizedState:Qt.memoizedState,baseState:Qt.baseState,baseQueue:Qt.baseQueue,queue:Qt.queue,next:null},rs===null?wt.memoizedState=rs=t:rs=rs.next=t}return rs}function Nu(t,e){return typeof e=="function"?e(t):e}function yg(t){var e=ar(),s=e.queue;if(s===null)throw Error(ie(311));s.lastRenderedReducer=t;var n=Qt,a=n.baseQueue,i=s.pending;if(i!==null){if(a!==null){var o=a.next;a.next=i.next,i.next=o}n.baseQueue=a=i,s.pending=null}if(a!==null){i=a.next,n=n.baseState;var l=o=null,c=null,d=i;do{var u=d.lane;if((Go&u)===u)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),n=d.hasEagerState?d.eagerState:t(n,d.action);else{var h={lane:u,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(l=c=h,o=n):c=c.next=h,wt.lanes|=u,Yo|=u}d=d.next}while(d!==null&&d!==i);c===null?o=n:c.next=l,Mr(n,e.memoizedState)||(fn=!0),e.memoizedState=n,e.baseState=o,e.baseQueue=c,s.lastRenderedState=n}if(t=s.interleaved,t!==null){a=t;do i=a.lane,wt.lanes|=i,Yo|=i,a=a.next;while(a!==t)}else a===null&&(s.lanes=0);return[e.memoizedState,s.dispatch]}function vg(t){var e=ar(),s=e.queue;if(s===null)throw Error(ie(311));s.lastRenderedReducer=t;var n=s.dispatch,a=s.pending,i=e.memoizedState;if(a!==null){s.pending=null;var o=a=a.next;do i=t(i,o.action),o=o.next;while(o!==a);Mr(i,e.memoizedState)||(fn=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),s.lastRenderedState=i}return[i,n]}function GT(){}function YT(t,e){var s=wt,n=ar(),a=e(),i=!Mr(n.memoizedState,a);if(i&&(n.memoizedState=a,fn=!0),n=n.queue,Bv(JT.bind(null,s,n,t),[t]),n.getSnapshot!==e||i||rs!==null&&rs.memoizedState.tag&1){if(s.flags|=2048,ku(9,KT.bind(null,s,n,a,e),void 0,null),cs===null)throw Error(ie(349));Go&30||qT(s,e,a)}return a}function qT(t,e,s){t.flags|=16384,t={getSnapshot:e,value:s},e=wt.updateQueue,e===null?(e={lastEffect:null,stores:null},wt.updateQueue=e,e.stores=[t]):(s=e.stores,s===null?e.stores=[t]:s.push(t))}function KT(t,e,s,n){e.value=s,e.getSnapshot=n,QT(e)&&XT(t)}function JT(t,e,s){return s(function(){QT(e)&&XT(t)})}function QT(t){var e=t.getSnapshot;t=t.value;try{var s=e();return!Mr(t,s)}catch{return!0}}function XT(t){var e=Ia(t,1);e!==null&&Sr(e,t,1,-1)}function Zj(t){var e=$r();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Nu,lastRenderedState:t},e.queue=t,t=t.dispatch=qR.bind(null,wt,t),[e.memoizedState,t]}function ku(t,e,s,n){return t={tag:t,create:e,destroy:s,deps:n,next:null},e=wt.updateQueue,e===null?(e={lastEffect:null,stores:null},wt.updateQueue=e,e.lastEffect=t.next=t):(s=e.lastEffect,s===null?e.lastEffect=t.next=t:(n=s.next,s.next=t,t.next=n,e.lastEffect=t)),t}function ZT(){return ar().memoizedState}function Em(t,e,s,n){var a=$r();wt.flags|=t,a.memoizedState=ku(1|e,s,void 0,n===void 0?null:n)}function Gp(t,e,s,n){var a=ar();n=n===void 0?null:n;var i=void 0;if(Qt!==null){var o=Qt.memoizedState;if(i=o.destroy,n!==null&&Fv(n,o.deps)){a.memoizedState=ku(e,s,i,n);return}}wt.flags|=t,a.memoizedState=ku(1|e,s,i,n)}function eN(t,e){return Em(8390656,8,t,e)}function Bv(t,e){return Gp(2048,8,t,e)}function eE(t,e){return Gp(4,2,t,e)}function tE(t,e){return Gp(4,4,t,e)}function sE(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function nE(t,e,s){return s=s!=null?s.concat([t]):null,Gp(4,4,sE.bind(null,e,t),s)}function Vv(){}function rE(t,e){var s=ar();e=e===void 0?null:e;var n=s.memoizedState;return n!==null&&e!==null&&Fv(e,n[1])?n[0]:(s.memoizedState=[t,e],t)}function aE(t,e){var s=ar();e=e===void 0?null:e;var n=s.memoizedState;return n!==null&&e!==null&&Fv(e,n[1])?n[0]:(t=t(),s.memoizedState=[t,e],t)}function iE(t,e,s){return Go&21?(Mr(s,e)||(s=uT(),wt.lanes|=s,Yo|=s,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,fn=!0),t.memoizedState=s)}function GR(t,e){var s=et;et=s!==0&&4>s?s:4,t(!0);var n=bg.transition;bg.transition={};try{t(!1),e()}finally{et=s,bg.transition=n}}function oE(){return ar().memoizedState}function YR(t,e,s){var n=Ti(t);if(s={lane:n,action:s,hasEagerState:!1,eagerState:null,next:null},lE(t))cE(e,s);else if(s=UT(t,e,s,n),s!==null){var a=Ws();Sr(s,t,n,a),dE(s,e,n)}}function qR(t,e,s){var n=Ti(t),a={lane:n,action:s,hasEagerState:!1,eagerState:null,next:null};if(lE(t))cE(e,a);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,l=i(o,s);if(a.hasEagerState=!0,a.eagerState=l,Mr(l,o)){var c=e.interleaved;c===null?(a.next=a,Dv(e)):(a.next=c.next,c.next=a),e.interleaved=a;return}}catch{}finally{}s=UT(t,e,a,n),s!==null&&(a=Ws(),Sr(s,t,n,a),dE(s,e,n))}}function lE(t){var e=t.alternate;return t===wt||e!==null&&e===wt}function cE(t,e){Bd=mf=!0;var s=t.pending;s===null?e.next=e:(e.next=s.next,s.next=e),t.pending=e}function dE(t,e,s){if(s&4194240){var n=e.lanes;n&=t.pendingLanes,s|=n,e.lanes=s,yv(t,s)}}var ff={readContext:rr,useCallback:Cs,useContext:Cs,useEffect:Cs,useImperativeHandle:Cs,useInsertionEffect:Cs,useLayoutEffect:Cs,useMemo:Cs,useReducer:Cs,useRef:Cs,useState:Cs,useDebugValue:Cs,useDeferredValue:Cs,useTransition:Cs,useMutableSource:Cs,useSyncExternalStore:Cs,useId:Cs,unstable_isNewReconciler:!1},KR={readContext:rr,useCallback:function(t,e){return $r().memoizedState=[t,e===void 0?null:e],t},useContext:rr,useEffect:eN,useImperativeHandle:function(t,e,s){return s=s!=null?s.concat([t]):null,Em(4194308,4,sE.bind(null,e,t),s)},useLayoutEffect:function(t,e){return Em(4194308,4,t,e)},useInsertionEffect:function(t,e){return Em(4,2,t,e)},useMemo:function(t,e){var s=$r();return e=e===void 0?null:e,t=t(),s.memoizedState=[t,e],t},useReducer:function(t,e,s){var n=$r();return e=s!==void 0?s(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=YR.bind(null,wt,t),[n.memoizedState,t]},useRef:function(t){var e=$r();return t={current:t},e.memoizedState=t},useState:Zj,useDebugValue:Vv,useDeferredValue:function(t){return $r().memoizedState=t},useTransition:function(){var t=Zj(!1),e=t[0];return t=GR.bind(null,t[1]),$r().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,s){var n=wt,a=$r();if(ft){if(s===void 0)throw Error(ie(407));s=s()}else{if(s=e(),cs===null)throw Error(ie(349));Go&30||qT(n,e,s)}a.memoizedState=s;var i={value:s,getSnapshot:e};return a.queue=i,eN(JT.bind(null,n,i,t),[t]),n.flags|=2048,ku(9,KT.bind(null,n,i,s,e),void 0,null),s},useId:function(){var t=$r(),e=cs.identifierPrefix;if(ft){var s=Ca,n=ka;s=(n&~(1<<32-Cr(n)-1)).toString(32)+s,e=":"+e+"R"+s,s=ju++,0<s&&(e+="H"+s.toString(32)),e+=":"}else s=WR++,e=":"+e+"r"+s.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},JR={readContext:rr,useCallback:rE,useContext:rr,useEffect:Bv,useImperativeHandle:nE,useInsertionEffect:eE,useLayoutEffect:tE,useMemo:aE,useReducer:yg,useRef:ZT,useState:function(){return yg(Nu)},useDebugValue:Vv,useDeferredValue:function(t){var e=ar();return iE(e,Qt.memoizedState,t)},useTransition:function(){var t=yg(Nu)[0],e=ar().memoizedState;return[t,e]},useMutableSource:GT,useSyncExternalStore:YT,useId:oE,unstable_isNewReconciler:!1},QR={readContext:rr,useCallback:rE,useContext:rr,useEffect:Bv,useImperativeHandle:nE,useInsertionEffect:eE,useLayoutEffect:tE,useMemo:aE,useReducer:vg,useRef:ZT,useState:function(){return vg(Nu)},useDebugValue:Vv,useDeferredValue:function(t){var e=ar();return Qt===null?e.memoizedState=t:iE(e,Qt.memoizedState,t)},useTransition:function(){var t=vg(Nu)[0],e=ar().memoizedState;return[t,e]},useMutableSource:GT,useSyncExternalStore:YT,useId:oE,unstable_isNewReconciler:!1};function yr(t,e){if(t&&t.defaultProps){e=Nt({},e),t=t.defaultProps;for(var s in t)e[s]===void 0&&(e[s]=t[s]);return e}return e}function kb(t,e,s,n){e=t.memoizedState,s=s(n,e),s=s==null?e:Nt({},e,s),t.memoizedState=s,t.lanes===0&&(t.updateQueue.baseState=s)}var Yp={isMounted:function(t){return(t=t._reactInternals)?rl(t)===t:!1},enqueueSetState:function(t,e,s){t=t._reactInternals;var n=Ws(),a=Ti(t),i=Ta(n,a);i.payload=e,s!=null&&(i.callback=s),e=Si(t,i,a),e!==null&&(Sr(e,t,a,n),_m(e,t,a))},enqueueReplaceState:function(t,e,s){t=t._reactInternals;var n=Ws(),a=Ti(t),i=Ta(n,a);i.tag=1,i.payload=e,s!=null&&(i.callback=s),e=Si(t,i,a),e!==null&&(Sr(e,t,a,n),_m(e,t,a))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var s=Ws(),n=Ti(t),a=Ta(s,n);a.tag=2,e!=null&&(a.callback=e),e=Si(t,a,n),e!==null&&(Sr(e,t,n,s),_m(e,t,n))}};function tN(t,e,s,n,a,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,i,o):e.prototype&&e.prototype.isPureReactComponent?!xu(s,n)||!xu(a,i):!0}function uE(t,e,s){var n=!1,a=zi,i=e.contextType;return typeof i=="object"&&i!==null?i=rr(i):(a=xn(e)?Ho:Rs.current,n=e.contextTypes,i=(n=n!=null)?mc(t,a):zi),e=new e(s,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Yp,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=a,t.__reactInternalMemoizedMaskedChildContext=i),e}function sN(t,e,s,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(s,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(s,n),e.state!==t&&Yp.enqueueReplaceState(e,e.state,null)}function Cb(t,e,s,n){var a=t.stateNode;a.props=s,a.state=t.memoizedState,a.refs={},Rv(t);var i=e.contextType;typeof i=="object"&&i!==null?a.context=rr(i):(i=xn(e)?Ho:Rs.current,a.context=mc(t,i)),a.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(kb(t,e,i,s),a.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof a.getSnapshotBeforeUpdate=="function"||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(e=a.state,typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount(),e!==a.state&&Yp.enqueueReplaceState(a,a.state,null),uf(t,s,a,n),a.state=t.memoizedState),typeof a.componentDidMount=="function"&&(t.flags|=4194308)}function gc(t,e){try{var s="",n=e;do s+=CD(n),n=n.return;while(n);var a=s}catch(i){a=` 39Error generating stack: `+i.message+` 40`+i.stack}return{value:t,source:e,stack:a,digest:null}}function wg(t,e,s){return{value:t,source:null,stack:s??null,digest:e??null}}function Sb(t,e){try{console.error(e.value)}catch(s){setTimeout(function(){throw s})}}var XR=typeof WeakMap=="function"?WeakMap:Map;function hE(t,e,s){s=Ta(-1,s),s.tag=3,s.payload={element:null};var n=e.value;return s.callback=function(){xf||(xf=!0,Ob=n),Sb(t,e)},s}function mE(t,e,s){s=Ta(-1,s),s.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var a=e.value;s.payload=function(){return n(a)},s.callback=function(){Sb(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(s.callback=function(){Sb(t,e),typeof n!="function"&&(_i===null?_i=new Set([this]):_i.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),s}function nN(t,e,s){var n=t.pingCache;if(n===null){n=t.pingCache=new XR;var a=new Set;n.set(e,a)}else a=n.get(e),a===void 0&&(a=new Set,n.set(e,a));a.has(s)||(a.add(s),t=hL.bind(null,t,e,s),e.then(t,t))}function rN(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function aN(t,e,s,n,a){return t.mode&1?(t.flags|=65536,t.lanes=a,t):(t===e?t.flags|=65536:(t.flags|=128,s.flags|=131072,s.flags&=-52805,s.tag===1&&(s.alternate===null?s.tag=17:(e=Ta(-1,1),e.tag=2,Si(s,e,1))),s.lanes|=1),t)}var ZR=Ba.ReactCurrentOwner,fn=!1;function zs(t,e,s,n){e.child=t===null?VT(e,null,s,n):pc(e,t.child,s,n)}function iN(t,e,s,n,a){s=s.render;var i=e.ref;return ac(e,a),n=$v(t,e,s,n,i,a),s=zv(),t!==null&&!fn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,Fa(t,e,a)):(ft&&s&&_v(e),e.flags|=1,zs(t,e,n,a),e.child)}function oN(t,e,s,n,a){if(t===null){var i=s.type;return typeof i=="function"&&!Jv(i)&&i.defaultProps===void 0&&s.compare===null&&s.defaultProps===void 0?(e.tag=15,e.type=i,fE(t,e,i,n,a)):(t=Dm(s.type,null,n,e,e.mode,a),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&a)){var o=i.memoizedProps;if(s=s.compare,s=s!==null?s:xu,s(o,n)&&t.ref===e.ref)return Fa(t,e,a)}return e.flags|=1,t=Ei(i,n),t.ref=e.ref,t.return=e,e.child=t}function fE(t,e,s,n,a){if(t!==null){var i=t.memoizedProps;if(xu(i,n)&&t.ref===e.ref)if(fn=!1,e.pendingProps=n=i,(t.lanes&a)!==0)t.flags&131072&&(fn=!0);else return e.lanes=t.lanes,Fa(t,e,a)}return _b(t,e,s,n,a)}function pE(t,e,s){var n=e.pendingProps,a=n.children,i=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},ot(Gl,kn),kn|=s;else{if(!(s&1073741824))return t=i!==null?i.baseLanes|s:s,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,ot(Gl,kn),kn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:s,ot(Gl,kn),kn|=n}else i!==null?(n=i.baseLanes|s,e.memoizedState=null):n=s,ot(Gl,kn),kn|=n;return zs(t,e,a,s),e.child}function xE(t,e){var s=e.ref;(t===null&&s!==null||t!==null&&t.ref!==s)&&(e.flags|=512,e.flags|=2097152)}
vendor: 5,244 bytes, line 40
40function _b(t,e,s,n,a){var i=xn(s)?Ho:Rs.current;return i=mc(e,i),ac(e,a),s=$v(t,e,s,n,i,a),n=zv(),t!==null&&!fn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a,Fa(t,e,a)):(ft&&n&&_v(e),e.flags|=1,zs(t,e,s,a),e.child)}function lN(t,e,s,n,a){if(xn(s)){var i=!0;af(e)}else i=!1;if(ac(e,a),e.stateNode===null)Mm(t,e),uE(e,s,n),Cb(e,s,n,a),n=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var c=o.context,d=s.contextType;typeof d=="object"&&d!==null?d=rr(d):(d=xn(s)?Ho:Rs.current,d=mc(e,d));var u=s.getDerivedStateFromProps,h=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==d)&&sN(e,o,n,d),ai=!1;var m=e.memoizedState;o.state=m,uf(e,n,o,a),c=e.memoizedState,l!==n||m!==c||pn.current||ai?(typeof u=="function"&&(kb(e,s,u,n),c=e.memoizedState),(l=ai||tN(e,s,l,n,m,c,d))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),o.props=n,o.state=c,o.context=d,n=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,HT(t,e),l=e.memoizedProps,d=e.type===e.elementType?l:yr(e.type,l),o.props=d,h=e.pendingProps,m=o.context,c=s.contextType,typeof c=="object"&&c!==null?c=rr(c):(c=xn(s)?Ho:Rs.current,c=mc(e,c));var f=s.getDerivedStateFromProps;(u=typeof f=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||m!==c)&&sN(e,o,n,c),ai=!1,m=e.memoizedState,o.state=m,uf(e,n,o,a);var p=e.memoizedState;l!==h||m!==p||pn.current||ai?(typeof f=="function"&&(kb(e,s,f,n),p=e.memoizedState),(d=ai||tN(e,s,d,n,m,p,c)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,p,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,p,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=p),o.props=n,o.state=p,o.context=c,n=d):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),n=!1)}return Tb(t,e,s,n,i,a)}function Tb(t,e,s,n,a,i){xE(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return a&&Yj(e,s,!1),Fa(t,e,i);n=e.stateNode,ZR.current=e;var l=o&&typeof s.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=pc(e,t.child,null,i),e.child=pc(e,null,l,i)):zs(t,e,l,i),e.memoizedState=n.state,a&&Yj(e,s,!0),e.child}function gE(t){var e=t.stateNode;e.pendingContext?Gj(t,e.pendingContext,e.pendingContext!==e.context):e.context&&Gj(t,e.context,!1),Lv(t,e.containerInfo)}function cN(t,e,s,n,a){return fc(),Ev(a),e.flags|=256,zs(t,e,s,n),e.child}var Eb={dehydrated:null,treeContext:null,retryLane:0};function Mb(t){return{baseLanes:t,cachePool:null,transitions:null}}function bE(t,e,s){var n=e.pendingProps,a=gt.current,i=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(a&2)!==0),l?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(a|=1),ot(gt,a&1),t===null)return jb(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,i?(n=e.mode,i=e.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Jp(o,n,0,null),t=Ro(t,n,s,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=Mb(s),e.memoizedState=Eb,t):Uv(e,o));if(a=t.memoizedState,a!==null&&(l=a.dehydrated,l!==null))return eL(t,e,o,n,l,a,s);if(i){i=n.fallback,o=e.mode,a=t.child,l=a.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&e.child!==a?(n=e.child,n.childLanes=0,n.pendingProps=c,e.deletions=null):(n=Ei(a,c),n.subtreeFlags=a.subtreeFlags&14680064),l!==null?i=Ei(l,i):(i=Ro(i,o,s,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,o=t.child.memoizedState,o=o===null?Mb(s):{baseLanes:o.baseLanes|s,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~s,e.memoizedState=Eb,n}return i=t.child,t=i.sibling,n=Ei(i,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=s),n.return=e,n.sibling=null,t!==null&&(s=e.deletions,s===null?(e.deletions=[t],e.flags|=16):s.push(t)),e.child=n,e.memoizedState=null,n}function Uv(t,e){return e=Jp({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Rh(t,e,s,n){return n!==null&&Ev(n),pc(e,t.child,null,s),t=Uv(e,e.pen
vendor: 8,390 bytes, line 40
40dingProps.children),t.flags|=2,e.memoizedState=null,t}function eL(t,e,s,n,a,i,o){if(s)return e.flags&256?(e.flags&=-257,n=wg(Error(ie(422))),Rh(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=n.fallback,a=e.mode,n=Jp({mode:"visible",children:n.children},a,0,null),i=Ro(i,a,o,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,e.mode&1&&pc(e,t.child,null,o),e.child.memoizedState=Mb(o),e.memoizedState=Eb,i);if(!(e.mode&1))return Rh(t,e,o,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(ie(419)),n=wg(i,n,void 0),Rh(t,e,o,n)}if(l=(o&t.childLanes)!==0,fn||l){if(n=cs,n!==null){switch(o&-o){case 4:a=2;break;case 16:a=8;break;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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Ia(t,a),Sr(n,t,a,-1))}return Kv(),n=wg(Error(ie(421))),Rh(t,e,o,n)}return a.data==="$?"?(e.flags|=128,e.child=t.child,e=mL.bind(null,t),a._reactRetry=e,null):(t=i.treeContext,Tn=Ci(a.nextSibling),En=e,ft=!0,jr=null,t!==null&&(Kn[Jn++]=ka,Kn[Jn++]=Ca,Kn[Jn++]=Wo,ka=t.id,Ca=t.overflow,Wo=e),e=Uv(e,n.children),e.flags|=4096,e)}function dN(t,e,s){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Nb(t.return,e,s)}function jg(t,e,s,n,a){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:s,tailMode:a}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=s,i.tailMode=a)}function yE(t,e,s){var n=e.pendingProps,a=n.revealOrder,i=n.tail;if(zs(t,e,n.children,s),n=gt.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&dN(t,s,e);else if(t.tag===19)dN(t,s,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(ot(gt,n),!(e.mode&1))e.memoizedState=null;else switch(a){case"forwards":for(s=e.child,a=null;s!==null;)t=s.alternate,t!==null&&hf(t)===null&&(a=s),s=s.sibling;s=a,s===null?(a=e.child,e.child=null):(a=s.sibling,s.sibling=null),jg(e,!1,a,s,i);break;case"backwards":for(s=null,a=e.child,e.child=null;a!==null;){if(t=a.alternate,t!==null&&hf(t)===null){e.child=a;break}t=a.sibling,a.sibling=s,s=a,a=t}jg(e,!0,s,null,i);break;case"together":jg(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function Mm(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Fa(t,e,s){if(t!==null&&(e.dependencies=t.dependencies),Yo|=e.lanes,!(s&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(ie(153));if(e.child!==null){for(t=e.child,s=Ei(t,t.pendingProps),e.child=s,s.return=e;t.sibling!==null;)t=t.sibling,s=s.sibling=Ei(t,t.pendingProps),s.return=e;s.sibling=null}return e.child}function tL(t,e,s){switch(e.tag){case 3:gE(e),fc();break;case 5:WT(e);break;case 1:xn(e.type)&&af(e);break;case 4:Lv(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,a=e.memoizedProps.value;ot(cf,n._currentValue),n._currentValue=a;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(ot(gt,gt.current&1),e.flags|=128,null):s&e.child.childLanes?bE(t,e,s):(ot(gt,gt.current&1),t=Fa(t,e,s),t!==null?t.sibling:null);ot(gt,gt.current&1);break;case 19:if(n=(s&e.childLanes)!==0,t.flags&128){if(n)return yE(t,e,s);e.flags|=128}if(a=e.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),ot(gt,gt.current),n)break;return null;case 22:case 23:return e.lanes=0,pE(t,e,s)}return Fa(t,e,s)}var vE,Ab,wE,jE;vE=function(t,e){for(var s=e.child;s!==null;){if(s.tag===5||s.tag===6)t.appendChild(s.stateNode);else if(s.tag!==4&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===e)break;for(;s.sibling===null;){if(s.return===null||s.return===e)return;s=s.return}s.sibling.return=s.return,s=s.sibling}};Ab=function(){};wE=function(t,e,s,n){var a=t.memoizedProps;if(a!==n){t=e.stateNode,ko(Zr.current);var i=null;switch(s){case"input":a=Z0(t,a),n=Z0(t,n),i=[];break;case"select":a=Nt({},a,{value:void 0}),n=Nt({},n,{value:void 0}),i=[];break;case"textarea":a=sb(t,a),n=sb(t,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=nf)}rb(s,n);var o;s=null;for(d in a)if(!n.hasOwnProperty(d)&&a.hasOwnProperty(d)&&a[d]!=null)if(d==="style"){var l=a[d];for(o in l)l.hasOwnProperty(o)&&(s||(s={}),s[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(cu.hasOwnProperty(d)?i||(i=[]):(i=i||[]).push(d,null));for(d in n){var c=n[d];if(l=a!=null?a[d]:void 0,n.hasOwnProperty(d)&&c!==l&&(c!=null||l!=null))if(d==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(s||(s={}),s[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(s||(s={}),s[o]=c[o])}else s||(i||(i=[]),i.push(d,s)),s=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(cu.hasOwnProperty(d)?(c!=null&&d==="onScroll"&<("scroll",t),i||l===c||(i=[])):(i=i||[]).push(d,c))}s&&(i=i||[]).push("style",s);var d=i;(e.updateQueue=d)&&(e.flags|=4)}};jE=function(t,e,s,n){s!==n&&(e.flags|=4)};function td(t,e){if(!ft)switch(t.tailMode){case"hidden":e=t.tail;for(var s=null;e!==null;)e.alternate!==null&&(s=e),e=e.sibling;s===null?t.tail=null:s.sibling=null;break;case"collapsed":s=t.tail;for(var n=null;s!==null;)s.alternate!==null&&(n=s),s=s.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Ss(t){var e=t.alternate!==null&&t.alternate.child===t.child,s=0,n=0;if(e)for(var a=t.child;a!==null;)s|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=t,a=a.sibling;else for(a=t.child;a!==null;)s|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=t,a=a.sibling;return t.subtreeFlags|=n,t.childLanes=s,e}function sL(t,e,s){var n=e.pendingProps;switch(Tv(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ss(e),null;case 1:return xn(e.type)&&rf(),Ss(e),null;case 3:return n=e.stateNode,xc(),dt(pn),dt(Rs),Iv(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Ph(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,jr!==null&&($b(jr),jr=null))),Ab(t,e),Ss(e),null;case 5:Ov(e);var a=ko(wu.current);if(s=e.type,t!==null&&e.stateNode!=null)wE(t,e,s,n,a),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(ie(166));return Ss(e),null}if(t=ko(Zr.current),Ph(e)){n=e.stateNode,s=e.type;var i=e.memoizedProps;switch(n[Wr]=e,n[yu]=i,t=(e.mode&1)!==0,s){case"dialog":lt("cancel",n),lt("close",n);break;case"iframe":case"object":case"embed":lt("load",n);break;case"video":case"audio":for(a=0;a<kd.length;a++)lt(kd[a],n);break;case"source":lt("error",n);break;case"img":case"image":case"link":lt("error",n),lt("load",n);break;case"details":lt("toggle",n);break;case"input":yj(n,i),lt("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},lt("invalid",n);break;case"textarea":wj(n,i),lt("invalid",n)}rb(s,i),a=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&Ah(n.textContent,l,t),a=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Ah(n.textContent,l,t),a=["children",""+l]):cu.hasOwnProperty(o)&&l!=null&&o==="onScroll"&<("scroll",n)}switch(s){case"input":Nh(n),vj(n,i,!0);break;case"textarea":Nh(n),jj(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=nf)}n=a,e.updateQueue=n,n!==null&&(e.flags|=4)}else{o=a.nodeType===9?a:a.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=J_(s)),t==="http://www.w3.org/1999/xhtml"?s==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>
40",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(s,{is:n.is}):(t=o.createElement(s),s==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,s),t[Wr]=e,t[yu]=n,vE(t,e,!1,!1),e.stateNode=t;e:{switch(o=ab(s,n),s){case"dialog":lt("cancel",t),lt("close",t),a=n;break;case"iframe":case"object":case"embed":lt("load",t),a=n;break;case"video":case"audio":for(a=0;a<kd.length;a++)lt(kd[a],t);a=n;break;case"source":lt("error",t),a=n;break;case"img":case"image":case"link":lt("error",t),lt("load",t),a=n;break;case"details":lt("toggle",t),a=n;break;case"input":yj(t,n),a=Z0(t,n),lt("invalid",t);break;case"option":a=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},a=Nt({},n,{value:void 0}),lt("invalid",t);break;case"textarea":wj(t,n),a=sb(t,n),lt("invalid",t);break;default:a=n}rb(s,a),l=a;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Z_(t,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Q_(t,c)):i==="children"?typeof c=="string"?(s!=="textarea"||c!=="")&&du(t,c):typeof c=="number"&&du(t,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(cu.hasOwnProperty(i)?c!=null&&i==="onScroll"&<("scroll",t):c!=null&&mv(t,i,c,o))}switch(s){case"input":Nh(t),vj(t,n,!1);break;case"textarea":Nh(t),jj(t);break;case"option":n.value!=null&&t.setAttribute("value",""+$i(n.value));break;case"select":t.multiple=!!n.multiple,i=n.value,i!=null?tc(t,!!n.multiple,i,!1):n.defaultValue!=null&&tc(t,!!n.multiple,n.defaultValue,!0);break;default:typeof a.onClick=="function"&&(t.onclick=nf)}switch(s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}return Ss(e),null;case 6:if(t&&e.stateNode!=null)jE(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(ie(166));if(s=ko(wu.current),ko(Zr.current),Ph(e)){if(n=e.stateNode,s=e.memoizedProps,n[Wr]=e,(i=n.nodeValue!==s)&&(t=En,t!==null))switch(t.tag){case 3:Ah(n.nodeValue,s,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Ah(n.nodeValue,s,(t.mode&1)!==0)}i&&(e.flags|=4)}else n=(s.nodeType===9?s:s.ownerDocument).createTextNode(n),n[Wr]=e,e.stateNode=n}return Ss(e),null;case 13:if(dt(gt),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(ft&&Tn!==null&&e.mode&1&&!(e.flags&128))zT(),fc(),e.flags|=98560,i=!1;else if(i=Ph(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(ie(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ie(317));i[Wr]=e}else fc(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Ss(e),i=!1}else jr!==null&&($b(jr),jr=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=s,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||gt.current&1?Xt===0&&(Xt=3):Kv())),e.updateQueue!==null&&(e.flags|=4),Ss(e),null);case 4:return xc(),Ab(t,e),t===null&&gu(e.stateNode.containerInfo),Ss(e),null;case 10:return Pv(e.type._context),Ss(e),null;case 17:return xn(e.type)&&rf(),Ss(e),null;case 19:if(dt(gt),i=e.memoizedState,i===null)return Ss(e),null;if(n=(e.flags&128)!==0,o=i.rendering,o===null)if(n)td(i,!1);else{if(Xt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=hf(t),o!==null){for(e.flags|=128,td(i,!1),n=o.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=s,s=e.child;s!==null;)i=s,t=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),s=s.sibling;return ot(gt,gt.current&1|2),e.child}t=t.sibling}i.tail!==null&&Rt()>bc&&(e.flags|=128,n=!0,td(i,!1),e.lanes=4194304)}else{if(!n)if(t=hf(o),t!==null){if(e.flags|=128,n=!0,s=t.updateQueue,s!==null&&(e.updateQueue=s,e.flags|=4),td(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!ft)return Ss(e),null}else 2*Rt()-i.renderingStartTime>bc&&s!==1073741824&&(e.flags|=128,n=!0,td(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(s=i.last,s!==null?s.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Rt(),e.sibling=null,s=gt.current,ot(gt,n?s&1|2:s&1),e):(Ss(e),null);case 22:case 23:return qv(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?kn&1073741824&&(Ss(e),e.subtreeFlags&6&&(e.flags|=8192)):Ss(e),null;case 24:return null;case 25:return null}throw Error(ie(156,e.tag))}function nL(t,e){switch(Tv(e),e.tag){case 1:return xn(e.type)&&rf(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;
vendor: 1,693 bytes, line 40
40case 3:return xc(),dt(pn),dt(Rs),Iv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Ov(e),null;case 13:if(dt(gt),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(ie(340));fc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return dt(gt),null;case 4:return xc(),null;case 10:return Pv(e.type._context),null;case 22:case 23:return qv(),null;case 24:return null;default:return null}}var Lh=!1,As=!1,rL=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Wl(t,e){var s=t.ref;if(s!==null)if(typeof s=="function")try{s(null)}catch(n){Et(t,e,n)}else s.current=null}function Pb(t,e,s){try{s()}catch(n){Et(t,e,n)}}var uN=!1;function aL(t,e){if(pb=ef,t=_T(),Sv(t)){if("selectionStart"in t)var s={start:t.selectionStart,end:t.selectionEnd};else e:{s=(s=t.ownerDocument)&&s.defaultView||window;var n=s.getSelection&&s.getSelection();if(n&&n.rangeCount!==0){s=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{s.nodeType,i.nodeType}catch{s=null;break e}var o=0,l=-1,c=-1,d=0,u=0,h=t,m=null;t:for(;;){for(var f;h!==s||a!==0&&h.nodeType!==3||(l=o+a),h!==i||n!==0&&h.nodeType!==3||(c=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(f=h.firstChild)!==null;)m=h,h=f;for(;;){if(h===t)break t;if(m===s&&++d===a&&(l=o),m===i&&++u===n&&(c=o),(f=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=f}s=l===-1||c===-1?null:{start:l,end:c}}else s=null}s=s||{start:0,end:0}}else s=null;for(xb={focusedElem:t,selectionRange:s},ef=!1,ge=e;ge!==null;)if(e=ge,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ge=t;else for(;ge!==null;){e=ge;try{var p=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;
vendor: 1,915 bytes, line 40
40case 1:if(p!==null){var g=p.memoizedProps,x=p.memoizedState,b=e.stateNode,y=b.getSnapshotBeforeUpdate(e.elementType===e.type?g:yr(e.type,g),x);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ie(163))}}catch(N){Et(e,e.return,N)}if(t=e.sibling,t!==null){t.return=e.return,ge=t;break}ge=e.return}return p=uN,uN=!1,p}function Vd(t,e,s){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&t)===t){var i=a.destroy;a.destroy=void 0,i!==void 0&&Pb(e,s,i)}a=a.next}while(a!==n)}}function qp(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var s=e=e.next;do{if((s.tag&t)===t){var n=s.create;s.destroy=n()}s=s.next}while(s!==e)}}function Db(t){var e=t.ref;if(e!==null){var s=t.stateNode;switch(t.tag){case 5:t=s;break;default:t=s}typeof e=="function"?e(t):e.current=t}}function NE(t){var e=t.alternate;e!==null&&(t.alternate=null,NE(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Wr],delete e[yu],delete e[yb],delete e[BR],delete e[VR])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function kE(t){return t.tag===5||t.tag===3||t.tag===4}function hN(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||kE(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Rb(t,e,s){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?s.nodeType===8?s.parentNode.insertBefore(t,e):s.insertBefore(t,e):(s.nodeType===8?(e=s.parentNode,e.insertBefore(t,s)):(e=s,e.a
vendor: 19,471 bytes, line 40
40ppendChild(t)),s=s._reactRootContainer,s!=null||e.onclick!==null||(e.onclick=nf));else if(n!==4&&(t=t.child,t!==null))for(Rb(t,e,s),t=t.sibling;t!==null;)Rb(t,e,s),t=t.sibling}function Lb(t,e,s){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?s.insertBefore(t,e):s.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(Lb(t,e,s),t=t.sibling;t!==null;)Lb(t,e,s),t=t.sibling}var ps=null,vr=!1;function qa(t,e,s){for(s=s.child;s!==null;)CE(t,e,s),s=s.sibling}function CE(t,e,s){if(Xr&&typeof Xr.onCommitFiberUnmount=="function")try{Xr.onCommitFiberUnmount(zp,s)}catch{}switch(s.tag){case 5:As||Wl(s,e);case 6:var n=ps,a=vr;ps=null,qa(t,e,s),ps=n,vr=a,ps!==null&&(vr?(t=ps,s=s.stateNode,t.nodeType===8?t.parentNode.removeChild(s):t.removeChild(s)):ps.removeChild(s.stateNode));break;case 18:ps!==null&&(vr?(t=ps,s=s.stateNode,t.nodeType===8?pg(t.parentNode,s):t.nodeType===1&&pg(t,s),fu(t)):pg(ps,s.stateNode));break;case 4:n=ps,a=vr,ps=s.stateNode.containerInfo,vr=!0,qa(t,e,s),ps=n,vr=a;break;case 0:case 11:case 14:case 15:if(!As&&(n=s.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Pb(s,e,o),a=a.next}while(a!==n)}qa(t,e,s);break;case 1:if(!As&&(Wl(s,e),n=s.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=s.memoizedProps,n.state=s.memoizedState,n.componentWillUnmount()}catch(l){Et(s,e,l)}qa(t,e,s);break;case 21:qa(t,e,s);break;case 22:s.mode&1?(As=(n=As)||s.memoizedState!==null,qa(t,e,s),As=n):qa(t,e,s);break;default:qa(t,e,s)}}function mN(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var s=t.stateNode;s===null&&(s=t.stateNode=new rL),e.forEach(function(n){var a=fL.bind(null,t,n);s.has(n)||(s.add(n),n.then(a,a))})}}function pr(t,e){var s=e.deletions;if(s!==null)for(var n=0;n<s.length;n++){var a=s[n];try{var i=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:ps=l.stateNode,vr=!1;break e;case 3:ps=l.stateNode.containerInfo,vr=!0;break e;case 4:ps=l.stateNode.containerInfo,vr=!0;break e}l=l.return}if(ps===null)throw Error(ie(160));CE(i,o,a),ps=null,vr=!1;var c=a.alternate;c!==null&&(c.return=null),a.return=null}catch(d){Et(a,e,d)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)SE(e,t),e=e.sibling}function SE(t,e){var s=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(pr(e,t),Rr(t),n&4){try{Vd(3,t,t.return),qp(3,t)}catch(g){Et(t,t.return,g)}try{Vd(5,t,t.return)}catch(g){Et(t,t.return,g)}}break;case 1:pr(e,t),Rr(t),n&512&&s!==null&&Wl(s,s.return);break;case 5:if(pr(e,t),Rr(t),n&512&&s!==null&&Wl(s,s.return),t.flags&32){var a=t.stateNode;try{du(a,"")}catch(g){Et(t,t.return,g)}}if(n&4&&(a=t.stateNode,a!=null)){var i=t.memoizedProps,o=s!==null?s.memoizedProps:i,l=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&q_(a,i),ab(l,o);var d=ab(l,i);for(o=0;o<c.length;o+=2){var u=c[o],h=c[o+1];u==="style"?Z_(a,h):u==="dangerouslySetInnerHTML"?Q_(a,h):u==="children"?du(a,h):mv(a,u,h,d)}switch(l){case"input":eb(a,i);break;case"textarea":K_(a,i);break;case"select":var m=a._wrapperState.wasMultiple;a._wrapperState.wasMultiple=!!i.multiple;var f=i.value;f!=null?tc(a,!!i.multiple,f,!1):m!==!!i.multiple&&(i.defaultValue!=null?tc(a,!!i.multiple,i.defaultValue,!0):tc(a,!!i.multiple,i.multiple?[]:"",!1))}a[yu]=i}catch(g){Et(t,t.return,g)}}break;case 6:if(pr(e,t),Rr(t),n&4){if(t.stateNode===null)throw Error(ie(162));a=t.stateNode,i=t.memoizedProps;try{a.nodeValue=i}catch(g){Et(t,t.return,g)}}break;case 3:if(pr(e,t),Rr(t),n&4&&s!==null&&s.memoizedState.isDehydrated)try{fu(e.containerInfo)}catch(g){Et(t,t.return,g)}break;case 4:pr(e,t),Rr(t);break;case 13:pr(e,t),Rr(t),a=t.child,a.flags&8192&&(i=a.memoizedState!==null,a.stateNode.isHidden=i,!i||a.alternate!==null&&a.alternate.memoizedState!==null||(Gv=Rt())),n&4&&mN(t);break;case 22:if(u=s!==null&&s.memoizedState!==null,t.mode&1?(As=(d=As)||u,pr(e,t),As=d):pr(e,t),Rr(t),n&8192){if(d=t.memoizedState!==null,(t.stateNode.isHidden=d)&&!u&&t.mode&1)for(ge=t,u=t.child;u!==null;){for(h=ge=u;ge!==null;){switch(m=ge,f=m.child,m.tag){case 0:case 11:case 14:case 15:Vd(4,m,m.return);break;case 1:Wl(m,m.return);var p=m.stateNode;if(typeof p.componentWillUnmount=="function"){n=m,s=m.return;try{e=n,p.props=e.memoizedProps,p.state=e.memoizedState,p.componentWillUnmount()}catch(g){Et(n,s,g)}}break;case 5:Wl(m,m.return);break;case 22:if(m.memoizedState!==null){pN(h);continue}}f!==null?(f.return=m,ge=f):pN(h)}u=u.sibling}e:for(u=null,h=t;;){if(h.tag===5){if(u===null){u=h;try{a=h.stateNode,d?(i=a.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=X_("display",o))}catch(g){Et(t,t.return,g)}}}else if(h.tag===6){if(u===null)try{h.stateNode.nodeValue=d?"":h.memoizedProps}catch(g){Et(t,t.return,g)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;u===h&&(u=null),h=h.return}u===h&&(u=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:pr(e,t),Rr(t),n&4&&mN(t);break;case 21:break;default:pr(e,t),Rr(t)}}function Rr(t){var e=t.flags;if(e&2){try{e:{for(var s=t.return;s!==null;){if(kE(s)){var n=s;break e}s=s.return}throw Error(ie(160))}switch(n.tag){case 5:var a=n.stateNode;n.flags&32&&(du(a,""),n.flags&=-33);var i=hN(t);Lb(t,i,a);break;case 3:case 4:var o=n.stateNode.containerInfo,l=hN(t);Rb(t,l,o);break;default:throw Error(ie(161))}}catch(c){Et(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function iL(t,e,s){ge=t,_E(t)}function _E(t,e,s){for(var n=(t.mode&1)!==0;ge!==null;){var a=ge,i=a.child;if(a.tag===22&&n){var o=a.memoizedState!==null||Lh;if(!o){var l=a.alternate,c=l!==null&&l.memoizedState!==null||As;l=Lh;var d=As;if(Lh=o,(As=c)&&!d)for(ge=a;ge!==null;)o=ge,c=o.child,o.tag===22&&o.memoizedState!==null?xN(a):c!==null?(c.return=o,ge=c):xN(a);for(;i!==null;)ge=i,_E(i),i=i.sibling;ge=a,Lh=l,As=d}fN(t)}else a.subtreeFlags&8772&&i!==null?(i.return=a,ge=i):fN(t)}}function fN(t){for(;ge!==null;){var e=ge;if(e.flags&8772){var s=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:As||qp(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!As)if(s===null)n.componentDidMount();else{var a=e.elementType===e.type?s.memoizedProps:yr(e.type,s.memoizedProps);n.componentDidUpdate(a,s.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&Xj(e,i,n);break;case 3:var o=e.updateQueue;if(o!==null){if(s=null,e.child!==null)switch(e.child.tag){case 5:s=e.child.stateNode;break;case 1:s=e.child.stateNode}Xj(e,o,s)}break;case 5:var l=e.stateNode;if(s===null&&e.flags&4){s=l;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&s.focus();break;case"img":c.src&&(s.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var d=e.alternate;if(d!==null){var u=d.memoizedState;if(u!==null){var h=u.dehydrated;h!==null&&fu(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ie(163))}As||e.flags&512&&Db(e)}catch(m){Et(e,e.return,m)}}if(e===t){ge=null;break}if(s=e.sibling,s!==null){s.return=e.return,ge=s;break}ge=e.return}}function pN(t){for(;ge!==null;){var e=ge;if(e===t){ge=null;break}var s=e.sibling;if(s!==null){s.return=e.return,ge=s;break}ge=e.return}}function xN(t){for(;ge!==null;){var e=ge;try{switch(e.tag){case 0:case 11:case 15:var s=e.return;try{qp(4,e)}catch(c){Et(e,s,c)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var a=e.return;try{n.componentDidMount()}catch(c){Et(e,a,c)}}var i=e.return;try{Db(e)}catch(c){Et(e,i,c)}break;case 5:var o=e.return;try{Db(e)}catch(c){Et(e,o,c)}}}catch(c){Et(e,e.return,c)}if(e===t){ge=null;break}var l=e.sibling;if(l!==null){l.return=e.return,ge=l;break}ge=e.return}}var oL=Math.ceil,pf=Ba.ReactCurrentDispatcher,Hv=Ba.ReactCurrentOwner,tr=Ba.ReactCurrentBatchConfig,qe=0,cs=null,Ut=null,vs=0,kn=0,Gl=Xi(0),Xt=0,Cu=null,Yo=0,Kp=0,Wv=0,Ud=null,dn=null,Gv=0,bc=1/0,wa=null,xf=!1,Ob=null,_i=null,Oh=!1,pi=null,gf=0,Hd=0,Ib=null,Am=-1,Pm=0;function Ws(){return qe&6?Rt():Am!==-1?Am:Am=Rt()}function Ti(t){return t.mode&1?qe&2&&vs!==0?vs&-vs:HR.transition!==null?(Pm===0&&(Pm=uT()),Pm):(t=et,t!==0||(t=window.event,t=t===void 0?16:bT(t.type)),t):1}function Sr(t,e,s,n){if(50<Hd)throw Hd=0,Ib=null,Error(ie(185));Zu(t,s,n),(!(qe&2)||t!==cs)&&(t===cs&&(!(qe&2)&&(Kp|=s),Xt===4&&di(t,vs)),gn(t,n),s===1&&qe===0&&!(e.mode&1)&&(bc=Rt()+500,Wp&&Zi()))}function gn(t,e){var s=t.callbackNode;HD(t,e);var n=Zm(t,t===cs?vs:0);if(n===0)s!==null&&Cj(s),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(s!=null&&Cj(s),e===1)t.tag===0?UR(gN.bind(null,t)):IT(gN.bind(null,t)),$R(function(){!(qe&6)&&Zi()}),s=null;else{switch(hT(n)){case 1:s=bv;break;case 4:s=cT;break;case 16:s=Xm;break;case 536870912:s=dT;break;default:s=Xm}s=LE(s,TE.bind(null,t))}t.callbackPriority=e,t.callbackNode=s}}function TE(t,e){if(Am=-1,Pm=0,qe&6)throw Error(ie(327));var s=t.callbackNode;if(ic()&&t.callbackNode!==s)return null;var n=Zm(t,t===cs?vs:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=bf(t,n);else{e=n;var a=qe;qe|=2;var i=ME();(cs!==t||vs!==e)&&(wa=null,bc=Rt()+500,Do(t,e));do try{dL();break}catch(l){EE(t,l)}while(!0);Av(),pf.current=i,qe=a,Ut!==null?e=0:(cs=null,vs=0,e=Xt)}if(e!==0){if(e===2&&(a=db(t),a!==0&&(n=a,e=Fb(t,a))),e===1)throw s=Cu,Do(t,0),di(t,n),gn(t,Rt()),s;if(e===6)di(t,n);else{if(a=t.current.alternate,!(n&30)&&!lL(a)&&(e=bf(t,n),e===2&&(i=db(t),i!==0&&(n=i,e=Fb(t,i))),e===1))throw s=Cu,Do(t,0),di(t,n),gn(t,Rt()),s;switch(t.finishedWork=a,t.finishedLanes=n,e){case 0:case 1:throw Error(ie(345));case 2:xo(t,dn,wa);break;case 3:if(di(t,n),(n&130023424)===n&&(e=Gv+500-Rt(),10<e)){if(Zm(t,0)!==0)break;if(a=t.suspendedLanes,(a&n)!==n){Ws(),t.pingedLanes|=t.suspendedLanes&a;break}t.timeoutHandle=bb(xo.bind(null,t,dn,wa),e);break}xo(t,dn,wa);break;case 4:if(di(t,n),(n&4194240)===n)break;for(e=t.eventTimes,a=-1;0<n;){var o=31-Cr(n);i=1<<o,o=e[o],o>a&&(a=o),n&=~i}if(n=a,n=Rt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*oL(n/1960))-n,10<n){t.timeoutHandle=bb(xo.bind(null,t,dn,wa),n);break}xo(t,dn,wa);break;case 5:xo(t,dn,wa);break;default:throw Error(ie(329))}}}return gn(t,Rt()),t.callbackNode===s?TE.bind(null,t):null}function Fb(t,e){var s=Ud;return t.current.memoizedState.isDehydrated&&(Do(t,e).flags|=256),t=bf(t,e),t!==2&&(e=dn,dn=s,e!==null&&$b(e)),t}function $b(t){dn===null?dn=t:dn.push.apply(dn,t)}function lL(t){for(var e=t;;){if(e.flags&16384){var s=e.updateQueue;if(s!==null&&(s=s.stores,s!==null))for(var n=0;n<s.length;n++){var a=s[n],i=a.getSnapshot;a=a.value;try{if(!Mr(i(),a))return!1}catch{return!1}}}if(s=e.child,e.subtreeFlags&16384&&s!==null)s.return=e,e=s;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function di(t,e){for(e&=~Wv,e&=~Kp,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var s=31-Cr(e),n=1<<s;t[s]=-1,e&=~n}}function gN(t){if(qe&6)throw Error(ie(327));ic();var e=Zm(t,0);if(!(e&1))return gn(t,Rt()),null;var s=bf(t,e);if(t.tag!==0&&s===2){var n=db(t);n!==0&&(e=n,s=Fb(t,n))}if(s===1)throw s=Cu,Do(t,0),di(t,e),gn(t,Rt()),s;if(s===6)throw Error(ie(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,xo(t,dn,wa),gn(t,Rt()),null}function Yv(t,e){var s=qe;qe|=1;try{return t(e)}finally{qe=s,qe===0&&(bc=Rt()+500,Wp&&Zi())}}function qo(t){pi!==null&&pi.tag===0&&!(qe&6)&&ic();var e=qe;qe|=1;var s=tr.transition,n=et;try{if(tr.transition=null,et=1,t)return t()}finally{et=n,tr.transition=s,qe=e,!(qe&6)&&Zi()}}function qv(){kn=Gl.current,dt(Gl)}function Do(t,e){t.finishedWork=null,t.finishedLanes=0;var s=t.timeoutHandle;if(s!==-1&&(t.timeoutHandle=-1,FR(s)),Ut!==null)for(s=Ut.return;s!==null;){var n=s;switch(Tv(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&rf();break;case 3:xc(),dt(pn),dt(Rs),Iv();break;case 5:Ov(n);break;case 4:xc();break;case 13:dt(gt);break;case 19:dt(gt);break;case 10:Pv(n.type._context);break;case 22:case 23:qv()}s=s.return}if(cs=t,Ut=t=Ei(t.current,null),vs=kn=e,Xt=0,Cu=null,Wv=Kp=Yo=0,dn=Ud=null,No!==null){for(e=0;e<No.length;e++)if(s=No[e],n=s.interleaved,n!==null){s.interleaved=null;var a=n.next,i=s.pending;if(i!==null){var o=i.next;i.next=a,n.next=o}s.pending=n}No=null}return t}function EE(t,e){do{var s=Ut;try{if(Av(),Tm.current=ff,mf){for(var n=wt.memoizedState;n!==null;){var a=n.queue;a!==null&&(a.pending=null),n=n.next}mf=!1}if(Go=0,rs=Qt=wt=null,Bd=!1,ju=0,Hv.current=null,s===null||s.return===null){Xt=1,Cu=e,Ut=null;break}e:{var i=t,o=s.return,l=s,c=e;if(e=vs,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,u=l,h=u.tag;if(!(u.mode&1)&&(h===0||h===11||h===15)){var m=u.alternate;m?(u.updateQueue=m.updateQueue,u.memoizedState=m.memoizedState,u.lanes=m.lanes):(u.updateQueue=null,u.memoizedState=null)}var f=rN(o);if(f!==null){f.flags&=-257,aN(f,o,l,i,e),f.mode&1&&nN(i,d,e),e=f,c=d;var p=e.updateQueue;if(p===null){var g=new Set;g.add(c),e.updateQueue=g}else p.add(c);break e}else{if(!(e&1)){nN(i,d,e),Kv();break e}c=Error(ie(426))}}else if(ft&&l.mode&1){var x=rN(o);if(x!==null){!(x.flags&65536)&&(x.flags|=256),aN(x,o,l,i,e),Ev(gc(c,l));break e}}i=c=gc(c,l),Xt!==4&&(Xt=2),Ud===null?Ud=[i]:Ud.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var b=hE(i,c,e);Qj(i,b);break e;case 1:l=c;var y=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof y.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(_i===null||!_i.has(w)))){i.flags|=65536,e&=-e,i.lanes|=e;var N=mE(i,l,e);Qj(i,N);break e}}i=i.return}while(i!==null)}PE(s)}catch(j){e=j,Ut===s&&s!==null&&(Ut=s=s.return);continue}break}while(!0)}function ME(){var t=pf.current;return pf.current=ff,t===null?ff:t}function Kv(){(Xt===0||Xt===3||Xt===2)&&(Xt=4),cs===null||!(Yo&268435455)&&!(Kp&268435455)||di(cs,vs)}function bf(t,e){var s=qe;qe|=2;var n=ME();(cs!==t||vs!==e)&&(wa=null,Do(t,e));do try{cL();break}catch(a){EE(t,a)}while(!0);if(Av(),qe=s,pf.current=n,Ut!==null)throw Error(ie(261));return cs=null,vs=0,Xt}function cL(){for(;Ut!==null;)AE(Ut)}function dL(){for(;Ut!==null&&!LD();)AE(Ut)}function AE(t){var e=RE(t.alternate,t,kn);t.memoizedProps=t.pendingProps,e===null?PE(t):Ut=e,Hv.current=null}function PE(t){var e=t;do{var s=e.alternate;if(t=e.return,e.flags&32768){if(s=nL(s,e),s!==null){s.flags&=32767,Ut=s;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Xt=6,Ut=null;return}}else if(s=sL(s,e,kn),s!==null){Ut=s;return}if(e=e.sibling,e!==null){Ut=e;return}Ut=e=t}while(e!==null);Xt===0&&(Xt=5)}function xo(t,e,s){var n=et,a=tr.transition;try{tr.transition=null,et=1,uL(t,e,s,n)}finally{tr.transition=a,et=n}return null}function uL(t,e,s,n){do ic();while(pi!==null);if(qe&6)throw Error(ie(327));s=t.finishedWork;var a=t.finishedLanes;if(s===null)return null;if(t.finishedWork=null,t.finishedLanes=0,s===t.current)throw Error(ie(177));t.callbackNode=null,t.callbackPriority=0;var i=s.lanes|s.childLanes;if(WD(t,i),t===cs&&(Ut=cs=null,vs=0),!(s.subtreeFlags&2064)&&!(s.flags&2064)||Oh||(Oh=!0,LE(Xm,function(){return ic(),null})),i=(s.flags&15990)!==0,s.subtreeFlags&15990||i){i=tr.transition,tr.transition=null;var o=et;et=1;var l=qe;qe|=4,Hv.current=null,aL(t,s),SE(s,t),AR(xb),ef=!!pb,xb=pb=null,t.current=s,iL(s),OD(),qe=l,et=o,tr.transition=i}else t.current=s;if(Oh&&(Oh=!1,pi=t,gf=a),i=t.pendingLanes,i===0&&(_i=null),$D(s.stateNode),gn(t,Rt()),e!==null)for(n=t.onRecoverableError,s=0;s<e.length;s++)a=e[s],n(a.value,{componentStack:a.stack,digest:a.digest});if(xf)throw xf=!1,t=Ob,Ob=null,t;return gf&1&&t.tag!==0&&ic(),i=t.pendingLanes,i&1?t===Ib?Hd++:(Hd=0,Ib=t):Hd=0,Zi(),null}function ic(){if(pi!==null){var t=hT(gf),e=tr.transition,s=et;try{if(tr.transition=null,et=16>t?16:t,pi===null)var n=!1;else{if(t=pi,pi=null,gf=0,qe&6)throw Error(ie(331));var a=qe;for(qe|=4,ge=t.current;ge!==null;){var i=ge,o=i.child;if(ge.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var d=l[c];for(ge=d;ge!==null;){var u=ge;switch(u.tag){case 0:case 11:case 15:Vd(8,u,i)}var h=u.child;if(h!==null)h.return=u,ge=h;else for(;ge!==null;){u=ge;var m=u.sibling,f=u.return;if(NE(u),u===d){ge=null;break}if(m!==null){m.return=f,ge=m;break}ge=f}}}var p=i.alternate;if(p!==null){var g=p.child;if(g!==null){p.child=null;do{var x=g.sibling;g.sibling=null,g=x}while(g!==null)}}ge=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,ge=o;else e:for(;ge!==null;){if(i=ge,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Vd(9,i,i.return)}var b=i.sibling;if(b!==null){b.return=i.return,ge=b;break e}ge=i.return}}var y=t.current;for(ge=y;ge!==null;){o=ge;var w=o.child;if(o.subtreeFlags&2064&&w!==null)w.return=o,ge=w;else e:for(o=y;ge!==null;){if(l=ge,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:qp(9,l)}}catch(j){Et(l,l.return,j)}if(l===o){ge=null;break e}var N=l.sibling;if(N!==null){N.return=l.return,ge=N;break e}ge=l.return}}if(qe=a,Zi(),Xr&&typeof Xr.onPostCommitFiberRoot=="function")try{Xr.onPostCommitFiberRoot(zp,t)}catch{}n=!0}return n}finally{et=s,tr.transition=e}}return!1}function bN(t,e,s){e=gc(s,e),e=hE(t,e,1),t=Si(t,e,1),e=Ws(),t!==null&&(Zu(t,1,e),gn(t,e))}function Et(t,e,s){if(t.tag===3)bN(t,t,s);else for(;e!==null;){if(e.tag===3){bN(e,t,s);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(_i===null||!_i.has(n))){t=gc(s,t),t=mE(e,t,1),e=Si(e,t,1),t=Ws(),e!==null&&(Zu(e,1,t),gn(e,t));break}}e=e.return}}function hL(t,e,s){var n=t.pingCache;n!==null&&n.delete(e),e=Ws(),t.pingedLanes|=t.suspendedLanes&s,cs===t&&(vs&s)===s&&(Xt===4||Xt===3&&(vs&130023424)===vs&&500>Rt()-Gv?Do(t,0):Wv|=s),gn(t,e)}function DE(t,e){e===0&&(t.mode&1?(e=Sh,Sh<<=1,!(Sh&130023424)&&(Sh=4194304)):e=1);var s=Ws();t=Ia(t,e),t!==null&&(Zu(t,e,s),gn(t,s))}function mL(t){var e=t.memoizedState,s=0;e!==null&&(s=e.retryLane),DE(t,s)}function fL(t,e){var s=0;switch(t.tag){case 13:var n=t.stateNode,a=t.memoizedState;a!==null&&(s=a.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(ie(314))}n!==null&&n.delete(e),DE(t,s)}var RE;RE=function(t,e,s){if(t!==null)if(t.memoizedProps!==e.pendingProps||pn.current)fn=!0;else{if(!(t.lanes&s)&&!(e.flags&128))return fn=!1,tL(t,e,s);fn=!!(t.flags&131072)}else fn=!1,ft&&e.flags&1048576&&FT(e,lf,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Mm(t,e),t=e.pendingProps;var a=mc(e,Rs.current);ac(e,s),a=$v(null,e,n,t,a,s);var i=zv();return e.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,xn(n)?(i=!0,af(e)):i=!1,e.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,Rv(e),a.updater=Yp,e.stateNode=a,a._reactInternals=e,Cb(e,n,t,s),e=Tb(null,e,n,!0,i,s)):(e.tag=0,ft&&i&&_v(e),zs(null,e,a,s),e=e.child),e;case 16:n=e.elementType;e:{switch(Mm(t,e),t=e.pendingProps,a=n._init,n=a(n._payload),e.type=n,a=e.tag=xL(n),t=yr(n,t),a){case 0:e=_b(null,e,n,t,s);break e;case 1:e=lN(null,e,n,t,s);break e;case 11:e=iN(null,e,n,t,s);break e;case 14:e=oN(null,e,n,yr(n.type,t),s);break e}throw Error(ie(306,n,""))}return e;case 0:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:yr
vendor: 1,200 bytes, line 40
40(n,a),_b(t,e,n,a,s);case 1:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:yr(n,a),lN(t,e,n,a,s);case 3:e:{if(gE(e),t===null)throw Error(ie(387));n=e.pendingProps,i=e.memoizedState,a=i.element,HT(t,e),uf(e,n,null,s);var o=e.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){a=gc(Error(ie(423)),e),e=cN(t,e,n,s,a);break e}else if(n!==a){a=gc(Error(ie(424)),e),e=cN(t,e,n,s,a);break e}else for(Tn=Ci(e.stateNode.containerInfo.firstChild),En=e,ft=!0,jr=null,s=VT(e,null,n,s),e.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling;else{if(fc(),n===a){e=Fa(t,e,s);break e}zs(t,e,n,s)}e=e.child}return e;case 5:return WT(e),t===null&&jb(e),n=e.type,a=e.pendingProps,i=t!==null?t.memoizedProps:null,o=a.children,gb(n,a)?o=null:i!==null&&gb(n,i)&&(e.flags|=32),xE(t,e),zs(t,e,o,s),e.child;case 6:return t===null&&jb(e),null;case 13:return bE(t,e,s);case 4:return Lv(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=pc(e,null,n,s):zs(t,e,n,s),e.child;case 11:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:yr
vendor: 1,450 bytes, line 40
40(n,a),iN(t,e,n,a,s);case 7:return zs(t,e,e.pendingProps,s),e.child;case 8:return zs(t,e,e.pendingProps.children,s),e.child;case 12:return zs(t,e,e.pendingProps.children,s),e.child;case 10:e:{if(n=e.type._context,a=e.pendingProps,i=e.memoizedProps,o=a.value,ot(cf,n._currentValue),n._currentValue=o,i!==null)if(Mr(i.value,o)){if(i.children===a.children&&!pn.current){e=Fa(t,e,s);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=Ta(-1,s&-s),c.tag=2;var d=i.updateQueue;if(d!==null){d=d.shared;var u=d.pending;u===null?c.next=c:(c.next=u.next,u.next=c),d.pending=c}}i.lanes|=s,c=i.alternate,c!==null&&(c.lanes|=s),Nb(i.return,s,e),l.lanes|=s;break}c=c.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(ie(341));o.lanes|=s,l=o.alternate,l!==null&&(l.lanes|=s),Nb(o,s,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}zs(t,e,a.children,s),e=e.child}return e;case 9:return a=e.type,n=e.pendingProps.children,ac(e,s),a=rr(a),n=n(a),e.flags|=1,zs(t,e,n,s),e.child;case 14:return n=e.type,a=yr(n,e.pendingProps),a=yr(n.type,a),oN(t,e,n,a,s);case 15:return fE(t,e,e.type,e.pendingProps,s);case 17:return n=e.type,a=e.pendingProps,a=e.elementType===n?a:yr
vendor: 11,075 bytes, lines 40-49
40(n,a),Mm(t,e),e.tag=1,xn(n)?(t=!0,af(e)):t=!1,ac(e,s),uE(e,n,a),Cb(e,n,a,s),Tb(null,e,n,!0,t,s);case 19:return yE(t,e,s);case 22:return pE(t,e,s)}throw Error(ie(156,e.tag))};function LE(t,e){return lT(t,e)}function pL(t,e,s,n){this.tag=t,this.key=s,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zn(t,e,s,n){return new pL(t,e,s,n)}function Jv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function xL(t){if(typeof t=="function")return Jv(t)?1:0;if(t!=null){if(t=t.$$typeof,t===pv)return 11;if(t===xv)return 14}return 2}function Ei(t,e){var s=t.alternate;return s===null?(s=Zn(t.tag,e,t.key,t.mode),s.elementType=t.elementType,s.type=t.type,s.stateNode=t.stateNode,s.alternate=t,t.alternate=s):(s.pendingProps=e,s.type=t.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=t.flags&14680064,s.childLanes=t.childLanes,s.lanes=t.lanes,s.child=t.child,s.memoizedProps=t.memoizedProps,s.memoizedState=t.memoizedState,s.updateQueue=t.updateQueue,e=t.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},s.sibling=t.sibling,s.index=t.index,s.ref=t.ref,s}function Dm(t,e,s,n,a,i){var o=2;if(n=t,typeof t=="function")Jv(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case Ol:return Ro(s.children,a,i,e);case fv:o=8,a|=8;break;case K0:return t=Zn(12,s,e,a|2),t.elementType=K0,t.lanes=i,t;case J0:return t=Zn(13,s,e,a),t.elementType=J0,t.lanes=i,t;case Q0:return t=Zn(19,s,e,a),t.elementType=Q0,t.lanes=i,t;case W_:return Jp(s,a,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case U_:o=10;break e;case H_:o=9;break e;case pv:o=11;break e;case xv:o=14;break e;case ri:o=16,n=null;break e}throw Error(ie(130,t==null?t:typeof t,""))}return e=Zn(o,s,e,a),e.elementType=t,e.type=n,e.lanes=i,e}function Ro(t,e,s,n){return t=Zn(7,t,n,e),t.lanes=s,t}function Jp(t,e,s,n){return t=Zn(22,t,n,e),t.elementType=W_,t.lanes=s,t.stateNode={isHidden:!1},t}function Ng(t,e,s){return t=Zn(6,t,null,e),t.lanes=s,t}function kg(t,e,s){return e=Zn(4,t.children!==null?t.children:[],t.key,e),e.lanes=s,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function gL(t,e,s,n,a){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=rg(0),this.expirationTimes=rg(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rg(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Qv(t,e,s,n,a,i,o,l,c){return t=new gL(t,e,s,l,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Zn(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:s,cache:null,transitions:null,pendingSuspenseBoundaries:null},Rv(i),t}function bL(t,e,s){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Ll,key:n==null?null:""+n,children:t,containerInfo:e,implementation:s}}function OE(t){if(!t)return zi;t=t._reactInternals;e:{if(rl(t)!==t||t.tag!==1)throw Error(ie(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(xn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(ie(171))}if(t.tag===1){var s=t.type;if(xn(s))return OT(t,s,e)}return e}function IE(t,e,s,n,a,i,o,l,c){return t=Qv(s,n,!0,t,a,i,o,l,c),t.context=OE(null),s=t.current,n=Ws(),a=Ti(s),i=Ta(n,a),i.callback=e??null,Si(s,i,a),t.current.lanes=a,Zu(t,a,n),gn(t,n),t}function Qp(t,e,s,n){var a=e.current,i=Ws(),o=Ti(a);return s=OE(s),e.context===null?e.context=s:e.pendingContext=s,e=Ta(i,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=Si(a,e,o),t!==null&&(Sr(t,a,o,i),_m(t,a,o)),o}function yf(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function yN(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var s=t.retryLane;t.retryLane=s!==0&&s<e?s:e}}function Xv(t,e){yN(t,e),(t=t.alternate)&&yN(t,e)}function yL(){return null}var FE=typeof reportError=="function"?reportError:function(t){console.error(t)};function Zv(t){this._internalRoot=t}Xp.prototype.render=Zv.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(ie(409));Qp(t,e,null,null)};Xp.prototype.unmount=Zv.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;qo(function(){Qp(null,t,null,null)}),e[Oa]=null}};function Xp(t){this._internalRoot=t}Xp.prototype.unstable_scheduleHydration=function(t){if(t){var e=pT();t={blockedOn:null,target:t,priority:e};for(var s=0;s<ci.length&&e!==0&&e<ci[s].priority;s++);ci.splice(s,0,t),s===0&&gT(t)}};function ew(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Zp(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function vN(){}function vL(t,e,s,n,a){if(a){if(typeof n=="function"){var i=n;n=function(){var d=yf(o);i.call(d)}}var o=IE(e,n,t,0,null,!1,!1,"",vN);return t._reactRootContainer=o,t[Oa]=o.current,gu(t.nodeType===8?t.parentNode:t),qo(),o}for(;a=t.lastChild;)t.removeChild(a);if(typeof n=="function"){var l=n;n=function(){var d=yf(c);l.call(d)}}var c=Qv(t,0,!1,null,null,!1,!1,"",vN);return t._reactRootContainer=c,t[Oa]=c.current,gu(t.nodeType===8?t.parentNode:t),qo(function(){Qp(e,c,s,n)}),c}function ex(t,e,s,n,a){var i=s._reactRootContainer;if(i){var o=i;if(typeof a=="function"){var l=a;a=function(){var c=yf(o);l.call(c)}}Qp(e,o,t,a)}else o=vL(s,e,t,a,n);return yf(o)}mT=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var s=Nd(e.pendingLanes);s!==0&&(yv(e,s|1),gn(e,Rt()),!(qe&6)&&(bc=Rt()+500,Zi()))}break;case 13:qo(function(){var n=Ia(t,1);if(n!==null){var a=Ws();Sr(n,t,1,a)}}),Xv(t,1)}};vv=function(t){if(t.tag===13){var e=Ia(t,134217728);if(e!==null){var s=Ws();Sr(e,t,134217728,s)}Xv(t,134217728)}};fT=function(t){if(t.tag===13){var e=Ti(t),s=Ia(t,e);if(s!==null){var n=Ws();Sr(s,t,e,n)}Xv(t,e)}};pT=function(){return et};xT=function(t,e){var s=et;try{return et=t,e()}finally{et=s}};ob=function(t,e,s){switch(e){case"input":if(eb(t,s),e=s.name,s.type==="radio"&&e!=null){for(s=t;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<s.length;e++){var n=s[e];if(n!==t&&n.form===t.form){var a=Hp(n);if(!a)throw Error(ie(90));Y_(n),eb(n,a)}}}break;case"textarea":K_(t,s);break;case"select":e=s.value,e!=null&&tc(t,!!s.multiple,e,!1)}};sT=Yv;nT=qo;var wL={usingClientEntryPoint:!1,Events:[th,zl,Hp,eT,tT,Yv]},sd={findFiberByHostInstance:jo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},jL={bundleType:sd.bundleType,version:sd.version,rendererPackageName:sd.rendererPackageName,rendererConfig:sd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Ba.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=iT(t),t===null?null:t.stateNode},findFiberByHostInstance:sd.findFiberByHostInstance||yL,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ih=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ih.isDisabled&&Ih.supportsFiber)try{zp=Ih.inject(jL),Xr=Ih}catch{}}$n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=wL;$n.createPortal=function(t,e){var s=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ew(e))throw Error(ie(200));return bL(t,e,null,s)};$n.createRoot=function(t,e){if(!ew(t))throw Error(ie(299));var s=!1,n="",a=FE;return e!=null&&(e.unstable_strictMode===!0&&(s=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(a=e.onRecoverableError)),e=Qv(t,1,!1,null,null,s,!1,n,a),t[Oa]=e.current,gu(t.nodeType===8?t.parentNode:t),new Zv(e)};$n.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(ie(188)):(t=Object.keys(t).join(","),Error(ie(268,t)));return t=iT(e),t=t===null?null:t.stateNode,t};$n.flushSync=function(t){return qo(t)};$n.hydrate=function(t,e,s){if(!Zp(e))throw Error(ie(200));return ex(null,t,e,!0,s)};$n.hydrateRoot=function(t,e,s){if(!ew(t))throw Error(ie(405));var n=s!=null&&s.hydratedSources||null,a=!1,i="",o=FE;if(s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(i=s.identifierPrefix),s.onRecoverableError!==void 0&&(o=s.onRecoverableError)),e=IE(e,null,t,1,s??null,a,!1,i,o),t[Oa]=e.current,gu(t),n)for(t=0;t<n.length;t++)s=n[t],a=s._getVersion,a=a(s._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[s,a]:e.mutableSourceEagerHydrationData.push(s,a);return new Xp(e)};$n.render=function(t,e,s){if(!Zp(e))throw Error(ie(200));return ex(null,t,e,!1,s)};$n.unmountComponentAtNode=function(t){if(!Zp(t))throw Error(ie(40));return t._reactRootContainer?(qo(function(){ex(null,null,t,!1,function(){t._reactRootContainer=null,t[Oa]=null})}),!0):!1};$n.unstable_batchedUpdates=Yv;$n.unstable_renderSubtreeIntoContainer=function(t,e,s,n){if(!Zp(s))throw Error(ie(200));if(t==null||t._reactInternals===void 0)throw Error(ie(38));return ex(t,e,s,!1,n)};$n.version="18.3.1-next-f1338f8080-20240426";function $E(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE($E)}catch(t){console.error(t)}}$E(),$_.exports=$n;var tx=$_.exports;const zE=__(tx);var wN=tx;Y0.createRoot=wN.createRoot,Y0.hydrateRoot=wN.hydrateRoot;/** 41 * @remix-run/router v1.23.2 42 * 43 * Copyright (c) Remix Software Inc. 44 * 45 * This source code is licensed under the MIT license found in the 46 * LICENSE.md file in the root directory of this source tree. 47 * 48 * @license MIT 49 */function Su(){return Su=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},Su.apply(this,arguments)}var xi;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(xi||(xi={}));const jN="popstate";function NL(t){t===void 0&&(t={});function e(n,a){let{pathname:i,search:o,hash:l}=n.location;return zb("",{pathname:i,search:o,hash:l},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}
vendor: 11,812 bytes, lines 49-58
49function s(n,a){return typeof a=="string"?a:vf(a)}return CL(e,s,null,t)}function jt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function tw(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function kL(){return Math.random().toString(36).substr(2,8)}function NN(t,e){return{usr:t.state,key:t.key,idx:e}}function zb(t,e,s,n){return s===void 0&&(s=null),Su({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Bc(e):e,{state:s,key:e&&e.key||n||kL()})}function vf(t){let{pathname:e="/",search:s="",hash:n=""}=t;return s&&s!=="?"&&(e+=s.charAt(0)==="?"?s:"?"+s),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Bc(t){let e={};if(t){let s=t.indexOf("#");s>=0&&(e.hash=t.substr(s),t=t.substr(0,s));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function CL(t,e,s,n){n===void 0&&(n={});let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,l=xi.Pop,c=null,d=u();d==null&&(d=0,o.replaceState(Su({},o.state,{idx:d}),""));function u(){return(o.state||{idx:null}).idx}function h(){l=xi.Pop;let x=u(),b=x==null?null:x-d;d=x,c&&c({action:l,location:g.location,delta:b})}function m(x,b){l=xi.Push;let y=zb(g.location,x,b);d=u()+1;let w=NN(y,d),N=g.createHref(y);try{o.pushState(w,"",N)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;a.location.assign(N)}i&&c&&c({action:l,location:g.location,delta:1})}function f(x,b){l=xi.Replace;let y=zb(g.location,x,b);d=u();let w=NN(y,d),N=g.createHref(y);o.replaceState(w,"",N),i&&c&&c({action:l,location:g.location,delta:0})}function p(x){let b=a.location.origin!=="null"?a.location.origin:a.location.href,y=typeof x=="string"?x:vf(x);return y=y.replace(/ $/,"%20"),jt(b,"No window.location.(origin|href) available to create URL for href: "+y),new URL(y,b)}let g={get action(){return l},get location(){return t(a,o)},listen(x){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(jN,h),c=x,()=>{a.removeEventListener(jN,h),c=null}},createHref(x){return e(a,x)},createURL:p,encodeLocation(x){let b=p(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:m,replace:f,go(x){return o.go(x)}};return g}var kN;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(kN||(kN={}));function SL(t,e,s){return s===void 0&&(s="/"),_L(t,e,s)}function _L(t,e,s,n){let a=typeof e=="string"?Bc(e):e,i=yc(a.pathname||"/",s);if(i==null)return null;let o=BE(t);TL(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let d=$L(i);l=IL(o[c],d)}return l}function BE(t,e,s,n){e===void 0&&(e=[]),s===void 0&&(s=[]),n===void 0&&(n="");let a=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(jt(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let d=Mi([n,c.relativePath]),u=s.concat(c);i.children&&i.children.length>0&&(jt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+d+'".')),BE(i.children,e,u,d)),!(i.path==null&&!i.index)&&e.push({path:d,score:LL(d,i.index),routesMeta:u})};return t.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))a(i,o);else for(let c of VE(i.path))a(i,o,c)}),e}function VE(t){let e=t.split("/");if(e.length===0)return[];let[s,...n]=e,a=s.endsWith("?"),i=s.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=VE(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),a&&l.push(...o),l.map(c=>t.startsWith("/")&&c===""?"/":c)}function TL(t){t.sort((e,s)=>e.score!==s.score?s.score-e.score:OL(e.routesMeta.map(n=>n.childrenIndex),s.routesMeta.map(n=>n.childrenIndex)))}const EL=/^:[\w-]+$/,ML=3,AL=2,PL=1,DL=10,RL=-2,CN=t=>t==="*";function LL(t,e){let s=t.split("/"),n=s.length;return s.some(CN)&&(n+=RL),e&&(n+=AL),s.filter(a=>!CN(a)).reduce((a,i)=>a+(EL.test(i)?ML:i===""?PL:DL),n)}function OL(t,e){return t.length===e.length&&t.slice(0,-1).every((n,a)=>n===e[a])?t[t.length-1]-e[e.length-1]:0}function IL(t,e,s){let{routesMeta:n}=t,a={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],d=l===n.length-1,u=i==="/"?e:e.slice(i.length)||"/",h=Bb({path:c.relativePath,caseSensitive:c.caseSensitive,end:d},u),m=c.route;if(!h)return null;Object.assign(a,h.params),o.push({params:a,pathname:Mi([i,h.pathname]),pathnameBase:HL(Mi([i,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(i=Mi([i,h.pathnameBase]))}return o}function Bb(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[s,n]=FL(t.path,t.caseSensitive,t.end),a=e.match(s);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),l=a.slice(1);return{params:n.reduce((d,u,h)=>{let{paramName:m,isOptional:f}=u;if(m==="*"){let g=l[h]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const p=l[h];return f&&!p?d[m]=void 0:d[m]=(p||"").replace(/%2F/g,"/"),d},{}),pathname:i,pathnameBase:o,pattern:t}}function FL(t,e,s){e===void 0&&(e=!1),s===void 0&&(s=!0),tw(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let n=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),n]}function $L(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return tw(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function yc(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let s=e.endsWith("/")?e.length-1:e.length,n=t.charAt(s);return n&&n!=="/"?null:t.slice(s)||"/"}const zL=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,BL=t=>zL.test(t);function VL(t,e){e===void 0&&(e="/");let{pathname:s,search:n="",hash:a=""}=typeof t=="string"?Bc(t):t,i;if(s)if(BL(s))i=s;else{if(s.includes("//")){let o=s;s=s.replace(/\/\/+/g,"/"),tw(!1,"Pathnames cannot have embedded double slashes - normalizing "+(o+" -> "+s))}s.startsWith("/")?i=SN(s.substring(1),"/"):i=SN(s,e)}else i=e;return{pathname:i,search:WL(n),hash:GL(a)}}function SN(t,e){let s=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?s.length>1&&s.pop():a!=="."&&s.push(a)}),s.length>1?s.join("/"):"/"}function Cg(t,e,s,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function UL(t){return t.filter((e,s)=>s===0||e.route.path&&e.route.path.length>0)}function sw(t,e){let s=UL(t);return e?s.map((n,a)=>a===s.length-1?n.pathname:n.pathnameBase):s.map(n=>n.pathnameBase)}function nw(t,e,s,n){n===void 0&&(n=!1);let a;typeof t=="string"?a=Bc(t):(a=Su({},t),jt(!a.pathname||!a.pathname.includes("?"),Cg("?","pathname","search",a)),jt(!a.pathname||!a.pathname.includes("#"),Cg("#","pathname","hash",a)),jt(!a.search||!a.search.includes("#"),Cg("#","search","hash",a)));let i=t===""||a.pathname==="",o=i?"/":a.pathname,l;if(o==null)l=s;else{let h=e.length-1;if(!n&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),h-=1;a.pathname=m.join("/")}l=h>=0?e[h]:"/"}let c=VL(a,l),d=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&s.endsWith("/");return!c.pathname.endsWith("/")&&(d||u)&&(c.pathname+="/"),c}const Mi=t=>t.join("/").replace(/\/\/+/g,"/"),HL=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),WL=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,GL=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function YL(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const UE=["post","put","patch","delete"];new Set(UE);const qL=["get",...UE];new Set(qL);/** 50 * React Router v6.30.3 51 * 52 * Copyright (c) Remix Software Inc. 53 * 54 * This source code is licensed under the MIT license found in the 55 * LICENSE.md file in the root directory of this source tree. 56 * 57 * @license MIT 58 */function _u(){return _u=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},_u.apply(this,arguments)}const sx=M.createContext(null),HE=M.createContext(null),Va=M.createContext(null),nx=M.createContext(null),da=M.createContext({outlet:null,matches:[],isDataRoute:!1}),WE=M.createContext(null);function KL(t,e){let{relative:s}=e===void 0?{}:e;Vc()||jt(!1);let{basename:n,navigator:a}=M.useContext(Va),{hash:i,pathname:o,search:l}=rx(t,{relative:s}),c=o;return n!=="/"&&(c=o==="/"?n:Mi([n,o])),a.createHref({pathname:c,search:l,hash:i})}function Vc(){return M.useContext(nx)!=null}function jn(){return Vc()||jt(!1),M.useContext(nx).location}function GE(t){M.useContext(Va).static||M.useLayoutEffect(t)}function Bn(){let{isDataRoute:t}=M.useContext(da);return t?dO():JL()}function JL(){Vc()||jt(!1);let t=M.useContext(sx),{basename:e,future:s,navigator:n}=M.useContext(Va),{matches:a}=M.useContext(da),{pathname:i}=jn(),o=JSON.stringify(sw(a,s.v7_relativeSplatPath)),l=M.useRef(!1);return GE(()=>{l.current=!0}),M.useCallback(function(d,u){if(u===void 0&&(u={}),!l.current)return;if(typeof d=="number"){n.go(d);return}let h=nw(d,JSON.parse(o),i,u.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Mi([e,h.pathname])),(u.replace?n.replace:n.push)(h,u.state,u)},[e,n,o,i,t])}const QL=M.createContext(null);function XL(t){let e=M.useContext(da).outlet;return e&&M.createElement(QL.Provider,{value:t},e)}function al(){let{matches:t}=M.useContext(da),e=t[t.length-1];return e?e.params:{}}function rx(t,e){let{relative:s}=e===void 0?{}:e,{future:n}=M.useContext(Va),{matches:a}=M.useContext(da),{pathname:i}=jn(),o=JSON.stringify(sw(a,n.v7_relativeSplatPath));return M.useMemo(()=>nw(t,JSON.parse(o),i,s==="path"),[t,o,i,s])}function ZL(t,e){return eO(t,e)}function eO(t,e,s,n){Vc()||jt(!1);let{navigator:a}=M.useContext(Va),{matches:i}=M.useContext(da),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let d=jn(),u;if(e){var h;let x=typeof e=="string"?Bc(e):e;c==="/"||(h=x.pathname)!=null&&h.startsWith(c)||jt(!1),u=x}else u=d;let m=u.pathname||"/",f=m;if(c!=="/"){let x=c.replace(/^\//,"").split("/");f="/"+m.replace(/^\//,"").split("/").slice(x.length).join("/")}let p=SL(t,{pathname:f}),g=aO(p&&p.map(x=>Object.assign({},x,{params:Object.assign({},l,x.params),pathname:Mi([c,a.encodeLocation?a.encodeLocation(x.pathname).pathname:x.pathname]),pathnameBase:x.pathnameBase==="/"?c:Mi([c,a.encodeLocation?a.encodeLocation(x.pathnameBase).pathname:x.pathnameBase])})),i,s,n);return e&&g?M.createElement(nx.Provider,{value:{location:_u({pathname:"/",search:"",hash:"",state:null,key:"default"},u),navigationType:xi.Pop}},g):g}function tO(){let t=cO(),e=YL(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),s=t instanceof Error?t.stack:null,a={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return M.createElement(M.Fragment,null,M.createElement("h2",null,"Unexpected Application
58Error!"),M.createElement("h3",{style:{fontStyle:"italic"}},e),s?M.createElement("pre",{style:a},s):null,null)}const sO=M.createElement(tO,null);class nO extends M.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,s){return s.location!==e.location||s.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:s.error,location:s.location,revalidation:e.revalidation||s.revalidation}}componentDidCatch(e,s){console.error("React Router caught the following error during render",e,s)}render(){return this.state.error!==void 0?M.createElement(da.Provider,{value:this.props.routeContext},M.createElement(WE.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rO(t){let{routeContext:e,match:s,children:n}=t,a=M.useContext(sx);return a&&a.static&&a.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=s.route.id),M.createElement(da.Provider,{value:e},n)}function aO(t,e,s,n){var a;if(e===void 0&&(e=[]),s===void 0&&(s=null),n===void 0&&(n=null),t==null){var i;if(!s)return null;if(s.errors)t=s.matches;else if((i=n)!=null&&i.v7_partialHydration&&e.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let o=t,l=(a=s)==null?void 0:a.errors;if(l!=null){let u=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);u>=0||jt(!1),o=o.slice(0,Math.min(o.length,u+1))}let c=!1,d=-1;if(s&&n&&n.v7_partialHydration)for(let u=0;u<o.length;u++){let h=o[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(d=u),h.route.id){let{loaderData:m,errors:f}=s,p=h.route.loader&&m[h.route.id]===void 0&&(!f||f[h.route.id]===void 0);if(h.route.lazy||p){c=!0,d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}return o.reduceRight((u,h,m)=>{let f,p=!1,g=null,x=null;s&&(f=l&&h.route.id?l[h.route.id]:void 0,g=h.route.errorElement||sO,c&&(d<0&&m===0?(uO("route-fallback"),p=!0,x=null):d===m&&(p=!0,x=h.route.hydrateFallbackElement||null)));let b=e.concat(o.slice(0,m+1)),y=()=>{let w;return f?w=g:p?w=x:h.route.Component?w=M.createElement(h.route.Component,null):h.route.element?w=h.route.element:w=u,M.createElement(rO,{match:h,routeContext:{outlet:u,matches:b,isDataRoute:s!=null},children:w})};return s&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?M.createElement(nO,{location:s.location,revalidation:s.revalidation,component:g,error:f,children:y(),routeC
58ontext:{outlet:null,matches:b,isDataRoute:!0}}):y()},null)}var YE=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(YE||{}),qE=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(qE||{});function iO(t){let e=M.useContext(sx);return e||jt(!1),e}function oO(t){let e=M.useContext(HE);return e||jt(!1),e}function lO(t){let e=M.useContext(da);return e||jt(!1),e}function KE(t){let e=lO(),s=e.matches[e.matches.length-1];return s.route.id||jt(!1),s.route.id}function cO(){var t;let e=M.useContext(WE),s=oO(),n=KE();return e!==void 0?e:(t=s.errors)==null?void 0:t[n]}function dO(){let{router:t}=iO(YE.UseNavigateStable),e=KE(qE.UseNavigateStable),s=M.useRef(!1);return GE(()=>{s.current=!0}),M.useCallback(function(a,i){i===void 0&&(i={}),s.current&&(typeof a=="number"?t.navigate(a):t.navigate(a,_u({fromRouteId:e},i)))},[t,e])}const _N={};function uO(t,e,s){_N[t]||(_N[t]=!0)}function hO(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function Mn(t){let{to:e,replace:s,state:n,relative:a}=t;Vc()||jt(!1);let{future:i,static:o}=M.useContext(Va),{matches:l}=M.useContext(da),{pathname:c}=jn(),d=Bn(),u=nw(e,sw(l,i.v7_relativeSplatPath),c,a==="path"),h=JSON.stringify(u);return M.useEffect(()=>d(JSON.parse(h),{replace:s,state:n,relative:a}),[d,h,a,s,n]),null}function JE(t){return XL(t.context)}function je(t){jt(!1)}function mO(t){let{basename:e="/",children:s=null,location:n,navigationType:a=xi.Pop,navigator:i,static:o=!1,future:l}=t;Vc()&&jt(!1);let c=e.replace(/^\/*/,"/"),d=M.useMemo(()=>({basename:c,navigator:i,static:o,future:_u({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=Bc(n));let{pathname:u="/",search:h="",hash:m="",state:f=null,key:p="default"}=n,g=M.useMemo(()=>{let x=yc(u,c);return x==null?null:{location:{pathname:x,search:h,hash:m,state:f,key:p},navigationType:a}},[c,u,h,m,f,p,a]);return g==null?null:M.createElement(Va.Provider,{value:d},M.createElement(nx.Provider,{children:s,value:g}))}function fO(t){let{children:e,location:s}=t;return ZL(Vb(e),s)}new Promise(()=>{});function Vb(t,e){e===void 0&&(e=[]);let s=[];return M.Children.forEach(t,(n,a)=>{if(!M.isValidElement(n))return;let i=[...e,a];if(n.type===M.Fragment){s.push.apply(s,Vb(n.props.children,i));return}n.type!==je&&jt(!1),!n.props.index||!n.props.children||jt(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Vb(n.props.children,i)),s.push(o)}),s}/** 59 * React Router DOM v6.30.3 60 * 61 * Copyright (c) Remix Software Inc. 62 * 63 * This source code is licensed under the MIT license found in the 64 * LICENSE.md file in the root directory of this source tree. 65 * 66 * @license MIT 67 */function wf(){return wf=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var s=arguments[e];for(var n in s)Object.prototype.hasOwnProperty.call(s,n)&&(t[n]=s[n])}return t},wf.apply(this,arguments)}function QE(t,e){if(t==null)return{};var s={},n=Object.keys(t),a,i;for(i=0;i<n.length;i++)a=n[i],!(e.indexOf(a)>=0)&&(s[a]=t[a]);return s}function pO(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function xO(t,e){return t.button===0&&(!e||e==="_self")&&!pO(t)}function Ub(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,s)=>{let n=t[s];return e.concat(Array.isArray(n)?n.map(a=>[s,a]):[[s,n]])},[]))}function gO(t,e){let s=Ub(t);return e&&e.forEach((n,a)=>
67{s.has(a)||e.getAll(a).forEach(i=>{s.append(a,i)})}),s}const bO=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],yO=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],vO="6";try{window.__reactRouterVersion=vO}catch{}const wO=M.createContext({isTransitioning:!1}),jO="startTransition",TN=dv[jO];function NO(t){let{basename:e,children:s,future:n,window:a}=t,i=M.useRef();i.current==null&&(i.current=NL({window:a,v5Compat:!0}));let o=i.current,[l,c]=M.useState({action:o.action,location:o.location}),{v7_startTransition:d}=n||{},u=M.useCallback(h=>{d&&TN?TN(()=>c(h)):c(h)},[c,d]);return M.useLayoutEffect(()=>o.listen(u),[o,u]),M.useEffect(()=>hO(n),[n]),M.createElement(mO,{basename:e,children:s,location:l.location,navigationType:l.action,navigator:o,future:n})}const kO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",CO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,K=M.forwardRef(function(e,s){let{onClick:n,relative:a,reloadDocument:i,replace:o,state:l,target:c,to:d,preventScrollReset:u,viewTransition:h}=e,m=QE(e,bO),{basename:f}=M.useContext(Va),p,g=!1;if(typeof d=="string"&&CO.test(d)&&(p=d,kO))try{let w=new URL(window.location.href),N=d.startsWith("//")?new URL(w.protocol+d):new URL(d),j=yc(N.pathname,f);N.origin===w.origin&&j!=null?d=j+N.search+N.hash:g=!0}catch{}let x=KL(d,{relative:a}),b=_O(d,{replace:o,state:l,target:c,preventScrollReset:u,relative:a,viewTransition:h});function y(w){n&&n(w),w.defaultPrevented||b(w)}return M.createElement("a",wf({},m,{href:p||x,onClick:g||i?n:y,ref:s,target:c}))}),il=M.forwardRef(function(e,s){let{"aria-current":n="page",caseSensitive:a=!1,className:i="",end:o=!1,style:l,to:c,viewTransition:d,children:u}=e,h=QE(e,yO),m=rx(c,{relative:h.relative}),f=jn(),p=M.useContext(HE),{navigator:g,basename:x}=M.useContext(Va),b=p!=null&&TO(m)&&d===!0,y=g.encodeLocation?g.encodeLocation(m).pathname:m.pathname,w=f.pathname,N=p&&p.navigation&&p.navigation.location?p.navigation.location.pathname:null;a||(w=w.toLowerCase(),N=N?N.toLowerCase():null,y=y.toLowerCase()),N&&x&&(N=yc(N,x)||N);const j=y!=="/"&&y.endsWith("/")?y.length-1:y.length;let S=w===y||!o&&w.startsWith(y)&&w.charAt(j)==="/",k=N!=null&&(N===y||!o&&N.startsWith(y)&&N.charAt(y.length)==="/"),C={isActive:S,isPending:k,isTransitioning:b},T=S?n:void 0,A;typeof i=="function"?A=i(C):A=[i,S?"active":null,k?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let E=typeof l=="function"?l(C):l;return M.createElement(K,wf({},h,{"aria-current":T,className:A,ref:s,style:E,to:c,viewTransition:d}),typeof u=="function"?u(C):u)});var Hb;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Hb||(Hb={}));var EN;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(EN||(EN={}));function SO(t){let e=M.useContext(sx);return e||jt(!1),e}function _O(t,e){let{target:s,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:l}=e===void 0?{}:e,c=Bn(),d=jn(),u=rx(t,{relative:o});return M.useCallback(h=>{if(xO(h,s)){h.preventDefault();let m=n!==void 0?n:vf(d)===vf(u);c(t,{replace:m,state:a,preventScrollReset:i,relative:o,viewTransition:l})}},[d,c,u,n,a,s,t,i,o,l])}function eo(t){let e=M.useRef(Ub(t)),s=M.useRef(!1),n=jn(),a=M.useMemo(()=>gO(n.search,s.current?null:e.current),[n.search]),i=Bn(),o=M.useCallback((l,c)=>{const d=Ub(typeof l=="function"?l(a):l);s.current=!0,i("?"+d,c)},[i,a]);return[a,o]}function TO(t,e){e===void 0&&(e={});let s=M.useContext(wO);s==null&&jt(!1);let{basename:n}=SO(Hb.useViewTransitionState),a=rx(t,{relative:e.relative});if(!s.isTransitioning)return!1;let i=yc(s.currentLocation.pathname,n)||s.currentLocation.pathname,o=yc(s.nextLocation.pathname,n)||s.nextLocation.pathname;return Bb(a.pathname,o)!=null||Bb(a.pathname,i)!=null}const Ae=t=>typeof t=="string",nd=()=>{let t,e;const s=new Promise((n,a)=>{t=n,e=a});return s.resolve=t,s.reject=e,s},MN=t=>t==null?"":""+t,EO=(t,e,s)=>{t.forEach(n=>{e[n]&&(s[n]=e[n])})},MO=/###/g,AN=t=>t&&t.indexOf("###")>-1?t.replace(MO,"."):t,PN=t=>!t||Ae(t),Wd=(t,e,s)=>{const n=Ae(e)?e.split("."):e;let a=0;for(;a<n.length-1;){if(PN(t))return{};const i=AN(n[a]);!t[i]&&s&&(t[i]=new s),Object.prototype.hasOwnProperty.call(t,i)?t=t[i]:t={},++a}return PN(t)?{}:{obj:t,k:AN(n[a])}},DN=(t,e,s)=>{const{obj:n,k:a}=Wd(t,e,Object);if(n!==void 0||e.length===1){n[a]=s;return}let i=e[e.length-1],o=e.slice(0,e.length-1),l=Wd(t,o,Object);for(;l.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),l=Wd(t,o,Object),l&&l.obj&&typeof l.obj[`${l.k}.${i}`]<"u"&&(l.obj=void 0);l.obj[`${l.k}.${i}`]=s},AO=(t,e,s,n)=>{const{obj:a,k:i}=Wd(t,e,Object);a[i]=a[i]||[],a[i].push(s)},jf=(t,e)=>{const{obj:s,k:n}=Wd(t,e);if(s)return s[n]},PO=(t,e,s)=>{const n=jf(t,s);return n!==void 0?n:jf(e,s)},XE=(t,e,s)=>{for(const n in e)n!=="__proto__"&&n!=="constructor"&&(n in t?Ae(t[n])||t[n]instanceof String||Ae(e[n])||e[n]instanceof String?s&&(t[n]=e[n]):XE(t[n],e[n],s):t[n]=e[n]);return t},bl=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var DO={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const RO=t=>Ae(t)?t.replace(/[&<>
67"'\/]/g,e=>DO[e]):t;class LO{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const s=this.regExpMap.get(e);if(s!==void 0)return s;const n=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,n),this.regExpQueue.push(e),n}}const OO=[" ",",","?","!",";"],IO=new LO(20),FO=(t,e,s)=>{e=e||"",s=s||"";const n=OO.filter(o=>e.indexOf(o)<0&&s.indexOf(o)<0);if(n.length===0)return!0;const a=IO.getRegExp(`(${n.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!a.test(t);if(!i){const o=t.indexOf(s);o>0&&!a.test(t.substring(0,o))&&(i=!0)}return i},Wb=function(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:".";if(!t)return;if(t[e])return t[e];const n=e.split(s);let a=t;for(let i=0;i<n.length;){if(!a||typeof a!="object")return;let o,l="";for(let c=i;c<n.length;++c)if(c!==i&&(l+=s),l+=n[c],o=a[l],o!==void 0){if(["string","number","boolean"].indexOf(typeof o)>-1&&c<n.length-1)continue;i+=c-i+1;break}a=o}return a},Nf=t=>t&&t.replace("_","-"),$O={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console&&console[t]&&console[t].apply(console,e)}};class kf{constructor(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.init(e,s)}init(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.prefix=s.prefix||"i18next:",this.logger=e||$O,this.options=s,this.debug=s.debug}log(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return this.forward(s,"log","",!0)}warn(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return this.forward(s,"warn","",!0)}error(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return this.forward(s,"error","")}deprecate(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return this.forward(s,"warn","WARNING DEPRECATED: ",!0)}forward(e,s,n,a){return a&&!this.debug?null:(Ae(e[0])&&(e[0]=`${n}${this.prefix} ${e[0]}`),this.logger[s](e))}create(e){return new kf(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new kf(this.logger,e)}}var qr=new kf;let ax=class{constructor(){this.observers={}}on(e,s){return e.split(" ").forEach(n=>{this.observers[n]||(this.observers[n]=new Map);const a=this.observers[n].get(s)||0;this.observers[n].set(s,a+1)}),this}off(e,s){if(this.observers[e]){if(!s){delete this.observers[e];return}this.observers[e].delete(s)}}emit(e){for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];this.observers[e]&&Array.from(this.observers[e].entries()).forEach(o=>{let[l,c]=o;for(let d=0;d<c;d++)l(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(o=>{let[l,c]=o;for(let d=0;d<c;d++)l.apply(l,[e,...n])})}};class RN extends ax{constructor(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const s=this.options.ns.indexOf(e);s>-1&&this.options.ns.splice(s,1)}getResource(e,s,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,o=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let l;e.indexOf(".")>-1?l=e.split("."):(l=[e,s],n&&(Array.isArray(n)?l.push(...n):Ae(n)&&i?l.push(...n.split(i)):l.push(n)));const c=jf(this.data,l);return!c&&!s&&!n&&e.indexOf(".")>-1&&(e=l[0],s=l[1],n=l.slice(2).join(".")),c||!o||!Ae(n)?c:Wb(this.data&&this.data[e]&&this.data[e][s],n,i)}addResource(e,s,n,a){let i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{silent:!1};const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let l=[e,s];
vendor: 1,644 bytes, line 67
67n&&(l=l.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(l=e.split("."),a=s,s=l[1]),this.addNamespaces(s),DN(this.data,l,a),i.silent||this.emit("added",e,s,n,a)}addResources(e,s,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{silent:!1};for(const i in n)(Ae(n[i])||Array.isArray(n[i]))&&this.addResource(e,s,i,n[i],{silent:!0});a.silent||this.emit("added",e,s,n)}addResourceBundle(e,s,n,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{silent:!1,skipCopy:!1},l=[e,s];e.indexOf(".")>-1&&(l=e.split("."),a=n,n=s,s=l[1]),this.addNamespaces(s);let c=jf(this.data,l)||{};o.skipCopy||(n=JSON.parse(JSON.stringify(n))),a?XE(c,n,i):c={...c,...n},DN(this.data,l,c),o.silent||this.emit("added",e,s,n)}removeResourceBundle(e,s){this.hasResourceBundle(e,s)&&delete this.data[e][s],this.removeNamespaces(s),this.emit("removed",e,s)}hasResourceBundle(e,s){return this.getResource(e,s)!==void 0}getResourceBundle(e,s){return s||(s=this.options.defaultNS),this.options.compatibilityAPI==="v1"?{...this.getResource(e,s)}:this.getResource(e,s)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const s=this.getDataByLanguage(e);return!!(s&&Object.keys(s)||[]).find(a=>s[a]&&Object.keys(s[a]).length>0)}toJSON(){return this.data}}var ZE={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,s,n,a){return t.forEach(i=>{this.processors[i]&&(e=this.processors[i].process(e,s,n,a))}),e}};const LN={};class Cf extends ax{constructor(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};super(),EO(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","
67i18nFormat","utils"],e,this),this.options=s,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=qr.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};if(e==null)return!1;const n=this.resolve(e,s);return n&&n.res!==void 0}extractFromKey(e,s){let n=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;n===void 0&&(n=":");const a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let i=s.ns||this.options.defaultNS||[];const o=n&&e.indexOf(n)>-1,l=!this.options.userDefinedKeySeparator&&!s.keySeparator&&!this.options.userDefinedNsSeparator&&!s.nsSeparator&&!FO(e,n,a);if(o&&!l){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:Ae(i)?[i]:i};const d=e.split(n);(n!==a||n===a&&this.options.ns.indexOf(d[0])>-1)&&(i=d.shift()),e=d.join(a)}return{key:e,namespaces:Ae(i)?[i]:i}}translate(e,s,n){if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),e==null)return"";Array.isArray(e)||(e=[String(e)]);const a=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:o,namespaces:l}=this.extractFromKey(e[e.length-1],s),c=l[l.length-1],d=s.lng||this.language,u=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d&&d.toLowerCase()==="cimode"){if(u){const N=s.nsSeparator||this.options.nsSeparator;return a?{res:`${c}${N}${o}`,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:`${c}${N}${o}`}return a?{res:o,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:c,usedParams:this.getUsedParamsDetails(s)}:o}const h=this.resolve(e,s);let m=h&&h.res;const f=h&&h.usedKey||o,p=h&&h.exactUsedKey||o,g=Object.prototype.toString.apply(m),x=["[object Number]","[object Function]","[object RegExp]"],b=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,y=!this.i18nFormat||this.i18nFormat.handleAsObject,w=!Ae(m)&&typeof m!="boolean"&&typeof m!="number";if(y&&m&&w&&x.indexOf(g)<0&&!(Ae(b)&&Array.isArray(m))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const N=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,m,{...s,ns:l}):`key '${o} (${this.language})' returned an object instead of string.`;return a?(h.res=N,h.usedParams=this.getUsedParamsDetails(s),h):N}if(i){const N=Array.isArray(m),j=N?[]:{},S=N?p:f;for(const k in m)if(Object.prototype.hasOwnProperty.call(m,k)){const C=`${S}${i}${k}`;j[k]=this.translate(C,{...s,joinArrays:!1,ns:l}),j[k]===C&&(j[k]=m[k])}m=j}}else if(y&&Ae(b)&&Array.isArray(m))m=m.join(b),m&&(m=this.extendTranslation(m,e,s,n));else{let N=!1,j=!1;const S=s.count!==void 0&&!Ae(s.count),k=Cf.hasDefaultValue(s),C=S?this.pluralResolver.getSuffix(d,s.count,s):"",T=s.ordinal&&S?this.pluralResolver.getSuffix(d,s.count,{ordinal:!1}):"",A=S&&!s.ordinal&&s.count===0&&this.pluralResolver.shouldUseIntlApi(),E=A&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${C}`]||s[`defaultValue${T}`]||s.defaultValue;!this.isValidLookup(m)&&k&&(N=!0,m=E),this.isValidLookup(m)||(j=!0,m=o);const D=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&j?void 0:m,P=k&&E!==m&&this.options.updateMissing;if(j||N||P){if(this.logger.log(P?"updateKey":"missingKey",d,c,o,P?E:m),i){const _=this.resolve(o,{...s,keySeparator:!1});_&&_.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let R=[];const $=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&$&&$[0])for(let _=0;_<$.length;_++)R.push($[_]);else this.options.saveMissingTo==="all"?R=this.languageUtils.toResolveHierarchy(s.lng||this.language):R.push(s.lng||this.language);const O=(_,B,J)=>{const Q=k&&J!==m?J:D;this.options.missingKeyHandler?this.options.missingKeyHandler(_,c,B,Q,P,s):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(_,c,B,Q,P,s),this.emit
vendor: 3,899 bytes, line 67
67("missingKey",_,c,B,m)};this.options.saveMissing&&(this.options.saveMissingPlurals&&S?R.forEach(_=>{const B=this.pluralResolver.getSuffixes(_,s);A&&s[`defaultValue${this.options.pluralSeparator}zero`]&&B.indexOf(`${this.options.pluralSeparator}zero`)<0&&B.push(`${this.options.pluralSeparator}zero`),B.forEach(J=>{O([_],o+J,s[`defaultValue${J}`]||E)})}):O(R,o,E))}m=this.extendTranslation(m,e,s,h,n),j&&m===o&&this.options.appendNamespaceToMissingKey&&(m=`${c}:${o}`),(j||N)&&this.options.parseMissingKeyHandler&&(this.options.compatibilityAPI!=="v1"?m=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${c}:${o}`:o,N?m:void 0):m=this.options.parseMissingKeyHandler(m))}return a?(h.res=m,h.usedParams=this.getUsedParamsDetails(s),h):m}extendTranslation(e,s,n,a,i){var o=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const d=Ae(e)&&(n&&n.interpolation&&n.interpolation.skipOnVariables!==void 0?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(d){const m=e.match(this.interpolator.nestingRegexp);u=m&&m.length}let h=n.replace&&!Ae(n.replace)?n.replace:n;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,n.lng||this.language||a.usedLng,n),d){const m=e.match(this.interpolator.nestingRegexp),f=m&&m.length;u<f&&(n.nest=!1)}!n.lng&&this.options.compatibilityAPI!=="v1"&&a&&a.res&&(n.lng=this.language||a.usedLng),n.nest!==!1&&(e=this.interpolator.nest(e,function(){for(var m=arguments.length,f=new Array(m),p=0;p<m;p++)f[p]=arguments[p];return i&&i[0]===f[0]&&!n.context?(o.logger.warn(`It seems you are nesting recursively key: ${f[0]} in key: ${s[0]}`),null):o.translate(...f,s)},n)),n.interpolation&&this.interpolator.reset()}const l=n.postProcess||this.options.postProcess,c=Ae(l)?[l]:l;return e!=null&&c&&c.length&&n.applyPostProcessor!==!1&&(e=ZE.handle(c,e,s,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(n)},...n}:n,this)),e}resolve(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n,a,i,o,l;return Ae(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(n))return;const d=this.extractFromKey(c,s),u=d.key;a=u;let h=d.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const m=s.count!==void 0&&!Ae(s.count),f=m&&!s.ordinal&&s.count===0&&this.pluralResolver.shouldUseIntlApi(),p=s.context!==void 0&&(Ae(s.context)||typeof s.context=="number")&&s.context!=="",g=s.lngs?s.lngs:this.languageUtils.toResolveHierarchy(s.lng||this.language,s.fallbackLng);h.forEach(x=>{this.isValidLookup(n)||(l=x,!LN[`${g[0]}-${x}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(l)&&(LN[`${g[0]}-${x}`]=!0,this.logger.warn(`key "${a}" for languages "${g.join(", ")}" won't get resolved as namespace "${l}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),g.forEach(b=>{if(this.isValidLookup(n))return;o=b;const y=[u];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(y,u,b,x,s);else{let N;m&&(N=this.pluralResolver.getSuffix(b,s.count,s));const j=`${this.options.pluralSeparator}zero`,S=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(m&&(y.push(u+N),s.ordinal&&N.indexOf(S)===0&&y.push(u+N.replace(S,this.options.pluralSeparator)),f&&y.push(u+j)),p){const k=`${u}${this.options.contextSeparator}
67${s.context}`;y.push(k),m&&(y.push(k+N),s.ordinal&&N.indexOf(S)===0&&y.push(k+N.replace(S,this.options.pluralSeparator)),f&&y.push(k+j))}}let w;for(;w=y.pop();)this.isValidLookup(n)||(i=w,n=this.getResource(b,x,w,s))}))})}),{res:n,usedKey:a,exactUsedKey:i,usedLng:o,usedNS:l}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,s,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,s,n,a):this.resourceStore.getResource(e,s,n,a)}getUsedParamsDetails(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};const s=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&!Ae(e.replace);let a=n?e.replace:e;if(n&&typeof e.count<"u"&&(a.count=e.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!n){a={...a};for(const i of s)delete a[i]}return a}static hasDefaultValue(e){const s="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&s===n.substring(0,s.length)&&e[n]!==void 0)return!0;return!1}}const Sg=t=>t.charAt(0).toUpperCase()+t.slice(1);class ON{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=qr.create("languageUtils")}getScriptPartFromCode(e){if(e=Nf(e),!e||e.indexOf("-")<0)return null;const s=e.split("-");return s.length===2||(s.pop(),s[s.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(s.join("-"))}getLanguagePartFromCode(e){if(e=Nf(e),!e||e.indexOf("-")<0)return e;const s=e.split("-");return this.formatLanguageCode(s[0])}formatLanguageCode(e){if(Ae(e)&&e.indexOf("-")>-1){if(typeof Intl<"u"&&typeof Intl.getCanonicalLocales<"u")try{let a=Intl.getCanonicalLocales(e)[0];if(a&&this.options.lowerCaseLng&&(a=a.toLowerCase()),a)return a}catch{}const s=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map(a=>a.toLowerCase()):n.length===2?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),s.indexOf(n[1].toLowerCase())>-1&&(n[1]=Sg(n[1].toLowerCase()))):n.length===3&&(n[0]=n[0].toLowerCase(),n[1].length===2&&(n[1]=n[1].toUpperCase()),n[0]!=="sgn"&&n[2].length===2&&(n[2]=n[2].toUpperCase()),s.indexOf(n[1].toLowerCase())>-1&&(n[1]=Sg(n[1].toLowerCase())),s.indexOf(n[2].toLowerCase())>-1&&(n[2]=Sg(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let s;return e.forEach(n=>{if(s)return;const a=this.formatLanguageCode(n);(!this.options.supportedLngs||this.isSupportedCode(a))&&(s=a)}),!s&&this.options.supportedLngs&&e.forEach(n=>{if(s)return;const a=this.getLanguagePartFromCode(n);if(this.isSupportedCode(a))return s=a;s=this.options.supportedLngs.find(i=>{if(i===a)return i;if(!(i.indexOf("-")<0&&a.indexOf("-")<0)&&(i.indexOf("-")>0&&a.indexOf("-")<0&&i.substring(0,i.indexOf("-"))===a||i.indexOf(a)===0&&a.length>1))return i})}),s||(s=this.getFallbackCodes(this.options.fallbackLng)[0]),s}getFallbackCodes(e,s){if(!e)return[];if(typeof e=="function"&&(e=e(s)),Ae(e)&&(e=[e]),Array.isArray(e))return e;if(!s)return e.default||[];let n=e[s];return n||(n=e[this.getScriptPartFromCode(s)]),n||(n=e[this.formatLanguageCode(s)]),n||(n=e[this.getLanguagePartFromCode(s)]),n||(n=e.default),n||[]}toResolveHierarchy(e,s){const n=this.getFallbackCodes(s||this.options.fallbackLng||[],e),a=[],i=o=>{o&&(this.isSupportedCode(o)?a.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return Ae(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):Ae(e)&&i(this.formatLanguageCode(e)),n.forEac
vendor: 4,125 bytes, line 67
67h(o=>{a.indexOf(o)<0&&i(this.formatLanguageCode(o))}),a}}let zO=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],BO={1:t=>+(t>1),2:t=>+(t!=1),3:t=>0,4:t=>t%10==1&&t%100!=11?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,5:t=>t==0?0:t==1?1:t==2?2:t%100>=3&&t%100<=10?3:t%100>=11?4:5,6:t=>t==1?0:t>=2&&t<=4?1:2,7:t=>t==1?0:t%10>=2&&t%10<=4&&(t%100<10||t%100>=20)?1:2,8:t=>t==1?0:t==2?1:t!=8&&t!=11?2:3,9:t=>+(t>=2),10:t=>t==1?0:t==2?1:t<7?2:t<11?3:4,11:t=>t==1||t==11?0:t==2||t==12?1:t>2&&t<20?2:3,12:t=>+(t%10!=1||t%100==11),13:t=>+(t!==0),14:t=>t==1?0:t==2?1:t==3?2:3,15:t=>t%10==1&&t%100!=11?0:t%10>=2&&(t%100<10||t%100>=20)?1:2,16:t=>t%10==1&&t%100!=11?0:t!==0?1:2,17:t=>t==1||t%10==1&&t%100!=11?0:1,18:t=>t==0?0:t==1?1:2,19:t=>t==1?0:t==0||t%100>1&&t%100<11?1:t%100>10&&t%100<20?2:3,20:t=>t==1?0:t==0||t%100>0&&t%100<20?1:2,21:t=>t%100==1?1:t%100==2?2:t%100==3||t%100==4?3:0,22:t=>t==1?0:t==2?1:(t<0||t>10)&&t%10==0?2:3};const VO=["v1","v2","v3"],UO=["v4"],IN={zero:0,one:1,two:2,few:3,many:4,other:5},HO=()=>{const t={};return zO.forEach(e=>{e.lngs.forEach(s=>{t[s]={numbers:e.nr,plurals:BO[e.fc]}})}),t};class WO{constructor(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.languageUtils=e,this.options=s,this.logger=qr.create("pluralResolver"),(!this.options.compatibilityJSON||UO.includes(this.options.compatibilityJSON))&&(typeof Intl>"u"||!Intl.PluralRules)&&(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=HO(),this.pluralRulesCache={}}addRule(e,s){this.rules[e]=s}clearCache(){this.pluralRulesCache={}}getRule(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.shouldUseIntlApi()){const n=Nf(e==="dev"?"en":e),a=s.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:n,type:a});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(n,{type:a})}catch{if(!e.match(/-|_/))return;const c=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(c,s)}return this.pluralRulesCache[i]=o,o}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(e,s);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,s){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return this.getSuffixes(e,n).map(a=>`${s}${a}`)}getSuffixes(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};const n=this.getRule(e,s);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort((a,i)=>IN[a]-IN[i]).map(a=>`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${a}
67`):n.numbers.map(a=>this.getSuffix(e,a,s)):[]}getSuffix(e,s){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const a=this.getRule(e,n);return a?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a.select(s)}`:this.getSuffixRetroCompatible(a,s):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,s){const n=e.noAbs?e.plurals(s):e.plurals(Math.abs(s));let a=e.numbers[n];this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1&&(a===2?a="plural":a===1&&(a=""));const i=()=>this.options.prepend&&a.toString()?this.options.prepend+a.toString():a.toString();return this.options.compatibilityJSON==="v1"?a===1?"":typeof a=="number"?`_plural_${a.toString()}`:i():this.options.compatibilityJSON==="v2"||this.options.simplifyPluralSuffix&&e.numbers.length===2&&e.numbers[0]===1?i():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!VO.includes(this.options.compatibilityJSON)}}const FN=function(t,e,s){let n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:".",a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,i=PO(t,e,s);return!i&&a&&Ae(s)&&(i=Wb(t,s,n),i===void 0&&(i=Wb(e,s,n))),i},_g=t=>t.replace(/\$/g,"$$$$");class GO{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qr.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(s=>s),this.init(e)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const{escape:s,escapeValue:n,useRawValueToEscape:a,prefix:i,prefixEscaped:o,suffix:l,suffixEscaped:c,formatSeparator:d,unescapeSuffix:u,unescapePrefix:h,nestingPrefix:m,nestingPrefixEscaped:f,nestingSuffix:p,nestingSuffixEscaped:g,nestingOptionsSeparator:x,maxReplaces:b,alwaysFormat:y}=e.interpolation;this.escape=s!==void 0?s:RO,this.escapeValue=n!==void 0?n:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=i?bl(i):o||"{{",this.suffix=l?bl(l):c||"}}",this.formatSeparator=d||",",this.unescapePrefix=u?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":u||"",this.nestingPrefix=m?bl(m):f||bl("$t("),this.nestingSuffix=p?bl(p):g||bl(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=b||1e3,this.alwaysFormat=y!==void 0?y:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(s,n)=>s&&s.source===n?(s.lastIndex=0,s):new RegExp(n,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}(.+?)${this.nestingSuffix}`)}interpolate(e,s,n,a){let i,o,l;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},d=f=>{if(f.indexOf(this.formatSeparator)<0){const b=FN(s,c,f,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(b,void 0,n,{...a,...s,interpolationkey:f}):b}const p=f.split(this.formatSeparator),g=p.shift().trim(),x=p.join(this.formatSeparator).trim();return this.format(FN(s,c,g,this.options.keySeparator,this.options.ignoreJSONStructure),x,n,{...a,...s,interpolationkey:g})};this.resetRegExp();const u=a&&a.missingInterpolationHandler||this.options.missingInterpolationHandler,h=a&&a.interpolation&&a.interpolation.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:f=>_g(f)},{regex:this.regexp,safeValue:f=>this.escapeValue?_g(this.escape(f)):_g(f)}].forEach(f=>{for(l=0;i=f.regex.exec(e);){const p=i[1].trim();if(o=d(p),o===void 0)if(typeof u=="function"){const x=u(e,i,a);o=Ae(x)?x:""}else if(a&&Object.prototype.hasOwnProperty.call(a,p))o="";else if(h){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${p} for interpolating ${e}`),o="";else!Ae(o)&&!this.useRawValueToEscape&&(o=MN(o));const g=f.safeValue(o);if(e=e.replace(i[0],g),h?(f.regex.lastIndex+=o.length,f.regex.lastIndex-=i[0].length):f.regex.lastIndex=0,l++,l>=this.maxReplaces)break}}),e}nest(e,s){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a,i,o;const l=(c,d)=>{const u=this.nestingOptionsSeparator;if(c.indexOf(u)<0)return c;const h=c.split(new RegExp(`${u}[ ]*{`));let m=`{${h[1]}`;c=h[0],m=this.interpolate(m,o);const f=m.match(/'/g),p=m.match(/"/g);(f&&f.length%2===0&&!p||p.length%2!==0)&&(m=m.replace(/'/g,'"'));try{o=JSON.parse(m),d&&(o={...d,...o})}catch(g){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,g),`${c}${u}${m}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,c};for(;a=this.nestingRegexp.exec(e);){let c=[];o={...n},o=o.replace&&!Ae(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let d=!1;if(a[0].indexOf(this.formatSeparator)!==-1&&!/{.*}/.test(a[1])){const u=a[1].split(this.formatSeparator).map(h=>h.trim());a[1]=u.shift(),c=u,d=!0}if(i=s(l.call(this,a[1].trim(),o),o),i&&a[0]===e&&!Ae(i))return i;Ae(i)||(i=MN(i)),i||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),i=""),d&&(i=c.reduce((u,h)=>this.format(u,h,n.lng,{...n,interpolationkey:a[1].trim()}),i.trim())),e=e.replace(a[0],i),this.regexp.lastIndex=0}return e}}const YO=t=>{let e=t.toLowerCase().trim();const s={};if(t.indexOf("(")>-1){const n=t.split("(");e=n[0].toLowerCase().trim();const a=n[1].substring(0,n[1].length-1);e==="currency"&&a.indexOf(":")<0?s.currency||(s.currency=a.trim()):e==="relativetime"&&a.indexOf(":")<0?s.range||(s.range=a.trim()):a.split(";").forEach(o=>{if(o){const[l,...c]=o.split(":"),d=c.join(":").trim().replace(/^'+|'+$/g,""),u=l.trim();s[u]||(s[u]=d),d==="false"&&(s[u]=!1),d==="true"&&(s[u]=!0),isNaN(d)||(s[u]=parseInt(d,10))}})}return{formatName:e,formatOptions:s}},yl=t=>{const e={};return(s,n,a)=>{let i=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(i={...i,[a.interpolationkey]:void 0});const o=n+JSON.stringify(i);let l=e[o];return l||(l=t(Nf(n),a),e[o]=l),l(s)}};class qO{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.logger=qr.create("formatter"),this.options=e,this.formats={number:yl((s,n)=>{const a=new Intl.NumberFormat(s,{...n});return i=>
vendor: 15,172 bytes, line 67
67a.format(i)}),currency:yl((s,n)=>{const a=new Intl.NumberFormat(s,{...n,style:"currency"});return i=>a.format(i)}),datetime:yl((s,n)=>{const a=new Intl.DateTimeFormat(s,{...n});return i=>a.format(i)}),relativetime:yl((s,n)=>{const a=new Intl.RelativeTimeFormat(s,{...n});return i=>a.format(i,n.range||"day")}),list:yl((s,n)=>{const a=new Intl.ListFormat(s,{...n});return i=>a.format(i)})},this.init(e)}init(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{interpolation:{}};this.formatSeparator=s.interpolation.formatSeparator||","}add(e,s){this.formats[e.toLowerCase().trim()]=s}addCached(e,s){this.formats[e.toLowerCase().trim()]=yl(s)}format(e,s,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};const i=s.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(l=>l.indexOf(")")>-1)){const l=i.findIndex(c=>c.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,l)].join(this.formatSeparator)}return i.reduce((l,c)=>{const{formatName:d,formatOptions:u}=YO(c);if(this.formats[d]){let h=l;try{const m=a&&a.formatParams&&a.formatParams[a.interpolationkey]||{},f=m.locale||m.lng||a.locale||a.lng||n;h=this.formats[d](l,f,{...u,...a,...m})}catch(m){this.logger.warn(m)}return h}else this.logger.warn(`there was no format function for ${d}`);return l},e)}}const KO=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class JO extends ax{constructor(e,s,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{};super(),this.backend=e,this.store=s,this.services=n,this.languageUtils=n.languageUtils,this.options=a,this.logger=qr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,a.backend,a)}queueLoad(e,s,n,a){const i={},o={},l={},c={};return e.forEach(d=>{let u=!0;s.forEach(h=>{const m=`${d}|${h}`;!n.reload&&this.store.hasResourceBundle(d,h)?this.state[m]=2:this.state[m]<0||(this.state[m]===1?o[m]===void 0&&(o[m]=!0):(this.state[m]=1,u=!1,o[m]===void 0&&(o[m]=!0),i[m]===void 0&&(i[m]=!0),c[h]===void 0&&(c[h]=!0)))}),u||(l[d]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(l),toLoadNamespaces:Object.keys(c)}}loaded(e,s,n){const a=e.split("|"),i=a[0],o=a[1];s&&this.emit("failedLoading",i,o,s),!s&&n&&this.store.addResourceBundle(i,o,n,void 0,void 0,{skipCopy:!0}),this.state[e]=s?-1:2,s&&n&&(this.state[e]=0);const l={};this.queue.forEach(c=>{AO(c.loaded,[i],o),KO(c,e),s&&c.errors.push(s),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(d=>{l[d]||(l[d]={});const u=c.loaded[d];u.length&&u.forEach(h=>{l[d][h]===void 0&&(l[d][h]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",l),this.queue=this.queue.filter(c=>!c.done)}read(e,s,n){let a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0,i=arguments.length>4&&arguments[4]!==void 0?arguments[4]:this.retryTimeout,o=arguments.length>5?arguments[5]:void 0;if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:s,fcName:n,tried:a,wait:i,callback:o});return}this.readingCalls++;const l=(d,u)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(d&&u&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,e,s,n,a+1,i*2,o)},i);return}o(d,u)},c=this.backend[n].bind(this.backend);if(c.length===2){try{const d=c(e,s);d&&typeof d.then=="function"?d.then(u=>l(null,u)).catch(l):l(null,d)}catch(d){l(d)}return}return c(e,s,l)}prepareLoading(e,s){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},a=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();Ae(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Ae(s)&&(s=[s]);const i=this.queueLoad(e,s,n,a);if(!i.toLoad.length)return i.pending.length||a(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,s,n){this.prepareLoading(e,s,{},n)}reload(e,s,n){this.prepareLoading(e,s,{reload:!0},n)}loadOne(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";const n=e.split("|"),a=n[0],i=n[1];this.read(a,i,"read",void 0,void 0,(o,l)=>{o&&this.logger.warn(`${s}loading namespace ${i} for language ${a} failed`,o),!o&&l&&this.logger.log(`${s}loaded namespace ${i} for language ${a}`,l),this.loaded(e,o,l)})}saveMissing(e,s,n,a,i){let o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:{},l=arguments.length>6&&arguments[6]!==void 0?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(s)){this.logger.warn(`did not save key "${n}" as the namespace "${s}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(n==null||n==="")){if(this.backend&&this.backend.create){const c={...o,isUpdate:i},d=this.backend.create.bind(this.backend);if(d.length<6)try{let u;d.length===5?u=d(e,s,n,a,c):u=d(e,s,n,a),u&&typeof u.then=="function"?u.then(h=>l(null,h)).catch(l):l(null,u)}catch(u){l(u)}else d(e,s,n,a,l,c)}!e||!e[0]||this.store.addResource(e[0],s,n,a)}}}const $N=()=>({debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Ae(t[1])&&(e.defaultValue=t[1]),Ae(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const s=t[3]||t[2];Object.keys(s).forEach(n=>{e[n]=s[n]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}),zN=t=>(Ae(t.ns)&&(t.ns=[t.ns]),Ae(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Ae(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs&&t.supportedLngs.indexOf("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),t),Fh=()=>{},QO=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(s=>{typeof t[s]=="function"&&(t[s]=t[s].bind(t))})};class Tu extends ax{constructor(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;if(super(),this.options=zN(e),this.services={},this.logger=qr,this.modules={external:[]},QO(this),s&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,s),this;setTimeout(()=>{this.init(e,s)},0)}}init(){var e=this;let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;this.isInitializing=!0,typeof s=="function"&&(n=s,s={}),!s.defaultNS&&s.defaultNS!==!1&&s.ns&&(Ae(s.ns)?s.defaultNS=s.ns:s.ns.indexOf("translation")<0&&(s.defaultNS=s.ns[0]));const a=$N();this.options={...a,...this.options,...zN(s)},this.options.compatibilityAPI!=="v1"&&(this.options.interpolation={...a.interpolation,...this.options.interpolation}),s.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=s.keySeparator),s.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=s.nsSeparator);const i=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?qr.init(i(this.modules.logger),this.options):qr.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:typeof Intl<"u"&&(u=qO);const h=new ON(this.options);this.store=new RN(this.options.resources,this.options);const m=this.services;m.logger=qr,m.resourceStore=this.store,m.languageUtils=h,m.pluralResolver=new WO(h,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),u&&(!this.options.interpolation.format||this.options.interpolation.format===a.interpolation.format)&&(m.formatter=i(u),m.formatter.init(m,this.options),this.options.interpolation.format=m.formatter.format.bind(m.formatter)),m.interpolator=new GO(this.options),m.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},m.backendConnector=new JO(i(this.modules.backend),m.resourceStore,m,this.options),m.backendConnector.on("*",function(f){for(var p=arguments.length,g=new Array(p>1?p-1:0),x=1;x<p;x++)g[x-1]=arguments[x];e.emit(f,...g)}),this.modules.languageDetector&&(m.languageDetector=i(this.modules.languageDetector),m.languageDetector.init&&m.languageDetector.init(m,this.options.detection,this.options)),this.modules.i18nFormat&&(m.i18nFormat=i(this.modules.i18nFormat),m.i18nFormat.init&&m.i18nFormat.init(this)),this.translator=new Cf(this.services,this.options),this.translator.on("*",function(f){for(var p=arguments.length,g=new Array(p>1?p-1:0),x=1;x<p;x++)g[x-1]=arguments[x];e.emit(f,...g)}),this.modules.external.forEach(f=>{f.init&&f.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Fh),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=function(){return e.store[u](...arguments)}}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=function(){return e.store[u](...arguments),e}});const c=nd(),d=()=>{const u=(h,m)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(m),n(h,m)};if(this.languages&&this.options.compatibilityAPI!=="v1"&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initImmediate?d():setTimeout(d,0),c}loadResources(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fh;const a=Ae(e)?e:this.language;if(typeof e=="function"&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(a&&a.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return n();const i=[],o=l=>{if(!l||l==="cimode")return;this.services.languageUtils.toResolveHierarchy(l).forEach(d=>{d!=="cimode"&&i.indexOf(d)<0&&i.push(d)})};a?o(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>o(c)),this.options.preload&&this.options.preload.forEach(l=>o(l)),this.services.backendConnector.load(i,this.options.ns,l=>{!l&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),n(l)})}else n(null)}reloadResources(e,s,n){const a=nd();return typeof e=="function"&&(n=e,e=void 0),typeof s=="function"&&(n=s,s=void 0),e||(e=this.languages),s||(s=this.options.ns),n||(n=Fh),this.services.backendConnector.reload(e,s,i=>{a.resolve(),n(i)}),a}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&ZE.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1))for(let s=0;s<this.languages.length;s++){const n=this.languages[s];if(!(["cimode","dev"].indexOf(n)>-1)&&this.store.hasLanguageSomeTranslations(n)){this.resolvedLanguage=n;break}}}changeLanguage(e,s){var n=this;this.isLanguageChangingTo=e;const a=nd();this.emit("languageChanging",e);const i=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,d)=>{d?(i(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,a.resolve(function(){return n.t(...arguments)}),s&&s(c,function(){return n.t(...arguments)})},l=c=>{!e&&!c&&this.services.languageDetector&&(c=[]);const d=Ae(c)?c:this.services.languageUtils.getBestMatchFromCodes(c);d&&(this.language||i(d),this.translator.language||this.translator.changeLanguage(d),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(d)),this.loadResources(d,u=>{o(u,d)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?l(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(l):this.services.languageDetector.detect(l):l(e),a}getFixedT(e,s,n){var a=this;const i=function(o,l){let c;if(typeof l!="object"){for(var d=arguments.length,u=new Array(d>2?d-2:0),h=2;h<d;h++)u[h-2]=arguments[h];c=a.options.overloadTranslationOptionHandler([o,l].concat(u))}else c={...l};c.lng=c.lng||i.lng,c.lngs=c.lngs||i.lngs,c.ns=c.ns||i.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||n||i.keyPrefix);const m=a.options.keySeparator||".";let f;return c.keyPrefix&&Array.isArray(o)?f=o.map(p=>`${c.keyPrefix}${m}${p}`):f=c.keyPrefix?`${c.keyPrefix}${m}${o}`:o,a.t(f,c)};return Ae(e)?i.lng=e:i.lngs=e,i.ns=s,i.keyPrefix=n,i}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;
vendor: 8,514 bytes, line 67
67if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=s.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(n.toLowerCase()==="cimode")return!0;const o=(l,c)=>{const d=this.services.backendConnector.state[`${l}|${c}`];return d===-1||d===0||d===2};if(s.precheck){const l=s.precheck(this,o);if(l!==void 0)return l}return!!(this.hasResourceBundle(n,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(n,e)&&(!a||o(i,e)))}loadNamespaces(e,s){const n=nd();return this.options.ns?(Ae(e)&&(e=[e]),e.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{n.resolve(),s&&s(a)}),n):(s&&s(),Promise.resolve())}loadLanguages(e,s){const n=nd();Ae(e)&&(e=[e]);const a=this.options.preload||[],i=e.filter(o=>a.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=a.concat(i),this.loadResources(o=>{n.resolve(),s&&s(o)}),n):(s&&s(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const s=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],n=this.services&&this.services.languageUtils||new ON($N());return s.indexOf(n.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1?arguments[1]:void 0;return new Tu(e,s)}cloneInstance(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Fh;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const a={...this.options,...e,isClone:!0},i=new Tu(a);return(e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(l=>{i[l]=this[l]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},n&&(i.store=new RN(this.store.data,a),i.services.resourceStore=i.store),i.translator=new Cf(i.services,a),i.translator.on("*",function(l){for(var c=arguments.length,d=new Array(c>1?c-1:0),u=1;u<c;u++)d[u-1]=arguments[u];i.emit(l,...d)}),i.init(a,s),i.translator.options=a,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const js=Tu.createInstance();js.createInstance=Tu.createInstance;js.createInstance;js.dir;js.init;js.loadResources;js.reloadResources;js.use;js.changeLanguage;js.getFixedT;js.t;js.exists;js.setDefaultNamespace;js.hasLoadedNamespace;js.loadNamespaces;js.loadLanguages;const XO=(t,e,s,n)=>{var i,o,l,c;const a=[s,{code:e,...n||{}}];if((o=(i=t==null?void 0:t.services)==null?void 0:i.logger)!=null&&o.forward)return t.services.logger.forward(a,"warn","react-i18next::",!0);Lo(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),(c=(l=t==null?void 0:t.services)==null?void 0:l.logger)!=null&&c.warn?t.services.logger.warn(...a):console!=null&&console.warn&&console.warn(...a)},BN={},Gb=(t,e,s,n)=>{Lo(s)&&BN[s]||(Lo(s)&&(BN[s]=new Date),XO(t,e,s,n))},e4=(t,e)=>()=>{if(t.isInitialized)e();else{const s=()=>{setTimeout(()=>{t.off("initialized",s)},0),e()};t.on("initialized",s)}},Yb=(t,e,s)=>{t.loadNamespaces(e,e4(t,s))},VN=(t,e,s,n)=>{if(Lo(s)&&(s=[s]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Yb(t,s,n);s.forEach(a=>{t.options.ns.indexOf(a)<0&&t.options.ns.push(a)}),t.loadLanguages(e,e4(t,n))},ZO=(t,e,s={})=>!e.languages||!e.languages.length?(Gb(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:s.lng,precheck:(n,a)=>{if(s.bindI18n&&s.bindI18n.indexOf("languageChanging")>-1&&n.services.backendConnector.backend&&n.isLanguageChangingTo&&!a(n.isLanguageChangingTo,t))return!1}}),Lo=t=>typeof t=="string",eI=t=>typeof t=="object"&&t!==null,tI=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,sI={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"â¦","…":"â¦","/":"/","/":"/"},nI=t=>sI[t],rI=t=>t.replace(tI,nI);let qb={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:rI};const aI=(t={})=>{qb={...qb,...t}},iI=()=>qb;let t4;const oI=t=>{t4=t},lI=()=>t4,cI={type:"3rdParty",init(t){aI(t.options.react),oI(t)}},dI=M.createContext();class uI{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(s=>{this.usedNamespaces[s]||(this.usedNamespaces[s]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const hI=(t,e)=>{const s=M.useRef();return M.useEffect(()=>{s.current=t},[t,e]),s.current},s4=(t,e,s,n)=>t.getFixedT(e,s,n),mI=(t,e,s,n)=>M.useCallback(s4(t,e,s,n),[t,e,s,n]),en=(t,e={})=>{var N,j,S,k;const{i18n:s}=e,{i18n:n,defaultNS:a}=M.useContext(dI)||{},i=s||n||lI();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new uI),!i){Gb(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const C=(A,E)=>Lo(E)?E:eI(E)&&Lo(E.defaultValue)?E.defaultValue:Array.isArray(A)?A[A.length-1]:A,T=[C,{},!1];return T.t=C,T.i18n={},T.ready=!1,T}(N=i.options.react)!=null&&N.wait&&Gb(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={...iI(),...i.options.react,...e},{useSuspense:l,keyPrefix:c}=o;let d=a||((j=i.options)==null?void 0:j.defaultNS);d=Lo(d)?[d]:d||["translation"],(k=(S=i.reportNamespaces).addUsedNamespaces)==null||k.call(S,d);const u=(i.isInitialized||i.initializedStoreOnce)&&d.every(C=>ZO(C,i,o)),h=mI(i,e.lng||null,o.nsMode==="fallback"?d:d[0],c),m=()=>h,f=()=>s4(i,e.lng||null,o.nsMode==="fallback"?d:d[0],c),[p,g]=M.useState(m);let x=d.join();e.lng&&(x=`${e.lng}${x}`);const b=hI(x),y=M.useRef(!0);M.useEffect(()=>{const{bindI18n:C,bindI18nStore:T}=o;y.current=!0,!u&&!l&&(e.lng?VN(i,e.lng,d,()=>{y.current&&g(f)}):Yb(i,d,()=>{y.current&&g(f)})),u&&b&&b!==x&&y.current&&g(f);const A=()=>{y.current&&g(f)};return C&&(i==null||i.on(C,A)),T&&(i==null||i.store.on(T,A)),()=>{y.current=!1,i&&C&&(C==null||C.split(" ").forEach(E=>i.off(E,A))),T&&i&&T.split(" ").forEach(E=>i.store.off(E,A))}},[i,x]),M.useEffect(()=>{y.current&&u&&g(m)},[i,c,u]);const w=[p,i,u];if(w.t=p,w.i18n=i,w.ready=u,u||!u&&!l)return w;throw new Promise(C=>{e.lng?VN(i,e.lng,d,()=>C()):Yb(i,d,()=>C())})},fI={logoSubtitle:"Counsel Forum"},pI={about:"About",events:"Events",resources:"Resources",memberLogin:"Member Login",join:"Join ACGC",dashboard:"Dashboard",directory:"Directory",profile:"My Profile",billing:"Billing",logout:"Logout"},xI={eyebrow:"African Corporate & Government Counsel Forum",headline:"The professional home for in-house and government counsel across Africa.",sub:"Events, learning resources, and a member network designed to strengthen community, knowledge-sharing, and practical excellence.",ctaJoin:"Join ACGC",ctaEvents:"View Events",stats:{memberNetworkTitle:"Member Network",memberNetworkDesc:"Find peers by country, sector, role.",resourceHubTitle:"Resource Hub",resourceHubDesc:"Guides, videos, toolkits (YouTube embeds).",eventsTitle:"Events",eventsDesc:"Webinars, conferences, trainings."},thisWeek:{title:"This week in ACGC",badge:"New",sub:"A premium member experience with dashboard cards, directory, and resources.",cards:{webinarTitle:"Upcoming Webinar",webinarMeta:"In-house legal ops playbook",webinarCta:"See events",resourceTitle:"New Resource",resourceMeta:"Practical tips & guides",resourceCta:"Browse resources",portalTitle:"Member Portal",portalMeta:"Exclusive networking and content",portalCta:"Login"}}
67,ecosystem:{eyebrow:"Designed for value",title:"A modern ecosystem for events, resources, and membership",sub:"This is the foundation. Next phases add billing, advanced analytics, admin workflows, and content migration tooling.",cta:"Become a Member"},features:{directoryTitle:"Member Directory",directoryDesc:"Card-based directory with search + filters, designed for fast discovery.",directoryTag:"Portal",resourcesTitle:"Resources & Videos",resourcesDesc:"Structured categories with thumbnails, summaries, and YouTube embeds.",resourcesTag:"Portal",eventsTitle:"Events",eventsDesc:"Event cards (countdowns, tags, add-to-calendar) ready for next iteration.",eventsTag:"Public + Portal"},ready:{title:"Ready to join?",sub:"Create your member profile in minutes.",ctaJoin:"Join ACGC",ctaLogin:"I already have an account"}},gI={copyright:"© {{year}} African Corporate & Government Counsel Forum.",tagline:"Modern website + member portal foundation."},bI={eyebrow:"About",title:"About ACGC",sub:"This is starter content. Next phase will replace this with your final copy and improved SEO metadata.",missionTitle:"Mission",missionBody:"ACGC strengthens the community of in-house and government counsel across Africa through events, learning, and peer connection.",buildingTitle:"What weâre building",buildingBody:"A modern public website plus a paid member portal with a directory, structured resources, and unified membership + events workflows."},yI={eyebrow:"Events",title:"Conferences, webinars & training",sub:"This is a starter view. Next iteration adds countdown timers, add-to-calendar, member vs non-member pricing, and billing checkout.",featured:"Featured",detailsNext:"Details (next phase)",registerCta:"Register",membersMoreTitle:"Members get more",membersMoreSub:"Differential pricing and access to post-event resources will be enforced in the member portal.",membersMoreCta:"Join ACGC"},vI={eyebrow:"Resources",title:"Structured, searchable content",sub:"This is a public preview. In the member portal weâll add full category tabs, filtering, tagging, and paid access control.",preview:"Preview",videoHostingTitle:"Video hosting",videoHostingSub:"All video content is embedded from YouTube (not hosted locally).",videoPlayerTitle:"YouTube video player"},wI={title:"Choose language",close:"Close",searchPlaceholder:"Search by name or code (e.g. fr-CA, zh-Hans)"},jI={loading:"Loadingâ¦",saving:"Savingâ¦",itemCount:"{{count}} item(s)",resultCount:"{{count}} result(s)",empty:"â",failed:"Failed",edit:"Edit",delete:"Delete",close:"Close",cancel:"Cancel",save:"Save",post:"Post"},NI={paidTitle:"Member Directory is a paid feature",paidSub:"Upgrade your membership to access the directory and connect with peers.",goToBilling:"Go to Billing",title:"Member Directory",sub:"Search and filter to find members quickly.",searchLabel:"Search",searchPlaceholder:"Name, organisation, titleâ¦",countryLabel:"Country",countryPlaceholder:"e.g. Kenya",sectorLabel:"Sector",industryLabel:"Industry",all:"All",noResults:"No members match your filters.",memberSince:"Member since {{year}}",linkedin:"LinkedIn",privateMessageNext:"Private message (next phase)"},kI={title:"Billing",sub:"Stripe Checkout is used for secure payment. Currency selection is supported.",currentMembership:"Current membership",packageLabel:"Package:",paid:"Paid",free:"Free",organisationLabel:"Organisation:",currencyLabel:"Currency",redirecting:"Redirectingâ¦",payWithStripe:"Pay with Stripe",stripeSessionDev:"Stripe session (dev)",selected:"Selected",option:"Option",feePlaceholder:"Fee placeholder: {{amount}} {{currency}}",plans:{individualTitle:"Individual Plan",individualDesc:"Single member. Still linked to your organisation for reporting and future upgrades.",organisationTitle:"Organisation Plan",organisationDesc:"Multi-member billing construct. Enrolled members will be linked to one organisation account."}},CI={title:"My Profile",sub:"Your member profile is always individual (not an organisation).",paymentLabel:"Payment:",packageLabel:"Package:",memberSince:"Member since {{year}}",devToolsTitle:"Dev tools",devToolsSub:"Only for local testing before Stripe verification is implemented.",simulatePaid:"Simulate Paid Status",updating:"Updatingâ¦",devPaidSet:"Payment status set to PAID (dev only).",f
67ields:{name:"Name",email:"Email",organisation:"Organisation",jobTitle:"Job Title",sector:"Sector",industry:"Industry",country:"Country",linkedin:"LinkedIn"}},SI={title:"Resources",sub:"Structured categories with a searchable library. Videos are embedded from YouTube.",postCta:"Post Content",paidTitle:"Some resources are for paid members",paidSub:"Upgrade your membership to unlock paid resources.",goToBilling:"Go to Billing",searchLabel:"Search",searchPlaceholder:"Search titles and summariesâ¦",categoryLabel:"Category",categoryAll:"All",watchOnYoutube:"Watch on YouTube",download:"Download",paidOnlyLabel:"Paid members only",publicLabel:"Public"},_I={title:"Post Content",sub:"Create a new resource item (YouTube embeds supported).",newCta:"New resource",backCta:"Back to Resources",latestTitle:"Latest resources",modalNewTitle:"New resource",modalEditTitle:"Edit resource",confirmDelete:"Delete this resource?",notAllowedTitle:"Not allowed",notAllowedSub:"You need Admin or Editor role to post content.",fields:{title:"Title",category:"Category",type:"Type",summary:"Summary",youtubeUrl:"YouTube URL",fileUrl:"File URL",thumbnailUrl:"Thumbnail URL",contentOwner:"Content owner",partnerName:"Partner name (if applicable)",tags:"Tags (comma separated)",year:"Year",publishedAt:"Published at",access:"Access"},filters:{search:"Search",searchPlaceholder:"Search title/summaryâ¦",category:"Category",type:"Type",all:"All"},preview:"Preview",loadMore:"Load more",access:{paidMembers:"Paid members",public:"Public"}},TI={title:"Events",sub:"Member events and announcements.",manageCta:"Manage Events",paidTitle:"Some events are for paid members",paidSub:"Upgrade your membership to see paid-only events.",goToBilling:"Go to Billing",searchLabel:"Search",searchPlaceholder:"Search title/summary/locationâ¦",typeLabel:"Type",all:"All",unknownType:"Event",registerCta:"Register",when:"When: {{date}} at {{time}}",where:"Where: {{location}}",badges:{paid:"Paid",public:"Public"}},EI={title:"Post Events",sub:"Create and manage events (Admin/Editor).",newCta:"New event",backCta:"Back to Events",latestTitle:"Latest events",modal
67NewTitle:"New event",modalEditTitle:"Edit event",confirmDelete:"Delete this event?",preview:"Preview",notAllowedTitle:"Not allowed",notAllowedSub:"You need Admin or Editor role to post events.",badges:{featured:"Featured",standard:"Standard",paid:"Paid",public:"Public"},fields:{title:"Title",type:"Type",summary:"Summary",startAt:"Start at",endAt:"End at",timezone:"Timezone",location:"Location",registrationUrl:"Registration URL",access:"Access",featured:"Featured"},featured:{yes:"Yes",no:"No"},access:{public:"Public",paidMembers:"Paid members"},timezone:{placeholderDraft:"Optional for drafts",placeholderPublished:"Select a reference zone",hintPublished:"Required for published events so entered times convert correctly and emails show the organiserâs reference time."},ok:{posted:"Posted successfully.",saved:"Saved successfully.",deleted:"Deleted successfully."},errors:{missingRequired:"Title, Type, and Start time are required.",timezoneRequiredPublished:"Published events need a timezone (WAT, EAT, SAST, CAT, GMT, or UTC). Save as draft if you are not ready to choose one.",failed:"Failed"}},MI={email:"Email Address",password:"Password",signIn:"Sign in",signingIn:"Signing inâ¦",createAccount:"Create account",creatingAccount:"Creating accountâ¦",noAccount:"New to ACGC?",join:"Start your membership",alreadyMember:"Already a member?",loginLink:"Login",loginFailed:"Login failed",registrationFailed:"Registration failed",login:{eyebrow:"Member Login",title:"Access the ACGC Member Hub",sub:"Sign in to access the ACGC member community, directory, and resources.",benefitsTitle:"Your membership includes",forgotPassword:"Forgot password?",benefits:{network:"Member Network: Connect with 3,000+ in-house and government counsel across 40+ countries.",events:"Events & Learning: Access webinars, roundtables and conference programmes throughout the year.",resources:"Resources & Insights: Toolkits, research, recordings and practical materials from across the ACGC community.",opportunities:"Opportunities & Visibility: Speaking opportunities, editorial features and career opportunities shared within the network."}},register:{eyebrow:"Join ACGC",title:"Start Your ACGC Membership",sub:"Join Africa's Leading Network of In-House & Government Counsel",passwordHint:"At least 8 characters, one number, one special character",fields:{firstName:"First name",lastName:"Last name",organisation:"Organisation",jobTitle:"Job Title",sector:"Sector",industry:"Industry",country:"Country",linkedin:"LinkedIn",twitter:"Twitter",instagram:"Instagram",membershipType:"Membership Type",language:"Preferred Language"}}},AI={brand:fI,nav:pI,home:xI,footer:gI,about:bI,events:yI,publicResources:vI,languagePicker:wI,common:jI,portalDirectory:NI,portalBilling:kI,portalProfile:CI,portalResources:SI,portalResourcesManage:_I,portalEvents:TI,portalEventsManage:EI,auth:MI},PI={logoSubtitle:"Forum des conseillers"},DI={about:"à propos",events:"Ãvénements",resources:"Ressources",memberLogin:"Connexion membre",join:"Rejoindre ACGC",dashboard:"Tableau de bord",directory:"Annuaire",profile:"Mon profil",billing:"Paiement",logout:"Déconnexion"},RI={eyebrow:"Forum Africain des Conseillers Juridiques dâEntreprise et Gouvernementaux",headline:"La maison professionnelle des juristes internes et gouvernementaux à travers lâAfrique.",sub:"Ãvénements, ressources dâapprentissage et réseau de membres pour renforcer la communauté et le partage de connaissances.",ctaJoin:"Rejoindre ACGC",ctaEvents:"Voir les événements",stats:{memberNetworkTitle:"Réseau de membres",memberNetworkDesc:"Trouvez des pairs par pays, secteur, rôle.",resourceHubTitle:"Centre de ressources",resourceHubDesc:"Guides, vidéos, outils (intégrations YouTube).",eventsTitle:"Ãvénements",eventsDesc:"Webinaires, conférences, formations."},thisWeek:{title:"Cette semaine à lâACGC",badge:"Nouveau",sub:"Une expérience premium avec cartes de tableau de bord, annuaire et ressources.",cards:{webinarTitle:"Webinaire à venir",webinarMeta:"Guide opérationnel juridique interne",webinarCta:"Voir les événements",resourceTitle:"Nouvelle ressource",resourceMeta:"Conseils pratiques et guides",resourceCta:"Parcourir les ressources",portalTitle:"Portail membre",portalMeta:"Réseautage et contenu exclusifs",portalCta:"Connexion"}},ecosystem:{eyebrow:"Conçu pour la valeur",title:"Un écosystème moderne pour les événements, les ressources et lâadhésion",sub:"Câest la base. Les proch
67aines phases ajoutent la facturation, des analyses avancées, des workflows admin et la migration de contenu.",cta:"Devenir membre"},features:{directoryTitle:"Annuaire des membres",directoryDesc:"Annuaire par cartes avec recherche et filtres, pour une découverte rapide.",directoryTag:"Portail",resourcesTitle:"Ressources et vidéos",resourcesDesc:"Catégories structurées avec vignettes, résumés et intégrations YouTube.",resourcesTag:"Portail",eventsTitle:"Ãvénements",eventsDesc:"Cartes dâévénements (compte à rebours, tags, ajout au calendrier) prêtes pour la prochaine itération.",eventsTag:"Public + Portail"},ready:{title:"Prêt à rejoindre ?",sub:"Créez votre profil membre en quelques minutes.",ctaJoin:"Rejoindre ACGC",ctaLogin:"Jâai déjà un compte"}},LI={copyright:"© {{year}} Forum Africain des Conseillers Juridiques dâEntreprise et Gouvernementaux.",tagline:"Site moderne + fondation du portail membre."},OI={eyebrow:"à propos",title:"à propos de lâACGC",sub:"Contenu de départ. La prochaine phase remplacera ce texte par votre version finale et améliorera le SEO.",missionTitle:"Mission",missionBody:"LâACGC renforce la communauté des juristes internes et gouvernementaux à travers lâAfrique via des événements, lâapprentissage et la connexion entre pairs.",buildingTitle:"Ce que nous construisons",buildingBody:"Un site public moderne et un portail membre payant avec annuaire, ressources structurées et workflows unifiés."},II={eyebrow:"Ãvénements",title:"Conférences, webinaires et formations",sub:"Vue initiale. La prochaine itération ajoute des compteurs, lâajout au calendrier, des tarifs membres/non-membres et la facturation.",featured:"à la une",detailsNext:"Détails (prochaine phase)",registerCta:"Sâinscrire",membersMoreTitle:"Les membres ont plus",membersMoreSub:"Les tarifs différenciés et lâaccès aux ressources post-événement seront appliqués dans le portail membre.",membersMoreCta:"Rejoindre ACGC"},FI={eyebrow:"Ressources",title:"Contenu structuré et consultable",sub:"Aperçu public. Dans le portail membre, nous ajouterons des onglets, filtres, tags et le contrôle dâaccès payant.",preview:"Aperçu",videoHostingTitle:"Hébergement vidéo",videoHostingSub:"Tout le contenu vidéo est intégré depuis YouTube (pas hébergé localement).",videoPlayerTitle:"Lecteur vidéo YouTube"},$I={title:"Choisir une langue",close:"Fermer",searchPlaceholder:"Rechercher par nom ou code (ex. fr-CA, zh-Hans)"},zI={loading:"Chargementâ¦",saving:"Enregistrementâ¦",itemCount:"{{count}} élément(s)",resultCount:"{{count}} résultat(s)",empty:"â",failed:"Ãchec",edit:"Modifier",delete:"Supprimer",close:"Fermer",cancel:"Annuler",save:"Enregistrer",post:"Publier"},BI={paidTitle:"Lâannuaire des membres est une fonctionnalité payante",paidSub:"Mettez à niveau votre adhésion pour accéder à lâannuaire et vous connecter avec des pairs.",goToBilling:"Aller à la facturation",title:"Annuaire des membres",sub:"Recherchez et filtrez pour trouver rapidement des membres.",searchLabel:"Rechercher",searchPlaceholder:"Nom, organisation, posteâ¦",countryLabel:"Pays",countryPlaceholder:"ex. Kenya",sectorLabel:"Secteur",industryLabel:"Industrie",all:"Toutes",noResults:"Aucun membre ne correspond à vos filtres.",memberSince:"Membre depuis {{year}}",linkedin:"LinkedIn",privateMessageNext:"Message privé (prochaine phase)"},VI={title:"Facturation",sub:"Stripe Checkout est utilisé pour un paiement sécurisé. La sélection de devise est prise en charge.",currentMembership:"Adhésion actuelle",packageLabel:"Forfait :",paid:"Payé",free:"Gratuit",organisationLabel:"Organisation :",currencyLabel:"Devise",redirecting:"Redirectionâ¦",payWithStripe:"Payer avec Stripe",stripeSessionDev:"Session Stripe (dev)",selected:"Sélectionné",option:"Option",feePlaceholder:"Frais (placeholder) : {{amount}} {{currency}}",plans:{individualTitle:"Forfait individuel",individualDesc:"Membre unique. Toujours lié à votre organisation pour les rapports et futures évolutions.",organisationTitle:"Forfait organisation",organisationDesc:"Construct de facturation multi-membres. Les membres inscrits seront liés à un seul compte organisation."}},UI={title:"Mon profil",sub:"Votre profil membre est toujours individuel (pas une organisation).",paymentLabel:"Paiement :",packageLabel:"Forfait :",memberSince:"Membre depuis {{year}}",devToolsTitle:"Outils dev",devToolsSub:"Uniquement pour les tests locaux avant la vérification Stripe.",simulatePaid:"Simuler le statut payé",updating:"Mise à jourâ¦",devPaidSet:"Statut de paiement défini sur PAYà (dev uniquement).",fields:{name:"Nom",email:"Email",organisation:"Organisation",jobTitle:"Poste",sector:"Secteur",industry:"Industrie",country:"Pays",linkedin:"LinkedIn"}},HI={title:"Ressources",sub:"Catégories structurées avec une bibliothèque consultable. Les vidéos sont intégrées depuis YouTube.",postCta:"Publier du contenu",paidTitle:"Certaines ressources sont réservées aux membres payants",paidSub
67:"Mettez à niveau votre adhésion pour débloquer les ressources payantes.",goToBilling:"Aller à la facturation",searchLabel:"Rechercher",searchPlaceholder:"Rechercher des titres et des résumésâ¦",categoryLabel:"Catégorie",categoryAll:"Toutes",watchOnYoutube:"Regarder sur YouTube",download:"Télécharger",paidOnlyLabel:"Réservé aux membres payants",publicLabel:"Public"},WI={title:"Publier du contenu",sub:"Créez un nouvel élément de ressource (intégrations YouTube prises en charge).",newCta:"Nouvelle ressource",backCta:"Retour aux ressources",latestTitle:"Dernières ressources",modalNewTitle:"Nouvelle ressource",modalEditTitle:"Modifier la ressource",confirmDelete:"Supprimer cette ressource ?",notAllowedTitle:"Accès refusé",notAllowedSub:"Vous devez être Admin ou Ãditeur pour publier du contenu.",fields:{title:"Titre",category:"Catégorie",type:"Type",summary:"Résumé",youtubeUrl:"URL YouTube",fileUrl:"URL du fichier",thumbnailUrl:"URL de la miniature",contentOwner:"Propriétaire du contenu",partnerName:"Nom du partenaire (si applicable)",tags:"Tags (séparés par des virgules)",year:"Année",publishedAt:"Date de publication",access:"Accès"},filters:{search:"Rechercher",searchPlaceholder:"Rechercher dans le titre/le résuméâ¦",category:"Catégorie",type:"Type",all:"Toutes"},preview:"Aperçu",loadMore:"Charger plus",access:{paidMembers:"Membres payants",public:"Public"}},GI={title:"Ãvénements",sub:"Ãvénements et annonces pour les membres.",manageCta:"Gérer les événements",paidTitle:"Certains événements sont réservés aux membres payants",paidSub:"Mettez à niveau votre adhésion pour voir les événements réservés.",goToBilling:"Aller à la facturation",searchLabel:"Rechercher",searchPlaceholder:"Rechercher titre/résumé/lieuâ¦",typeLabel:"Type",all:"Tous",unknownType:"Ãvénement",registerCta:"Sâinscrire",when:"Quand : {{date}} à {{time}}",where:"Où : {{location}}",badges:{paid:"Payant",public:"Public"}},YI={title:"Publier des événements",sub:"Créer et gérer des événements (Admin/Ãditeur).",newCta:"Nouvel événement",backCta:"Retour aux événements",latestTitle:"Derniers événements",modal
67NewTitle:"Nouvel événement",modalEditTitle:"Modifier lâévénement",confirmDelete:"Supprimer cet événement ?",preview:"Aperçu",notAllowedTitle:"Non autorisé",notAllowedSub:"Vous devez être Admin ou Ãditeur pour publier des événements.",badges:{featured:"à la une",standard:"Standard",paid:"Payant",public:"Public"},fields:{title:"Titre",type:"Type",summary:"Résumé",startAt:"Début",endAt:"Fin",timezone:"Fuseau horaire",location:"Lieu",registrationUrl:"URL dâinscription",access:"Accès",featured:"à la une"},featured:{yes:"Oui",no:"Non"},access:{public:"Public",paidMembers:"Membres payants"},timezone:{placeholderDraft:"Facultatif pour les brouillons",placeholderPublished:"Choisir un fuseau de référence",hintPublished:"Obligatoire pour les événements publiés : conversion correcte des heures saisies et heure de référence dans les e-mails."},ok:{posted:"Publié avec succès.",saved:"Enregistré avec succès.",deleted:"Supprimé avec succès."},errors:{missingRequired:"Le titre, le type et lâheure de début sont requis.",timezoneRequiredPublished:"Les événements publiés exigent un fuseau horaire (WAT, EAT, SAST, CAT, GMT ou UTC). Enregistrez en brouillon si vous nâêtes pas prêt à en choisir un.",failed:"Ãchec"}},qI={email:"Adresse e-mail",password:"Mot de passe",signIn:"Se connecter",signingIn:"Connexionâ¦",createAccount:"Créer un compte",creatingAccount:"Création du compteâ¦",noAccount:"Nouveau chez ACGC ?",join:"Commencez votre adhésion",alreadyMember:"Déjà membre ?",loginLink:"Connexion",loginFailed:"Ãchec de la connexion",registrationFailed:"Ãchec de lâinscription",login:{eyebrow:"Connexion membre",title:"Accéder au Hub Membres ACGC",sub:"Connectez-vous pour accéder à la communauté, l'annuaire et les ressources ACGC.",benefitsTitle:"Votre adhésion comprend",benefitsSub:"Tout ce dont vous avez besoin pour vous connecter à la communauté et aux ressources ACGC.",forgotPassword:"Mot de passe oublié ?",benefits:{network:"Réseau de membres : Connectez-vous avec plus de 3 000 juristes d'entreprise et de gouvernement dans plus de 25 pays.",events:"Ãvénements et apprentissage : Accédez aux webinaires, tables rondes et programmes de conférences tout au long de l'année.",resources:"Ressources et informations : Guides, recherches, enregistrements et matériaux pratiques de la communauté ACGC.",opportunities:"Opportunités et visibilité : Opportunités de prise de parole, articles et opportunités de carrière partagés dans le réseau."}},register:{eyebrow:"Rejoindre ACGC",title:"Créer votre profil membre",sub:"Les membres sont toujours des individus. Lâorganisation sert au regroupement, au reporting et aux futures évolutions vers des plans organisation.",passwordHint:"Minimum 8 caractères",fields:{firstName:"Prénom",lastName:"Nom",organisation:"Organisation",jobTitle:"Poste",sector:"Secteur",industry:"Industrie",country:"Pays",linkedin:"LinkedIn",twitter:"Twitter",instagram:"Instagram",membershipPackage:"Forfait dâadhésion"},sidebarTitle:"Clarté du modèle de données",sidebarSub:"Nous séparons la facturation commerciale du regroupement organisationnel et de lâidentité individuelle.",sidebar:{membershipPackageTitle:"Forfait dâadhésion",membershipPackageSub:"Forfait individuel ou forfait organisation (multi-membres)",organisationTitle:"Compte organisation",organisationSub:"Regroupement employeur/institution (quel que soit le paiement)",memberProfileTitle:"Profil membre",memberProfileSub:"La personne (vous). Toujours inscrit en tant quâindividu."}}},KI={brand:PI,nav:DI,home:RI,footer:LI,about:OI,events:II,publicResources:FI,languagePicker:$I,common:zI,portalDirectory:BI,portalBilling:VI,portalProfile:UI,portalResources:HI,portalRe
67sourcesManage:WI,portalEvents:GI,portalEventsManage:YI,auth:qI},JI={logoSubtitle:"Fórum de conselheiros"},QI={about:"Sobre",events:"Eventos",resources:"Recursos",memberLogin:"Login de membro",join:"Juntar-se à ACGC",dashboard:"Painel",directory:"Diretório",profile:"Meu perfil",billing:"Pagamentos",logout:"Sair"},XI={eyebrow:"Fórum Africano de Conselheiros JurÃdicos Corporativos e Governamentais",headline:"A casa profissional para juristas internos e governamentais em toda a Ãfrica.",sub:"Eventos, recursos de aprendizagem e uma rede de membros para fortalecer a comunidade e a partilha de conhecimento.",ctaJoin:"Juntar-se à ACGC",ctaEvents:"Ver eventos",stats:{memberNetworkTitle:"Rede de membros",memberNetworkDesc:"Encontre pares por paÃs, setor e função.",resourceHubTitle:"Centro de recursos",resourceHubDesc:"Guias, vÃdeos, kits de ferramentas (embeds do YouTube).",eventsTitle:"Eventos",eventsDesc:"Webinars, conferências, treinamentos."},thisWeek:{title:"Esta semana na ACGC",badge:"Novo",sub:"Uma experiência premium com cartões do painel, diretório e recursos.",cards:{webinarTitle:"Webinar em breve",webinarMeta:"Guia de operações jurÃdicas internas",webinarCta:"Ver eventos",resourceTitle:"Novo recurso",resourceMeta:"Dicas práticas e guias",resourceCta:"Explorar recursos",portalTitle:"Portal do membro",portalMeta:"Rede e conteúdo exclusivos",portalCta:"Entrar"}},ecosystem:{eyebrow:"Projetado para gerar valor",title:"Um ecossistema moderno para eventos, recursos e adesão",sub:"Esta é a base. As próximas fases adicionam faturamento, análises avançadas, fluxos admin e migração de conteúdo.",cta:"Tornar-se membro"},features:{directoryTitle:"Diretório de membros",directoryDesc:"Diretório em cartões com busca e filtros, feito para descoberta rápida.",directoryTag:"Portal",resourcesTitle:"Recursos e vÃdeos",resourcesDesc:"Categorias estruturadas com miniaturas, resumos e embeds do YouTube.",resourcesTag:"Portal",eventsTitle:"Eventos",eventsDesc:"Cartões de eventos (contagem regressiva, tags, adicionar ao calendário) prontos para a próxima iteração.",eventsTag:"Público + Portal"},ready:{title:"Pronto para se juntar?",sub:"Crie seu perfil de membro em minutos.",ctaJoin:"Juntar-se à ACGC",ctaLogin:"Já tenho uma conta"}},ZI={copyright:"© {{year}} Fórum Africano de Conselheiros JurÃdicos Corporativos e Governamentais.",tagline:"Site moderno + base do portal de membros."},e6={eyebrow:"Sobre",title:"Sobre a ACGC",sub:"Conteúdo inicial. A próxima fase substituirá este texto pela versão final e melhorará o SEO.",missionTitle:"Missão",missionBody:"A ACGC fortalece a comunidade de juristas internos e governamentais em toda a Ãfrica por meio de eventos, aprendizagem e conexão entre pares.",buildingTitle:"O que estamos construindo",buildingBody:"Um site público moderno e um portal pago com diretório, recursos estruturados e fluxos unificados."},t6={eyebrow:"Eventos",title:"Conferências, webinars e treinamentos",sub:"Visão inicial. A próxima iteração adiciona contagens regressivas, adicionar ao calendário, preços para membros/não membros e faturamento.",featured:"Destaque",detailsNext:"Detalhes (próxima fase)",registerCta:"Inscrever-se",membersMoreTitle:"Membros têm mais",membersMoreSub:"Preços diferenciados e acesso a recursos pós-evento serão aplicados no portal de membros.",membersMoreCta:"Juntar-se à ACGC"},s6={eyebrow:"Recursos",title:"Conteúdo estruturado e pesquisável",sub:"Prévia pública. No portal, adicionaremos abas, filtros, tags e controle de acesso pago.",preview:"Prévia",videoHostingTitle:"Hospedagem de vÃdeo",videoHostingSub:"Todo o conteúdo de vÃdeo é incorporado do YouTube (não hospedado localmente).",videoPlayerTitle:"Reprodutor de vÃdeo do YouTube"},n6={title:"Escolher idioma",close:"Fechar",searchPlaceholder:"Pesquisar por nome ou código (ex.: fr-CA, zh-Hans)"},r6={loading:"Carregandoâ¦",saving:"Salvandoâ¦",itemCount:"{{count}} item(ns)",resultCount:"{{count}} resultado(s)",empty:"â",failed:"Falhou",edit:"Editar",delete:"Excluir",close:"Fechar",cancel:"Cancelar",save:"Salvar",post:"Publicar"},a6={paidTitle:"O diretório de membros é um recurso pago",paidSub
67:"Atualize sua adesão para acessar o diretório e se conectar com pares.",goToBilling:"Ir para Pagamentos",title:"Diretório de membros",sub:"Pesquise e filtre para encontrar membros rapidamente.",searchLabel:"Pesquisar",searchPlaceholder:"Nome, organização, cargoâ¦",countryLabel:"PaÃs",countryPlaceholder:"ex.: Quênia",sectorLabel:"Setor",industryLabel:"Indústria",all:"Todos",noResults:"Nenhum membro corresponde aos seus filtros.",memberSince:"Membro desde {{year}}",linkedin:"LinkedIn",privateMessageNext:"Mensagem privada (próxima fase)"},i6={title:"Pagamentos",sub:"O Stripe Checkout é usado para pagamento seguro. A seleção de moeda é suportada.",currentMembership:"Assinatura atual",packageLabel:"Pacote:",paid:"Pago",free:"Grátis",organisationLabel:"Organização:",currencyLabel:"Moeda",redirecting:"Redirecionandoâ¦",payWithStripe:"Pagar com Stripe",stripeSessionDev:"Sessão Stripe (dev)",selected:"Selecionado",option:"Opção",feePlaceholder:"Taxa (placeholder): {{amount}} {{currency}}",plans:{individualTitle:"Plano individual",individualDesc:"Membro único. Ainda vinculado à sua organização para relatórios e futuras atualizações.",organisationTitle:"Plano da organização",organisationDesc:"Estrutura de cobrança multi-membros. Os membros inscritos serão vinculados a uma conta de organização."}},o6={title:"Meu perfil",sub:"Seu perfil de membro é sempre individual (não uma organização).",paymentLabel:"Pagamento:",packageLabel:"Pacote:",memberSince:"Membro desde {{year}}",devToolsTitle:"Ferramentas dev",devToolsSub:"Apenas para testes locais antes da verificação do Stripe.",simulatePaid:"Simular status pago",updating:"Atualizandoâ¦",devPaidSet:"Status de pagamento definido como PAGO (somente dev).",fields:{name:"Nome",email:"Email",organisation:"Organização",jobTitle:"Cargo",sector:"Setor",industry:"Indústria",country:"PaÃs",linkedin:"LinkedIn"}},l6={title:"Recursos",sub:"Categorias estruturadas com uma biblioteca pesquisável. VÃdeos são incorporados do YouTube.",postCta:"Publicar conteúdo",paidTitle:"Alguns recursos são apenas para membros pagos",paidSub:"Atualize sua associação para desbloquear recursos pagos.",goToBilling:"Ir para faturamento",searchLabel:"Pesquisar",searchPlaceholder:"Pesquisar tÃtulos e resumosâ¦",categoryLabel:"Categoria",categoryAll:"Todos",watchOnYoutube:"Assistir no YouTube",download:"Baixar",paidOnlyLabel:"Apenas membros pagos",publicLabel:"Público"},c6={title:"Publicar conteúdo",sub:"Crie um novo recurso (embeds do YouTube suportados).",newCta:"Novo recurso",backCta:"Voltar aos recursos",latestTitle:"Recursos mais recentes",modalNewTitle:"Novo recurso",modalEditTitle:"Editar recurso",confirmDelete:"Excluir este recurso?",notAllowedTitle:"Não permitido",notAllowedSub:"Você precisa ser Admin ou Editor para publicar conteúdo.",fields:{title:"TÃtulo",category:"Categoria",type:"Tipo",summary:"Resumo",youtubeUrl:"URL do YouTube",fileUrl:"URL do arquivo",thumbnailUrl:"URL da miniatura",contentOwner:"Dono do conteúdo",partnerName:"Nome do parceiro (se aplicável)",tags:"Tags (separadas por vÃrgulas)",year:"Ano",publishedAt:"Publicado em",access:"Acesso"},filters:{search:"Pesquisar",searchPlaceholder:"Pesquisar no tÃtulo/resumoâ¦",category:"Categoria",type:"Tipo",all:"Todos"},preview:"Pré-visualizar",loadMore:"Carregar mais",access:{paidMembers:"Membros pagos",public:"Público"}},d6={title:"Eventos",sub:"Eventos e anúncios para membros.",manageCta:"Gerenciar eventos",paidTitle:"Alguns eventos são apenas para membros pagos",paidSub:"Atualize sua adesão para ver eventos exclusivos.",goToBilling:"Ir para Pagamentos",searchLabel:"Pesquisar",searchPlaceholder:"Pesquisar tÃtulo/resumo/localâ¦",typeLabel:"Tipo",all:"Todos",unknownType:"Evento",registerCta:"Inscrever-se",when:"Quando: {{date}} à s {{time}}",where:"Onde: {{location}}",badges:{paid:"Pago",public:"Público"}},u6={title:"Publicar eventos",sub:"Criar e gerenciar eventos (Admin/Editor).",newCta:"Novo evento",backCta:"Voltar para Eventos",latestTitle:"Ãltimos eventos",modalNewTitle:"Novo evento",modalEditTitle:"Editar evento",confirmDelete:"Excluir este evento?",preview:"Prévia",notAllowedTitle:"Não permitido",notAllowedSub:"Você precisa ser Admin ou Editor para publicar eventos.",badges:{featured:"Destaque",standard:"Padrão",paid:"Pago",public:"Público"},fields:{title:"TÃtulo",type:"Tipo",summary:"Resumo",startAt:"InÃcio",endAt:"Fim",timezone:"Fuso horário",location:"Local",registrationUrl:"URL de inscrição",access:"Acesso",featured:"Destaque"},featured:{yes:"Sim",no:"Não"},access:{public:"Público",paidMembers:"Membros pagos"},timezone:{placeholderDraft:"Opcional para rascunhos",placeholderPublished:"Selecione uma zona de referência",hintPublished:"Obrigatório para eventos publicados: as horas inseridas são convert
67idas corretamente e os e-mails mostram a hora de referência do organizador."},ok:{posted:"Publicado com sucesso.",saved:"Salvo com sucesso.",deleted:"ExcluÃdo com sucesso."},errors:{missingRequired:"TÃtulo, tipo e hora de inÃcio são obrigatórios.",timezoneRequiredPublished:"Eventos publicados exigem um fuso horário (WAT, EAT, SAST, CAT, GMT ou UTC). Guarde como rascunho se ainda não puder escolher.",failed:"Falhou"}},h6={email:"E-mail",password:"Senha",signIn:"Entrar",signingIn:"Entrandoâ¦",createAccount:"Criar conta",creatingAccount:"Criando contaâ¦",noAccount:"Novo na ACGC?",join:"Comece sua adesão",alreadyMember:"Já é membro?",loginLink:"Login",loginFailed:"Falha no login",registrationFailed:"Falha no cadastro",login:{eyebrow:"Login de membro",title:"Acessar o Hub de Membros ACGC",sub:"Entre para acessar a comunidade, diretório e recursos da ACGC.",benefitsTitle:"Sua adesão inclui",benefitsSub:"Tudo o que você precisa para se conectar com a comunidade e recursos da ACGC.",forgotPassword:"Esqueceu a senha?",benefits:{network:"Rede de membros: Conecte-se com mais de 3.000 advogados internos e de governo em mais de 25 paÃses.",events:"Eventos e aprendizado: Acesse webinários, mesas redondas e programas de conferências ao longo do ano.",resources:"Recursos e informações: Guias, pesquisas, gravações e materiais práticos da comunidade ACGC.",opportunities:"Oportunidades e visibilidade: Oportunidades de palestras, artigos e oportunidades de carreira compartilhados na rede."}},register:{eyebrow:"Juntar-se à ACGC",title:"Criar seu perfil de membro",sub:"Os membros são sempre indivÃduos. A organização é usada para agrupamento, relatórios e futuras atualizações para planos de organização.",passwordHint:"MÃnimo de 8 caracteres",fields:{firstName:"Nome",lastName:"Sobrenome",organisation:"Organização",jobTitle:"Cargo",sector:"Setor",industry:"Indústria",country:"PaÃs",linkedin:"LinkedIn",twitter:"Twitter",instagram:"Instagram",membershipPackage:"Pacote de adesão"},sidebarTitle:"Clareza do modelo de dados",sidebarSub:"Mantemos a cobrança comercial separada do agrupamento organizacional e da identidade individual.",sidebar:{membershipPackageTitle:"Pacote de adesão",membershipPackageSub:"Plano individual ou plano da organização (multi-membros)",organisationTitle:"Conta da organização",organisationSub:"Agrupamento de empregador/instituição (existe independentemente de como você paga)",memberProfileTitle:"Perfil do membro",memberProfileSub:"A pessoa (você). Sempre se cadastra como indivÃduo."}}},m6={brand:JI,nav:QI,home:XI,footer:ZI,about:e6,events:t6,publicResources:s6,languagePicker:n6,common:r6,portalDirectory:a6,portalBilling:i6,portalProfile:o6,portalResources:l6,portalResourcesManage:c6,portalEvents:d6,portalEventsManage:u6,auth:h6},f6={logoSubtitle:"Foro de consejeros"},p6={about:"Acerca de",events:"Eventos",resources:"Recursos",memberLogin:"Acceso de miembros",join:"Unirse a ACGC",dashboard:"Panel",directory:"Directorio",profile:"Mi perfil",billing:"Pagos",logout:"Salir"},x6={eyebrow:"Foro Africano de Consejeros JurÃdicos Corporativos y Gubernamentales",headline:"El hogar profesional para abogados internos y del gobierno en toda Ãfrica.",sub:"Eventos, recursos de aprendizaje y una red de miembros para fortalecer la comunidad y el intercambio de conocimiento.",ctaJoin:"Unirse a ACGC",ctaEvents:"Ver eventos",stats:{memberNetworkTitle:"Red de miembros",memberNetworkDesc:"Encuentra colegas por paÃs, sector y rol.",resourceHubTitle:"Centro de recursos",resourceHubDesc:"GuÃas, vÃdeos y herramientas (YouTube).",eventsTitle:"Eventos",eventsDesc:"Webinars, conferencias, formaciones."},thisWeek:{title:"Esta semana en ACGC",badge:"Nuevo",sub:"Una experiencia premium con tarjetas de panel, directorio y recursos.",cards:{webinarTitle:"Webinar próximo",webinarMeta:"GuÃa de operaciones legales internas",webinarCta:"Ver eventos",resourceTitle:"Nuevo recurso",resourceMeta:"Consejos prácticos y guÃas",resourceCta:"Explorar recursos",portalTitle:"Portal de miembros",portalMeta:"Red y contenido exclusivos",portalCta:"Iniciar sesión"}},ecosystem:{eyebrow:"Diseñado para aportar valor",title:"Un ecosistema moderno para eventos, recursos y membresÃa",sub:"Esta es la base. Las próximas fases añaden facturación, analÃtica avanzada, flujos de admin y migración de contenido.",cta:"Hazte miembro"},features:{directoryTitle:"Directorio de miembros",directoryDesc:"Directorio en tarjetas con búsqueda y filtros, diseñado para descubrir rápido.",directoryTag:"Portal",resourcesTitle:"Recursos y vÃdeos",resourcesDesc:"CategorÃas estructuradas con miniaturas, resúmenes e incrustaciones de YouTube.",resourcesTag:"Portal",eventsTitle:"Eventos",eventsDesc:"Tarjetas de eventos (cuenta atrás, etiquetas, añadir al calendario) listas para la próxima iteración.",eventsTag:"Público + Portal"},ready:{title:"¿Listo para unirte?",sub:"Crea tu perfil de miembro en minutos.",ctaJoin:"Unirse a ACGC",ctaLogin:"Ya tengo una cuenta"}},g6={copyright:"© {{year}} Foro Africano de Consejeros JurÃdicos Corporativos y Gubernamentales.",tagline:"Sitio moderno + base del portal de miembros."},b6={eyebrow:"Acerca de",title:"Acerca de ACGC",sub:"Contenido inicial. La siguiente fase reemplazará este texto por la versión final y mejorará el SEO.",missionTitle:"Misión",missionBody:"ACGC fortalece la comunidad de abogados internos y del gobierno en Ãfrica a través de eventos, aprendizaje y conexión entre colegas.",buildingTitle:"Lo que estamos construyendo",buildingBody:"Un sitio público moderno y un portal de pago con directorio, recursos estructurados y flujos unificados."},y6={eyebrow:"Eventos",title:"Conferencias, webinars y formación",sub:"Vista inicial. La próxima iteración añade cuenta atrás, añadir al calendario, precios para miembros/no miembros y facturación.",featured:"Destacado",detailsNext:"Detalles (próxima fase)",registerCta:"Registrarse",membersMoreTitle:"Los miembros obtienen más",membersMoreSub:"Los precios diferenciados y el acceso a recursos posteriores al evento se aplicarán en el portal de miembros.",membersMoreCta:"Unirse a ACGC"},v6={eyebrow:"Recursos",title:"Contenido estructurado y buscable",sub:"Vista previa pública. En el portal de miembros añadiremos pestañas, filtros, etiquetas y control de acceso de pago.",preview:"Vista previa",videoHostingTitle:"Alojamiento de vÃdeo",videoHostingSub:"Todo el contenido de vÃdeo se integra desde YouTube (no se aloja localmente).",videoPlayerTitle:"Reproductor de vÃdeo de YouTube"},w6={title:"Elegir idioma",close:"Cerrar",searchPlaceholder:"Buscar por nombre o código (p. ej. fr-CA, zh-Hans)"},j6={loading:"Cargandoâ¦",saving:"Guardandoâ¦",itemCount:"{{count}} elemento(s)",resultCount:"{{count}} resultado(s)",empty:"â",failed:"Falló",edit:"Editar",delete:"Eliminar",close:"Cerrar",cancel:"Cancelar",save:"Guardar",post:"Publicar"},N6={paidTitle:"El Directorio de miembros es una función de pago",paidSub
67:"Mejora tu membresÃa para acceder al directorio y conectar con colegas.",goToBilling:"Ir a Pagos",title:"Directorio de miembros",sub:"Busca y filtra para encontrar miembros rápidamente.",searchLabel:"Buscar",searchPlaceholder:"Nombre, organización, cargoâ¦",countryLabel:"PaÃs",countryPlaceholder:"p. ej. Kenia",sectorLabel:"Sector",industryLabel:"Industria",all:"Todos",noResults:"Ningún miembro coincide con tus filtros.",memberSince:"Miembro desde {{year}}",linkedin:"LinkedIn",privateMessageNext:"Mensaje privado (próxima fase)"},k6={title:"Pagos",sub:"Stripe Checkout se utiliza para un pago seguro. Se admite la selección de moneda.",currentMembership:"MembresÃa actual",packageLabel:"Paquete:",paid:"Pagado",free:"Gratis",organisationLabel:"Organización:",currencyLabel:"Moneda",redirecting:"Redirigiendoâ¦",payWithStripe:"Pagar con Stripe",stripeSessionDev:"Sesión de Stripe (dev)",selected:"Seleccionado",option:"Opción",feePlaceholder:"Tarifa (placeholder): {{amount}} {{currency}}",plans:{individualTitle:"Plan individual",individualDesc:"Un solo miembro. Aún vinculado a tu organización para informes y mejoras futuras.",organisationTitle:"Plan de organización",organisationDesc:"Estructura de facturación multi-miembro. Los miembros inscritos se vincularán a una cuenta de organización."}},C6={title:"Mi perfil",sub:"Tu perfil de miembro siempre es individual (no una organización).",paymentLabel:"Pago:",packageLabel:"Paquete:",memberSince:"Miembro desde {{year}}",devToolsTitle:"Herramientas dev",devToolsSub:"Solo para pruebas locales antes de la verificación de Stripe.",simulatePaid:"Simular estado de pago",updating:"Actualizandoâ¦",devPaidSet:"Estado de pago establecido en PAGADO (solo dev).",fields:{name:"Nombre",email:"Correo",organisation:"Organización",jobTitle:"Cargo",sector:"Sector",industry:"Industria",country:"PaÃs",linkedin:"LinkedIn"}},S6={title:"Recursos",sub:"CategorÃas estructuradas con una biblioteca buscable. Los vÃdeos se integran desde YouTube.",postCta:"Publicar contenido",paidTitle:"Algunos recursos son solo para miembros de pago",paidSub:"Mejora tu membresÃa para desbloquear recursos de pago.",goToBilling:"Ir a facturación",searchLabel:"Buscar",searchPlaceholder:"Buscar tÃtulos y resúmenesâ¦",categoryLabel:"CategorÃa",categoryAll:"Todos",watchOnYoutube:"Ver en YouTube",download:"Descargar",paidOnlyLabel:"Solo miembros de pago",publicLabel:"Público"},_6={title:"Publicar contenido",sub:"Crea un nuevo recurso (integraciones de YouTube compatibles).",newCta:"Nuevo recurso",backCta:"Volver a Recursos",latestTitle:"Ãltimos recursos",modalNewTitle:"Nuevo recurso",modalEditTitle:"Editar recurso",confirmDelete:"¿Eliminar este recurso?",notAllowedTitle:"No permitido",notAllowedSub:"Necesitas rol de Admin o Editor para publicar contenido.",fields:{title:"TÃtulo",category:"CategorÃa",type:"Tipo",summary:"Resumen",youtubeUrl:"URL de YouTube",fileUrl:"URL del archivo",thumbnailUrl:"URL de miniatura",contentOwner:"Propietario del contenido",partnerName:"Nombre del socio (si aplica)",tags:"Etiquetas (separadas por comas)",year:"Año",publishedAt:"Publicado el",access:"Acceso"},filters:{search:"Buscar",searchPlaceholder:"Buscar en tÃtulo/resumenâ¦",category:"CategorÃa",type:"Tipo",all:"Todos"},preview:"Vista previa",loadMore:"Cargar más",access:{paidMembers:"Miembros de pago",public:"Público"}},T6={title:"Eventos",sub:"Eventos y anuncios para miembros.",manageCta:"Gestionar eventos",paidTitle:"Algunos eventos son solo para miembros de pago",paidSub:"Mejora tu membresÃa para ver eventos solo para miembros.",goToBilling:"Ir a Pagos",searchLabel:"Buscar",searchPlaceholder:"Buscar tÃtulo/resumen/ubicaciónâ¦",typeLabel:"Tipo",all:"Todos",unknownType:"Evento",registerCta:"Registrarse",when:"Cuándo: {{date}} a las {{time}}",where:"Dónde: {{location}}",badges:{paid:"De pago",public:"Público"}},E6={title:"Publicar eventos",sub:"Crea y gestiona eventos (Admin/Editor).",newCta:"Nuevo evento",backCta:"Volver a Eventos",latestTitle:"Ãltimos eventos",modalNewTitle:"Nuevo evento",modalEditTitle:"Editar evento",confirmDelete:"¿Eliminar este evento?",preview:"Vista previa",notAllowedTitle:"No permitido",notAllowedSub:"Necesitas rol de Admin o Editor para publicar eventos.",badges:{featured:"Destacado",standard:"Estándar",paid:"De pago",public:"Público"},fields:{title:"TÃtulo",type:"Tipo",summary:"Resumen",startAt:"Inicio",endAt:"Fin",timezone:"Zona horaria",location:"Ubicación",registrationUrl:"URL de registro",access:"Acceso",featured:"Destacado"},featured:{yes:"SÃ",no:"No"},access:{public:"Público",paidMembers:"Miembros de pago"},timezone:{placeholderDraft:"Opcional en borradores",placeholderPublished:"Seleccione una zona de referencia",hintPublished:"Obligatorio para eventos publicados: las horas introducidas se convierten correctamente y los correos muestran la hora de referencia del organizador."}
67,ok:{posted:"Publicado correctamente.",saved:"Guardado correctamente.",deleted:"Eliminado correctamente."},errors:{missingRequired:"TÃtulo, tipo y hora de inicio son obligatorios.",timezoneRequiredPublished:"Los eventos publicados requieren una zona horaria (WAT, EAT, SAST, CAT, GMT o UTC). Guarde como borrador si aún no puede elegir una.",failed:"Falló"}},M6={email:"Correo electrónico",password:"Contraseña",signIn:"Iniciar sesión",signingIn:"Iniciando sesiónâ¦",createAccount:"Crear cuenta",creatingAccount:"Creando cuentaâ¦",noAccount:"¿Nuevo en ACGC?",join:"Comienza tu membresÃa",alreadyMember:"¿Ya eres miembro?",loginLink:"Acceso",loginFailed:"Error al iniciar sesión",registrationFailed:"Error al registrarse",login:{eyebrow:"Acceso de miembros",title:"Acceder al Hub de Miembros ACGC",sub:"Inicia sesión para acceder a la comunidad, directorio y recursos de ACGC.",benefitsTitle:"Tu membresÃa incluye",benefitsSub:"Todo lo que necesitas para conectarte con la comunidad y los recursos de ACGC.",forgotPassword:"¿Olvidaste tu contraseña?",benefits:{network:"Red de miembros: Conecta con más de 3.000 abogados internos y de gobierno en más de 25 paÃses.",events:"Eventos y aprendizaje: Accede a webinarios, mesas redondas y programas de conferencias durante todo el año.",resources:"Recursos e información: GuÃas, investigación, grabaciones y materiales prácticos de la comunidad ACGC.",opportunities:"Oportunidades y visibilidad: Oportunidades para hablar, artÃculos editoriales y oportunidades profesionales compartidas en la red."}},register:{eyebrow:"Unirse a ACGC",title:"Crear tu perfil de miembro",sub:"Los miembros siempre son individuos. La organización se usa para agrupar, reportar y futuras mejoras hacia plane
67s de organización.",passwordHint:"MÃnimo 8 caracteres",fields:{firstName:"Nombre",lastName:"Apellidos",organisation:"Organización",jobTitle:"Cargo",sector:"Sector",industry:"Industria",country:"PaÃs",linkedin:"LinkedIn",twitter:"Twitter",instagram:"Instagram",membershipPackage:"Paquete de membresÃa"},sidebarTitle:"Claridad del modelo de datos",sidebarSub:"Separamos la facturación comercial del agrupamiento organizacional y la identidad individual.",sidebar:{membershipPackageTitle:"Paquete de membresÃa",membershipPackageSub:"Plan individual o plan de organización (multi-miembro)",organisationTitle:"Cuenta de organización",organisationSub:"Agrupación de empleador/institución (existe independientemente de cómo pagues)",memberProfileTitle:"Perfil de miembro",memberProfileSub:"La persona (tú). Siempre se registra como individuo."}}},A6={brand:f6,nav:p6,home:x6,footer:g6,about:b6,events:y6,publicResources:v6,languagePicker:w6,common:j6,portalDirectory:N6,portalBilling:k6,portalProfile:C6,portalResources:S6,portalResourcesManage:_6,portalEvents:T6,portalEventsManage:E6,auth:M6},P6={logoSubtitle:"Jukwaa la mawakili"},D6={about:"Kuhusu",events:"Matukio",resources:"Rasilimali",memberLogin:"Ingia",join:"Jiunge na ACGC",dashboard:"Dashibodi",directory:"Orodha ya Wanachama",profile:"Wasifu Wangu",billing:"Malipo",logout:"Toka"},R6={eyebrow:"Jukwaa la Mawakili wa Ndani na Serikali Afrika",headline:"Nyumbani kwa kitaaluma kwa wanasheria wa ndani na wa serikali barani Afrika.",sub:"Matukio, rasilimali za kujifunza, na mtandao wa wanachama kwa ajili ya kuimarisha jamii na kubadilishana maarifa.",ctaJoin:"Jiunge",ctaEvents:"Tazama Matukio",stats:{memberNetworkTitle:"Mtandao wa wanachama",memberNetworkDesc:"Pata wenzako kwa nchi, sekta na jukumu.",resourceHubTitle:"Kituo cha rasilimali",resourceHubDesc:"Miongozo, video, zana (YouTube embeds).",eventsTitle:"Matukio",eventsDesc:"Webina, makongamano, mafunzo."},thisWeek:{title:"Wiki hii ACGC",badge:"Mpya",sub:"Uzoefu wa kiwango cha juu wenye kadi za dashibodi, orodha na rasilimali.",cards:{webinarTitle:"Webina ijayo",webinarMeta:"Mwongozo wa utendaji wa sheria za ndani",webinarCta:"Tazama matukio",resourceTitle:"Rasilimali mpya",resourceMeta:"Vidokezo na miongozo ya vitendo",resourceCta:"Tazama rasilimali",portalTitle:"Lango la wanachama",portalMeta:"Mitandao na maudhui ya kipekee",portalCta:"Ingia"}},ecosystem:{eyebrow:"Imeundwa kwa thamani",title:"Mfumo wa kisasa kwa matukio, rasilimali na uanachama",sub:"Huu ni msingi. Awamu zinazofuata huongeza malipo, uchambuzi wa kina, kazi za msimamizi na uhamishaji wa maudhui.",cta:"Kuwa mwanachama"},features:{directoryTitle:"Orodha ya wanachama",directoryDesc:"Orodha ya kadi yenye utafutaji na vichujio, kwa ugunduzi wa haraka.",directoryTag:"Portal",resourcesTitle:"Rasilimali na video",resourcesDesc:"Makundi yenye muundo, picha ndogo, muhtasari na YouTube embeds.",resourcesTag:"Portal",eventsTitle:"Matukio",eventsDesc:"Kadi za matukio (hesabu nyuma, vitambulisho, kuongeza kalenda) tayari kwa hatua inayofuata.",eventsTag:"Umma + Portal"},ready:{title:"Uko tayari kujiunga?",sub:"Tengeneza wasifu wako kwa dakika chache.",ctaJoin:"Jiunge",ctaLogin:"Tayari nina akaunti"}},L6={copyright:"© {{year}} Jukwaa la Mawakili wa Ndani na Serikali Afrika.",tagline:"Tovuti ya kisasa + msingi wa portal ya wanachama."},O6={eyebrow:"Kuhusu",title:"Kuhusu ACGC",sub:"Maudhui ya mwanzo. Awamu inayofuata itabadilisha maandishi haya na kuboresha SEO.",missionTitle:"Dhamira",missionBody:"ACGC huimarisha jamii ya mawakili wa ndani na wa serikali barani Afrika kupitia matukio, kujifunza na uhusiano wa wenzao.",buildingTitle:"Tunachojenga",buildingBody:"Tovuti ya umma ya kisasa na portal ya kulipia yenye orodha, rasilimali zenye muundo na mifumo iliyounganishwa."},I6={eyebrow:"Matukio",title:"Makongamano, webina na mafunzo",sub:"Mwonekano wa mwanzo. Toleo lijalo litaongeza countdown, kuongeza kwenye kalenda, bei za wanachama/wasio wanachama na malipo.",featured:"Maarufu",detailsNext:"Maelezo (awamu ijayo)",registerCta:"Jisajili",membersMoreTitle:"Wanachama hupata zaidi",membersMoreSub:"Bei tofauti na upatikanaji wa rasilimali baada ya tukio utasimamiwa kwenye portal ya wanachama.",membersMoreCta:"Jiunge"},F6={eyebrow:"Rasilimali",title:"Maudhui yenye muundo na yanayoweza kutafutwa",sub:"Mwonekano wa umma. Kwenye portal tutaongeza vichupo, vichujio, lebo na udhibiti wa upatikanaji wa kulipia.",preview:"Mwonekano",videoHostingTitle:"Ukaribishaji wa video",videoHostingSub:"Video zote huonyeshwa kupitia YouTube (hazihifadhiwi hapa).",videoPlayerTitle:"Kichezeshi cha video cha YouTube"},$6={title:"Chagua lugha",close:"Funga",searchPlaceholder:"Tafuta kwa jina au msimbo (mf. fr-CA, zh-Hans)"},z6={loading:"Inapakiaâ¦",saving:"Inahifadhiâ¦",itemCount:"{{count}} kipengee",resultCount:"{{count}} matokeo",empty:"â",failed:"Imeshindikana",edit:"Hariri",delete:"Futa",close:"Funga",cancel:"Ghairi",save:"Hifadhi",post:"Chapisha"},B6={paidTitle:"Orodha ya Wanachama ni huduma ya kulipia",paidSub
67:"Boresha uanachama wako ili upate orodha na kuungana na wenzako.",goToBilling:"Nenda kwenye Malipo",title:"Orodha ya wanachama",sub:"Tafuta na chuja ili upate wanachama kwa haraka.",searchLabel:"Tafuta",searchPlaceholder:"Jina, shirika, cheoâ¦",countryLabel:"Nchi",countryPlaceholder:"mf. Kenya",sectorLabel:"Sekta",industryLabel:"Sekta ya biashara",all:"Zote",noResults:"Hakuna mwanachama anayelingana na vichujio vyako.",memberSince:"Mwanachama tangu {{year}}",linkedin:"LinkedIn",privateMessageNext:"Ujumbe binafsi (awamu ijayo)"},V6={title:"Malipo",sub:"Stripe Checkout hutumika kwa malipo salama. Uchaguzi wa sarafu unaungwa mkono.",currentMembership:"Uanachama wa sasa",packageLabel:"Kifurushi:",paid:"Umelipa",free:"Bure",organisationLabel:"Shirika:",currencyLabel:"Sarafu",redirecting:"Inaelekezaâ¦",payWithStripe:"Lipa kwa Stripe",stripeSessionDev:"Kikao cha Stripe (dev)",selected:"Imechaguliwa",option:"Chaguo",feePlaceholder:"Ada (placeholder): {{amount}} {{currency}}",plans:{individualTitle:"Mpango wa mtu binafsi",individualDesc:"Mwanachama mmoja. Bado umeunganishwa na shirika lako kwa ripoti na maboresho yajayo.",organisationTitle:"Mpango wa shirika",organisationDesc:"Muundo wa malipo wa wanachama wengi. Wanachama waliandikishwa wataunganishwa na akaunti moja ya shirika."}},U6={title:"Wasifu Wangu",sub:"Wasifu wako wa mwanachama ni wa mtu binafsi (si shirika).",paymentLabel:"Malipo:",packageLabel:"Kifurushi:",memberSince:"Mwanachama tangu {{year}}",devToolsTitle:"Zana za dev",devToolsSub:"Kwa majaribio ya ndani tu kabla ya uthibitisho wa Stripe.",simulatePaid:"Jaribu hali ya kulipia",updating:"Inasasishaâ¦",devPaidSet:"Hali ya malipo imewekwa kuwa PAID (dev pekee).",fields:{name:"Jina",email:"Barua pepe",organisation:"Shirika",jobTitle:"Cheo",sector:"Sekta",industry:"Sekta ya biashara",country:"Nchi",linkedin:"LinkedIn"}},H6={title:"Rasilimali",sub:"Makundi yaliyopangwa na maktaba inayoweza kutafutwa. Video zimeingizwa kutoka YouTube.",postCta:"Chapisha maudhui",paidTitle:"Baadhi ya rasilimali ni za wanachama wanaolipa",paidSub:"Boresha uanachama wako ili kufungua rasilimali za malipo.",goToBilling:"Nenda kwenye Malipo",searchLabel:"Tafuta",searchPlaceholder:"Tafuta vichwa na muhtasariâ¦",categoryLabel:"Kategoria",categoryAll:"Zote",watchOnYoutube:"Tazama kwenye YouTube",download:"Pakua",paidOnlyLabel:"Wanachama wanaolipa pekee",publicLabel:"Hadharani"},W6={title:"Chapisha maudhui",sub:"Unda rasilimali mpya (YouTube embeds zinatumika).",newCta:"Rasilimali mpya",backCta:"Rudi kwenye Rasilimali",latestTitle:"Rasilimali za hivi karibuni",modalNewTitle:"Rasilimali mpya",modalEditTitle:"Hariri rasilimali",confirmDelete:"Futa rasilimali hii?",notAllowedTitle:"Hairuhusiwi",notAllowedSub:"Unahitaji kuwa Admin au Editor ili kuchapisha maudhui.",fields:{title:"Kichwa",category:"Kategoria",type:"Aina",summary:"Muhtasari",youtubeUrl:"URL ya YouTube",fileUrl:"URL ya faili",thumbnailUrl:"URL ya picha",contentOwner:"Mmiliki wa maudhui",partnerName:"Jina la mshirika (ikiwezekana)",tags:"Lebo (kwa koma)",year:"Mwaka",publishedAt:"Ilichapishwa",access:"Upatikanaji"},filters:{search:"Tafuta",searchPlaceholder:"Tafuta kichwa/muhtasariâ¦",category:"Kategoria",type:"Aina",all:"Zote"},preview:"Hakiki",loadMore:"Onyesha zaidi",access:{paidMembers:"Wanachama wanaolipa",public:"Hadharani"}},G6={title:"Matukio",sub:"Matukio na matangazo ya wanachama.",manageCta:"Dhibiti matukio",paidTitle:"Baadhi ya matukio ni ya wanachama wanaolipa",paidSub:"Boresha uanachama wako ili uone matukio ya kulipia pekee.",goToBilling:"Nenda kwenye Malipo",searchLabel:"Tafuta",searchPlaceholder:"Tafuta kichwa/muhtasari/eneoâ¦",typeLabel:"Aina",all:"Zote",unknownType:"Tukio",registerCta:"Jisajili",when:"Lini: {{date}} saa {{time}}",where:"Wapi: {{location}}",badges:{paid:"Ya kulipia",public:"Hadharani"}},Y6={title:"Chapisha matukio",sub:"Unda na dhibiti matukio (Admin/Mhariri).",newCta:"Tukio jipya",backCta:"Rudi kwenye Matukio",latestTitle:"Matukio ya hivi karibuni",modalNewTitle:"Tukio jipya",modalEditTitle:"Hariri tukio",confirmDelete:"Futa tukio hili?",preview:"Hakiki",notAllowedTitle:"Hairuhusiwi",notAllowedSub:"Unahitaji kuwa Admin au Mhariri ili kuchapisha matukio.",badges:{featured:"Maarufu",standard:"Kawaida",paid:"Ya kulipia",public:"Hadharani"},fields:{title:"Kichwa",type:"Aina",summary:"Muhtasari",startAt:"Anza",endAt:"Maliza",timezone:"Muda wa eneo",location:"Eneo",registrationUrl:"Kiungo cha usajili",access:"Upatikanaji",featured:"Maarufu"},featured:{yes:"Ndiyo",no:"Hapana"},access:{public:"Hadharani",paidMembers:"Wanachama wanaolipa"},timezone:{placeholderDraft:"Si lazima kwa rasimu",placeholderPublished:"Chagua eneo la kumbukumbu",hintPublished:"Lazima kwa matukio yaliyochapishwa: muda unaingizwa unabadilishwa kwa usahihi na barua pepe zinaonyesha muda wa kumbukumbu wa mratibu."},ok:{posted:"Imechapishwa kwa mafanikio.",saved:"Imehifadhiwa kwa mafanikio.",deleted:"Imefutwa kwa mafanikio."},errors:{missingRequired:"Kichwa, Aina na muda wa kuanza vinahitajika.",timezoneRequiredPublished:"Matukio yaliyochapishwa yanahitaji eneo la saa (WAT, EAT, SAST, CAT, GMT au UTC). Hifadhi kama rasimu ikiwa bado huwezi kuchagua.",failed:"Imeshindikana"}},q6={email:"Barua pepe",password:"Nenosiri",signIn:"Ingia",signingIn:"Inaingiaâ¦",createAccount:"Fungua akaunti",creatingAccount:"Inaunda akauntiâ¦",noAccount:"Mpya kwa ACGC?",join:"Anza uanachama wako",alreadyMember:"Tayari ni mwanachama?",loginLink:"Ingia",loginFailed:"Imeshindwa kuingia",registrationFailed:"Imeshindwa kujiandikisha",login:{eyebrow:"Ingia",title:"Fikia ACGC Hub ya Wanachama",sub:"Ingia kupata jumuiya, orodha na rasilimali za ACGC.",benefitsTitle:"Uanachama wako unajumuisha",benefitsSub
67:"Kila kitu unachohitaji kuungana na jumuiya na rasilimali za ACGC.",forgotPassword:"Umesahau nenosiri?",benefits:{network:"Mtandao wa wanachama: Ungana na zaidi ya wakili 3,000 wa ndani na serikali katika nchi zaidi ya 25.",events:"Matukio na Kujifunza: Fikia webina, meza za duara na programu za mikutano mwaka mzima.",resources:"Rasilimali na Maarifa: Miongozo, utafiti, rekodi na nyenzo za vitendo kutoka jumuiya ya ACGC.",opportunities:"Fursa na Uonekano: Fursa za kuzungumza, makala na fursa za kazi zinazoshirikiwa ndani ya mtandao."}},register:{eyebrow:"Jiunge",title:"Tengeneza wasifu wako wa mwanachama",sub:"Wanachama ni watu binafsi. Shirika hutumika kwa upangaji, ripoti na maboresho ya baadaye kwa mipango ya shirika.",passwordHint:"Angalau herufi 8",fields:{firstName:"Jina la kwanza",lastName:"Jina la mwisho",organisation:"Shirika",jobTitle:"Cheo",sector:"Sekta",industry:"Sekta ya biashara",country:"Nchi",linkedin:"LinkedIn",twitter:"Twitter",instagram:"Instagram",membershipPackage:"Kifurushi cha uanachama"},sidebarTitle:"Uwazi wa muundo wa data",sidebarSub:"Tunatenganisha malipo ya kibiashara na upangaji wa shirika na utambulisho wa mtu binafsi.",sidebar:{membershipPackageTitle:"Kifurushi cha uanachama",membershipPackageSub:"Mpango wa mtu binafsi au mpango wa shirika (wanachama wengi)",organisationTitle:"Akaunti ya shirika",organisationSub:"Upangaji wa mwajiri/taasisi (ipo bila kujali jinsi unavyolipa)",memberProfileTitle:"Wasifu wa mwanachama",memberProfileSub:"Mtu (wewe). Daima hujiandikisha kama mtu binafsi."}}},K6={brand:P6,nav:D6,home:R6,footer:L6,about:O6,events:I6,publicResources:F6,languagePicker:$6,common:z6,portalDirectory:B6,portalBilling:V6,portalProfile:U6,portalResources:H6,portalResourcesManage:W6,portalEvents:G6,portalEventsManage:Y6,auth:q6};function J6(t){const e=String(t).trim();if(!e)return"en";const s=e.split("-").filter(Boolean);if(s.length===0)return"en";const n=[];for(let a=0;a<s.length;a++){const i=s[a];if(a===0){n.push(i.toLowerCase());continue}if(i.length===4){n.push(i[0].toUpperCase()+i.slice(1).toLowerCase());continue}if(i.length===2){n.push(i.toUpperCase());continue}if(/^\d{3}$/.test(i)){n.push(i);continue}n.push(i)}return n.join("-")}const Q6=[{name:"Afrikaans",code:"af"},{name:"Albanian",code:"sq"},{name:"Arabic (Saudi Arabia)",code:"ar-SA"},{name:"Arabic",code:"ar"},{name:"Azerbaijani",code:"az"},{name:"Belarusian",code:"be"},{name:"Bengali (India)",code:"bn-IN"},{name:"Bengali",code:"bn"},{name:"Bosnian (Cyrillic)",code:"bs-Cyrl"},{name:"Bosnian",code:"bs"},{name:"Bulgarian",code:"bg"},{name:"Burmese",code:"my"},{name:"Catalan",code:"ca"},{name:"Chinese (China)",code:"zh-CN"},{name:"Chinese (Hong Kong)",code:"zh-HK"},{name:"Chinese (Simplified)",code:"zh-Hans"},{name:"Chinese (Taiwan)",code:"zh-TW"},{name:"Chinese (Traditional)",code:"zh-Hant"},{name:"Chinese",code:"zh"},{name:"Croatian",code:"hr"},{name:"Czech",code:"cs"},{name:"Danish",code:"da"},{name:"Dutch (Belgium)",code:"nl-BE"},{name:"Dutch",code:"nl"},{name:"English (Australia)",code:"en-AU"},{name:"English (Canada)",code:"en-CA"},{name:"English (New Zealand)",code:"en-NZ"},{name:"English (Philippines)",code:"en-PH"},{name:"English (South Africa)",code:"en-ZA"},{name:"English (United Kingdom)",code:"en-GB"},{name:"English (United States)",code:"en-US"},{name:"English",code:"en"},{name:"Estonian",code:"et"},{name:"Filipino",code:"fil"},{name:"Finnish",code:"fi"},{name:"French (Canada)",code:"fr-CA"},{name:"French (Switzerland)",code:"fr-CH"},{name:"French",code:"fr"},{name:"Frisian",code:"fy"},{name:"Galician",code:"gl"},{name:"Georgian",code:"ka"},{name:"German",code:"de"},{name:"Greek",code:"el"},{name:"Guarani",code:"gn"},{name:"Gujarati",code:"gu"},{name:"Hebrew",code:"he"},{name:"Hebrew (legacy)",code:"iw"},{name:"Hindi",code:"hi"},{name:"Hungarian",code:"hu"},{name:"Icelandic",code:"is"},{name:"Indonesian",code:"id"},{name:"Italian",code:"it"},{name:"Japanese",code:"ja"},{name:"Kannada",code:"kn"},{name:"Khmer",code:"km"},{name:"Korean",code:"ko"},{name:"Kyrgyz",code:"ky"},{name:"Lao",code:"lo"},{name:"Latvian",code:"lv"},{name:"Lingala",code:"ln"},{name:"Lithuanian",code:"lt"},{name:"Macedonian",code:"mk"},{name:"Malay",code:"ms"},{name:"Malayalam",code:"ml"},{name:"Marathi",code:"mr"},{name:"Nepali",code:"ne"},{name:"Norwegian Bokmal",code:"nb"},{name:"Norwegian",code:"no"},{name:"Persian",code:"fa"},{name:"Polish",code:"pl"},{name:"Portuguese (Brazil)",code:"pt-BR"},{name:"Portuguese (Portugal)",code:"pt-PT"},{name:"Portuguese",code:"pt"},{name:"Punjabi (Pakistan)",code:"pa-PK"},{name:"Punjabi",code:"pa"},{name:"Romanian",code:"ro"},{name:"Russian",code:"ru"},{name:"Slovak",code:"sk"},{name:"Slovenian",code:"sl"},{name:"Spanish (Argentina)",code:"es-AR"},{name:"Spanish (Chile)",code:"es-CL"},{name:"Spanish (Colombia)",code:"es-CO"},{name:"Spanish (Costa Rica)",code:"es-CR"},{name:"Spanish (Ecuador)",code:"es-EC"},{name:"Spanish (El Salvador)",code:"es-SV"},{name:"Spanish (Guatemala)",code:"es-GT"},{name:"Spanish (Haiti)",code:"es-HT"},{name:"Spanish (Honduras)",code:"es-HN"},{name:"Spanish (Latin America)",code:"es-419"},{name:"Spanish (Mexico)",code:"es-MX"},{name:"Spanish (Nicaragua)",code:"es-NI"},{name:"Spanish (Panama)",code:"es-PA"},{name:"Spanish (Paraguay)",code:"es-PY"},{name:"Spanish (Peru)",code:"es-PE"},{name:"Spanish (Puerto Rico)",code:"es-PR"}
67,{name:"Spanish (Spain)",code:"es-ES"},{name:"Spanish (United States)",code:"es-US"},{name:"Spanish (Uruguay)",code:"es-UY"},{name:"Spanish (Venezuela)",code:"es-VE"},{name:"Spanish",code:"es"},{name:"Swahili",code:"sw"},{name:"Swedish",code:"sv"},{name:"Tagalog",code:"tl"},{name:"Tamil",code:"ta"},{name:"Telugu",code:"te"},{name:"Thai",code:"th"},{name:"Turkish",code:"tr"},{name:"Ukrainian",code:"uk"},{name:"Urdu",code:"ur"},{name:"Uzbek",code:"uz"},{name:"Vietnamese",code:"vi"},{name:"Welsh",code:"cy"},{name:"Zulu",code:"zu"}];new Set(Q6.map(t=>t.code));const X6={en:{translation:AI},fr:{translation:KI},pt:{translation:m6},es:{translation:A6},sw:{translation:K6}},n4="acgc_lang";function Z6(){try{return J6(localStorage.getItem(n4)||"en")}catch{return"en"}}js.use(cI).init({resources:X6,lng:Z6(),fallbackLng:"en",interpolation:{escapeValue:!1}});js.on("languageChanged",t=>{try{localStorage.setItem(n4,t)}catch{}});const e8="https://acgc-production-7e76.up.railway.app";function tt(t){return`${e8}${t}`}function rw(t){if(!t)return"";const e=String(t).trim();return/^https?:\/\//i.test(e)?e:tt(e.startsWith("/")?e:`/${e}`)}function t8(t){return new Promise(e=>setTimeout(e,t))}async function U(t,{token:e,method:s="GET",body:n,retryDbInit:a=!0}={}){const i=n instanceof FormData;let o;!i&&n&&(o=JSON.stringify(n));const l=s==="GET"&&a!==!1?12:1;for(let c=1;c<=l;c++){const d=await fetch(tt(t),{method:s,headers:{...i?{}:{"Content-Type":"application/json"},...e?{Authorization:`Bearer ${e}`}:{}},body:i?n:o}),u=await d.json().catch(()=>({}));if(d.ok)return u;if(d.status===503&&(u==null?void 0:u.error)==="service_unavailable"&&(u==null?void 0:u.details)==="database_initializing"&&c<l){await t8(Math.min(350*c,2500));continue}const m=u!=null&&u.details&&(u!=null&&u.error)?`${u.error}: ${u.details}`:(u==null?void 0:u.error)||`request_failed_${d.status}`,f=new Error(m);throw f.status=d.status,f.data=u,f}}const Kb="acgc_token";function s8(){try{return localStorage.getItem(Kb)}catch{return null}}function rd(t){try{t?localStorage.setItem(Kb,t):localStorage.removeItem(Kb)}catch{}}const r4=v.createContext(null);function n8({children:t}){const[e,s]=v.useState(s8()),[n,a]=v.useState(null),[i,o]=v.useState(!0),[l,c]=v.useState(!1),d=v.useCallback(async({silent:x=!0,token:b}={})=>{const y=b??e;if(!y){a(null),o(!1),c(!1);return}x?c(!0):o(!0);try{const w=await U("/api/me",{token:y});a(w.member)}catch{rd(null),s(null),a(null)}finally{x?c(!1):o(!1)}},[e]);v.useEffect(()=>{d({silent:!1})},[d]);const u=async(x,b)=>{const y=await U("/api/auth/login",{method:"POST",body:{email:x,password:b}});return rd(y.token),s(y.token),y.token},h=async x=>{const b=await U("/api/auth/register",{method:"POST",body:x});return rd(b.token),s(b.token),b.token},m=async x=>{const b=await U("/api/auth/register-group",{method:"POST",body:x});return rd(b.token),s(b.token),b},f=v.useCallback(x=>{rd(x),s(x||null),x||a(null)},[]),g={token:e,member:n,loading:i,refreshing:l,login:u,register:h,registerGroup:m,setAuthToken:f,logout:()=>{f(null)},refresh:d};return v.createElement(r4.Provider,{value:g},t)}function Oe(){const t=v.useContext(r4);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}const aw=M.createContext({});function Uc(t){const e=M.useRef(null);return e.current===null&&(e.current=t()),e.current}const ix=M.createContext(null),ox=M.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class r8 extends M.Component{getSnapshotBeforeUpdate(e){const s=this.props.childRef.current;if(s&&e.isPresent&&!this.props.isPresent){const n=this.props.sizeRef.current;n.height=s.offsetHeight||0,n.width=s.offsetWidth||0,n.top=s.offsetTop,n.left=s.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function a8({children:t,isPresent:e}){const s=M.useId(),n=M.useRef(null),a=M.useRef({width:0,height:0,top:0,left:0}),{nonce:i}=M.useContext(ox);return M.useInsertionEffect(()=>{const{width:o,height:l,top:c,left:d}=a.current;if(e||!n.current||!o||!l)return;n.current.dataset.motionPopId=s;const u=document.createElement("style");return i&&(u.nonce=i),document.head.appendChild(u),u.sheet&&u.sheet.insertRule(` 68 [data-motion-pop-id="${s}"] { 69 position: absolute !important; 70 width: ${o}px !important; 71 height: ${l}px !important; 72 top: ${c}px !important; 73 left: ${d}px !important; 74 } 75 `),()=>{document.head.removeChild(u)}},[e]),r.jsx(r8,{isPresent:e,childRef:n,sizeRef:a,children:M.cloneElement(t,{ref:n})})}const i8=({children:t,initial:e,isPresent:s,onExitComplete:n,custom:a,presenceAffectsLayout:i,mode:o})=>{const l=Uc(o8),c=M.useId(),d=M.useCallback(h=>{l.set(h,!0);for(const m of l.values())if(!m)return;n&&n()},[l,n]),u=M.useMemo(()=>({id:c,initial:e,isPresent:s,custom:a,onExitComplete:d,register:h=>(l.set(h,!1),()=>l.delete(h))}),i?[Math.random(),d]:[s,d]);return M.useMemo(()=>{l.forEach((h,m)=>l.set(m,!1))},[s]),M.useEffect(()=>{!s&&!l.size&&n&&n()},[s]),o==="popLayout"&&(t=r.jsx(a8,{isPresent:s,children:t})),r.jsx(ix.Provider,{value:u,children:t})};function o8(){return new Map}function a4(t=!0){const e=M.useContext(ix);if(e===null)return[!0,null];const{isPresent:s,onExitComplete:n,register:a}=e,i=M.useId();M.useEffect(()=>{t&&a(i)},[t]);const o=M.useCallback(()=>t&&n&&n(i),[i,n,t]);return!s&&n?[!1,o]:[!0]}const $h=t=>t.key||"";function UN(t){const e=[];
vendor: 30,264 bytes, line 75
75return M.Children.forEach(t,s=>{M.isValidElement(s)&&e.push(s)}),e}const iw=typeof window<"u",lx=iw?M.useLayoutEffect:M.useEffect,ir=({children:t,custom:e,initial:s=!0,onExitComplete:n,presenceAffectsLayout:a=!0,mode:i="sync",propagate:o=!1})=>{const[l,c]=a4(o),d=M.useMemo(()=>UN(t),[t]),u=o&&!l?[]:d.map($h),h=M.useRef(!0),m=M.useRef(d),f=Uc(()=>new Map),[p,g]=M.useState(d),[x,b]=M.useState(d);lx(()=>{h.current=!1,m.current=d;for(let N=0;N<x.length;N++){const j=$h(x[N]);u.includes(j)?f.delete(j):f.get(j)!==!0&&f.set(j,!1)}},[x,u.length,u.join("-")]);const y=[];if(d!==p){let N=[...d];for(let j=0;j<x.length;j++){const S=x[j],k=$h(S);u.includes(k)||(N.splice(j,0,S),y.push(S))}i==="wait"&&y.length&&(N=y),b(UN(N)),g(d);return}const{forceRender:w}=M.useContext(aw);return r.jsx(r.Fragment,{children:x.map(N=>{const j=$h(N),S=o&&!l?!1:d===x||u.includes(j),k=()=>{if(f.has(j))f.set(j,!0);else return;let C=!0;f.forEach(T=>{T||(C=!1)}),C&&(w==null||w(),b(m.current),o&&(c==null||c()),n&&n())};return r.jsx(i8,{isPresent:S,initial:!h.current||s?void 0:!1,custom:S?void 0:e,presenceAffectsLayout:a,mode:i,onExitComplete:S?void 0:k,children:N},j)})})},Gs=t=>t;let l8=Gs,i4=Gs;function ow(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ko=(t,e,s)=>{const n=e-t;return n===0?1:(s-t)/n},Ea=t=>t*1e3,Ma=t=>t/1e3,c8={useManualTiming:!1};function d8(t){let e=new Set,s=new Set,n=!1,a=!1;const i=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function l(d){i.has(d)&&(c.schedule(d),t()),d(o)}const c={schedule:(d,u=!1,h=!1)=>{const f=h&&n?e:s;return u&&i.add(d),f.has(d)||f.add(d),d},cancel:d=>{s.delete(d),i.delete(d)},process:d=>{if(o=d,n){a=!0;return}n=!0,[e,s]=[s,e],e.forEach(l),e.clear(),n=!1,a&&(a=!1,c.process(d))}};return c}const zh=["read","resolveKeyframes","update","preRender","render","postRender"],u8=40;function o4(t,e){let s=!1,n=!0;const a={delta:0,timestamp:0,isProcessing:!1},i=()=>s=!0,o=zh.reduce((b,y)=>(b[y]=d8(i),b),{}),{read:l,resolveKeyframes:c,update:d,preRender:u,render:h,postRender:m}=o,f=()=>{const b=performance.now();s=!1,a.delta=n?1e3/60:Math.max(Math.min(b-a.timestamp,u8),1),a.timestamp=b,a.isProcessing=!0,l.process(a),c.process(a),d.process(a),u.process(a),h.process(a),m.process(a),a.isProcessing=!1,s&&e&&(n=!1,t(f))},p=()=>{s=!0,n=!0,a.isProcessing||t(f)};return{schedule:zh.reduce((b,y)=>{const w=o[y];return b[y]=(N,j=!1,S=!1)=>(s||p(),w.schedule(N,j,S)),b},{}),cancel:b=>{for(let y=0;y<zh.length;y++)o[zh[y]].cancel(b)},state:a,steps:o}}const{schedule:Je,cancel:Ar,state:ns,steps:Tg}=o4(typeof requestAnimationFrame<"u"?requestAnimationFrame:Gs,!0),l4=M.createContext({strict:!1}),HN={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"]},vc={};for(const t in HN)vc[t]={isEnabled:e=>HN[t].some(s=>!!e[s])};function h8(t){for(const e in t)vc[e]={...vc[e],...t[e]}}const m8=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","ignoreStrict","viewport"]);function Sf(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||m8.has(t)}let c4=t=>!Sf(t);function f8(t){t&&(c4=e=>e.startsWith("on")?!Sf(e):t(e))}try{f8(require("@emotion/is-prop-valid").default)}catch{}function p8(t,e,s){const n={};for(const a in t)a==="values"&&typeof t.values=="object"||(c4(a)||s===!0&&Sf(a)||!e&&!Sf(a)||t.draggable&&a.startsWith("onDrag"))&&(n[a]=t[a]);return n}function x8(t){if(typeof Proxy>"u")return t;const e=new Map,s=(...n)=>t(...n);return new Proxy(s,{get:(n,a)=>a==="create"?t:(e.has(a)||e.set(a,t(a)),e.get(a))})}const cx=M.createContext({});function Eu(t){return typeof t=="string"||Array.isArray(t)}function dx(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}const lw=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cw=["initial",...lw];function ux(t){return dx(t.animate)||cw.some(e=>Eu(t[e]))}function d4(t){return!!(ux(t)||t.variants)}function g8(t,e){if(ux(t)){const{initial:s,animate:n}=t;return{initial:s===!1||Eu(s)?s:void 0,animate:Eu(n)?n:void 0}}return t.inherit!==!1?e:{}}function b8(t){const{initial:e,animate:s}=g8(t,M.useContext(cx));return M.useMemo(()=>({initial:e,animate:s}),[WN(e),WN(s)])}function WN(t){return Array.isArray(t)?t.join(" "):t}const y8=Symbol.for("motionComponentSymbol");function Yl(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function v8(t,e,s){return M.useCallback(n=>{n&&t.onMount&&t.onMount(n),e&&(n?e.mount(n):e.unmount()),s&&(typeof s=="function"?s(n):Yl(s)&&(s.current=n))},[e])}const dw=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),w8="framerAppearId",u4="data-"+dw(w8),{schedule:uw}=o4(queueMicrotask,!1),h4=M.createContext({});function j8(t,e,s,n,a){var i,o;const{visualElement:l}=M.useContext(cx),c=M.useContext(l4),d=M.useContext(ix),u=M.useContext(ox).reducedMotion,h=M.useRef(null);n=n||c.renderer,!h.current&&n&&(h.current=n(t,{visualState:e,parent:l,props:s,presenceContext:d,blockInitialAnimation:d?d.initial===!1:!1,reducedMotionConfig:u}));const m=h.current,f=M.useContext(h4);m&&!m.projection&&a&&(m.type==="html"||m.type==="svg")&&N8(h.current,s,a,f);const p=M.useRef(!1);M.useInsertionEffect(()=>{m&&p.current&&m.update(s,d)});const g=s[u4],x=M.useRef(!!g&&!(!((i=window.MotionHandoffIsComplete)===null||i===void 0)&&i.call(window,g))&&((o=window.MotionHasOptimisedAnimation)===null||o===void 0?void 0:o.call(window,g)));return lx(()=>{m&&(p.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),uw.render(m.render),x.current&&m.animationState&&m.animationState.animateChanges())}),M.useEffect(()=>{m&&(!x.current&&m.animationState&&m.animationState.animateChanges(),x.current&&(queueMicrotask(()=>{var b;(b=window.MotionHandoffMarkAsComplete)===null||b===void 0||b.call(window,g)}),x.current=!1))}),m}function N8(t,e,s,n){const{layoutId:a,layout:i,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d}=e;t.projection=new s(t.latestValues,e["data-framer-portal-id"]?void 0:m4(t.parent)),t.projection.setOptions({layoutId:a,layout:i,alwaysMeasureLayout:!!o||l&&Yl(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:n,layoutScroll:c,layoutRoot:d})}function m4(t){if(t)return t.options.allowProjection!==!1?t.projection:m4(t.parent)}function k8({preloadedFeatures:t,createVisualElement:e,useRender:s,useVisualState:n,Component:a}){var i,o;t&&h8(t);function l(d,u){let h;const m={...M.useContext(ox),...d,layoutId:C8(d)},{isStatic:f}=m,p=b8(d),g=n(d,f);if(!f&&iw){S8();const x=_8(m);h=x.MeasureLayout,p.visualElement=j8(a,g,m,e,x.ProjectionNode)}return r.jsxs(cx.Provider,{value:p,children:[h&&p.visualElement?r.jsx(h,{visualElement:p.visualElement,...m}):null,s(a,d,v8(g,p.visualElement,u),g,f,p.visualElement)]})}l.displayName=`motion.${typeof a=="string"?a:`create(${(o=(i=a.displayName)!==null&&i!==void 0?i:a.name)!==null&&o!==void 0?o:""})`}`;const c=M.forwardRef(l);return c[y8]=a,c}function C8({layoutId:t}){const e=M.useContext(aw).id;return e&&t!==void 0?e+"-"+t:t}function S8(t,e){M.useContext(l4).strict}function _8(t){const{drag:e,layout:s}=vc;if(!e&&!s)return{};const n={...e,...s};return{MeasureLayout:e!=null&&e.isEnabled(t)||s!=null&&s.isEnabled(t)?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}const T8=["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 hw(t){return typeof t!="string"||t.includes("-")?!1:!!(T8.indexOf(t)>-1||/[A-Z]/u.test(t))}function GN(t){const e=[{},{}];return t==null||t.values.forEach((s,n)=>{e[0][n]=s.get(),e[1][n]=s.getVelocity()}),e}function mw(t,e,s,n){if(typeof e=="function"){const[a,i]=GN(n);e=e(s!==void 0?s:t.custom,a,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[a,i]=GN(n);e=e(s!==void 0?s:t.custom,a,i)}return e}const Jb=t=>Array.isArray(t),E8=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),M8=t=>Jb(t)?t[t.length-1]||0:t,Ps=t=>!!(t&&t.getVelocity);function Rm(t){const e=Ps(t)?t.get():t;return E8(e)?e.toValue():e}function A8({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:s},n,a,i){const o={latestValues:P8(n,a,i,t),renderState:e()};return s&&(o.onMount=l=>s({props:n,current:l,...o}),o.onUpdate=l=>s(l)),o}const f4=t=>(e,s)=>{const n=M.useContext(cx),a=M.useContext(ix),i=()=>A8(t,e,n,a);return s?i():Uc(i)};function P8(t,e,s,n){const a={},i=n(t,{});for(const m in i)a[m]=Rm(i[m]);let{initial:o,animate:l}=t;const c=ux(t),d=d4(t);e&&d&&!c&&t.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let u=s?s.initial===!1:!1;u=u||o===!1;const h=u?l:o;if(h&&typeof h!="boolean"&&!dx(h)){const m=Array.isArray(h)?h:[h];for(let f=0;f<m.length;f++){const p=mw(t,m[f]);if(p){const{transitionEnd:g,transition:x,...b}=p;for(const y in b){let w=b[y];if(Array.isArray(w)){const N=u?w.length-1:0;w=w[N]}w!==null&&(a[y]=w)}for(const y in g)a[y]=g[y]}}}return a}const Hc=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],ol=new Set(Hc),p4=t=>e=>typeof e=="string"&&e.startsWith(t),x4=p4("--"),D8=p4("var(--"),fw=t=>D8(t)?R8.test(t.split("/*")[0].trim()):!1,R8=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,g4=(t,e)=>e&&typeof t=="number"?e.transform(t):t,ra=(t,e,s)=>s>e?e:s<t?t:s,Wc={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Mu={...Wc,transform:t=>ra(0,1,t)},Bh={...Wc,default:1},nh=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),ti=nh("deg"),ea=nh("%"),Ee=nh("px"),L8=nh("vh"),O8=nh("vw"),YN={...ea,parse:t=>ea.parse(t)/100,transform:t=>ea.transform(t*100)},I8={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,radius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,backgroundPositionX:Ee,backgroundPositionY:Ee},F8={rotate:ti,rotateX:ti,rotateY:ti,rotateZ:ti,scale:Bh,scaleX:Bh,scaleY:Bh,scaleZ:Bh,skew:ti,skewX:ti,skewY:ti,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:Mu,originX:YN,originY:YN,originZ:Ee},qN={...Wc,transform:Math.round},pw={...I8,...F8,zIndex:qN,size:Ee,fillOpacity:Mu,strokeOpacity:Mu,numOctaves:qN},$8={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},z8=Hc.length;function B8(t,e,s){let n="",a=!0;for(let i=0;i<z8;i++){const o=Hc[i],l=t[o];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(o.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||s){const d=g4(l,pw[o]);if(!c){a=!1;const u=$8[o]||o;n+=`${u}(${d}) `}s&&(e[o]=d)}}return n=n.trim(),s?n=s(e,a?"":n):a&&(n="none"),n}function xw(t,e,s){const{style:n,vars:a,transformOrigin:i}=t;let o=!1,l=!1;for(const c in e){const d=e[c];if(ol.has(c)){o=!0;continue}else if(x4(c)){a[c]=d;continue}else{const u=g4(d,pw[c]);c.startsWith("origin")?(l=!0,i[c]=u):n[c]=u}}if(e.transform||(o||s?n.transform=B8(e,t.transform,s):n.transform&&(n.transform="none")),l){const{originX:c="50%",originY:d="50%",originZ:u=0}=i;n.transformOrigin=`${c} ${d} ${u}`}}const V8={offset:"stroke-dashoffset",array:"stroke-dasharray"},U8={offset:"strokeDashoffset",array:"strokeDasharray"};function H8(t,e,s=1,n=0,a=!0){t.pathLength=1;const i=a?V8:U8;t[i.offset]=Ee.transform(-n);const o=Ee.transform(e),l=Ee.transform(s);t[i.array]=`${o} ${l}`}function KN(t,e,s){return typeof t=="string"?t:Ee.transform(e+s*t)}function W8(t,e,s){const n=KN(e,t.x,t.width),a=KN(s,t.y,t.height);return`${n} ${a}`}function gw(t,{attrX:e,attrY:s,attrScale:n,originX:a,originY:i,pathLength:o,pathSpacing:l=1,pathOffset:c=0,...d},u,h){if(xw(t,d,h),u){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:m,style:f,dimensions:p}=t;m.transform&&(p&&(f.transform=m.transform),delete m.transform),p&&(a!==void 0||i!==void 0||f.transform)&&(f.transformOrigin=W8(p,a!==void 0?a:.5,i!==void 0?i:.5)),e!==void 0&&(m.x=e),s!==void 0&&(m.y=s),n!==void 0&&(m.scale=n),o!==void 0&&H8(m,o,l,c,!1)}const bw=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),b4=()=>({...bw(),attrs:{}}),yw=t=>typeof t=="string"&&t.toLowerCase()==="svg";function y4(t,{style:e,vars:s},n,a){Object.assign(t.style,e,a&&a.getProjectionStyles(n));for(const i in s)t.style.setProperty(i,s[i])}const v4=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"]);function w4(t,e,s,n){y4(t,e,void 0,n);for(const a in e.attrs)t.setAttribute(v4.has(a)?a:dw(a),e.attrs[a])}const _f={};function G8(t){Object.assign(_f,t)}function j4(t,{layout:e,layoutId:s}){return ol.has(t)||t.startsWith("origin")||(e||s!==void 0)&&(!!_f[t]||t==="opacity")}function vw(t,e,s){var n;const{style:a}=t,i={};for(const o in a)(Ps(a[o])||e.style&&Ps(e.style[o])||j4(o,t)||((n=s==null?void 0:s.getValue(o))===null||n===void 0?void 0:n.liveStyle)!==void 0)&&(i[o]=a[o]);return i}function N4(t,e,s){const n=vw(t,e,s);for(const a in t)if(Ps(t[a])||Ps(e[a])){const i=Hc.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;n[i]=t[a]}return n}function Y8(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}const JN=["x","y","width","height","cx","cy","r"],q8={useVisualState:f4({scrapeMotionValuesFromProps:N4,createRenderState:b4,onUpdate:({props:t,prevProps:e,current:s,renderState:n,latestValues:a})=>{if(!s)return;let i=!!t.drag;if(!i){for(const l in a)if(ol.has(l)){i=!0;break}}if(!i)return;let o=!e;if(e)for(let l=0;l<JN.length;l++){const c=JN[l];t[c]!==e[c]&&(o=!0)}o&&Je.read(()=>{Y8(s,n),Je.render(()=>{gw(n,a,yw(s.tagName),t.transformTemplate),w4(s,n)})})}})},K8={useVisualState:f4({scrapeMotionValuesFromProps:vw,createRenderState:bw})};function k4(t,e,s){for(const n in e)!Ps(e[n])&&!j4(n,s)&&(t[n]=e[n])}function J8({transformTemplate:t},e){return M.useMemo(()=>{const s=bw();return xw(s,e,t),Object.assign({},s.vars,s.style)},[e])}function Q8(t,e){const s=t.style||{},n={};return k4(n,s,t),Object.assign(n,J8(t,e)),n}function X8(t,e){const s={},n=Q8(t,e);return t.drag&&t.dragListener!==!1&&(s.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(s.tabIndex=0),s.style=n,s}function Z8(t,e,s,n){const a=M.useMemo(()=>{const i=b4();return gw(i,e,yw(n),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};k4(i,t.style,t),a.style={...i,...a.style}}return a}function eF(t=!1){return(s,n,a,{latestValues:i},o)=>{const c=(hw(s)?Z8:X8)(n,i,o,s),d=p8(n,typeof s=="string",t),u=s!==M.Fragment?{...d,...c,ref:a}:{},{children:h}=n,m=M.useMemo(()=>Ps(h)?h.get():h,[h]);return M.createElement(s,{...u,children:m})}}function tF(t,e){return function(n,{forwardMotionProps:a}={forwardMotionProps:!1}){const o={...hw(n)?q8:K8,preloadedFeatures:t,useRender:eF(a),createVisualElement:e,Component:n};return k8(o)}}function C4(t,e){if(!Array.isArray(e))return!1;const s=e.length;if(s!==t.length)return!1;for(let n=0;n<s;n++)if(e[n]!==t[n])return!1;return!0}function hx(t,e,s){const n=t.getProps();return mw(n,e,s!==void 0?s:n.custom,t)}const S4=ow(()=>window.ScrollTimeline!==void 0);class sF{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,s){for(let n=0;n<this.animations.length;n++)this.animations[n][e]=s}attachTimeline(e,s){const n=this.animations.map(a=>{if(S4()&&a.attachTimeline)return a.attachTimeline(e);if(typeof s=="function")return s(a)});return()=>{n.forEach((a,i)=>{a&&a(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let s=0;s<this.animations.length;s++)e=Math.max(e,this.animations[s].duration);return e}runAll(e){this.animations.forEach(s=>s[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class nF extends sF{then(e,s){return Promise.all(this.animations).then(e).catch(s)}}function ww(t,e){return t?t[e]||t.default||t:void 0}const Qb=2e4;function _4(t){let e=0;const s=50;let n=t.next(e);for(;!n.done&&e<Qb;)e+=s,n=t.next(e);return e>=Qb?1/0:e}function jw(t){return typeof t=="function"}function QN(t,e){t.timeline=e,t.onfinish=null}const Nw=t=>Array.isArray(t)&&typeof t[0]=="number",rF={linearEasing:void 0};function aF(t,e){const s=ow(t);return()=>{var n;return(n=rF[e])!==null&&n!==void 0?n:s()}}const Tf=aF(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),T4=(t,e,s=10)=>{let n="";const a=Math.max(Math.round(e/s),2);for(let i=0;i<a;i++)n+=t(Ko(0,a-1,i))+", ";return`linear(${n.substring(0,n.length-2)})`};function E4(t){return!!(typeof t=="function"&&Tf()||!t||typeof t=="string"&&(t in Xb||Tf())||Nw(t)||Array.isArray(t)&&t.every(E4))}const Cd=([t,e,s,n])=>`cubic-bezier(${t}, ${e}, ${s}, ${n})`,Xb={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Cd([0,.65,.55,1]),circOut:Cd([.55,0,1,.45]),backIn:Cd([.31,.01,.66,-.59]),backOut:Cd([.33,1.53,.69,.99])};function M4(t,e){if(t)return typeof t=="function"&&Tf()?T4(t,e):Nw(t)?Cd(t):Array.isArray(t)?t.map(s=>M4(s,e)||Xb.easeOut):Xb[t]}const br={x:!1,y:!1};function A4(){return br.x||br.y}function kw(t,e,s){var n;if(t instanceof Element)return[t];if(typeof t=="string"){let a=document;const i=(n=void 0)!==null&&n!==void 0?n:a.querySelectorAll(t);return i?Array.from(i):[]}return Array.from(t)}function P4(t,e){const s=kw(t),n=new AbortController,a={passive:!0,...e,signal:n.signal};return[s,a,()=>n.abort()]}function XN(t){return e=>{e.pointerType==="touch"||A4()||t(e)}}function iF(t,e,s={}){const[n,a,i]=P4(t,s),o=XN(l=>{const{target:c}=l,d=e(l);if(typeof d!="function"||!c)return;const u=XN(h=>{d(h),c.removeEventListener("pointerleave",u)});c.addEventListener("pointerleave",u,a)});return n.forEach(l=>{l.addEventListener("pointerenter",o,a)}),i}const D4=(t,e)=>e?t===e?!0:D4(t,e.parentElement):!1,Cw=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,oF=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function lF(t){return oF.has(t.tagName)||t.tabIndex!==-1}const Sd=new WeakSet;function ZN(t){return e=>{e.key==="Enter"&&t(e)}}function Eg(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const cF=(t,e)=>{const s=t.currentTarget;if(!s)return;const n=ZN(()=>{if(Sd.has(s))return;Eg(s,"down");const a=ZN(()=>{Eg(s,"up")}),i=()=>Eg(s,"cancel");s.addEventListener("keyup",a,e),s.addEventListener("blur",i,e)});s.addEventListener("keydown",n,e),s.addEventListener("blur",()=>s.removeEventListener("keydown",n),e)};function e2(t){return Cw(t)&&!A4()}function dF(t,e,s={}){const[n,a,i]=P4(t,s),o=l=>{const c=l.currentTarget;if(!e2(l)||Sd.has(c))return;Sd.add(c);const d=e(l),u=(f,p)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",m),!(!e2(f)||!Sd.has(c))&&(Sd.delete(c),typeof d=="function"&&d(f,{success:p}))},h=f=>{u(f,s.useGlobalTarget||D4(c,f.target))},m=f=>{u(f,!1)};window.addEventListener("pointerup",h,a),window.addEventListener("pointercancel",m,a)};return n.forEach(l=>{!lF(l)&&l.getAttribute("tabindex")===null&&(l.tabIndex=0),(s.useGlobalTarget?window:l).addEventListener("pointerdown",o,a),l.addEventListener("focus",d=>cF(d,a),a)}),i}function uF(t){return t==="x"||t==="y"?br[t]?null:(br[t]=!0,()=>{br[t]=!1}):br.x||br.y?null:(br.x=br.y=!0,()=>{br.x=br.y=!1})}const R4=new Set(["width","height","top","left","right","bottom",...Hc]);let Lm;function hF(){Lm=void 0}const ta={now:()=>(Lm===void 0&&ta.set(ns.isProcessing||c8.useManualTiming?ns.timestamp:performance.now()),Lm),set:t=>{Lm=t,queueMicrotask(hF)}};function Sw(t,e){t.indexOf(e)===-1&&t.push(e)}function _w(t,e){const s=t.indexOf(e);s>-1&&t.splice(s,1)}class Tw{constructor(){this.subscriptions=[]}add(e){return Sw(this.subscriptions,e),()=>_w(this.subscriptions,e)}notify(e,s,n){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](e,s,n);else for(let i=0;i<a;i++){const o=this.subscriptions[i];o&&o(e,s,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Ew(t,e){return e?t*(1e3/e):0}const t2=30,mF=t=>!isNaN(parseFloat(t)),Gd={current:void 0};class fF{constructor(e,s={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(n,a=!0)=>{const i=ta.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(n),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),a&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=s.owner}setCurrent(e){this.current=e,this.updatedAt=ta.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=mF(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,s){this.events[e]||(this.events[e]=new Tw);const n=this.events[e].add(s);return e==="change"?()=>{n(),Je.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,s){this.passiveEffect=e,this.stopPassiveEffect=s}set(e,s=!0){!s||!this.passiveEffect?this.updateAndNotify(e,s):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,s,n){this.set(s),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,s=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,s&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Gd.current&&Gd.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=ta.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>t2)return 0;const s=Math.min(this.updatedAt-this.prevUpdatedAt,t2);return Ew(parseFloat(this.current)-parseFloat(this.prevFrameValue),s)}start(e){return this.stop(),new Promise(s=>{this.hasAnimated=!0,this.animation=e(s),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(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Kr(t,e){return new fF(t,e)}function pF(t,e,s){t.hasValue(e)?t.getValue(e).set(s):t.addValue(e,Kr(s))}function xF(t,e){const s=hx(t,e);let{transitionEnd:n={},transition:a={},...i}=s||{};i={...i,...n};for(const o in i){const l=M8(i[o]);pF(t,o,l)}}function gF(t){return!!(Ps(t)&&t.add)}function Zb(t,e){const s=t.getValue("willChange");if(gF(s))return s.add(e)}function L4(t){return t.props[u4]}const O4=(t,e,s)=>(((1-3*s+3*e)*t+(3*s-6*e))*t+3*e)*t,bF=1e-7,yF=12;function vF(t,e,s,n,a){let i,o,l=0;do o=e+(s-e)/2,i=O4(o,n,a)-t,i>0?s=o:e=o;while(Math.abs(i)>bF&&++l<yF);return o}function rh(t,e,s,n){if(t===e&&s===n)return Gs;const a=i=>vF(i,0,1,t,s);return i=>i===0||i===1?i:O4(a(i),e,n)}const I4=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,F4=t=>e=>1-t(1-e),$4=rh(.33,1.53,.69,.99),Mw=F4($4),z4=I4(Mw),B4=t=>(t*=2)<1?.5*Mw(t):.5*(2-Math.pow(2,-10*(t-1))),Aw=t=>1-Math.sin(Math.acos(t)),V4=F4(Aw),U4=I4(Aw),H4=t=>/^0[^.\s]+$/u.test(t);function wF(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||H4(t):!0}const Yd=t=>Math.round(t*1e5)/1e5,Pw=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function jF(t){return t==null}const NF=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dw=(t,e)=>s=>!!(typeof s=="string"&&NF.test(s)&&s.startsWith(t)||e&&!jF(s)&&Object.prototype.hasOwnProperty.call(s,e)),W4=(t,e,s)=>n=>{if(typeof n!="string")return n;const[a,i,o,l]=n.match(Pw);return{[t]:parseFloat(a),[e]:parseFloat(i),[s]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},kF=t=>ra(0,255,t),Mg={...Wc,transform:t=>Math.round(kF(t))},Co={test:Dw("rgb","red"),parse:W4("red","green","blue"),transform:({red:t,green:e,blue:s,alpha:n=1})=>"rgba("+Mg.transform(t)+", "+Mg.transform(e)+", "+Mg.transform(s)+", "+Yd(Mu.transform(n))+")"};function CF(t){let e="",s="",n="",a="";return t.length>5?(e=t.substring(1,3),s=t.substring(3,5),n=t.substring(5,7),a=t.substring(7,9)):(e=t.substring(1,2),s=t.substring(2,3),n=t.substring(3,4),a=t.substring(4,5),e+=e,s+=s,n+=n,a+=a),{red:parseInt(e,16),green:parseInt(s,16),blue:parseInt(n,16),alpha:a?parseInt(a,16)/255:1}}const ey={test:Dw("#"),parse:CF,transform:Co.transform},ql={test:Dw("hsl","hue"),parse:W4("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:s,alpha:n=1})=>"hsla("+Math.round(t)+", "+ea.transform(Yd(e))+", "+ea.transform(Yd(s))+", "+Yd(Mu.transform(n))+")"},_s={test:t=>Co.test(t)||ey.test(t)||ql.test(t),parse:t=>Co.test(t)?Co.parse(t):ql.test(t)?ql.parse(t):ey.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Co.transform(t):ql.transform(t)},SF=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function _F(t){var e,s;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Pw))===null||e===void 0?void 0:e.length)||0)+(((s=t.match(SF))===null||s===void 0?void 0:s.length)||0)>0}const G4="number",Y4="color",TF="var",EF="var(",s2="${}",MF=/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 Au(t){const e=t.toString(),s=[],n={color:[],number:[],var:[]},a=[];let i=0;const l=e.replace(MF,c=>(_s.test(c)?(n.color.push(i),a.push(Y4),s.push(_s.parse(c))):c.startsWith(EF)?(n.var.push(i),a.push(TF),s.push(c)):(n.number.push(i),a.push(G4),s.push(parseFloat(c))),++i,s2)).split(s2);return{values:s,split:l,indexes:n,types:a}}function q4(t){return Au(t).values}function K4(t){const{split:e,types:s}=Au(t),n=e.length;return a=>{let i="";for(let o=0;o<n;o++)if(i+=e[o],a[o]!==void 0){const l=s[o];l===G4?i+=Yd(a[o]):l===Y4?i+=_s.transform(a[o]):i+=a[o]}return i}}const AF=t=>typeof t=="number"?0:t;function PF(t){const e=q4(t);return K4(t)(e.map(AF))}const Bi={test:_F,parse:q4,createTransformer:K4,getAnimatableNone:PF},DF=new Set(["brightness","contrast","saturate","opacity"]);function RF(t){const[e,s]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[n]=s.match(Pw)||[];if(!n)return t;const a=s.replace(n,"");let i=DF.has(e)?1:0;return n!==s&&(i*=100),e+"("+i+a+")"}const LF=/\b([a-z-]*)\(.*?\)/gu,ty={...Bi,getAnimatableNone:t=>{const e=t.match(LF);return e?e.map(RF).join(" "):t}},OF={...pw,color:_s,backgroundColor:_s,outlineColor:_s,fill:_s,stroke:_s,borderColor:_s,borderTopColor:_s,borderRightColor:_s,borderBottomColor:_s,borderLeftColor:_s,filter:ty,WebkitFilter:ty},Rw=t=>OF[t];function J4(t,e){let s=Rw(t);return s!==ty&&(s=Bi),s.getAnimatableNone?s.getAnimatableNone(e):void 0}const IF=new Set(["auto","none","0"]);function FF(t,e,s){let n=0,a;for(;n<t.length&&!a;){const i=t[n];typeof i=="string"&&!IF.has(i)&&Au(i).values.length&&(a=t[n]),n++}if(a&&s)for(const i of e)t[i]=J4(s,a)}const n2=t=>t===Wc||t===Ee,r2=(t,e)=>parseFloat(t.split(", ")[e]),a2=(t,e)=>(s,{transform:n})=>{if(n==="none"||!n)return 0;const a=n.match(/^matrix3d\((.+)\)$/u);if(a)return r2(a[1],e);{const i=n.match(/^matrix\((.+)\)$/u);return i?r2(i[1],t):0}},$F=new Set(["x","y","z"]),zF=Hc.filter(t=>!$F.has(t));function BF(t){const e=[];return zF.forEach(s=>{const n=t.getValue(s);n!==void 0&&(e.push([s,n.get()]),n.set(s.startsWith("scale")?1:0))}),e}const wc={width:({x:t},{paddingLeft:e="0",paddingRight:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),height:({y:t},{paddingTop:e="0",paddingBottom:s="0"})=>t.max-t.min-parseFloat(e)-parseFloat(s),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:a2(4,13),y:a2(5,14)};wc.translateX=wc.x;wc.translateY=wc.y;const Oo=new Set;let sy=!1,ny=!1;function Q4(){if(ny){const t=Array.from(Oo).filter(n=>n.needsMeasurement),e=new Set(t.map(n=>n.element)),s=new Map;e.forEach(n=>{const a=BF(n);a.length&&(s.set(n,a),n.render())}),t.forEach(n=>n.measureInitialState()),e.forEach(n=>
vendor: 1,717 bytes, line 75
75{n.render();const a=s.get(n);a&&a.forEach(([i,o])=>{var l;(l=n.getValue(i))===null||l===void 0||l.set(o)})}),t.forEach(n=>n.measureEndState()),t.forEach(n=>{n.suspendedScrollY!==void 0&&window.scrollTo(0,n.suspendedScrollY)})}ny=!1,sy=!1,Oo.forEach(t=>t.complete()),Oo.clear()}function X4(){Oo.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ny=!0)})}function VF(){X4(),Q4()}class Lw{constructor(e,s,n,a,i,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=s,this.name=n,this.motionValue=a,this.element=i,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Oo.add(this),sy||(sy=!0,Je.read(X4),Je.resolveKeyframes(Q4))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:s,element:n,motionValue:a}=this;for(let i=0;i<e.length;i++)if(e[i]===null)if(i===0){const o=a==null?void 0:a.get(),l=e[e.length-1];if(o!==void 0)e[0]=o;else if(n&&s){const c=n.readValue(s,l);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=l),a&&o===void 0&&a.set(e[0])}else e[i]=e[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Oo.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Oo.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Z4=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),UF=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function HF(t){const e=UF.exec(t);if(!e)return[,];const[,s,n,a]=e;return[`--${s??n}`,a]}function e3(t,e,s=1){const[n,a]=HF(t);if(!n)return;const i=window.getComputedStyle(e).getPropertyValue(n);if(i){const o=i.trim();
vendor: 1,601 bytes, line 75
75return Z4(o)?parseFloat(o):o}return fw(a)?e3(a,e,s+1):a}const t3=t=>e=>e.test(t),WF={test:t=>t==="auto",parse:t=>t},s3=[Wc,Ee,ea,ti,O8,L8,WF],i2=t=>s3.find(t3(t));class n3 extends Lw{constructor(e,s,n,a,i){super(e,s,n,a,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:s,name:n}=this;if(!s||!s.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let d=e[c];if(typeof d=="string"&&(d=d.trim(),fw(d))){const u=e3(d,s.current);u!==void 0&&(e[c]=u),c===e.length-1&&(this.finalKeyframe=d)}}if(this.resolveNoneKeyframes(),!R4.has(n)||e.length!==2)return;const[a,i]=e,o=i2(a),l=i2(i);if(o!==l)if(n2(o)&&n2(l))for(let c=0;c<e.length;c++){const d=e[c];typeof d=="string"&&(e[c]=parseFloat(d))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:s}=this,n=[];for(let a=0;a<e.length;a++)wF(e[a])&&n.push(a);n.length&&FF(e,n,s)}measureInitialState(){const{element:e,unresolvedKeyframes:s,name:n}=this;if(!e||!e.current)return;n==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=wc[n](e.measureViewportBox(),window.getComputedStyle(e.current)),s[0]=this.measuredOrigin;const a=s[s.length-1];a!==void 0&&e.getValue(n,a).jump(a,!1)}measureEndState(){var e;const{element:s,name:n,unresolvedKeyframes:a}=this;if(!s||!s.current)return;const i=s.getValue(n);i&&i.jump(this.measuredOrigin,!1);const o=a.length-1,l=a[o];a[o]=wc[n](s.measureViewportBox(),window.getComputedStyle(s.current)),l!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=l),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEac
vendor: 6,113 bytes, line 75
75h(([c,d])=>{s.getValue(c).set(d)}),this.resolveNoneKeyframes()}}const o2=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Bi.test(t)||t==="0")&&!t.startsWith("url("));function GF(t){const e=t[0];if(t.length===1)return!0;for(let s=0;s<t.length;s++)if(t[s]!==e)return!0}function YF(t,e,s,n){const a=t[0];if(a===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],o=o2(a,e),l=o2(i,e);return!o||!l?!1:GF(t)||(s==="spring"||jw(s))&&n}const qF=t=>t!==null;function mx(t,{repeat:e,repeatType:s="loop"},n){const a=t.filter(qF),i=e&&s!=="loop"&&e%2===1?0:a.length-1;return!i||n===void 0?a[i]:n}const KF=40;class r3{constructor({autoplay:e=!0,delay:s=0,type:n="keyframes",repeat:a=0,repeatDelay:i=0,repeatType:o="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ta.now(),this.options={autoplay:e,delay:s,type:n,repeat:a,repeatDelay:i,repeatType:o,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>KF?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&VF(),this._resolved}onKeyframesResolved(e,s){this.resolvedAt=ta.now(),this.hasAttemptedResolve=!0;const{name:n,type:a,velocity:i,delay:o,onComplete:l,onUpdate:c,isGenerator:d}=this.options;if(!d&&!YF(e,n,a,i))if(o)this.options.duration=0;else{c&&c(mx(e,this.options,s)),l&&l(),this.resolveFinishedPromise();return}const u=this.initPlayback(e,s);u!==!1&&(this._resolved={keyframes:e,finalKeyframe:s,...u},this.onPostResolved())}onPostResolved(){}then(e,s){return this.currentFinishedPromise.then(e,s)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const yt=(t,e,s)=>t+(e-t)*s;function Ag(t,e,s){return s<0&&(s+=1),s>1&&(s-=1),s<1/6?t+(e-t)*6*s:s<1/2?e:s<2/3?t+(e-t)*(2/3-s)*6:t}function JF({hue:t,saturation:e,lightness:s,alpha:n}){t/=360,e/=100,s/=100;let a=0,i=0,o=0;if(!e)a=i=o=s;else{const l=s<.5?s*(1+e):s+e-s*e,c=2*s-l;a=Ag(c,l,t+1/3),i=Ag(c,l,t),o=Ag(c,l,t-1/3)}return{red:Math.round(a*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:n}}function Ef(t,e){return s=>s>0?e:t}const Pg=(t,e,s)=>{const n=t*t,a=s*(e*e-n)+n;return a<0?0:Math.sqrt(a)},QF=[ey,Co,ql],XF=t=>QF.find(e=>e.test(t));function l2(t){const e=XF(t);if(!e)return!1;let s=e.parse(t);return e===ql&&(s=JF(s)),s}const c2=(t,e)=>{const s=l2(t),n=l2(e);if(!s||!n)return Ef(t,e);const a={...s};return i=>(a.red=Pg(s.red,n.red,i),a.green=Pg(s.green,n.green,i),a.blue=Pg(s.blue,n.blue,i),a.alpha=yt(s.alpha,n.alpha,i),Co.transform(a))},ZF=(t,e)=>s=>e(t(s)),ah=(...t)=>t.reduce(ZF),ry=new Set(["none","hidden"]);function e$(t,e){return ry.has(t)?s=>s<=0?t:e:s=>s>=1?e:t}function t$(t,e){return s=>yt(t,e,s)}function Ow(t){return typeof t=="number"?t$:typeof t=="string"?fw(t)?Ef:_s.test(t)?c2:r$:Array.isArray(t)?a3:typeof t=="object"?_s.test(t)?c2:s$:Ef}function a3(t,e){const s=[...t],n=s.length,a=t.map((i,o)=>Ow(i)(i,e[o]));return i=>{for(let o=0;o<n;o++)s[o]=a[o](i);return s}}function s$(t,e){const s={...t,...e},n={};for(const a in s)t[a]!==void 0&&e[a]!==void 0&&(n[a]=Ow(t[a])(t[a],e[a]));return a=>{for(const i in n)s[i]=n[i](a);return s}}function n$(t,e){var s;const n=[],a={color:0,var:0,number:0};for(let i=0;i<e.values.length;i++){const o=e.types[i],l=t.indexes[o][a[o]],c=(s=t.values[l])!==null&&s!==void 0?s:0;n[i]=c,a[o]++}return n}const r$=(t,e)=>{const s=Bi.createTransformer(e),n=Au(t),a=Au(e);return n.indexes.var.length===a.indexes.var.length&&n.indexes.color.length===a.indexes.color.length&&n.indexes.number.length>=a.indexes.number.length?ry.has(t)&&!a.values.length||ry.has(e)&&!n.values.length?e$(t,e):ah(a3(n$(n,a),a.values),s):Ef(t,e)};function i3(t,e,s){return typeof t=="number"&&typeof e=="number"&&typeof s=="number"?yt(t,e,s):Ow(t)(t,e)}const a$=5;function o3(t,e,s){const n=Math.max(e-a$,0);return Ew(s-t(n),e-n)}const Tt={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},Dg=.001;function i$({duration:t=Tt.duration,bounce:e=Tt.bounce,velocity:s=Tt.velocity,mass:n=Tt.mass}){let a,i,o=1-e;o=ra(Tt.minDamping,Tt.maxDamping,o),t=ra(Tt.minDuration,Tt.maxDuration,Ma(t)),o<1?(a=d=>{const u=d*o,h=u*t,m=u-s,f=ay(d,o),p=Math.exp(-h);return Dg-m/f*p},i=d=>{const h=d*o*t,m=h*s+s,f=Math.pow(o,2)*Math.pow(d,2)*t,p=Math.exp(-h),g=ay(Math.pow(d,2),o);return(-a(d)+Dg>0?-1:1)*((m-f)*p)/g}):(a=d=>{const u=Math.exp(-d*t),h=(d-s)*t+1;return-Dg+u*h},i=d=>{const u=Math.exp(-d*t),h=(s-d)*(t*t);return u*h});const l=5/t,c=l$(a,i,l);if(t=Ea(t),isNaN(c))return{stiffness:Tt.stiffness,damping:Tt.damping,duration:t};{const d=Math.pow(c,2)*n;return{stiffness:d,damping:o*2*Math.sqrt(n*d),duration:t}}}const o$=12;function l$(t,e,s){let n=s;for(let a=1;a<o$;a++)n=n-t(n)/e(n);return n}function ay(t,e){return t*Math.sqrt(1-e*e)}const c$=["duration","bounce"],d$=["stiffness","damping","mass"];function d2(t,e){return e.some(s=>t[s]!==void 0)}function u$(t){let e={velocity:Tt.velocity,stiffness:Tt.stiffness,damping:Tt.damping,mass:Tt.mass,isResolvedFromDuration:!1,...t};if(!d2(t,d$)&&d2(t,c$))if(t.visualDuration){const s=t.visualDuration,n=2*Math.PI/(s*1.2),a=n*n,i=2*ra(.05,1,1-(t.bounce||0))*Math.sqrt(a);e={...e,mass:Tt.mass,stiffness:a,damping:i}}else{const s=i$(t);e={...e,...s,mass:Tt.mass},e.isResolvedFromDuration=!0}return e}function l3(t=Tt.visualDuration,e=Tt.bounce){const s=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:n,restDelta:a}=s;const i=s.keyframes[0],o=s.keyframes[s.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:d,mass:u,duration:h,velocity:m,isResolvedFromDuration:f}=u$({...s,velocity:-Ma(s.velocity||0)}),p=m||0,g=d/(2*Math.sqrt(c*u)),x=o-i,b=Ma(Math.sqrt(c/u)),y=Math.abs(x)<5;n||(n=y?Tt.restSpeed.granular:Tt.restSpeed.default),a||(a=y?Tt.restDelta.granular:Tt.restDelta.default);let w;if(g<1){const j=ay(b,g);w=S=>
vendor: 59,504 bytes, line 75
75{const k=Math.exp(-g*b*S);return o-k*((p+g*b*x)/j*Math.sin(j*S)+x*Math.cos(j*S))}}else if(g===1)w=j=>o-Math.exp(-b*j)*(x+(p+b*x)*j);else{const j=b*Math.sqrt(g*g-1);w=S=>{const k=Math.exp(-g*b*S),C=Math.min(j*S,300);return o-k*((p+g*b*x)*Math.sinh(C)+j*x*Math.cosh(C))/j}}const N={calculatedDuration:f&&h||null,next:j=>{const S=w(j);if(f)l.done=j>=h;else{let k=0;g<1&&(k=j===0?Ea(p):o3(w,j,S));const C=Math.abs(k)<=n,T=Math.abs(o-S)<=a;l.done=C&&T}return l.value=l.done?o:S,l},toString:()=>{const j=Math.min(_4(N),Qb),S=T4(k=>N.next(j*k).value,j,30);return j+"ms "+S}};return N}function u2({keyframes:t,velocity:e=0,power:s=.8,timeConstant:n=325,bounceDamping:a=10,bounceStiffness:i=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:u}){const h=t[0],m={done:!1,value:h},f=C=>l!==void 0&&C<l||c!==void 0&&C>c,p=C=>l===void 0?c:c===void 0||Math.abs(l-C)<Math.abs(c-C)?l:c;let g=s*e;const x=h+g,b=o===void 0?x:o(x);b!==x&&(g=b-h);const y=C=>-g*Math.exp(-C/n),w=C=>b+y(C),N=C=>{const T=y(C),A=w(C);m.done=Math.abs(T)<=d,m.value=m.done?b:A};let j,S;const k=C=>{f(m.value)&&(j=C,S=l3({keyframes:[m.value,p(m.value)],velocity:o3(w,C,m.value),damping:a,stiffness:i,restDelta:d,restSpeed:u}))};return k(0),{calculatedDuration:null,next:C=>{let T=!1;return!S&&j===void 0&&(T=!0,N(C),k(C)),j!==void 0&&C>=j?S.next(C-j):(!T&&N(C),m)}}}const h$=rh(.42,0,1,1),m$=rh(0,0,.58,1),c3=rh(.42,0,.58,1),f$=t=>Array.isArray(t)&&typeof t[0]!="number",p$={linear:Gs,easeIn:h$,easeInOut:c3,easeOut:m$,circIn:Aw,circInOut:U4,circOut:V4,backIn:Mw,backInOut:z4,backOut:$4,anticipate:B4},h2=t=>{if(Nw(t)){i4(t.length===4);const[e,s,n,a]=t;return rh(e,s,n,a)}else if(typeof t=="string")return p$[t];return t};function x$(t,e,s){const n=[],a=s||i3,i=t.length-1;for(let o=0;o<i;o++){let l=a(t[o],t[o+1]);if(e){const c=Array.isArray(e)?e[o]||Gs:e;l=ah(c,l)}n.push(l)}return n}function Iw(t,e,{clamp:s=!0,ease:n,mixer:a}={}){const i=t.length;if(i4(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=x$(e,n,a),c=l.length,d=u=>{if(o&&u<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(u<t[h+1]);h++);const m=Ko(t[h],t[h+1],u);return l[h](m)};return s?u=>d(ra(t[0],t[i-1],u)):d}function g$(t,e){const s=t[t.length-1];for(let n=1;n<=e;n++){const a=Ko(0,e,n);t.push(yt(s,1,a))}}function d3(t){const e=[0];return g$(e,t.length-1),e}function b$(t,e){return t.map(s=>s*e)}function y$(t,e){return t.map(()=>e||c3).splice(0,t.length-1)}function Mf({duration:t=300,keyframes:e,times:s,ease:n="easeInOut"}){const a=f$(n)?n.map(h2):h2(n),i={done:!1,value:e[0]},o=b$(s&&s.length===e.length?s:d3(e),t),l=Iw(o,e,{ease:Array.isArray(a)?a:y$(e,a)});return{calculatedDuration:t,next:c=>(i.value=l(c),i.done=c>=t,i)}}const v$=t=>{const e=({timestamp:s})=>t(s);return{start:()=>Je.update(e,!0),stop:()=>Ar(e),now:()=>ns.isProcessing?ns.timestamp:ta.now()}},w$={decay:u2,inertia:u2,tween:Mf,keyframes:Mf,spring:l3},j$=t=>t/100;class Fw extends r3{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:s,motionValue:n,element:a,keyframes:i}=this.options,o=(a==null?void 0:a.KeyframeResolver)||Lw,l=(c,d)=>this.onKeyframesResolved(c,d);this.resolver=new o(i,l,s,n,a),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:s="keyframes",repeat:n=0,repeatDelay:a=0,repeatType:i,velocity:o=0}=this.options,l=jw(s)?s:w$[s]||Mf;let c,d;l!==Mf&&typeof e[0]!="number"&&(c=ah(j$,i3(e[0],e[1])),e=[0,100]);const u=l({...this.options,keyframes:e});i==="mirror"&&(d=l({...this.options,keyframes:[...e].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=_4(u));const{calculatedDuration:h}=u,m=h+a,f=m*(n+1)-a;return{generator:u,mirroredGenerator:d,mapPercentToKeyframes:c,calculatedDuration:h,resolvedDuration:m,totalDuration:f}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,s=!1){const{resolved:n}=this;if(!n){const{keyframes:C}=this.options;return{done:!0,value:C[C.length-1]}}const{finalKeyframe:a,generator:i,mirroredGenerator:o,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:d,totalDuration:u,resolvedDuration:h}=n;if(this.startTime===null)return i.next(0);const{delay:m,repeat:f,repeatType:p,repeatDelay:g,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),s?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const b=this.currentTime-m*(this.speed>=0?1:-1),y=this.speed>=0?b<0:b>u;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let w=this.currentTime,N=i;if(f){const C=Math.min(this.currentTime,u)/h;let T=Math.floor(C),A=C%1;!A&&C>=1&&(A=1),A===1&&T--,T=Math.min(T,f+1),!!(T%2)&&(p==="reverse"?(A=1-A,g&&(A-=g/h)):p==="mirror"&&(N=o)),w=ra(0,1,A)*h}const j=y?{done:!1,value:c[0]}:N.next(w);l&&(j.value=l(j.value));let{done:S}=j;!y&&d!==null&&(S=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&S);return k&&a!==void 0&&(j.value=mx(c,this.options,a)),x&&x(j.value),k&&this.finish(),j}get duration(){const{resolved:e}=this;return e?Ma(e.calculatedDuration):0}get time(){return Ma(this.currentTime)}set time(e){e=Ea(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const s=this.playbackSpeed!==e;this.playbackSpeed=e,s&&(this.time=Ma(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=v$,onPlay:s,startTime:n}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),s&&s();const a=this.driver.now();this.holdTime!==null?this.startTime=a-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=a):this.startTime=n??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}const N$=new Set(["opacity","clipPath","filter","transform"]);function k$(t,e,s,{delay:n=0,duration:a=300,repeat:i=0,repeatType:o="loop",ease:l="easeInOut",times:c}={}){const d={[e]:s};c&&(d.offset=c);const u=M4(l,a);return Array.isArray(u)&&(d.easing=u),t.animate(d,{delay:n,duration:a,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"})}const C$=ow(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Af=10,S$=2e4;function _$(t){return jw(t.type)||t.type==="spring"||!E4(t.ease)}function T$(t,e){const s=new Fw({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let n={done:!1,value:t[0]};const a=[];let i=0;for(;!n.done&&i<S$;)n=s.sample(i),a.push(n.value),i+=Af;return{times:void 0,keyframes:a,duration:i-Af,ease:"linear"}}const u3={anticipate:B4,backInOut:z4,circInOut:U4};function E$(t){return t in u3}class m2 extends r3{constructor(e){super(e);const{name:s,motionValue:n,element:a,keyframes:i}=this.options;this.resolver=new n3(i,(o,l)=>this.onKeyframesResolved(o,l),s,n,a),this.resolver.scheduleResolve()}initPlayback(e,s){let{duration:n=300,times:a,ease:i,type:o,motionValue:l,name:c,startTime:d}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Tf()&&E$(i)&&(i=u3[i]),_$(this.options)){const{onComplete:h,onUpdate:m,motionValue:f,element:p,...g}=this.options,x=T$(e,g);e=x.keyframes,e.length===1&&(e[1]=e[0]),n=x.duration,a=x.times,i=x.ease,o="keyframes"}const u=k$(l.owner.current,c,e,{...this.options,duration:n,times:a,ease:i});return u.startTime=d??this.calcStartTime(),this.pendingTimeline?(QN(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:h}=this.options;l.set(mx(e,this.options,s)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:n,times:a,type:o,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:s}=e;return Ma(s)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:s}=e;return Ma(s.currentTime||0)}set time(e){const{resolved:s}=this;if(!s)return;const{animation:n}=s;n.currentTime=Ea(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:s}=e;return s.playbackRate}set speed(e){const{resolved:s}=this;if(!s)return;const{animation:n}=s;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:s}=e;return s.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:s}=e;return s.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:s}=this;if(!s)return Gs;const{animation:n}=s;QN(n,e)}return Gs}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.playState==="finished"&&this.updateFinishedPromise(),s.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:s,keyframes:n,duration:a,type:i,ease:o,times:l}=e;if(s.playState==="idle"||s.playState==="finished")return;if(this.time){const{motionValue:d,onUpdate:u,onComplete:h,element:m,...f}=this.options,p=new Fw({...f,keyframes:n,duration:a,type:i,ease:o,times:l,isGenerator:!0}),g=Ea(this.time);d.setWithVelocity(p.sample(g-Af).value,p.sample(g).value,Af)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:s,name:n,repeatDelay:a,repeatType:i,damping:o,type:l}=e;if(!s||!s.owner||!(s.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:d}=s.owner.getProps();return C$()&&n&&N$.has(n)&&!c&&!d&&!a&&i!=="mirror"&&o!==0&&l!=="inertia"}}const M$={type:"spring",stiffness:500,damping:25,restSpeed:10},A$=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),P$={type:"keyframes",duration:.8},D$={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},R$=(t,{keyframes:e})=>e.length>2?P$:ol.has(t)?t.startsWith("scale")?A$(e[1]):M$:D$;function L$({when:t,delay:e,delayChildren:s,staggerChildren:n,staggerDirection:a,repeat:i,repeatType:o,repeatDelay:l,from:c,elapsed:d,...u}){return!!Object.keys(u).length}const $w=(t,e,s,n={},a,i)=>o=>{const l=ww(n,t)||{},c=l.delay||n.delay||0;let{elapsed:d=0}=n;d=d-Ea(c);let u={keyframes:Array.isArray(s)?s:[null,s],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:m=>{e.set(m),l.onUpdate&&l.onUpdate(m)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:a};L$(l)||(u={...u,...R$(t,u)}),u.duration&&(u.duration=Ea(u.duration)),u.repeatDelay&&(u.repeatDelay=Ea(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(h=!0)),h&&!i&&e.get()!==void 0){const m=mx(u.keyframes,l);if(m!==void 0)return Je.update(()=>{u.onUpdate(m),u.onComplete()}),new nF([])}return!i&&m2.supports(u)?new m2(u):new Fw(u)};function O$({protectedKeys:t,needsAnimating:e},s){const n=t.hasOwnProperty(s)&&e[s]!==!0;return e[s]=!1,n}function h3(t,e,{delay:s=0,transitionOverride:n,type:a}={}){var i;let{transition:o=t.getDefaultTransition(),transitionEnd:l,...c}=e;n&&(o=n);const d=[],u=a&&t.animationState&&t.animationState.getState()[a];for(const h in c){const m=t.getValue(h,(i=t.latestValues[h])!==null&&i!==void 0?i:null),f=c[h];if(f===void 0||u&&O$(u,h))continue;const p={delay:s,...ww(o||{},h)};let g=!1;if(window.MotionHandoffAnimation){const b=L4(t);if(b){const y=window.MotionHandoffAnimation(b,h,Je);y!==null&&(p.startTime=y,g=!0)}}Zb(t,h),m.start($w(h,m,f,t.shouldReduceMotion&&R4.has(h)?{type:!1}:p,t,g));const x=m.animation;x&&d.push(x)}return l&&Promise.all(d).then(()=>{Je.update(()=>{l&&xF(t,l)})}),d}function iy(t,e,s={}){var n;const a=hx(t,e,s.type==="exit"?(n=t.presenceContext)===null||n===void 0?void 0:n.custom:void 0);let{transition:i=t.getDefaultTransition()||{}}=a||{};s.transitionOverride&&(i=s.transitionOverride);const o=a?()=>Promise.all(h3(t,a,s)):()=>Promise.resolve(),l=t.variantChildren&&t.variantChildren.size?(d=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:m}=i;return I$(t,e,u+d,h,m,s)}:()=>Promise.resolve(),{when:c}=i;if(c){const[d,u]=c==="beforeChildren"?[o,l]:[l,o];return d().then(()=>u())}else return Promise.all([o(),l(s.delay)])}function I$(t,e,s=0,n=0,a=1,i){const o=[],l=(t.variantChildren.size-1)*n,c=a===1?(d=0)=>d*n:(d=0)=>l-d*n;return Array.from(t.variantChildren).sort(F$).forEach((d,u)=>{d.notify("AnimationStart",e),o.push(iy(d,e,{...i,delay:s+c(u)}).then(()=>d.notify("AnimationComplete",e)))}),Promise.all(o)}function F$(t,e){return t.sortNodePosition(e)}function $$(t,e,s={}){t.notify("AnimationStart",e);let n;if(Array.isArray(e)){const a=e.map(i=>iy(t,i,s));n=Promise.all(a)}else if(typeof e=="string")n=iy(t,e,s);else{const a=typeof e=="function"?hx(t,e,s.custom):e;n=Promise.all(h3(t,a,s))}return n.then(()=>{t.notify("AnimationComplete",e)})}const z$=cw.length;function m3(t){if(!t)return;if(!t.isControllingVariants){const s=t.parent?m3(t.parent)||{}:{};return t.props.initial!==void 0&&(s.initial=t.props.initial),s}const e={};for(let s=0;s<z$;s++){const n=cw[s],a=t.props[n];(Eu(a)||a===!1)&&(e[n]=a)}return e}const B$=[...lw].reverse(),V$=lw.length;function U$(t){return e=>Promise.all(e.map(({animation:s,options:n})=>$$(t,s,n)))}function H$(t){let e=U$(t),s=f2(),n=!0;const a=c=>(d,u)=>{var h;const m=hx(t,u,c==="exit"?(h=t.presenceContext)===null||h===void 0?void 0:h.custom:void 0);if(m){const{transition:f,transitionEnd:p,...g}=m;d={...d,...g,...p}}return d};function i(c){e=c(t)}function o(c){const{props:d}=t,u=m3(t.parent)||{},h=[],m=new Set;let f={},p=1/0;for(let x=0;x<V$;x++){const b=B$[x],y=s[b],w=d[b]!==void 0?d[b]:u[b],N=Eu(w),j=b===c?y.isActive:null;j===!1&&(p=x);let S=w===u[b]&&w!==d[b]&&N;if(S&&n&&t.manuallyAnimateOnMount&&(S=!1),y.protectedKeys={...f},!y.isActive&&j===null||!w&&!y.prevProp||dx(w)||typeof w=="boolean")continue;const k=W$(y.prevProp,w);let C=k||b===c&&y.isActive&&!S&&N||x>p&&N,T=!1;const A=Array.isArray(w)?w:[w];let E=A.reduce(a(b),{});j===!1&&(E={});const{prevResolvedValues:L={}}=y,D={...L,...E},P=O=>{C=!0,m.has(O)&&(T=!0,m.delete(O)),y.needsAnimating[O]=!0;const _=t.getValue(O);_&&(_.liveStyle=!1)};for(const O in D){const _=E[O],B=L[O];if(f.hasOwnProperty(O))continue;let J=!1;Jb(_)&&Jb(B)?J=!C4(_,B):J=_!==B,J?_!=null?P(O):m.add(O):_!==void 0&&m.has(O)?P(O):y.protectedKeys[O]=!0}y.prevProp=w,y.prevResolvedValues=E,y.isActive&&(f={...f,...E}),n&&t.blockInitialAnimation&&(C=!1),C&&(!(S&&k)||T)&&h.push(...A.map(O=>({animation:O,options:{type:b}})))}if(m.size){const x={};m.forEach(b=>{const y=t.getBaseTarget(b),w=t.getValue(b);w&&(w.liveStyle=!0),x[b]=y??null}),h.push({animation:x})}let g=!!h.length;return n&&(d.initial===!1||d.initial===d.animate)&&!t.manuallyAnimateOnMount&&(g=!1),n=!1,g?e(h):Promise.resolve()}function l(c,d){var u;if(s[c].isActive===d)return Promise.resolve();(u=t.variantChildren)===null||u===void 0||u.forEach(m=>{var f;return(f=m.animationState)===null||f===void 0?void 0:f.setActive(c,d)}),s[c].isActive=d;const h=o(c);for(const m in s)s[m].protectedKeys={};return h}return{animateChanges:o,setActive:l,setAnimateFunction:i,getState:()=>s,reset:()=>{s=f2(),n=!0}}}function W$(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!C4(e,t):!1}function co(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function f2(){return{animate:co(!0),whileInView:co(),whileHover:co(),whileTap:co(),whileDrag:co(),whileFocus:co(),exit:co()}}class to{constructor(e){this.isMounted=!1,this.node=e}update(){}}class G$ extends to{constructor(e){super(e),e.animationState||(e.animationState=H$(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();dx(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:s}=this.node.prevProps||{};e!==s&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let Y$=0;class q$ extends to{constructor(){super(...arguments),this.id=Y$++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:s}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const a=this.node.animationState.setActive("exit",!e);s&&!e&&a.then(()=>s(this.id))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}const K$={animation:{Feature:G$},exit:{Feature:q$}};function Pu(t,e,s,n={passive:!0}){return t.addEventListener(e,s,n),()=>t.removeEventListener(e,s)}function ih(t){return{point:{x:t.pageX,y:t.pageY}}}const J$=t=>e=>Cw(e)&&t(e,ih(e));function qd(t,e,s,n){return Pu(t,e,J$(s),n)}const p2=(t,e)=>Math.abs(t-e);function Q$(t,e){const s=p2(t.x,e.x),n=p2(t.y,e.y);return Math.sqrt(s**2+n**2)}class f3{constructor(e,s,{transformPagePoint:n,contextWindow:a,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Lg(this.lastMoveEventInfo,this.history),m=this.startEvent!==null,f=Q$(h.offset,{x:0,y:0})>=3;if(!m&&!f)return;const{point:p}=h,{timestamp:g}=ns;this.history.push({...p,timestamp:g});const{onStart:x,onMove:b}=this.handlers;m||(x&&x(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,h)},this.handlePointerMove=(h,m)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Rg(m,this.transformPagePoint),Je.update(this.updatePoint,!0)},this.handlePointerUp=(h,m)=>{this.end();const{onEnd:f,onSessionEnd:p,resumeAnimation:g}=this.handlers;if(this.dragSnapToOrigin&&g&&g(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Lg(h.type==="pointercancel"?this.lastMoveEventInfo:Rg(m,this.transformPagePoint),this.history);this.startEvent&&f&&f(h,x),p&&p(h,x)},!Cw(e))return;this.dragSnapToOrigin=i,this.handlers=s,this.transformPagePoint=n,this.contextWindow=a||window;const o=ih(e),l=Rg(o,this.transformPagePoint),{point:c}=l,{timestamp:d}=ns;this.history=[{...c,timestamp:d}];const{onSessionStart:u}=s;u&&u(e,Lg(l,this.history)),this.removeListeners=ah(qd(this.contextWindow,"pointermove",this.handlePointerMove),qd(this.contextWindow,"pointerup",this.handlePointerUp),qd(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Ar(this.updatePoint)}}function Rg(t,e){return e?{point:e(t.point)}:t}function x2(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Lg({point:t},e){return{point:t,delta:x2(t,p3(e)),offset:x2(t,X$(e)),velocity:Z$(e,.1)}}function X$(t){return t[0]}function p3(t){return t[t.length-1]}function Z$(t,e){if(t.length<2)return{x:0,y:0};let s=t.length-1,n=null;const a=p3(t);for(;s>=0&&(n=t[s],!(a.timestamp-n.timestamp>Ea(e)));)s--;if(!n)return{x:0,y:0};const i=Ma(a.timestamp-n.timestamp);if(i===0)return{x:0,y:0};const o={x:(a.x-n.x)/i,y:(a.y-n.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const x3=1e-4,ez=1-x3,tz=1+x3,g3=.01,sz=0-g3,nz=0+g3;function Ln(t){return t.max-t.min}function rz(t,e,s){return Math.abs(t-e)<=s}function g2(t,e,s,n=.5){t.origin=n,t.originPoint=yt(e.min,e.max,t.origin),t.scale=Ln(s)/Ln(e),t.translate=yt(s.min,s.max,t.origin)-t.originPoint,(t.scale>=ez&&t.scale<=tz||isNaN(t.scale))&&(t.scale=1),(t.translate>=sz&&t.translate<=nz||isNaN(t.translate))&&(t.translate=0)}function Kd(t,e,s,n){g2(t.x,e.x,s.x,n?n.originX:void 0),g2(t.y,e.y,s.y,n?n.originY:void 0)}function b2(t,e,s){t.min=s.min+e.min,t.max=t.min+Ln(e)}function az(t,e,s){b2(t.x,e.x,s.x),b2(t.y,e.y,s.y)}function y2(t,e,s){t.min=e.min-s.min,t.max=t.min+Ln(e)}function Jd(t,e,s){y2(t.x,e.x,s.x),y2(t.y,e.y,s.y)}function iz(t,{min:e,max:s},n){return e!==void 0&&t<e?t=n?yt(e,t,n.min):Math.max(t,e):s!==void 0&&t>s&&(t=n?yt(s,t,n.max):Math.min(t,s)),t}function v2(t,e,s){return{min:e!==void 0?t.min+e:void 0,max:s!==void 0?t.max+s-(t.max-t.min):void 0}}function oz(t,{top:e,left:s,bottom:n,right:a}){return{x:v2(t.x,s,a),y:v2(t.y,e,n)}}function w2(t,e){let s=e.min-t.min,n=e.max-t.max;return e.max-e.min<t.max-t.min&&([s,n]=[n,s]),{min:s,max:n}}function lz(t,e){return{x:w2(t.x,e.x),y:w2(t.y,e.y)}}function cz(t,e){let s=.5;const n=Ln(t),a=Ln(e);return a>n?s=Ko(e.min,e.max-n,t.min):n>a&&(s=Ko(t.min,t.max-a,e.min)),ra(0,1,s)}function dz(t,e){const s={};return e.min!==void 0&&(s.min=e.min-t.min),e.max!==void 0&&(s.max=e.max-t.min),s}const oy=.35;function uz(t=oy){return t===!1?t=0:t===!0&&(t=oy),{x:j2(t,"left","right"),y:j2(t,"top","bottom")}}function j2(t,e,s){return{min:N2(t,e),max:N2(t,s)}}function N2(t,e){return typeof t=="number"?t:t[e]||0}const k2=()=>({translate:0,scale:1,origin:0,originPoint:0}),Kl=()=>({x:k2(),y:k2()}),C2=()=>({min:0,max:0}),Dt=()=>({x:C2(),y:C2()});function Gn(t){return[t("x"),t("y")]}function b3({top:t,left:e,right:s,bottom:n}){return{x:{min:e,max:s},y:{min:t,max:n}}}function hz({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function mz(t,e){if(!e)return t;const s=e({x:t.left,y:t.top}),n=e({x:t.right,y:t.bottom});return{top:s.y,left:s.x,bottom:n.y,right:n.x}}function Og(t){return t===void 0||t===1}function ly({scale:t,scaleX:e,scaleY:s}){return!Og(t)||!Og(e)||!Og(s)}function go(t){return ly(t)||y3(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function y3(t){return S2(t.x)||S2(t.y)}function S2(t){return t&&t!=="0%"}function Pf(t,e,s){const n=t-s,a=e*n;return s+a}function _2(t,e,s,n,a){return a!==void 0&&(t=Pf(t,a,n)),Pf(t,s,n)+e}function cy(t,e=0,s=1,n,a){t.min=_2(t.min,e,s,n,a),t.max=_2(t.max,e,s,n,a)}function v3(t,{x:e,y:s}){cy(t.x,e.translate,e.scale,e.originPoint),cy(t.y,s.translate,s.scale,s.originPoint)}const T2=.999999999999,E2=1.0000000000001;function fz(t,e,s,n=!1){const a=s.length;if(!a)return;e.x=e.y=1;let i,o;for(let l=0;l<a;l++){i=s[l],o=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(n&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Ql(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),o&&(e.x*=o.x.scale,e.y*=o.y.scale,v3(t,o)),n&&go(i.latestValues)&&Ql(t,i.latestValues))}e.x<E2&&e.x>T2&&(e.x=1),e.y<E2&&e.y>T2&&(e.y=1)}function Jl(t,e){t.min=t.min+e,t.max=t.max+e}function M2(t,e,s,n,a=.5){const i=yt(t.min,t.max,a);cy(t,e,s,i,n)}function Ql(t,e){M2(t.x,e.x,e.scaleX,e.scale,e.originX),M2(t.y,e.y,e.scaleY,e.scale,e.originY)}function w3(t,e){return b3(mz(t.getBoundingClientRect(),e))}function pz(t,e,s){const n=w3(t,s),{scroll:a}=e;return a&&(Jl(n.x,a.offset.x),Jl(n.y,a.offset.y)),n}const j3=({current:t})=>t?t.ownerDocument.defaultView:null,xz=new WeakMap;class gz{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Dt(),this.visualElement=e}start(e,{snapToCursor:s=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&n.isPresent===!1)return;const a=u=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),s&&this.snapToCursor(ih(u).point)},i=(u,h)=>{const{drag:m,dragPropagation:f,onDragStart:p}=this.getProps();if(m&&!f&&(this.openDragLock&&this.openDragLock(),this.openDragLock=uF(m),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Gn(x=>{let b=this.getAxisMotionValue(x).get()||0;if(ea.test(b)){const{projection:y}=this.visualElement;if(y&&y.layout){const w=y.layout.layoutBox[x];w&&(b=Ln(w)*(parseFloat(b)/100))}}this.originPoint[x]=b}),p&&Je.postRender(()=>p(u,h)),Zb(this.visualElement,"transform");const{animationState:g}=this.visualElement;g&&g.setActive("whileDrag",!0)},o=(u,h)=>{const{dragPropagation:m,dragDirectionLock:f,onDirectionLock:p,onDrag:g}=this.getProps();if(!m&&!this.openDragLock)return;const{offset:x}=h;if(f&&this.currentDirection===null){this.currentDirection=bz(x),this.currentDirection!==null&&p&&p(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),g&&g(u,h)},l=(u,h)=>this.stop(u,h),c=()=>Gn(u=>{var h;return this.getAnimationState(u)==="paused"&&((h=this.getAxisMotionValue(u).animation)===null||h===void 0?void 0:h.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new f3(e,{onSessionStart:a,onStart:i,onMove:o,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,contextWindow:j3(this.visualElement)})}stop(e,s){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:a}=s;this.startAnimation(a);const{onDragEnd:i}=this.getProps();i&&Je.postRender(()=>i(e,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:s}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),s&&s.setActive("whileDrag",!1)}updateAxis(e,s,n){const{drag:a}=this.getProps();if(!n||!Vh(e,a,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(o=iz(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var e;const{dragConstraints:s,dragElastic:n}=this.getProps(),a=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,i=this.constraints;s&&Yl(s)?this.constraints||(this.constraints=this.resolveRefConstraints()):s&&a?this.constraints=oz(a.layoutBox,s):this.constraints=!1,this.elastic=uz(n),i!==this.constraints&&a&&this.constraints&&!this.hasMutatedConstraints&&Gn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=dz(a.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:s}=this.getProps();if(!e||!Yl(e))return!1;const n=e.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const i=pz(n,a.root,this.visualElement.getTransformPagePoint());let o=lz(a.layout.layoutBox,i);if(s){const l=s(hz(o));this.hasMutatedConstraints=!!l,l&&(o=b3(l))}return o}startAnimation(e){const{drag:s,dragMomentum:n,dragElastic:a,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=Gn(u=>{if(!Vh(u,s,this.currentDirection))return;let h=c&&c[u]||{};o&&(h={min:0,max:0});const m=a?200:1e6,f=a?40:1e7,p={type:"inertia",velocity:n?e[u]:0,bounceStiffness:m,bounceDamping:f,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(u,p)});return Promise.all(d).then(l)}startAxisValueAnimation(e,s){const n=this.getAxisMotionValue(e);return Zb(this.visualElement,e),n.start($w(e,n,0,s,this.visualElement,!1))}stopAnimation(){Gn(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Gn(e=>{var s;return(s=this.getAxisMotionValue(e).animation)===null||s===void 0?void 0:s.pause()})}getAnimationState(e){var s;return(s=this.getAxisMotionValue(e).animation)===null||s===void 0?void 0:s.state}getAxisMotionValue(e){const s=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps(),a=n[s];return a||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Gn(s=>{const{drag:n}=this.getProps();if(!Vh(s,n,this.currentDirection))return;const{projection:a}=this.visualElement,i=this.getAxisMotionValue(s);if(a&&a.layout){const{min:o,max:l}=a.layout.layoutBox[s];i.set(e[s]-yt(o,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:s}=this.getProps(),{projection:n}=this.visualElement;if(!Yl(s)||!n||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};Gn(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();a[o]=cz({min:c,max:c},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Gn(o=>{if(!Vh(o,e,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(yt(c,d,a[o]))})}addListeners(){if(!this.visualElement.current)return;xz.set(this.visualElement,this);const e=this.visualElement.current,s=qd(e,"pointerdown",c=>{const{drag:d,dragListener:u=!0}=this.getProps();d&&u&&this.start(c)}),n=()=>{const{dragConstraints:c}=this.getProps();Yl(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,i=a.addEventListener("measure",n);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),Je.read(n);const o=Pu(window,"resize",()=>this.scalePositionWithinConstraints()),l=a.addEventListener("didUpdate",({delta:c,hasLayoutChanged:d})=>{this.isDragging&&d&&(Gn(u=>{const h=this.getAxisMotionValue(u);h&&(this.originPoint[u]+=c[u].translate,h.set(h.get()+c[u].translate))}),this.visualElement.render())});return()=>{o(),s(),i(),l&&l()}}getProps(){const e=this.visualElement.getProps(),{drag:s=!1,dragDirectionLock:n=!1,dragPropagation:a=!1,dragConstraints:i=!1,dragElastic:o=oy,dragMomentum:l=!0}=e;return{...e,drag:s,dragDirectionLock:n,dragPropagation:a,dragConstraints:i,dragElastic:o,dragMomentum:l}}}function Vh(t,e,s){return(e===!0||e===t)&&(s===null||s===t)}function bz(t,e=10){let s=null;return Math.abs(t.y)>e?s="y":Math.abs(t.x)>e&&(s="x"),s}class yz extends to{constructor(e){super(e),this.removeGroupControls=Gs,this.removeListeners=Gs,this.controls=new gz(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Gs}unmount(){this.removeGroupControls(),this.removeListeners()}}const A2=t=>(e,s)=>{t&&Je.postRender(()=>t(e,s))};class vz extends to{constructor(){super(...arguments),this.removePointerDownListener=Gs}onPointerDown(e){this.session=new f3(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:j3(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:s,onPan:n,onPanEnd:a}=this.node.getProps();return{onSessionStart:A2(e),onStart:A2(s),onMove:n,onEnd:(i,o)=>{delete this.session,a&&Je.postRender(()=>a(i,o))}}}mount(){this.removePointerDownListener=qd(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const Om={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function P2(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const ad={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Ee.test(t))t=parseFloat(t);else return t;const s=P2(t,e.target.x),n=P2(t,e.target.y);return`${s}% ${n}%`}},wz={correct:(t,{treeScale:e,projectionDelta:s})=>{const n=t,a=Bi.parse(t);if(a.length>5)return n;const i=Bi.createTransformer(t),o=typeof a[0]!="number"?1:0,l=s.x.scale*e.x,c=s.y.scale*e.y;a[0+o]/=l,a[1+o]/=c;const d=yt(l,c,.5);return typeof a[2+o]=="number"&&(a[2+o]/=d),typeof a[3+o]=="number"&&(a[3+o]/=d),i(a)}};class jz extends M.Component{componentDidMount(){const{visualElement:e,layoutGroup:s,switchLayoutGroup:n,layoutId:a}=this.props,{projection:i}=e;G8(Nz),i&&(s.group&&s.group.add(i),n&&n.register&&a&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),Om.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:s,visualElement:n,drag:a,isPresent:i}=this.props,o=n.projection;return o&&(o.isPresent=i,a||e.layoutDependency!==s||s===void 0?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Je.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),uw.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:s,switchLayoutGroup:n}=this.props,{projection:a}=e;a&&(a.scheduleCheckAfterUnmount(),s&&s.group&&s.group.remove(a),n&&n.deregister&&n.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function N3(t){const[e,s]=a4(),n=M.useContext(aw);return r.jsx(jz,{...t,layoutGroup:n,switchLayoutGroup:M.useContext(h4),isPresent:e,safeToRemove:s})}const Nz={borderRadius:{...ad,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ad,borderTopRightRadius:ad,borderBottomLeftRadius:ad,borderBottomRightRadius:ad,boxShadow:wz};function kz(t,e,s){const n=Ps(t)?t:Kr(t);return n.start($w("",n,e,s)),n.animation}function Cz(t){return t instanceof SVGElement&&t.tagName!=="svg"}const Sz=(t,e)=>t.depth-e.depth;class _z{constructor(){this.children=[],this.isDirty=!1}add(e){Sw(this.children,e),this.isDirty=!0}remove(e){_w(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Sz),this.isDirty=!1,this.children.forEach(e)}}function Tz(t,e){const s=ta.now(),n=({timestamp:a})=>{const i=a-s;i>=e&&(Ar(n),t(i-e))};return Je.read(n,!0),()=>Ar(n)}const k3=["TopLeft","TopRight","BottomLeft","BottomRight"],Ez=k3.length,D2=t=>typeof t=="string"?parseFloat(t):t,R2=t=>typeof t=="number"||Ee.test(t);function Mz(t,e,s,n,a,i){a?(t.opacity=yt(0,s.opacity!==void 0?s.opacity:1,Az(n)),t.opacityExit=yt(e.opacity!==void 0?e.opacity:1,0,Pz(n))):i&&(t.opacity=yt(e.opacity!==void 0?e.opacity:1,s.opacity!==void 0?s.opacity:1,n));for(let o=0;o<Ez;o++){const l=`border${k3[o]}Radius`;let c=L2(e,l),d=L2(s,l);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||R2(c)===R2(d)?(t[l]=Math.max(yt(D2(c),D2(d),n),0),(ea.test(d)||ea.test(c))&&(t[l]+="%")):t[l]=d}(e.rotate||s.rotate)&&(t.rotate=yt(e.rotate||0,s.rotate||0,n))}function L2(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Az=C3(0,.5,V4),Pz=C3(.5,.95,Gs);function C3(t,e,s){return n=>n<t?0:n>e?1:s(Ko(t,e,n))}function O2(t,e){t.min=e.min,t.max=e.max}function Hn(t,e){O2(t.x,e.x),O2(t.y,e.y)}function I2(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function F2(t,e,s,n,a){return t-=e,t=Pf(t,1/s,n),a!==void 0&&(t=Pf(t,1/a,n)),t}function Dz(t,e=0,s=1,n=.5,a,i=t,o=t){if(ea.test(e)&&(e=parseFloat(e),e=yt(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=yt(i.min,i.max,n);t===i&&(l-=e),t.min=F2(t.min,e,s,l,a),t.max=F2(t.max,e,s,l,a)}function $2(t,e,[s,n,a],i,o){Dz(t,e[s],e[n],e[a],e.scale,i,o)}const Rz=["x","scaleX","originX"],Lz=["y","scaleY","originY"];function z2(t,e,s,n){$2(t.x,e,Rz,s?s.x:void 0,n?n.x:void 0),$2(t.y,e,Lz,s?s.y:void 0,n?n.y:void 0)}function B2(t){return t.translate===0&&t.scale===1}function S3(t){return B2(t.x)&&B2(t.y)}function V2(t,e){return t.min===e.min&&t.max===e.max}function Oz(t,e){return V2(t.x,e.x)&&V2(t.y,e.y)}function U2(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function _3(t,e){return U2(t.x,e.x)&&U2(t.y,e.y)}function H2(t){return Ln(t.x)/Ln(t.y)}function W2(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Iz{constructor(){this.members=[]}add(e){Sw(this.members,e),e.scheduleRender()}remove(e){if(_w(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const s=this.members[this.members.length-1];s&&this.promote(s)}}relegate(e){const s=this.members.findIndex(a=>e===a);if(s===0)return!1;let n;for(let a=s;a>=0;a--){const i=this.members[a];if(i.isPresent!==!1){n=i;break}}return n?(this.promote(n),!0):!1}promote(e,s){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,s&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:a}=e.options;a===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:s,resumingFrom:n}=e;s.onExitComplete&&s.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Fz(t,e,s){let n="";const a=t.x.translate/e.x,i=t.y.translate/e.y,o=(s==null?void 0:s.z)||0;if((a||i||o)&&(n=`translate3d(${a}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(n+=`scale(${1/e.x}, ${1/e.y}) `),s){const{transformPerspective:d,rotate:u,rotateX:h,rotateY:m,skewX:f,skewY:p}=s;d&&(n=`perspective(${d}px) ${n}`),u&&(n+=`rotate(${u}deg) `),h&&(n+=`rotateX(${h}deg) `),m&&(n+=`rotateY(${m}deg) `),f&&(n+=`skewX(${f}deg) `),p&&(n+=`skewY(${p}deg) `)}const l=t.x.scale*e.x,c=t.y.scale*e.y;return(l!==1||c!==1)&&(n+=`scale(${l}, ${c})`),n||"none"}const bo={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},_d=typeof window<"u"&&window.MotionDebug!==void 0,Ig=["","X","Y","Z"],$z={visibility:"hidden"},G2=1e3;let zz=0;function Fg(t,e,s,n){const{latestValues:a}=e;a[t]&&(s[t]=a[t],e.setStaticValue(t,0),n&&(n[t]=0))}function T3(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const s=L4(e);if(window.MotionHasOptimisedAnimation(s,"transform")){const{layout:a,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(s,"transform",Je,!(a||i))}const{parent:n}=t;n&&!n.hasCheckedOptimisedAppear&&T3(n)}function E3({attachResizeListener:t,defaultParent:e,measureScroll:s,checkIsScrollRoot:n,resetTransform:a}){return class{constructor(o={},l=e==null?void 0:e()){this.id=zz++,this.animationId=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.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,_d&&(bo.totalNodes=bo.resolvedTargetDeltas=bo.recalculatedProjection=0),this.nodes.forEach(Uz),this.nodes.forEach(qz),this.nodes.forEach(Kz),this.nodes.forEach(Hz),_d&&window.MotionDebug.record(bo)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new _z)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new Tw),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=Cz(o),this.instance=o;const{layoutId:c,layout:d,visualElement:u}=this.options;if(u&&!u.current&&u.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(d||c)&&(this.isLayoutDirty=!0),t){let h;const m=()=>this.root.updateBlockedByResize=!1;t(o,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=Tz(m,250),Om.hasAnimatedSinceResize&&(Om.hasAnimatedSinceResize=!1,this.nodes.forEach(q2))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&u&&(c||d)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:m,hasRelativeTargetChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||eB,{onLayoutAnimationStart:x,onLayoutAnimationComplete:b}=u.getProps(),y=!this.targetLayout||!_3(this.targetLayout,p)||f,w=!m&&f;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||w||m&&(y||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,w);const N={...ww(g,"layout"),onPlay:x,onComplete:b};(u.shouldReduceMotion||this.options.layoutRoot)&&(N.delay=0,N.type=!1),this.startAnimation(N)}else m||q2(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,Ar(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(Jz),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&T3(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let u=0;u<this.path.length;u++){const h=this.path[u];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Y2);return}this.isUpdating||this.nodes.forEach(Gz),this.isUpdating=!1,this.nodes.forEach(Yz),this.nodes.forEach(Bz),this.nodes.forEach(Vz),this.clearAllSnapshots();const l=ta.now();ns.delta=ra(0,1e3/60,l-ns.timestamp),ns.timestamp=l,ns.isProcessing=!0,Tg.update.process(ns),Tg.preRender.process(ns),Tg.render.process(ns),ns.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,uw.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Wz),this.sharedNodes.forEach(Qz)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Je.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Je.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Dt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l){const c=n(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:s(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!a)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!S3(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,u=d!==this.prevTransformTemplateValue;o&&(l||go(this.latestValues)||u)&&(a(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),tB(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var o;const{visualElement:l}=this.options;if(!l)return Dt();const c=l.measureViewportBox();if(!(((o=this.scroll)===null||o===void 0?void 0:o.wasRoot)||this.path.some(sB))){const{scroll:u}=this.root;u&&(Jl(c.x,u.offset.x),Jl(c.y,u.offset.y))}return c}removeElementScroll(o){var l;const c=Dt();if(Hn(c,o),!((l=this.scroll)===null||l===void 0)&&l.wasRoot)return c;for(let d=0;d<this.path.length;d++){const u=this.path[d],{scroll:h,options:m}=u;u!==this.root&&h&&m.layoutScroll&&(h.wasRoot&&Hn(c,o),Jl(c.x,h.offset.x),Jl(c.y,h.offset.y))}return c}applyTransform(o,l=!1){const c=Dt();Hn(c,o);for(let d=0;d<this.path.length;d++){const u=this.path[d];!l&&u.options.layoutScroll&&u.scroll&&u!==u.root&&Ql(c,{x:-u.scroll.offset.x,y:-u.scroll.offset.y}),go(u.latestValues)&&Ql(c,u.latestValues)}return go(this.latestValues)&&Ql(c,this.latestValues),c}removeTransform(o){const l=Dt();Hn(l,o);for(let c=0;c<this.path.length;c++){const d=this.path[c];if(!d.instance||!go(d.latestValues))continue;ly(d.latestValues)&&d.updateSnapshot();const u=Dt(),h=d.measurePageBox();Hn(u,h),z2(l,d.latestValues,d.snapshot?d.snapshot.layoutBox:void 0,u)}return go(this.latestValues)&&z2(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==ns.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var l;const c=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=c.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=c.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=c.isSharedProjectionDirty);const d=!!this.resumingFrom||this!==c;if(!(o||d&&this.isSharedProjectionDirty||this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:m}=this.options;if(!(!this.layout||!(h||m))){if(this.resolvedRelativeTargetAt=ns.timestamp,!this.targetDelta&&!this.relativeTarget){const f=this.getClosestProjectingParent();f&&f.layout&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Dt(),this.relativeTargetOrigin=Dt(),Jd(this.relativeTargetOrigin,this.layout.layoutBox,f.layout.layoutBox),Hn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Dt(),this.targetWithTransforms=Dt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),az(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):Hn(this.target,this.layout.layoutBox),v3(this.target,this.targetDelta)):Hn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const f=this.getClosestProjectingParent();f&&!!f.resumingFrom==!!this.resumingFrom&&!f.options.layoutScroll&&f.target&&this.animationProgress!==1?(this.relativeParent=f,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Dt(),this.relativeTargetOrigin=Dt(),Jd(this.relativeTargetOrigin,this.target,f.target),Hn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}_d&&bo.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||ly(this.parent.latestValues)||y3(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var o;const l=this.getLead(),c=!!this.resumingFrom||this!==l;let d=!0;if((this.isProjectionDirty||!((o=this.parent)===null||o===void 0)&&o.isProjectionDirty)&&(d=!1),c&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(d=!1),this.resolvedRelativeTargetAt===ns.timestamp&&(d=!1),d)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;Hn(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,f=this.treeScale.y;fz(this.layoutCorrected,this.treeScale,this.path,c),l.layout&&!l.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(l.target=l.layout.layoutBox,l.targetWithTransforms=Dt());const{target:p}=l;if(!p){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(I2(this.prevProjectionDelta.x,this.projectionDelta.x),I2(this.prevProjectionDelta.y,this.projectionDelta.y)),Kd(this.projectionDelta,this.layoutCorrected,p,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==f||!W2(this.projectionDelta.x,this.prevProjectionDelta.x)||!W2(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",p)),_d&&bo.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)===null||l===void 0||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Kl(),this.projectionDelta=Kl(),this.projectionDeltaWithTransform=Kl()}setAnimationOrigin(o,l=!1){const c=this.snapshot,d=c?c.latestValues:{},u={...this.latestValues},h=Kl();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const m=Dt(),f=c?c.source:void 0,p=this.layout?this.layout.source:void 0,g=f!==p,x=this.getStack(),b=!x||x.members.length<=1,y=!!(g&&!b&&this.options.crossfade===!0&&!this.path.some(Zz));this.animationProgress=0;let w;this.mixTargetDelta=N=>{const j=N/1e3;K2(h.x,o.x,j),K2(h.y,o.y,j),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Jd(m,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Xz(this.relativeTarget,this.relativeTargetOrigin,m,j),w&&Oz(this.relativeTarget,w)&&(this.isProjectionDirty=!1),w||(w=Dt()),Hn(w,this.relativeTarget)),g&&(this.animationValues=u,Mz(u,d,this.latestValues,j,y,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(Ar(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Je.update(()=>{Om.hasAnimatedSinceResize=!0,this.currentAnimation=kz(0,G2,{...o,onUpdate:l=>{this.mixTargetDelta(l),o.onUpdate&&o.onUpdate(l)},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(G2),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:u}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&M3(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Dt();const h=Ln(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+h;const m=Ln(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+m}Hn(l,c),Ql(l,u),Kd(this.projectionDeltaWithTransform,this.layoutCorrected,l,u)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Iz),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var o;const{layoutId:l}=this.options;return l?((o=this.getStack())===null||o===void 0?void 0:o.lead)||this:this}getPrevLead(){var o;const{layoutId:l}=this.options;return l?(o=this.getStack())===null||o===void 0?void 0:o.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const d={};c.z&&Fg("z",o,d,this.animationValues);for(let u=0;u<Ig.length;u++)Fg(`rotate${Ig[u]}`,o,d,this.animationValues),Fg(`skew${Ig[u]}`,o,d,this.animationValues);o.render();for(const u in d)o.setStaticValue(u,d[u]),this.animationValues&&(this.animationValues[u]=d[u]);o.scheduleRender()}getProjectionStyles(o){var l,c;if(!this.instance||this.isSVG)return;if(!this.isVisible)return $z;const d={visibility:""},u=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,d.opacity="",d.pointerEvents=Rm(o==null?void 0:o.pointerEvents)||"",d.transform=u?u(this.latestValues,""):"none",d;const h=this.getLead();if(!this.projectionDelta||!this.layout||!h.target){const g={};return this.options.layoutId&&(g.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,g.pointerEvents=Rm(o==null?void 0:o.pointerEvents)||""),this.hasProjected&&!go(this.latestValues)&&(g.transform=u?u({},""):"none",this.hasProjected=!1),g}const m=h.animationValues||h.latestValues;this.applyTransformsToTarget(),d.transform=Fz(this.projectionDeltaWithTransform,this.treeScale,m),u&&(d.transform=u(m,d.transform));const{x:f,y:p}=this.projectionDelta;d.transformOrigin=`${f.origin*100}% ${p.origin*100}% 0`,h.animationValues?d.opacity=h===this?(c=(l=m.opacity)!==null&&l!==void 0?l:this.latestValues.opacity)!==null&&c!==void 0?c:1:this.preserveOpacity?this.latestValues.opacity:m.opacityExit:d.opacity=h===this?m.opacity!==void 0?m.opacity:"":m.opacityExit!==void 0?m.opacityExit:0;for(const g in _f){if(m[g]===void 0)continue;const{correct:x,applyTo:b}=_f[g],y=d.transform==="none"?m[g]:x(m[g],h);if(b){const w=b.length;for(let N=0;N<w;N++)d[b[N]]=y}else d[g]=y}return this.options.layoutId&&(d.pointerEvents=h===this?Rm(o==null?void 0:o.pointerEvents)||"":"none"),d}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)===null||l===void 0?void 0:l.stop()}),this.root.nodes.forEach(Y2),this.root.sharedNodes.clear()}}}function Bz(t){t.updateLayout()}function Vz(t){var e;const s=((e=t.resumeFrom)===null||e===void 0?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&s&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:a}=t.layout,{animationType:i}=t.options,o=s.source!==t.layout.source;i==="size"?Gn(h=>{const m=o?s.measuredBox[h]:s.layoutBox[h],f=Ln(m);m.min=n[h].min,m.max=m.min+f}):M3(i,s.layoutBox,n)&&Gn(h=>{const m=o?s.measuredBox[h]:s.layoutBox[h],f=Ln(n[h]);m.max=m.min+f,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+f)});const l=Kl();Kd(l,n,s.layoutBox);const c=Kl();o?Kd(c,t.applyTransform(a,!0),s.measuredBox):Kd(c,n,s.layoutBox);const d=!S3(l);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:m,layout:f}=h;if(m&&f){const p=Dt();Jd(p,s.layoutBox,m.layoutBox);const g=Dt();Jd(g,n,f.layoutBox),_3(p,g)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=g,t.relativeTargetOrigin=p,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:s,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function Uz(t){_d&&bo.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.
vendor: 6,390 bytes, line 75
75isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Hz(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Wz(t){t.clearSnapshot()}function Y2(t){t.clearMeasurements()}function Gz(t){t.isLayoutDirty=!1}function Yz(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function q2(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function qz(t){t.resolveTargetDelta()}function Kz(t){t.calcProjection()}function Jz(t){t.resetSkewAndRotation()}function Qz(t){t.removeLeadSnapshot()}function K2(t,e,s){t.translate=yt(e.translate,0,s),t.scale=yt(e.scale,1,s),t.origin=e.origin,t.originPoint=e.originPoint}function J2(t,e,s,n){t.min=yt(e.min,s.min,n),t.max=yt(e.max,s.max,n)}function Xz(t,e,s,n){J2(t.x,e.x,s.x,n),J2(t.y,e.y,s.y,n)}function Zz(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const eB={duration:.45,ease:[.4,0,.1,1]},Q2=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),X2=Q2("applewebkit/")&&!Q2("chrome/")?Math.round:Gs;function Z2(t){t.min=X2(t.min),t.max=X2(t.max)}function tB(t){Z2(t.x),Z2(t.y)}function M3(t,e,s){return t==="position"||t==="preserve-aspect"&&!rz(H2(e),H2(s),.2)}function sB(t){var e;return t!==t.root&&((e=t.scroll)===null||e===void 0?void 0:e.wasRoot)}const nB=E3({attachResizeListener:(t,e)=>Pu(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),$g={current:void 0},A3=E3({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!$g.current){const t=new nB({});t.mount(window),t.setOptions({layoutScroll:!0}),$g.current=t}return $g.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),rB={pan:{Feature:vz},drag:{Feature:yz,ProjectionNode:A3,MeasureLayout:N3}};function ek(t,e,s){const{props:n}=t;t.animationState&&n.whileHover&&t.animationState.setActive("whileHover",s==="Start");const a="onHover"+s,i=n[a];i&&Je.postRender(()=>i(e,ih(e)))}class aB extends to{mount(){const{current:e}=this.node;e&&(this.unmount=iF(e,s=>(ek(this.node,s,"Start"),n=>ek(this.node,n,"End"))))}unmount(){}}class iB extends to{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=ah(Pu(this.node.current,"focus",()=>this.onFocus()),Pu(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function tk(t,e,s){const{props:n}=t;t.animationState&&n.whileTap&&t.animationState.setActive("whileTap",s==="Start");const a="onTap"+(s==="End"?"":s),i=n[a];i&&Je.postRender(()=>i(e,ih(e)))}class oB extends to{mount(){const{current:e}=this.node;e&&(this.unmount=dF(e,s=>(tk(this.node,s,"Start"),(n,{success:a})=>tk(this.node,n,a?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const dy=new WeakMap,zg=new WeakMap,lB=t=>{const e=dy.get(t.target);e&&e(t)},cB=t=>{t.forEach(lB)};function dB({root:t,...e}){const s=t||document;zg.has(s)||zg.set(s,{});const n=zg.get(s),a=JSON.stringify(e);return n[a]||(n[a]=new IntersectionObserver(cB,{root:t,...e})),n[a]}function uB(t,e,s){const n=dB(e);return dy.set(t,s),n.observe(t),()=>{dy.delete(t),n.unobserve(t)}}const hB={some:0,all:1};class mB extends to{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:s,margin:n,amount:a="some",once:i}=e,o={root:s?s.current:void 0,rootMargin:n,threshold:typeof a=="number"?a:hB[a]},l=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:u,onViewportLeave:h}=this.node.getProps(),m=d?u:h;m&&m(c)};return uB(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:s}=this.node;["amount","margin","root"].some(fB(e,s))&&this.startObserver()}unmount(){}}function fB({viewport:t={}},{viewport:e={}}={}){return s=>t[s]!==e[s]}const pB={inView:{Feature:mB},tap:{Feature:oB},focus:{Feature:iB},hover:{Feature:aB}},xB={layout:{ProjectionNode:A3,MeasureLayout:N3}},uy={current:null},P3={current:!1};function gB(){if(P3.current=!0,!!iw)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>uy.current=t.matches;t.addListener(e),e()}else uy.current=!1}const bB=[...s3,_s,Bi],yB=t=>bB.find(t3(t)),sk=new WeakMap;function vB(t,e,s){for(const n in e){const a=e[n],i=s[n];if(Ps(a))t.addValue(n,a);else if(Ps(i))t.addValue(n,Kr(a,{owner:t}));else if(i!==a)if(t.hasValue(n)){const o=t.getValue(n);o.liveStyle===!0?o.jump(a):o.hasAnimated||o.set(a)}else{const o=t.getStaticValue(n);t.addValue(n,Kr(o!==void 0?o:a,{owner:t}))}}for(const n in s)e[n]===void 0&&t.removeValue(n);return e}const nk=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class wB{scrapeMotionValuesFromProps(e,s,n){return{}}constructor({parent:e,props:s,presenceContext:n,reducedMotionConfig:a,blockInitialAnimation:i,visualState:o},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Lw,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},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=ta.now();this.renderScheduledAt<f&&(this.renderScheduledAt=f,Je.render(this.render,!1,!0))};
vendor: 6,629 bytes, line 75
75const{latestValues:c,renderState:d,onUpdate:u}=o;this.onUpdate=u,this.latestValues=c,this.baseTarget={...c},this.initialValues=s.initial?{...c}:{},this.renderState=d,this.parent=e,this.props=s,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=a,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=ux(s),this.isVariantNode=d4(s),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...m}=this.scrapeMotionValuesFromProps(s,{},this);for(const f in m){const p=m[f];c[f]!==void 0&&Ps(p)&&p.set(c[f],!1)}}mount(e){this.current=e,sk.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,n)=>this.bindToMotionValue(n,s)),P3.current||gB(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:uy.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){sk.delete(this.current),this.projection&&this.projection.unmount(),Ar(this.notifyUpdate),Ar(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const s=this.features[e];s&&(s.unmount(),s.isMounted=!1)}this.current=null}bindToMotionValue(e,s){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const n=ol.has(e),a=s.on("change",l=>{this.latestValues[e]=l,this.props.onUpdate&&Je.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)}),i=s.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,e,s)),this.valueSubscriptions.set(e,()=>{a(),i(),o&&o(),s.owner&&s.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in vc){const s=vc[e];if(!s)continue;const{isEnabled:n,Feature:a}=s;if(!this.features[e]&&a&&n(this.props)&&(this.features[e]=new a(this)),this.features[e]){const i=this.features[e];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):Dt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,s){this.latestValues[e]=s}update(e,s){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=s;for(let n=0;n<nk.length;n++){const a=nk[n];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const i="on"+a,o=e[i];o&&(this.propEventSubscriptions[a]=this.on(a,o))}this.prevMotionValues=vB(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const s=this.getClosestVariantNode();if(s)return s.variantChildren&&s.variantChildren.add(e),()=>s.variantChildren.delete(e)}addValue(e,s){const n=this.values.get(e);s!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,s),this.values.set(e,s),this.latestValues[e]=s.get())}removeValue(e){this.values.delete(e);const s=this.valueSubscriptions.get(e);s&&(s(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,s){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&s!==void 0&&(n=Kr(s===null?void 0:s,{owner:this}),this.addValue(e,n)),n}readValue(e,s){var n;let a=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(n=this.getBaseTargetFromProps(this.props,e))!==null&&n!==void 0?n:this.readValueFromInstance(this.current,e,this.options);return a!=null&&(typeof a=="string"&&(Z4(a)||H4(a))?a=parseFloat(a):!yB(a)&&Bi.test(s)&&(a=J4(e,s)),this.setBaseTarget(e,Ps(a)?a.get():a)),Ps(a)?a.get():a}setBaseTarget(e,s){this.baseTarget[e]=s}getBaseTarget(e){var s;const{initial:n}=this.props;let a;if(typeof n=="string"||typeof n=="object"){const o=mw(this.props,n,(s=this.presenceContext)===null||s===void 0?void 0:s.custom);o&&(a=o[e])}if(n&&a!==void 0)return a;const i=this.getBaseTargetFromProps(this.props,e);return i!==void 0&&!Ps(i)?i:this.initialValues[e]!==void 0&&a===void 0?void 0:this.baseTarget[e]}on(e,s){return this.events[e]||(this.events[e]=new Tw),this.events[e].add(s)}notify(e,...s){this.events[e]&&this.events[e].notify(...s)}}class D3 extends wB{constructor(){super(...arguments),this.KeyframeResolver=n3}sortInstanceNodePosition(e,s){return e.compareDocumentPosition(s)&2?1:-1}getBaseTargetFromProps(e,s){return e.style?e.style[s]:void 0}removeValueFromRenderState(e,{vars:s,style:n}){delete s[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ps(e)&&(this.childSubscription=e.on("change",s=>{this.current&&(this.current.textContent=`${s}`)}))}}function jB(t){return window.getComputedStyle(t)}class NB extends D3{constructor(){super(...arguments),this.type="html",this.renderInstance=y4}readValueFromInstance(e,s){if(ol.has(s)){const n=Rw(s);return n&&n.default||0}else{const n=jB(e),a=(x4(s)?n.getPropertyValue(s):n[s])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:s}){return w3(e,s)}build(e,s,n){xw(e,s,n.transformTemplate)}scrapeMotionValuesFromProps(e,s,n){return vw(e,s,n)}}class kB extends D3{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Dt}getBaseTargetFromProps(e,s){return e[s]}readValueFromInstance(e,s){if(ol.has(s)){const n=Rw(s);return n&&n.default||0}return s=v4.has(s)?s:dw(s),e.getAttribute(s)}scrapeMotionValuesFromProps(e,s,n){return N4(e,s,n)}
75build(e,s,n){gw(e,s,this.isSVGTag,n.transformTemplate)}renderInstance(e,s,n,a){w4(e,s,n,a)}mount(e){this.isSVGTag=yw(e.tagName),super.mount(e)}}const CB=(t,e)=>hw(t)?new kB(e):new NB(e,{allowProjection:t!==M.Fragment}),SB=tF({...K$,...pB,...rB,...xB},CB),V=x8(SB);function R3(t,e){let s;const n=()=>{const{currentTime:a}=e,o=(a===null?0:a.value)/100;s!==o&&t(o),s=o};return Je.update(n,!0),()=>Ar(n)}const Im=new WeakMap;let si;function _B(t,e){if(e){const{inlineSize:s,blockSize:n}=e[0];return{width:s,height:n}}else return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}function TB({target:t,contentRect:e,borderBoxSize:s}){var n;(n=Im.get(t))===null||n===void 0||n.forEach(a=>{a({target:t,contentSize:e,get size(){return _B(t,s)}})})}function EB(t){t.forEach(TB)}function MB(){typeof ResizeObserver>"u"||(si=new ResizeObserver(EB))}function AB(t,e){si||MB();const s=kw(t);return s.forEach(n=>{let a=Im.get(n);a||(a=new Set,Im.set(n,a)),a.add(e),si==null||si.observe(n)}),()=>{s.forEach(n=>{const a=Im.get(n);a==null||a.delete(e),a!=null&&a.size||si==null||si.unobserve(n)})}}const Fm=new Set;let Qd;function PB(){Qd=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};Fm.forEach(s=>s(e))},window.addEventListener("resize",Qd)}function DB(t){return Fm.add(t),Qd||PB(),()=>{Fm.delete(t),!Fm.size&&Qd&&(Qd=void 0)}}function RB(t,e){return typeof t=="function"?DB(t):AB(t,e)}const LB=50,rk=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),OB=()=>({time:0,x:rk(),y:rk()}),IB={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function ak(t,e,s,n){const a=s[e],{length:i,position:o}=IB[e],l=a.current,c=s.time;a.current=t[`scroll${o}`],a.scrollLength=t[`scroll${i}`]-t[`client${i}`],a.offset.length=0,a.offset[0]=0,a.offset[1]=a.scrollLength,a.progress=Ko(0,a.scrollLength,a.current);const d=n-c;a.velocity=d>LB?0:Ew(a.current-l,d)}function FB(t,e,s){ak(t,"x",e,s),ak(t,"y",e,s),e.time=s}function $B(t,e){const s={x:0,y:0};let n=t;for(;n&&n!==e;)if(n instanceof HTMLElement)s.x+=n.offsetLeft,s.y+=n.offsetTop,n=n.offsetParent;else if(n.tagName==="svg"){const a=n.getBoundingClientRect();n=n.parentElement;const i=n.getBoundingClientRect();s.x+=a.left-i.left,s.y+=a.top-i.top}else if(n instanceof SVGGraphicsElement){const{x:a,y:i}=n.getBBox();s.x+=a,s.y+=i;let o=null,l=n.parentNode;for(;!o;)l.tagName==="svg"&&(o=l),l=n.parentNode;n=o}else break;return s}const hy={start:0,center:.5,end:1};function ik(t,e,s=0){let n=0;if(t in hy&&(t=hy[t]),typeof t=="string"){const a=parseFloat(t);t.endsWith("px")?n=a:t.endsWith("%")?t=a/100:t.endsWith("vw")?n=a/100*document.documentElement.clientWidth:t.endsWith("vh")?n=a/100*document.documentElement.clientHeight:t=a}return typeof t=="number"&&(n=e*t),s+n}const zB=[0,0];function BB(t,e,s,n){let a=Array.isArray(t)?t:zB,i=0,o=0;return typeof t=="number"?a=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?a=t.split(" "):a=[t,hy[t]?t:"0"]),i=ik(a[0],s,n),o=ik(a[1],e),i-o}const VB={All:[[0,0],[1,1]]},UB={x:0,y:0};function HB(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function WB(t,e,s){const{offset:n=VB.All}=s,{target:a=t,axis:i="y"}=s,o=i==="y"?"height":"width",l=a!==t?$B(a,t):UB,c=a===t?{width:t.scrollWidth,height:t.scrollHeight}:HB(a),d={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let u=!e[i].interpolate;const h=n.length;for(let m=0;m<h;m++){const f=BB(n[m],d[o],c[o],l[i]);!u&&f!==e[i].interpolatorOffsets[m]&&(u=!0),e[i].offset[m]=f}u&&(e[i].interpolate=Iw(e[i].offset,d3(n),{clamp:!1}),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=ra(0,1,e[i].interpolate(e[i].current))}function GB(t,e=t,s){if(s.x.targetOffset=0,s.y.targetOffset=0,e!==t){let n=e;for(;n&&n!==t;)s.x.targetOffset+=n.offsetLeft,s.y.targetOffset+=n.offsetTop,n=n.offsetParent}s.x.targetLength=e===t?e.scrollWidth:e.clientWidth,s.y.targetLength=e===t?e.scrollHeight:e.clientHeight,s.x.containerLength=t.clientWidth,s.y.c
75ontainerLength=t.clientHeight}function YB(t,e,s,n={}){return{measure:()=>GB(t,n.target,s),update:a=>{FB(t,s,a),(n.offset||n.target)&&WB(t,s,n)},notify:()=>e(s)}}const id=new WeakMap,ok=new WeakMap,Bg=new WeakMap,lk=t=>t===document.documentElement?window:t;function zw(t,{container:e=document.documentElement,...s}={}){let n=Bg.get(e);n||(n=new Set,Bg.set(e,n));const a=OB(),i=YB(e,t,a,s);if(n.add(i),!id.has(e)){const l=()=>{for(const m of n)m.measure()},c=()=>{for(const m of n)m.update(ns.timestamp)},d=()=>{for(const m of n)m.notify()},u=()=>{Je.read(l,!1,!0),Je.read(c,!1,!0),Je.update(d,!1,!0)};id.set(e,u);const h=lk(e);window.addEventListener("resize",u,{passive:!0}),e!==document.documentElement&&ok.set(e,RB(e,u)),h.addEventListener("scroll",u,{passive:!0})}const o=id.get(e);return Je.read(o,!1,!0),()=>{var l;Ar(o);const c=Bg.get(e);if(!c||(c.delete(i),c.size))return;const d=id.get(e);id.delete(e),d&&(lk(e).removeEventListener("scroll",d),(l=ok.get(e))===null||l===void 0||l(),window.removeEventListener("resize",d))}}function qB({source:t,container:e,axis:s="y"}){t&&(e=t);const n={value:0},a=zw(i=>{n.value=i[s].progress*100},{container:e,axis:s});return{currentTime:n,cancel:a}}
75const Vg=new Map;function L3({source:t,container:e=document.documentElement,axis:s="y"}={}){t&&(e=t),Vg.has(e)||Vg.set(e,{});const n=Vg.get(e);return n[s]||(n[s]=S4()?new ScrollTimeline({source:e,axis:s}):qB({source:e,axis:s})),n[s]}function KB(t){return t.length===2}function O3(t){return t&&(t.target||t.offset)}function JB(t,e){return KB(t)||O3(e)?zw(s=>{t(s[e.axis].progress,s)},e):R3(t,L3(e))}function QB(t,e){if(t.flatten(),O3(e))return t.pause(),zw(s=>{t.time=t.duration*s[e.axis].progress},e);{const s=L3(e);return t.attachTimeline?t.attachTimeline(s,n=>(n.pause(),R3(a=>{n.time=n.duration*a},s))):Gs}}function XB(t,{axis:e="y",...s}={}){const n={axis:e,...s};return typeof t=="function"?JB(t,n):QB(t,n)}function ck(t,e){l8(!!(!e||e.current))}const ZB=()=>({scrollX:Kr(0),scrollY:Kr(0),scrollXProgress:Kr(0),scrollYProgress:Kr(0)});function Bw({container:t,target:e,layoutEffect:s=!0,...n}={}){const a=Uc(ZB);return(s?lx:M.useEffect)(()=>(ck("target",e),ck("container",t),XB((o,{x:l,y:c})=>{a.scrollX.set(l.current),a.scrollXProgress.set(l.progress),a.scrollY.set(c.current),a.scrollYProgress.set(c.progress)},{...n,container:(t==null?void 0:t.current)||void 0,target:(e==null?void 0:e.current)||void 0})),[t,e,JSON.stringify(n.offset)]),a}function e7(t){const e=Uc(()=>Kr(t)),{isStatic:s}=M.useContext(ox);if(s){const[,n]=M.useState(t);M.useEffect(()=>e.on("change",n),[])}return e}function I3(t,e){const s=e7(e()),n=()=>s.set(e());return n(),lx(()=>{const a=()=>Je.preRender(n,!1,!0),i=t.map(o=>o.on("change",a));return()=>{i.forEach(o=>o()),Ar(n)}}),s}const t7=t=>t&&typeof t=="object"&&t.mix,s7=t=>t7(t)?t.mix:void 0;function n7(...t){const e=!Array.isArray(t[0]),s=e?0:-1,n=t[0+s],a=t[1+s],i=t[2+s],o=t[3+s],l=Iw(a,i,{mixer:s7(i[0]),...o});return e?l(n):l}function r7(t){Gd.current=[],t();const e=I3(Gd.current,t);return Gd.current=void 0,e}function F3(t,e,s,n){if(typeof t=="function")return r7(t);const a=typeof e=="function"?e:n7(e,s,n);return Array.isArray(t)?dk(t,a):dk([t],([i])=>a(i))}function dk(t,e){const s=Uc(()=>[]);return I3(t,()=>{s.length=0;const n=t.length;for(let a=0;a<n;a++)s[a]=t[a].get();return e(s)})}const a7={some:0,all:1};function i7(t,e,{root:s,margin:n,amount:a="some"}={}){const i=kw(t),o=new WeakMap,l=d=>{d.forEach(u=>{const h=o.get(u.target);if(u.isIntersecting!==!!h)if(u.isIntersecting){const m=e(u);typeof m=="function"?o.set(u.target,m):c.unobserve(u.target)}else typeof h=="function"&&(h(u),o.delete(u.target))})},c=new IntersectionObserver(l,{root:s,rootMargin:n,threshold:typeof a=="number"?a:a7[a]});return i.forEach(d=>c.observe(d)),()=>c.disconnect()}function o7(t,{root:e,margin:s,amount:n,once:a=!1}={}){const[i,o]=M.useState(!1);return M.useEffect(()=>{if(!t.current||a&&i)return;const l=()=>(o(!0),a?void 0:()=>o(!1)),c={root:e&&e.current||void 0,margin:s,amount:n};return i7(t.current,l,c)},[e,t,s,a,n]),i}/** 76 * @license lucide-react v0.451.0 - ISC 77 * 78 * This source code is licensed under the ISC license. 79 * See the LICENSE file in the root directory of this source tree. 80 */const l7=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),$3=(...t)=>t.filter((e,s,n)=>!!e&&n.indexOf(e)===s).join(" ");/** 81 * @license lucide-react v0.451.0 - ISC 82 * 83 * This source code is licensed under the ISC license. 84 * See the LICENSE file in the root directory of this source tree. 85 */var c7={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/** 86 * @license lucide-react v0.451.0 - ISC 87 * 88 * This source code is licensed under the ISC license. 89 * See the LICENSE file in the root directory of this source tree. 90 */const d7=M.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:s=2,absoluteStrokeWidth:n,className:a="",children:i,iconNode:o,...l},c)=>M.createElement("svg",{ref:c,...c7,width:e,height:e,stroke:t,strokeWidth:n?Number(s)*24/Number(e):s,className:$3("lucide",a),...l},[...o.map(([d,u])=>M.createElement(d,u)),...Array.isArray(i)?i:[i]]));/** 91 * @license lucide-react v0.451.0 - ISC 92 * 93 * This source code is licensed under the ISC license. 94 * See the LICENSE file in the root directory of this source tree. 95 */const ee=(t,e)=>{const s=M.forwardRef(({className:n,...a},i)=>M.createElement(d7,{ref:i,iconNode:e,className:$3(`lucide-${l7(t)}`,n),...a}
95));return s.displayName=`${t}`,s};/** 96 * @license lucide-react v0.451.0 - ISC 97 * 98 * This source code is licensed under the ISC license. 99 * See the LICENSE file in the root directory of this source tree. 100 */const uk=ee("Activity",[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]]);/** 101 * @license lucide-react v0.451.0 - ISC 102 * 103 * This source code is licensed under the ISC license. 104 * See the LICENSE file in the root directory of this source tree. 105 */const fx=ee("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/** 106 * @license lucide-react v0.451.0 - ISC 107 * 108 * This source code is licensed under the ISC license. 109 * See the LICENSE file in the root directory of this source tree. 110 */const vn=ee("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** 111 * @license lucide-react v0.451.0 - ISC 112 * 113 * This source code is licensed under the ISC license. 114 * See the LICENSE file in the root directory of this source tree. 115 */const nt=ee("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** 116 * @license lucide-react v0.451.0 - ISC 117 * 118 * This source code is licensed under the ISC license. 119 * See the LICENSE file in the root directory of this source tree. 120 */const px=ee("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** 121 * @license lucide-react v0.451.0 - ISC 122 * 123 * This source code is licensed under the ISC license. 124 * See the LICENSE file in the root directory of this source tree. 125 */const Df=ee("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** 126 * @license lucide-react v0.451.0 - ISC 127 * 128 * This source code is licensed under the ISC license. 129 * See the LICENSE file in the root directory of this source tree. 130 */const u7=ee("Ban",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.9 4.9 14.2 14.2",key:"1m5liu"}]]);/** 131 * @license lucide-react v0.451.0 - ISC 132 * 133 * This source code is licensed under the ISC license. 134 * See the LICENSE file in the root directory of this source tree. 135 */const h7=ee("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** 136 * @license lucide-react v0.451.0 - ISC 137 * 138 * This source code is licensed under the ISC license. 139 * See the LICENSE file in the root directory of this source tree. 140 */const m7=ee("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/** 141 * @license lucide-react v0.451.0 - ISC 142 * 143 * This source code is licensed under the ISC license. 144 * See the LICENSE file in the root directory of this source tree. 145 */const On=ee("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** 146 * @license lucide-react v0.451.0 - ISC 147 * 148 * This source code is licensed under the ISC license. 149 * See the LICENSE file in the root directory of this source tree. 150 */const hk=ee("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/** 151 * @license lucide-react v0.451.0 - ISC 152 * 153 * This source code is licensed under the ISC license. 154 * See the LICENSE file in the root directory of this source tree. 155 */const Wt=ee("Briefcase",[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]]);/** 156 * @license lucide-react v0.451.0 - ISC 157 * 158 * This source code is licensed under the ISC license. 159 * See the LICENSE file in the root directory of this source tree. 160 */const Gt=ee("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
160],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/** 161 * @license lucide-react v0.451.0 - ISC 162 * 163 * This source code is licensed under the ISC license. 164 * See the LICENSE file in the root directory of this source tree. 165 */const f7=ee("Bus",[["path",{d:"M8 6v6",key:"18i7km"}],["path",{d:"M15 6v6",key:"1sg6z9"}],["path",{d:"M2 12h19.6",key:"de5uta"}],["path",{d:"M18 18h3s.5-1.7.8-2.8c.1-.4.2-.8.2-1.2 0-.4-.1-.8-.2-1.2l-1.4-5C20.1 6.8 19.1 6 18 6H4a2 2 0 0 0-2 2v10h3",key:"1wwztk"}],["circle",{cx:"7",cy:"18",r:"2",key:"19iecd"}],["path",{d:"M9 18h5",key:"lrx6i"}],["circle",{cx:"16",cy:"18",r:"2",key:"1v4tcr"}]]);/** 166 * @license lucide-react v0.451.0 - ISC 167 * 168 * This source code is licensed under the ISC license. 169 * See the LICENSE file in the root directory of this source tree. 170 */const p7=ee("CalendarCheck",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"m9 16 2 2 4-4",key:"19s6y9"}]]);/** 171 * @license lucide-react v0.451.0 - ISC 172 * 173 * This source code is licensed under the ISC license. 174 * See the LICENSE file in the root directory of this source tree. 175 */const Ds=ee("CalendarDays",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 18h.01",key:"lrp35t"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M16 18h.01",key:"kzsmim"}]]);/** 176 * @license lucide-react v0.451.0 - ISC 177 * 178 * This source code is licensed under the ISC license. 179 * See the LICENSE file in the root directory of this source tree. 180 */const Xl=ee("CalendarPlus",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M21 13V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h8",key:"3spt84"}],["path",{d:"M3 10h18",key:"8toen8"}],["path",{d:"M16 19h6",key:"xwg31i"}],["path",{d:"M19 16v6",key:"tddt3s"}]]);/** 181 * @license lucide-react v0.451.0 - ISC 182 * 183 * This source code is licensed under the ISC license. 184 * See the LICENSE file in the root directory of this source tree. 185 */const aa=ee("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/** 186 * @license lucide-react v0.451.0 - ISC 187 * 188 * This source code is licensed under the ISC license. 189 * See the LICENSE file in the root directory of this source tree. 190 */const xx=ee("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);/** 191 * @license lucide-react v0.451.0 - ISC 192 * 193 * This source code is licensed under the ISC license. 194 * See the LICENSE file in the root directory of this source tree. 195 */const Vw=ee("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/** 196 * @license lucide-react v0.451.0 - ISC 197 * 198 * This source code is licensed under the ISC license. 199 * See the LICENSE file in the root directory of this source tree. 200 */const x7=ee("ChartNoAxesColumn",[["line",{x1:"18",x2:"18",y1:"20",y2:"10",key:"1xfpm4"}],["line",{x1:"12",x2:"12",y1:"20",y2:"4",key:"be30l9"}],["line",{x1:"6",x2:"6",y1:"20",y2:"14",key:"1r4le6"}]]);/** 201 * @license lucide-react v0.451.0 - ISC 202 * 203 * This source code is licensed under the ISC license. 204 * See the LICENSE file in the root directory of this source tree. 205 */const is=ee("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** 206 * @license lucide-react v0.451.0 - ISC 207 * 208 * This source code is licensed under the ISC license. 209 * See the LICENSE file in the root directory of this source tree. 210 */const ht=ee("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** 211 * @license lucide-react v0.451.0 - ISC 212 * 213 * This source code is licensed under the ISC license. 214 * See the LICENSE file in the root directory of this source tree. 215 */const ll=ee("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** 216 * @license lucide-react v0.451.0 - ISC 217 * 218 * This source code is licensed under the ISC license. 219 * See the LICENSE file in the root directory of this source tree. 220 */const Vi=ee("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/** 221 * @license lucide-react v0.451.0 - ISC 222 * 223 * This source code is licensed under the ISC license. 224 * See the LICENSE file in the root directory of this source tree. 225 */const Pr=ee("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/** 226 * @license lucide-react v0.451.0 - ISC 227 * 228 * This source code is licensed under the ISC license. 229 * See the LICENSE file in the root directory of this source tree. 230 */const ls=ee("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 231 * @license lucide-react v0.451.0 - ISC 232 * 233 * This source code is licensed under the ISC license. 234 * See the LICENSE file in the root directory of this source tree. 235 */const z3=ee("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/** 236 * @license lucide-react v0.451.0 - ISC 237 * 238 * This source code is licensed under the ISC license. 239 * See the LICENSE file in the root directory of this source tree. 240 */const B3=ee("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/** 241 * @license lucide-react v0.451.0 - ISC 242 * 243 * This source code is licensed under the ISC license. 244 * See the LICENSE file in the root directory of this source tree. 245 */const cl=ee("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** 246 * @license lucide-react v0.451.0 - ISC 247 * 248 * This source code is licensed under the ISC license. 249 * See the LICENSE file in the root directory of this source tree. 250 */const V3=ee("Coffee",[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]]);/** 251 * @license lucide-react v0.451.0 - ISC 252 * 253 * This source code is licensed under the ISC license. 254 * See the LICENSE file in the root directory of this source tree. 255 */const g7=ee("Cookie",[["path",{d:"M12 2a10 10 0 1 0 10 10 4 4 0 0 1-5-5 4 4 0 0 1-5-5",key:"laymnq"}],["path",{d:"M8.5 8.5v.01",key:"ue8clq"}],["path",{d:"M16 15.5v.01",key:"14dtrp"}],["path",{d:"M12 12v.01",key:"u5ubse"}],["path",{d:"M11 17v.01",key:"1hyl5a"}],["path",{d:"M7 14v.01",key:"uct60s"}]]);/** 256 * @license lucide-react v0.451.0 - ISC 257 * 258 * This source code is licensed under the ISC license. 259 * See the LICENSE file in the root directory of this source tree.
260 */const U3=ee("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** 261 * @license lucide-react v0.451.0 - ISC 262 * 263 * This source code is licensed under the ISC license. 264 * See the LICENSE file in the root directory of this source tree. 265 */const gi=ee("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/** 266 * @license lucide-react v0.451.0 - ISC 267 * 268 * This source code is licensed under the ISC license. 269 * See the LICENSE file in the root directory of this source tree. 270 */const mk=ee("Crown",[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]]);/** 271 * @license lucide-react v0.451.0 - ISC 272 * 273 * This source code is licensed under the ISC license. 274 * See the LICENSE file in the root directory of this source tree. 275 */const Rf=ee("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/** 276 * @license lucide-react v0.451.0 - ISC 277 * 278 * This source code is licensed under the ISC license. 279 * See the LICENSE file in the root directory of this source tree. 280 */const Ys=ee("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/** 281 * @license lucide-react v0.451.0 - ISC 282 * 283 * This source code is licensed under the ISC license. 284 * See the LICENSE file in the root directory of this source tree. 285 */const ur=ee("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/** 286 * @license lucide-react v0.451.0 - ISC 287 * 288 * This source code is licensed under the ISC license. 289 * See the LICENSE file in the root directory of this source tree. 290 */const gx=ee("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** 291 * @license lucide-react v0.451.0 - ISC 292 * 293 * This source code is licensed under the ISC license. 294 * See the LICENSE file in the root directory of this source tree. 295 */const b7=ee("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** 296 * @license lucide-react v0.451.0 - ISC 297 * 298 * This source code is licensed under the ISC license. 299 * See the LICENSE file in the root directory of this source tree. 300 */const y7=ee("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/** 301 * @license lucide-react v0.451.0 - ISC 302 * 303 * This source code is licensed under the ISC license. 304 * See the LICENSE file in the root directory of this source tree. 305 */const v7=ee("FileSpreadsheet",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M8 13h2",key:"yr2amv"}],["path",{d:"M14 13h2",key:"un5t4a"}],["path",{d:"M8 17h2",key:"2yhykz"}],["path",{d:"M14 17h2",key:"10kma7"}]]);/** 306 * @license lucide-react v0.451.0 - ISC 307 * 308 * This source code is licensed under the ISC license. 309 * See the LICENSE file in the root directory of this source tree. 310 */const es=ee("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);/** 311 * @license lucide-react v0.451.0 - ISC 312 * 313 * This source code is licensed under the ISC license. 314 * See the LICENSE file in the root directory of this source tree. 315 */const w7=ee("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]]);/** 316 * @license lucide-react v0.451.0 - ISC 317 * 318 * This source code is licensed under the ISC license. 319 * See the LICENSE file in the root directory of this source tree. 320 */const j7=ee("Gift",[["rect",{x:"3",y:"8",width:"18",height:"4",rx:"1",key:"bkv52"}],["path",{d:"M12 8v13",key:"1c76mn"}],["path",{d:"M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7",key:"6wjy6b"}],["path",{d:"M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5",key:"1ihvrl"}]]);/** 321 * @license lucide-react v0.451.0 - ISC 322 * 323 * This source code is licensed under the ISC license. 324 * See the LICENSE file in the root directory of this source tree. 325 */const pt=ee("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** 326 * @license lucide-react v0.451.0 - ISC 327 * 328 * This source code is licensed under the ISC license. 329 * See the LICENSE file in the root directory of this source tree. 330 */const Uw=ee("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** 331 * @license lucide-react v0.451.0 - ISC 332 * 333 * This source code is licensed under the ISC license. 334 * See the LICENSE file in the root directory of this source tree. 335 */const ui=ee("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/** 336 * @license lucide-react v0.451.0 - ISC 337 * 338 * This source code is licensed under the ISC license. 339 * See the LICENSE file in the root directory of this source tree. 340 */const N7=ee("HandCoins",[["path",{d:"M11 15h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 17",key:"geh8rc"}],["path",{d:"m7 21 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"1fto5m"}],["path",{d:"m2 16 6 6",key:"1pfhp9"}],["circle",{cx:"16",cy:"9",r:"2.9",key:"1n0dlu"}],["circle",{cx:"6",cy:"5",r:"3",key:"151irh"}]]);/** 341 * @license lucide-react v0.451.0 - ISC 342 * 343 * This source code is licensed under the ISC license. 344 * See the LICENSE file in the root directory of this source tree. 345 */const k7=ee("HandHeart",[["path",{d:"M11 14h2a2 2 0 1 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 16",key:"1ifwr1"}],["path",{d:"m7 20 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a2 2 0 0 0-2.75-2.91l-4.2 3.9",key:"17abbs"}],["path",{d:"m2 15 6 6",key:"10dquu"}],["path",{d:"M19.5 8.5c.7-.7 1.5-1.6 1.5-2.7A2.73 2.73 0 0 0 16 4a2.78 2.78 0 0 0-5 1.8c0 1.2.8 2 1.5 2.8L16 12Z",key:"1h3036"}]]);/** 346 * @license lucide-react v0.451.0 - ISC 347 * 348 * This source code is licensed under the ISC license. 349 * See the LICENSE file in the root directory of this source tree. 350 */const bx=ee("Handshake",[["path",{d:"m11 17 2 2a1 1 0 1 0 3-3",key:"efffak"}],["path",{d:"m14 14 2.5 2.5a1 1 0 1 0 3-3l-3.88-3.88a3 3 0 0 0-4.24 0l-.88.88a1 1 0 1 1-3-3l2.81-2.81a5.79 5.79 0 0 1 7.06-.87l.47.28a2 2 0 0 0 1.42.25L21 4",key:"9pr0kb"}],["path",{d:"m21 3 1 11h-2",key:"1tisrp"}],["path",{d:"M3 3 2 14l6.5 6.5a1 1 0 1 0 3-3",key:"1uvwmv"}],["path",{d:"M3 4h8",key:"1ep09j"}]]);/** 351 * @license lucide-react v0.451.0 - ISC 352 * 353 * This source code is licensed under the ISC license. 354 * See the LICENSE file in the root directory of this source tree. 355 */const C7=ee("Heading1",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"m17 12 3-2v8",key:"1hhhft"}]]);/** 356 * @license lucide-react v0.451.0 - ISC 357 * 358 * This source code is licensed under the ISC license. 359 * See the LICENSE file in the root directory of this source tree. 360 */const S7=ee("Heading2",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M21 18h-4c0-4 4-3 4-6 0-1.5-2-2.5-4-1",key:"9jr5yi"}
360]]);/** 361 * @license lucide-react v0.451.0 - ISC 362 * 363 * This source code is licensed under the ISC license. 364 * See the LICENSE file in the root directory of this source tree. 365 */const _7=ee("Heading3",[["path",{d:"M4 12h8",key:"17cfdx"}],["path",{d:"M4 18V6",key:"1rz3zl"}],["path",{d:"M12 18V6",key:"zqpxq5"}],["path",{d:"M17.5 10.5c1.7-1 3.5 0 3.5 1.5a2 2 0 0 1-2 2",key:"68ncm8"}],["path",{d:"M17 17.5c2 1.5 4 .3 4-1.5a2 2 0 0 0-2-2",key:"1ejuhz"}]]);/** 366 * @license lucide-react v0.451.0 - ISC 367 * 368 * This source code is licensed under the ISC license. 369 * See the LICENSE file in the root directory of this source tree. 370 */const T7=ee("Headphones",[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]]);/** 371 * @license lucide-react v0.451.0 - ISC 372 * 373 * This source code is licensed under the ISC license. 374 * See the LICENSE file in the root directory of this source tree. 375 */const E7=ee("HeartHandshake",[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}],["path",{d:"M12 5 9.04 7.96a2.17 2.17 0 0 0 0 3.08c.82.82 2.13.85 3 .07l2.07-1.9a2.82 2.82 0 0 1 3.79 0l2.96 2.66",key:"4oyue0"}],["path",{d:"m18 15-2-2",key:"60u0ii"}],["path",{d:"m15 18-2-2",key:"6p76be"}]]);/** 376 * @license lucide-react v0.451.0 - ISC 377 * 378 * This source code is licensed under the ISC license. 379 * See the LICENSE file in the root directory of this source tree. 380 */const yx=ee("Hotel",[["path",{d:"M10 22v-6.57",key:"1wmca3"}],["path",{d:"M12 11h.01",key:"z322tv"}],["path",{d:"M12 7h.01",key:"1ivr5q"}],["path",{d:"M14 15.43V22",key:"1q2vjd"}],["path",{d:"M15 16a5 5 0 0 0-6 0",key:"o9wqvi"}],["path",{d:"M16 11h.01",key:"xkw8gn"}],["path",{d:"M16 7h.01",key:"1kdx03"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 7h.01",key:"1vti4s"}],["rect",{x:"4",y:"2",width:"16",height:"20",rx:"2",key:"1uxh74"}]]);/** 381 * @license lucide-react v0.451.0 - ISC 382 * 383 * This source code is licensed under the ISC license. 384 * See the LICENSE file in the root directory of this source tree. 385 */const M7=ee("Hourglass",[["path",{d:"M5 22h14",key:"ehvnwv"}],["path",{d:"M5 2h14",key:"pdyrp9"}],["path",{d:"M17 22v-4.172a2 2 0 0 0-.586-1.414L12 12l-4.414 4.414A2 2 0 0 0 7 17.828V22",key:"1d314k"}],["path",{d:"M7 2v4.172a2 2 0 0 0 .586 1.414L12 12l4.414-4.414A2 2 0 0 0 17 6.172V2",key:"1vvvr6"}]]);/** 386 * @license lucide-react v0.451.0 - ISC 387 * 388 * This source code is licensed under the ISC license. 389 * See the LICENSE file in the root directory of this source tree. 390 */const A7=ee("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/** 391 * @license lucide-react v0.451.0 - ISC 392 * 393 * This source code is licensed under the ISC license. 394 * See the LICENSE file in the root directory of this source tree. 395 */const H3=ee("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/** 396 * @license lucide-react v0.451.0 - ISC 397 * 398 * This source code is licensed under the ISC license. 399 * See the LICENSE file in the root directory of this source tree. 400 */const Zl=ee("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** 401 * @license lucide-react v0.451.0 - ISC 402 * 403 * This source code is licensed under the ISC license. 404 * See the LICENSE file in the root directory of this source tree. 405 */const oh=ee("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/** 406 * @license lucide-react v0.451.0 - ISC 407 * 408 * This source code is licensed under the ISC license. 409 * See the LICENSE file in the root directory of this source tree. 410 */const P7=ee("Italic",[["line",{x1:"19",x2:"10",y1:"4",y2:"4",key:"15jd3p"}],["line",{x1:"14",x2:"5",y1:"20",y2:"20",key:"bu0au3"}],["line",{x1:"15",x2:"9",y1:"4",y2:"20",key:"uljnxc"}]]);/** 411 * @license lucide-react v0.451.0 - ISC 412 * 413 * This source code is licensed under the ISC license. 414 * See the LICENSE file in the root directory of this source tree. 415 */const Hw=ee("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);/** 416 * @license lucide-react v0.451.0 - ISC 417 * 418 * This source code is licensed under the ISC license. 419 * See the LICENSE file in the root directory of this source tree. 420 */const D7=ee("Layers",[["path",{d:"m12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83Z",key:"8b97xw"}],["path",{d:"m22 17.65-9.17 4.16a2 2 0 0 1-1.66 0L2 17.65",key:"dd6zsq"}],["path",{d:"m22 12.65-9.17 4.16a2 2 0 0 1-1.66 0L2 12.65",key:"ep9fru"}]]);/** 421 * @license lucide-react v0.451.0 - ISC 422 * 423 * This source code is licensed under the ISC license. 424 * See the LICENSE file in the root directory of this source tree.
425 */const R7=ee("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/** 426 * @license lucide-react v0.451.0 - ISC 427 * 428 * This source code is licensed under the ISC license. 429 * See the LICENSE file in the root directory of this source tree. 430 */const Du=ee("Library",[["path",{d:"m16 6 4 14",key:"ji33uf"}],["path",{d:"M12 6v14",key:"1n7gus"}],["path",{d:"M8 8v12",key:"1gg7y9"}],["path",{d:"M4 4v16",key:"6qkkli"}]]);/** 431 * @license lucide-react v0.451.0 - ISC 432 * 433 * This source code is licensed under the ISC license. 434 * See the LICENSE file in the root directory of this source tree. 435 */const Lf=ee("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/** 436 * @license lucide-react v0.451.0 - ISC 437 * 438 * This source code is licensed under the ISC license. 439 * See the LICENSE file in the root directory of this source tree. 440 */const L7=ee("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** 441 * @license lucide-react v0.451.0 - ISC 442 * 443 * This source code is licensed under the ISC license. 444 * See the LICENSE file in the root directory of this source tree. 445 */const bn=ee("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/** 446 * @license lucide-react v0.451.0 - ISC 447 * 448 * This source code is licensed under the ISC license. 449 * See the LICENSE file in the root directory of this source tree. 450 */const O7=ee("ListOrdered",[["line",{x1:"10",x2:"21",y1:"6",y2:"6",key:"76qw6h"}],["line",{x1:"10",x2:"21",y1:"12",y2:"12",key:"16nom4"}],["line",{x1:"10",x2:"21",y1:"18",y2:"18",key:"u3jurt"}],["path",{d:"M4 6h1v4",key:"cnovpq"}],["path",{d:"M4 10h2",key:"16xx2s"}],["path",{d:"M6 18H4c0-1 2-2 2-3s-1-1.5-2-1",key:"m9a95d"}]]);/** 451 * @license lucide-react v0.451.0 - ISC 452 * 453 * This source code is licensed under the ISC license. 454 * See the LICENSE file in the root directory of this source tree. 455 */const I7=ee("List",[["line",{x1:"8",x2:"21",y1:"6",y2:"6",key:"7ey8pc"}],["line",{x1:"8",x2:"21",y1:"12",y2:"12",key:"rjfblc"}],["line",{x1:"8",x2:"21",y1:"18",y2:"18",key:"c3b1m8"}],["line",{x1:"3",x2:"3.01",y1:"6",y2:"6",key:"1g7gq3"}],["line",{x1:"3",x2:"3.01",y1:"12",y2:"12",key:"1pjlvk"}],["line",{x1:"3",x2:"3.01",y1:"18",y2:"18",key:"28t2mc"}]]);/** 456 * @license lucide-react v0.451.0 - ISC 457 * 458 * This source code is licensed under the ISC license. 459 * See the LICENSE file in the root directory of this source tree. 460 */const $a=ee("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** 461 * @license lucide-react v0.451.0 - ISC 462 * 463 * This source code is licensed under the ISC license. 464 * See the LICENSE file in the root directory of this source tree. 465 */const or=ee("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/** 466 * @license lucide-react v0.451.0 - ISC 467 * 468 * This source code is licensed under the ISC license. 469 * See the LICENSE file in the root directory of this source tree. 470 */const W3=ee("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** 471 * @license lucide-react v0.451.0 - ISC 472 * 473 * This source code is licensed under the ISC license. 474 * See the LICENSE file in the root directory of this source tree. 475 */const Ft=ee("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/** 476 * @license lucide-react v0.451.0 - ISC 477 * 478 * This source code is licensed under the ISC license. 479 * See the LICENSE file in the root directory of this source tree. 480 */const kt=ee("MapPin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** 481 * @license lucide-react v0.451.0 - ISC 482 * 483 * This source code is licensed under the ISC license. 484 * See the LICENSE file in the root directory of this source tree. 485 */const F7=ee("Medal",[["path",{d:"M7.21 15 2.66 7.14a2 2 0 0 1 .13-2.2L4.4 2.8A2 2 0 0 1 6 2h12a2 2 0 0 1 1.6.8l1.6 2.14a2 2 0 0 1 .14 2.2L16.79 15",key:"143lza"}],["path",{d:"M11 12 5.12 2.2",key:"qhuxz6"}],["path",{d:"m13 12 5.88-9.8",key:"hbye0f"}],["path",{d:"M8 7h8",key:"i86dvs"}],["circle",{cx:"12",cy:"17",r:"5",key:"qbz8iq"}],["path",{d:"M12 18v-2h-.5",key:"fawc4q"}]]);/** 486 * @license lucide-react v0.451.0 - ISC 487 * 488 * This source code is licensed under the ISC license. 489 * See the LICENSE file in the root directory of this source tree. 490 */const fk=ee("Megaphone",[["path",{d:"m3 11 18-5v12L3 14v-3z",key:"n962bs"}],["path",{d:"M11.6 16.8a3 3 0 1 1-5.8-1.6",key:"1yl0tm"}]]);/** 491 * @license lucide-react v0.451.0 - ISC 492 * 493 * This source code is licensed under the ISC license. 494 * See the LICENSE file in the root directory of this source tree. 495 */const $7=ee("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** 496 * @license lucide-react v0.451.0 - ISC 497 * 498 * This source code is licensed under the ISC license. 499 * See the LICENSE file in the root directory of this source tree. 500 */const my=ee("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/** 501 * @license lucide-react v0.451.0 - ISC 502 * 503 * This source code is licensed under the ISC license. 504 * See the LICENSE file in the root directory of this source tree. 505 */const In=ee("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** 506 * @license lucide-react v0.451.0 - ISC 507 * 508 * This source code is licensed under the ISC license. 509 * See the LICENSE file in the root directory of this source tree. 510 */const vx=ee("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/** 511 * @license lucide-react v0.451.0 - ISC 512 * 513 * This source code is licensed under the ISC license. 514 * See the LICENSE file in the root directory of this source tree. 515 */const z7=ee("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/** 516 * @license lucide-react v0.451.0 - ISC 517 * 518 * This source code is licensed under the ISC license. 519 * See the LICENSE file in the root directory of this source tree. 520 */const Ww=ee("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/** 521 * @license lucide-react v0.451.0 - ISC 522 * 523 * This source code is licensed under the ISC license. 524 * See the LICENSE file in the root directory of this source tree. 525 */const B7=ee("Paperclip",[["path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",key:"1u3ebp"}]]);/** 526 * @license lucide-react v0.451.0 - ISC 527 * 528 * This source code is licensed under the ISC license. 529 * See the LICENSE file in the root directory of this source tree. 530 */const V7=ee("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);/** 531 * @license lucide-react v0.451.0 - ISC 532 * 533 * This source code is licensed under the ISC license. 534 * See the LICENSE file in the root directory of this source tree. 535 */const Ui=ee("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** 536 * @license lucide-react v0.451.0 - ISC 537 * 538 * This source code is licensed under the ISC license. 539 * See the LICENSE file in the root directory of this source tree. 540 */const Ai=ee("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/** 541 * @license lucide-react v0.451.0 - ISC 542 * 543 * This source code is licensed under the ISC license. 544 * See the LICENSE file in the root directory of this source tree. 545 */const wn=ee("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** 546 * @license lucide-react v0.451.0 - ISC 547 * 548 * This source code is licensed under the ISC license. 549 * See the LICENSE file in the root directory of this source tree. 550 */const qs=ee("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** 551 * @license lucide-react v0.451.0 - ISC 552 * 553 * This source code is licensed under the ISC license. 554 * See the LICENSE file in the root directory of this source tree. 555 */const so=ee("Presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);/** 556 * @license lucide-react v0.451.0 - ISC 557 * 558 * This source code is licensed under the ISC license. 559 * See the LICENSE file in the root directory of this source tree. 560 */const U7=ee("Quote",[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]]);/** 561 * @license lucide-react v0.451.0 - ISC 562 * 563 * This source code is licensed under the ISC license. 564 * See the LICENSE file in the root directory of this source tree. 565 */const H7=ee("Repeat2",[["path",{d:"m2 9 3-3 3 3",key:"1ltn5i"}],["path",{d:"M13 18H7a2 2 0 0 1-2-2V6",key:"1r6tfw"}],["path",{d:"m22 15-3 3-3-3",key:"4rnwn2"}],["path",{d:"M11 6h6a2 2 0 0 1 2 2v10",key:"2f72bc"}]]);/** 566 * @license lucide-react v0.451.0 - ISC 567 * 568 * This source code is licensed under the ISC license. 569 * See the LICENSE file in the root directory of this source tree. 570 */const W7=ee("Reply",[["polyline",{points:"9 17 4 12 9 7",key:"hvgpf2"}
570],["path",{d:"M20 18v-2a4 4 0 0 0-4-4H4",key:"5vmcpk"}]]);/** 571 * @license lucide-react v0.451.0 - ISC 572 * 573 * This source code is licensed under the ISC license. 574 * See the LICENSE file in the root directory of this source tree. 575 */const Gw=ee("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/** 576 * @license lucide-react v0.451.0 - ISC 577 * 578 * This source code is licensed under the ISC license. 579 * See the LICENSE file in the root directory of this source tree. 580 */const Ua=ee("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/** 581 * @license lucide-react v0.451.0 - ISC 582 * 583 * This source code is licensed under the ISC license. 584 * See the LICENSE file in the root directory of this source tree. 585 */const ia=ee("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/** 586 * @license lucide-react v0.451.0 - ISC 587 * 588 * This source code is licensed under the ISC license. 589 * See the LICENSE file in the root directory of this source tree. 590 */const G3=ee("Share2",[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]]);/** 591 * @license lucide-react v0.451.0 - ISC 592 * 593 * This source code is licensed under the ISC license. 594 * See the LICENSE file in the root directory of this source tree. 595 */const Ru=ee("ShieldAlert",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]]);/** 596 * @license lucide-react v0.451.0 - ISC 597 * 598 * This source code is licensed under the ISC license. 599 * See the LICENSE file in the root directory of this source tree. 600 */const pk=ee("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/** 601 * @license lucide-react v0.451.0 - ISC 602 * 603 * This source code is licensed under the ISC license. 604 * See the LICENSE file in the root directory of this source tree. 605 */const Hi=ee("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);/** 606 * @license lucide-react v0.451.0 - ISC 607 * 608 * This source code is licensed under the ISC license. 609 * See the LICENSE file in the root directory of this source tree. 610 */const G7=ee("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/** 611 * @license lucide-react v0.451.0 - ISC 612 * 613 * This source code is licensed under the ISC license. 614 * See the LICENSE file in the root directory of this source tree. 615 */const Y7=ee("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/** 616 * @license lucide-react v0.451.0 - ISC 617 * 618 * This source code is licensed under the ISC license. 619 * See the LICENSE file in the root directory of this source tree. 620 */const q7=ee("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** 621 * @license lucide-react v0.451.0 - ISC 622 * 623 * This source code is licensed under the ISC license. 624 * See the LICENSE file in the root directory of this source tree. 625 */const An=ee("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/** 626 * @license lucide-react v0.451.0 - ISC 627 * 628 * This source code is licensed under the ISC license. 629 * See the LICENSE file in the root directory of this source tree.
630 */const er=ee("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/** 631 * @license lucide-react v0.451.0 - ISC 632 * 633 * This source code is licensed under the ISC license. 634 * See the LICENSE file in the root directory of this source tree. 635 */const K7=ee("ThumbsUp",[["path",{d:"M7 10v12",key:"1qc93n"}],["path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z",key:"emmmcr"}]]);/** 636 * @license lucide-react v0.451.0 - ISC 637 * 638 * This source code is licensed under the ISC license. 639 * See the LICENSE file in the root directory of this source tree. 640 */const Fn=ee("Ticket",[["path",{d:"M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z",key:"qn84l0"}],["path",{d:"M13 5v2",key:"dyzc3o"}],["path",{d:"M13 17v2",key:"1ont0d"}],["path",{d:"M13 11v2",key:"1wjjxi"}]]);/** 641 * @license lucide-react v0.451.0 - ISC 642 * 643 * This source code is licensed under the ISC license. 644 * See the LICENSE file in the root directory of this source tree. 645 */const Lt=ee("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** 646 * @license lucide-react v0.451.0 - ISC 647 * 648 * This source code is licensed under the ISC license. 649 * See the LICENSE file in the root directory of this source tree. 650 */const fy=ee("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/** 651 * @license lucide-react v0.451.0 - ISC 652 * 653 * This source code is licensed under the ISC license. 654 * See the LICENSE file in the root directory of this source tree. 655 */const oc=ee("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** 656 * @license lucide-react v0.451.0 - ISC 657 * 658 * This source code is licensed under the ISC license. 659 * See the LICENSE file in the root directory of this source tree. 660 */const Yw=ee("Trophy",[["path",{d:"M6 9H4.5a2.5 2.5 0 0 1 0-5H6",key:"17hqa7"}],["path",{d:"M18 9h1.5a2.5 2.5 0 0 0 0-5H18",key:"lmptdp"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M10 14.66V17c0 .55-.47.98-.97 1.21C7.85 18.75 7 20.24 7 22",key:"1nw9bq"}],["path",{d:"M14 14.66V17c0 .55.47.98.97 1.21C16.15 18.75 17 20.24 17 22",key:"1np0yb"}],["path",{d:"M18 2H6v7a6 6 0 0 0 12 0V2Z",key:"u46fv3"}]]);/** 661 * @license lucide-react v0.451.0 - ISC 662 * 663 * This source code is licensed under the ISC license. 664 * See the LICENSE file in the root directory of this source tree. 665 */const lh=ee("Twitter",[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]]);/** 666 * @license lucide-react v0.451.0 - ISC 667 * 668 * This source code is licensed under the ISC license. 669 * See the LICENSE file in the root directory of this source tree. 670 */const J7=ee("Underline",[["path",{d:"M6 4v6a6 6 0 0 0 12 0V4",key:"9kb039"}],["line",{x1:"4",x2:"20",y1:"20",y2:"20",key:"nun2al"}]]);/** 671 * @license lucide-react v0.451.0 - ISC 672 * 673 * This source code is licensed under the ISC license. 674 * See the LICENSE file in the root directory of this source tree. 675 */const Q7=ee("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/** 676 * @license lucide-react v0.451.0 - ISC 677 * 678 * This source code is licensed under the ISC license. 679 * See the LICENSE file in the root directory of this source tree. 680 */const Y3=ee("UserCheck",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}
680],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/** 681 * @license lucide-react v0.451.0 - ISC 682 * 683 * This source code is licensed under the ISC license. 684 * See the LICENSE file in the root directory of this source tree. 685 */const q3=ee("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);/** 686 * @license lucide-react v0.451.0 - ISC 687 * 688 * This source code is licensed under the ISC license. 689 * See the LICENSE file in the root directory of this source tree. 690 */const Ls=ee("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** 691 * @license lucide-react v0.451.0 - ISC 692 * 693 * This source code is licensed under the ISC license. 694 * See the LICENSE file in the root directory of this source tree. 695 */const at=ee("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** 696 * @license lucide-react v0.451.0 - ISC 697 * 698 * This source code is licensed under the ISC license. 699 * See the LICENSE file in the root directory of this source tree. 700 */const Wi=ee("Video",[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]]);/** 701 * @license lucide-react v0.451.0 - ISC 702 * 703 * This source code is licensed under the ISC license. 704 * See the LICENSE file in the root directory of this source tree. 705 */const He=ee("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/** 706 * @license lucide-react v0.451.0 - ISC 707 * 708 * This source code is licensed under the ISC license. 709 * See the LICENSE file in the root directory of this source tree. 710 */const X7=ee("Youtube",[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]]);function K3({className:t="",size:e="md"}){const s=e==="sm"?"h-10":e==="lg"?"h-14":e==="xl"?"h-16":e==="xxl"?"h-20":e==="xxxl"?"h-24":e==="nav"?"h-[90px]":e==="full"?"h-full":"h-12";return r.jsx("div",{className:`flex items-center ${t}`,children:r.jsx("img",{src:e==="nav"?"/acgc-logo-trimmed.png":"/acgc-logo.png",alt:"ACGC â African Corporate & Government Counsel Forum",className:`${s} w-auto drop-shadow-sm`,loading:"lazy"})})}const xk="acgc_lang",Ug=[{name:"English",code:"en"},{name:"French",code:"fr"},{name:"Portuguese",code:"pt"},{name:"Spanish",code:"es"},{name:"Swahili",code:"sw"},{name:"Arabic",code:"ar"},{name:"Chinese (Simplified)",code:"zh-CN"},{name:"Afrikaans",code:"af"},{name:"Zulu",code:"zu"},{name:"German",code:"de"},{name:"Italian",code:"it"},{name:"Japanese",code:"ja"},{name:"Korean",code:"ko"},{name:"Russian",code:"ru"},{name:"Hindi",code:"hi"},{name:"Dutch",code:"nl"},{name:"Turkish",code:"tr"},{name:"Polish",code:"pl"},{name:"Vietnamese",code:"vi"},{name:"Thai",code:"th"},{name:"Malay",code:"ms"},{name:"Indonesian",code:"id"},{name:"Amharic",code:"am"},{name:"Hausa",code:"ha"},{name:"Yoruba",code:"yo"},{name:"Igbo",code:"ig"},{name:"Somali",code:"so"}];function Z7(){const t=document.cookie.match(/googtrans=\/en\/([^;
710]+)/);return t?t[1]:"en"}function eV(){const t=window.location.hostname,e=t.split("."),s=e.length>2?e.slice(-2).join("."):t,n=new Set(["",t,"."+t,s,"."+s]);for(const a of n)document.cookie="googtrans=; expires=Thu, 01 Jan 1970 00:00:00 UTC; path=/"+(a?"; domain="+a:"")}function Of({variant:t="public"}){const[e,s]=v.useState(()=>{try{return localStorage.getItem(xk)||"en"}catch{return"en"}}),[n,a]=v.useState(!1),[i,o]=v.useState("");v.useEffect(()=>{const d=Z7();d&&d!=="en"&&s(d)},[]),v.useEffect(()=>{if(!n)return;const d=u=>{u.key==="Escape"&&a(!1)};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[n]);const l=d=>{s(d);try{localStorage.setItem(xk,d)}catch{}eV(),d!=="en"&&(document.cookie="googtrans=/en/"+d+"; path=/"),window.location.reload()};v.useMemo(()=>{const d=Ug.find(u=>u.code===e);return d?d.name:e},[e]);const c=v.useMemo(()=>{const d=i.trim().toLowerCase();return d?Ug.filter(u=>{const h=(u.name||"").toLowerCase(),m=(u.code||"").toLowerCase();return h.includes(d)||m.includes(d)}):Ug},[i]);return r.jsxs("div",{children:[r.jsxs("button",{type:"button",className:"h-8 rounded-xl bg-[#c08a2f] border border-[#a77324] px-2 text-xs text-white w-14 flex items-center justify-between gap-1",onClick:()=>{o(""),a(!0)},"aria-label":"Language",children:[r.jsx("span",{className:"truncate",children:e==="en"?"EN":e.toUpperCase()}),r.jsx(ht,{className:"h-3.5 w-3.5 text-white/80"})]}),n?r.jsxs("div",{className:"fixed inset-0 z-50",children:[r.jsx("button",{type:"button",className:"absolute inset-0 bg-black/40",onClick:()=>a(!1),"aria-label":"Close language picker"}),r.jsx("div",{className:"relative max-w-lg mx-auto mt-20 px-4",children:r.jsxs("div",{className:"rounded-3xl border border-slate-200 bg-white shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-slate-200 flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-brand-900 font-semibold",children:"Choose language"}),r.jsx("button",{type:"button",className:"h-9 px-3 rounded-2xl border border-slate-200 text-slate-700 hover:bg-slate-50",onClick:()=>a(!1),children:"Close"})]}),r.jsxs("div",{className:"p-4",children:[r.jsx("input",{value:i,onChange:d=>o(d.target.value),placeholder:"Search languagesâ¦",className:"h-11 w-full rounded-2xl bg-white border border-slate-200 px-4 text-sm text-slate-700",autoFocus:!0}),r.jsx("div",{className:"mt-4 max-h-80 overflow-auto",children:r.jsx("div",{className:"grid gap-1",children:c.map(d=>{const u=d.code===e;return r.jsx("button",{type:"button",onClick:()=>{l(d.code),a(!1)},className:"w-full text-left px-3 py-2 rounded-2xl border transition "+(u?"border-brand-600/30 bg-brand-600/10 text-brand-900":"border-transparent hover:border-slate-200 hover:bg-slate-50 text-slate-800"),children:r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsx("div",{className:"font-medium",children:d.name}),r.jsx("div",{className:"text-xs text-slate-500",children:d.code})]})},d.code)})})})]})]})})]}):null]})}function vl({to:t,children:e,accent:s=!1,purple:n=!1}){return r.jsx(il,{to:t,className:({isActive:a})=>`group inline-flex h-9 items-center gap-1 px-1 transition font-semibold border-b-2 ${s?"text-[#c08a2f] hover:text-[#c08a2f] border-transparent":n?"text-[#1f0f3f] hover:text-[#c08a2f] border-transparent":a?"text-[#c08a2f] border-[#c08a2f]":"text-slate-600 hover:text-[#c08a2f] border-transparent hover:border-[#c08a2f]/40"}`,children:e})}const tV=[{key:"Conference Materials",label:"Conference Materials"},{key:"Webinars",label:"Webinars"},{key:"Learning Resources",label:"Learning Resources"},{key:"Community Videos",label:"Community Videos"},{key:"Tips, Tricks & Guides",label:"Tips, Tricks & Guides"},{key:"Research & Reports",label:"Research & Reports"},{key:"Microsoft AI Intelligence Hub",label:"Microsoft AI Intelligence Hub",featured:!0}],gk={key:"On The Horizon - A 2025 Africa GC Perspective",label:"On The Horizon-A 2025 Africa GC Perspective"};function sV(){const[t,e]=v.useState(!1),s=v.useRef(null),n=()=>{clearTimeout(s.current),e(!0)},a=()=>{s.current=setTimeout(()=>e(!1),150)};return r.jsxs("div",{className:"relative",onMouseEnter:n,onMouseLeave:a,children:[r.jsxs(il,{to:"/partners-and-sponsors",className:({isActive:i})=>`group inline-flex h-9 items-center gap-0.5 px-1 transition font-semibold border-b-2 ${i?"text-[#c08a2f] border-[#c08a2f]":"text-slate-600 hover:text-[#c08a2f] border-transparent hover:border-[#c08a2f]/40"}`,children:["Partners & Sponsors",r.jsx(ht,{className:`h-3.5 w-3.5 transition-transform ${t?"rotate-180 text-[#c08a2f]":"text-slate-400 group-hover:text-[#c08a2f]"}`})]}),t&&r.jsxs(V.div,{initial:{opacity:0,y:6}
710,animate:{opacity:1,y:0},transition:{duration:.15},className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-56 rounded-xl bg-white border border-slate-200 shadow-lg py-2 z-50",children:[r.jsx(K,{to:"/partners-and-sponsors",onClick:()=>e(!1),className:"block px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 hover:text-slate-900 transition",children:"Partners & Sponsors"}),r.jsx(K,{to:"/partnering-with-us",onClick:()=>e(!1),className:"block px-4 py-2 text-sm text-slate-600 hover:bg-slate-50 hover:text-slate-900 transition",children:"Partnering With Us"})]})]})}function nV(){const[t,e]=v.useState(!1),s=v.useRef(null),{pathname:n}=window.location,a=n==="/"||n.startsWith("/team")||n.startsWith("/about"),i=()=>{clearTimeout(s.current),e(!0)},o=()=>{s.current=setTimeout(()=>e(!1),150)};return r.jsxs("div",{className:"relative",onMouseEnter:i,onMouseLeave:o,children:[r.jsxs(il,{to:"/",end:!0,className:({isActive:l})=>`group inline-flex h-9 items-center gap-1 px-1 transition font-semibold border-b-2 ${l||a?"text-[#c08a2f] border-[#c08a2f]":"text-slate-600 hover:text-[#c08a2f] border-transparent hover:border-[#c08a2f]/40"}`,children:["Home",r.jsx(ht,{className:`h-3.5 w-3.5 transition-transform ${t?"rotate-180 text-[#c08a2f]":"text-slate-400 group-hover:text-[#c08a2f]"}`})]}),t&&r.jsxs(V.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15},className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-56 rounded-xl bg-white border border-slate-200 shadow-lg py-2 z-50",children:[r.jsx(K,{to:"/about",onClick:()=>e(!1),className:"block px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 hover:text-slate-900 transition",children:"About Us"}),r.jsx(K,{to:"/team",onClick:()=>e(!1),className:"block px-4 py-2 text-sm text-slate-600 hover:bg-slate-50 hover:text-slate-900 transition",children:"Team ACGC"}),r.jsx(K,{to:"/about/advisory-board",onClick:()=>e(!1),className:"block px-4 py-2 text-sm text-slate-600 hover:bg-slate-50 hover:text-slate-900 transition",children:"Advisory Board"})]})]})}function rV(){const[t,e]=v.useState(!1),s=v.useRef(null),n=()=>{clearTimeout(s.current),e(!0)},a=()=>{s.current=setTimeout(()=>e(!1),150)};return r.jsxs("div",{className:"relative",onMouseEnter:n,onMouseLeave:a,children:[r.jsxs(il,{to:"/join",className:({isActive:i})=>`group inline-flex h-9 items-center gap-1 px-1 transition font-semibold border-b-2 text-[#c08a2f] hover:text-[#c08a2f] ${i?"border-[#c08a2f]":"border-transparent hover:border-[#c08a2f]/40"}`,children:["Join ACGC",r.jsx(ht,{className:`h-3.5 w-3.5 transition-transform ${t?"rotate-180 text-[#a77324]":"text-[#c08a2f]/60 group-hover:text-[#a77324]"}`})]}),t&&r.jsxs(V.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15},className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-56 rounded-xl bg-white border border-slate-200 shadow-lg py-2 z-50",children:[r.jsx(K,{to:"/join",onClick:()=>e(!1),className:"block px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 hover:text-slate-900 transition",children:"Join ACGC"}),r.jsx(K,{to:"/joining-options",onClick:()=>e(!1),className:"block px-4 py-2 text-sm text-slate-600 hover:bg-slate-50 hover:text-slate-900 transition",children:"Joining Options"}),r.jsx(K,{to:"/lift-initiative",onClick:()=>e(!1),className:"block px-4 py-2 text-sm text-slate-600 hover:bg-slate-50 hover:text-slate-900 transition",children:"ACGC LIFT Initiative"})]})]})}function aV(){const[t,e]=v.useState(!1),s=v.useRef(null),n=()=>{clearTimeout(s.current),e(!0)},a=()=>{s.current=setTimeout(()=>e(!1),150)};return r.jsxs("div",{className:"relative",onMouseEnter:n,onMouseLeave:a,children:[r.jsxs(il,{to:"/directory",className:({isActive:i})=>`group inline-flex h-9 items-center gap-0.5 px-1 transition font-semibold border-b-2 ${i||window.location.pathname.startsWith("/members")?"text-[#c08a2f] border-[#c08a2f]":"text-slate-600 hover:text-[#c08a2f] border-transparent hover:border-[#c08a2f]/40"}`,children:["Member Directory",r.jsx(ht,{className:`h-3.5 w-3.5 transition-transform ${t?"rotate-180 text-[#c08a2f]":"text-slate-400 group-hover:text-[#c08a2f]"}`})]}),t&&r.jsxs(V.div,{initial:{opacity:0,y:6}
710,animate:{opacity:1,y:0},transition:{duration:.15},className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-52 rounded-xl bg-white border border-slate-200 shadow-lg py-2 z-50",children:[r.jsx(K,{to:"/directory",onClick:()=>e(!1),className:"block px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 hover:text-slate-900 transition",children:"Member Directory"}),r.jsx(K,{to:"/members/leaderboard",onClick:()=>e(!1),className:"block px-4 py-2 text-sm text-slate-600 hover:bg-slate-50 hover:text-slate-900 transition",children:"Leaderboard"})]})]})}function iV({member:t}){const[e,s]=v.useState(!1),n=v.useRef(null),a=()=>{clearTimeout(n.current),s(!0)},i=()=>{n.current=setTimeout(()=>s(!1),150)};return r.jsxs("div",{className:"relative",onMouseEnter:a,onMouseLeave:i,children:[r.jsxs(il,{to:"/resources",className:({isActive:o})=>`group inline-flex h-9 items-center gap-1 px-1 transition font-semibold border-b-2 ${o?"text-[#c08a2f] border-[#c08a2f]":"text-slate-600 hover:text-[#c08a2f] border-transparent hover:border-[#c08a2f]/40"}`,children:["Resources",r.jsx(ht,{className:`h-3.5 w-3.5 transition-transform ${e?"rotate-180 text-[#c08a2f]":"text-slate-400 group-hover:text-[#c08a2f]"}`})]}),e&&r.jsxs(V.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15},className:"absolute top-full left-1/2 -translate-x-1/2 mt-2 w-56 rounded-xl bg-white border border-slate-200 shadow-lg py-2 z-50",children:[r.jsx(K,{to:"/resources",onClick:()=>s(!1),className:"block px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 hover:text-slate-900 transition",children:"Browse All"}),r.jsx(K,{to:"/resource-hub",onClick:()=>s(!1),className:"block px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 hover:text-slate-900 transition",children:"Resource Hub"}),r.jsx("div",{className:"border-t border-slate-100 my-1"}),tV.map(o=>r.jsx(K,{to:`/resources?category=${encodeURIComponent(o.key)}`,onClick:()=>s(!1),className:o.featured?"block px-4 py-2 text-sm font-bold text-[#005a9e] bg-[#0078d4]/10 hover:bg-[#0078d4]/15 transition":"block px-4 py-2 text-sm text-slate-600 hover:bg-slate-50 hover:text-slate-900 transition",children:o.label},o.key)),r.jsx("div",{className:"border-t border-slate-100 my-1"}),r.jsx(K,{to:`/resources?category=${encodeURIComponent(gk.key)}`,onClick:()=>s(!1),className:"block px-4 py-2 text-sm font-semibold text-[#c08a2f] hover:bg-[#c08a2f]/5 transition",children:gk.label})]})]})}function oV({member:t,onLogout:e}){const[s,n]=v.useState(!1),a=v.useRef(null),i=()=>{clearTimeout(a.current),n(!0)},o=()=>{a.current=setTimeout(()=>n(!1),150)};return r.jsxs("div",{className:"relative shrink-0",onMouseEnter:i,onMouseLeave:o,children:[r.jsx("button",{type:"button",className:"group inline-flex h-8 w-8 items-center justify-center rounded-full border-2 border-slate-200 bg-slate-100 overflow-hidden transition hover:border-[#c08a2f]/60 hover:bg-[#c08a2f]/10",title:"Account",children:t!=null&&t.avatar_url?r.jsx("img",{src:tt(t.avatar_url),alt:"",className:"h-full w-full object-cover"}):r.jsx(Ls,{className:"h-3.5 w-3.5 text-slate-400 group-hover:text-[#c08a2f]"})}),s&&r.jsxs(V.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},transition:{duration:.15},className:"absolute top-full right-0 mt-2 w-48 rounded-xl bg-white border border-slate-200 shadow-lg py-2 z-50",children:[r.jsxs(K,{to:"/profile",onClick:()=>n(!1),className:"flex items-center gap-2 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 hover:text-slate-900 transition",children:[r.jsx(Ls,{className:"h-3.5 w-3.5"})," My Profile"]}),r.jsxs("button",{type:"button",onClick:()=>{n(!1),e()},className:"flex w-full items-center gap-2 px-4 py-2 text-sm font-medium text-slate-700 hover:bg-slate-50 hover:text-slate-900 transition",children:[r.jsx(W3,{className:"h-3.5 w-3.5"})," Logout"]})]})]})}function lV(){const{token:t,member:e,logout:s}=Oe(),n=Bn(),a=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",[i,o]=v.useState(0),[l,c]=v.useState(!1);v.useEffect(()=>{!t||!e||U("/api/messages/unread-count",{token:t}).then(u=>o(u.count||0)).catch(()=>{})},[t,e]);const d=()=>{s(),n("/")};return r.jsx("div",{className:"sticky top-0 z-30 bg-white border-b border-slate-200/70 shadow-[0_4px_20px_-12px_rgba(0,0,0,0.12)]",children:r.jsxs("div",{className:"w-full h-24 flex items-center gap-3 px-4 lg:px-4 xl:px-6 2xl:gap-5",children:[r.jsx(K,{to:"/","aria-label":"ACGC home",className:"shrink-0",children:r.jsx(K3,{size:"nav"})}),r.jsx("button",{onClick:()=>c(!l),className:"lg:hidden ml-auto mr-4 p-2 rounded-lg text-slate-600 hover:text-slate-900 hover:bg-slate-100 transition","aria-label":"Toggle menu",children:l?r.jsx(He,{className:"h-6 w-6"}):r.jsx($7,{className:"h-6 w-6"})}),r.jsxs("nav",{className:`hidden lg:flex min-w-0 flex-1 items-center text-[12px] xl:text-[13px] 2xl:text-base ${e?"justify-end gap-1.5 xl:gap-2 2xl:gap-3 ml-auto mr-1 2xl:mr-6":"justify-center gap-1.5 xl:gap-[10px] 2xl:gap-4 px-1 xl:px-2 2xl:px-6"}`,children:[r.jsx(nV,{}),!e&&r.jsx(rV,{}),r.jsx(vl,{to:"/events",children:"Events"}),e&&r.jsx(vl,{to:"/my-events",children:"My Events"}),r.jsx(iV,{member:e}),r.jsx(vl,{to:"/conference",children:"Conference"}),r.jsx(vl,{to:"/insights",children:"Insights"}),r.jsx(aV,{}),r.jsx(sV,{}),r.jsx("span",{className:"hidden xl:inline-flex",children:r.jsx(vl,{to:"/careers",children:"Careers"})}
710),!e&&r.jsx(vl,{to:"/login",purple:!0,children:"Login"}),a&&r.jsx(K,{to:"/hub",className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-[#1f0f3f] text-white transition hover:bg-[#2a1654] shrink-0",title:"Admin Hub",children:r.jsx(R7,{className:"h-3.5 w-3.5"})}),e&&r.jsxs(K,{to:"/messages",className:"group relative inline-flex h-8 w-8 items-center justify-center rounded-full border border-slate-200 bg-slate-50 transition hover:border-[#c08a2f]/60 hover:bg-[#c08a2f]/10 shrink-0",title:"Messages",children:[r.jsx(Ft,{className:"h-3.5 w-3.5 text-slate-600 group-hover:text-[#c08a2f]"}),i>0&&r.jsx("span",{className:"absolute -top-1.5 -right-1.5 min-w-[18px] h-[18px] flex items-center justify-center rounded-full bg-red-500 text-white text-[10px] font-bold px-1 leading-none",children:i>99?"99+":i})]}),e&&r.jsx(oV,{member:e,onLogout:d}),r.jsx("div",{className:"shrink-0",children:r.jsx(Of,{})})]}),l&&r.jsx(V.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"lg:hidden absolute top-full left-0 right-0 bg-white border-b border-slate-200 shadow-lg max-h-[80vh] overflow-y-auto",children:r.jsxs("div",{className:"px-4 py-6 space-y-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"text-sm font-medium text-slate-500",children:"Menu"}),r.jsx("div",{className:"shrink-0",children:r.jsx(Of,{})})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsx(K,{to:"/",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:"Home"}),r.jsx(K,{to:"/team",onClick:()=>c(!1),className:"block px-4 py-3 pl-8 text-base font-medium text-slate-600 hover:bg-slate-50 rounded-lg transition",children:"Team ACGC"}),r.jsx(K,{to:"/about/advisory-board",onClick:()=>c(!1),className:"block px-4 py-3 pl-8 text-base font-medium text-slate-600 hover:bg-slate-50 rounded-lg transition",children:"Advisory Board"}),!e&&r.jsxs(r.Fragment,{children:[r.jsx(K,{to:"/join",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-[#c08a2f] hover:bg-slate-50 rounded-lg transition",children:"Join ACGC"}),r.jsx(K,{to:"/joining-options",onClick:()=>c(!1),className:"block px-4 py-3 pl-8 text-base font-medium text-slate-600 hover:bg-slate-50 rounded-lg transition",children:"Joining Options"}),r.jsx(K,{to:"/lift-initiative",onClick:()=>c(!1),className:"block px-4 py-3 pl-8 text-base font-medium text-slate-600 hover:bg-slate-50 rounded-lg transition",children:"ACGC LIFT Initiative"})]}),r.jsx(K,{to:"/events",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:"Events"}),e&&r.jsx(K,{to:"/my-events",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:"My Events"}),r.jsx(K,{to:"/resources",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:"Resources"}),r.jsx(K,{to:"/resource-hub",onClick:()=>c(!1),className:"block px-4 py-3 pl-8 text-base font-medium text-slate-600 hover:bg-slate-50 rounded-lg transition",children:"Resource Hub"}),r.jsx(K,{to:"/conference",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:"Conference"}),r.jsx(K,{to:"/insights",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:"Insights"}),r.jsx(K,{to:"/directory",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:"Member Directory"}),r.jsx(K,{to:"/members/leaderboard",onClick:()=>c(!1),className:"block px-4 py-3 pl-8 text-base font-medium text-slate-600 hover:bg-slate-50 rounded-lg transition",children:"Leaderboard"}),r.jsx(K,{to:"/partners-and-sponsors",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:"Partners & Sponsors"}),r.jsx(K,{to:"/partnering-with-us",onClick:()=>c(!1),className:"block px-4 py-3 pl-8 text-base font-medium text-slate-600 hover:bg-slate-50 rounded-lg transition",children:"Partnering With Us"}),r.jsx(K,{to:"/careers",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:"Careers"}),!e&&r.jsx(K,{to:"/login",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium text-[#1f0f3f] hover:bg-slate-50 rounded-lg transition",children:"Login"}),a&&r.jsx(K,{to:"/hub",onClick:()=>c(!1),className:"block px-4 py-3 text-base font-medium bg-[#1f0f3f] text-white rounded-lg transition",children:"Admin Hub"})]}),e&&r.jsxs("div",{className:"border-t border-slate-200 pt-4 space-y-3",children:[r.jsxs(K,{to:"/messages",onClick:()=>c(!1),className:"flex items-center gap-3 px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:[r.jsx(Ft,{className:"h-5 w-5"}),"Messages",i>0&&r.jsx("span",{className:"ml-auto bg-red-500 text-white text-xs font-bold px-2 py-1 rounded-full",children:i>99?"99+":i})]}),r.jsxs(K,{to:"/profile",onClick:()=>c(!1),className:"flex items-center gap-3 px-4 py-3 text-base font-medium text-slate-900 hover:bg-slate-50 rounded-lg transition",children:[r.jsx(Ls,{className:"h-5 w-5"}),"Profile"]}),r.jsxs("button",{onClick:()=>{d(),c(!1)},className:"flex items-center gap-3 w-full px-4 py-3 text-base font-medium text-slate-600 hover:text-slate-900 hover:bg-slate-50 rounded-lg transition",children:[r.jsx(W3,{className:"h-5 w-5"}),"Logout"]})]})]})})]})})}function cV(){const t=new Date().getFullYear();return r.jsx("footer",{className:"bg-[#1f0f3f] text-white",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-6 md:px-8 pt-14 pb-6",children:[r.jsxs("div",{className:"grid md:grid-cols-3 gap-10 md:gap-12",children:[r.jsxs("div",{children:[r.jsx("img",{src:"/ACGCLogo.png",alt:"ACGC â African Corporate & Government Counsel Forum",className:"h-20 w-auto",loading:"lazy"}),r.jsx("p",{className:"mt-4 text-sm text-slate-300 leading-relaxed",style:{textAlign:"justify"},children:"We are a professional, member-funded association that supports, champions and advances Africa's in-house and government legal community."}),r.jsxs("div",{className:"mt-5 flex items-center gap-3",children:[r.jsx(od,{href:"https://x.com/african_inhouse",label:"X (Twitter)",children:r.jsx("svg",{className:"h-4 w-4",fill:"
710currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69a4.3 4.3 0 001.88-2.38 8.59 8.59 0 01-2.72 1.04 4.28 4.28 0 00-7.32 3.91A12.16 12.16 0 013.16 4.86a4.28 4.28 0 001.33 5.71 4.24 4.24 0 01-1.94-.54v.06a4.28 4.28 0 003.43 4.19 4.27 4.27 0 01-1.93.07 4.29 4.29 0 004 2.98A8.59 8.59 0 012 19.54a12.13 12.13 0 006.56 1.92c7.88 0 12.2-6.53 12.2-12.2 0-.19 0-.37-.01-.56A8.72 8.72 0 0024 5.06a8.57 8.57 0 01-2.54.7z"})})}),r.jsx(od,{href:"https://www.linkedin.com/company/african-corporate-and-government-counsel-forum/",label:"LinkedIn",children:r.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M20.45 20.45h-3.55v-5.57c0-1.33-.02-3.04-1.85-3.04-1.85 0-2.14 1.45-2.14 2.94v5.67H9.36V9h3.41v1.56h.05c.47-.9 1.64-1.85 3.37-1.85 3.6 0 4.27 2.37 4.27 5.46v6.28zM5.34 7.43a2.06 2.06 0 11-.01-4.13 2.06 2.06 0 01.01 4.13zM7.12 20.45H3.56V9h3.56v11.45zM22.22 0H1.77C.79 0 0 .77 0 1.73v20.54C0 23.23.79 24 1.77 24h20.45c.98 0 1.78-.77 1.78-1.73V1.73C24 .77 23.2 0 22.22 0z"})})}),r.jsx(od,{href:"mailto:[email protected]",label:"Email",children:r.jsx("svg",{className:"h-4 w-4",fill:"none",stroke:"currentColor",strokeWidth:"2",viewBox:"0 0 24 24",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 8l7.89 5.26a2 2 0 002.22 0L21 8M5 19h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v10a2 2 0 002 2z"})})}),r.jsx(od,{href:"https://www.youtube.com/@ACGCAfrica",label:"YouTube",children:r.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M23.5 6.19a3.02 3.02 0 00-2.12-2.14C19.54 3.5 12 3.5 12 3.5s-7.54 0-9.38.55A3.02 3.02 0 00.5 6.19 31.6 31.6 0 000 12a31.6 31.6 0 00.5 5.81 3.02 3.02 0 002.12 2.14c1.84.55 9.38.55 9.38.55s7.54 0 9.38-.55a3.02 3.02 0 002.12-2.14A31.6 31.6 0 0024 12a31.6 31.6 0 00-.5-5.81zM9.55 15.57V8.43L15.82 12l-6.27 3.57z"})})}),r.jsx(od,{href:"https://www.instagram.com/acgcafrica/",label:"Instagram",children:r.jsx("svg",{className:"h-4 w-4",fill:"currentColor",viewBox:"0 0 24 24",children:r.jsx("path",{d:"M12 2.16c3.2 0 3.58.01 4.85.07 1.17.05 1.97.24 2.44.41.61.24 1.05.52 1.51.98.46.46.74.9.98 1.51.17.47.36 1.27.41 2.44.06 1.27.07 1.65.07 4.85s-.01 3.58-.07 4.85c-.05 1.17-.24 1.97-.41 2.44a4.07 4.07 0 01-.98 1.51c-.46.46-.9.74-1.51.98-.47.17-1.27.36-2.44.41-1.27.06-1.65.07-4.85.07s-3.58-.01-4.85-.07c-1.17-.05-1.97-.24-2.44-.41a4.07 4.07 0 01-1.51-.98 4.07 4.07 0 01-.98-1.51c-.17-.47-.36-1.27-.41-2.44C2.17 15.58 2.16 15.2 2.16 12s.01-3.58.07-4.85c.05-1.17.24-1.97.41-2.44.24-.61.52-1.05.98-1.51a4.07 4.07 0 011.51-.98c.47-.17 1.27-.36 2.44-.41C8.42 2.17 8.8 2.16 12 2.16zM12 0C8.74 0 8.33.01 7.05.07 5.78.13 4.9.33 4.14.63a5.87 5.87 0 00-2.13 1.38A5.87 5.87 0 00.63 4.14C.33 4.9.13 5.78.07 7.05.01 8.33 0 8.74 0 12s.01 3.67.07 4.95c.06 1.27.26 2.15.56 2.91
710a5.87 5.87 0 001.38 2.13 5.87 5.87 0 002.13 1.38c.76.3 1.64.5 2.91.56C8.33 23.99 8.74 24 12 24s3.67-.01 4.95-.07c1.27-.06 2.15-.26 2.91-.56a5.87 5.87 0 002.13-1.38 5.87 5.87 0 001.38-2.13c.3-.76.5-1.64.56-2.91.06-1.28.07-1.69.07-4.95s-.01-3.67-.07-4.95c-.06-1.27-.26-2.15-.56-2.91a5.87 5.87 0 00-1.38-2.13A5.87 5.87 0 0019.86.63C19.1.33 18.22.13 16.95.07 15.67.01 15.26 0 12 0zm0 5.84a6.16 6.16 0 100 12.32 6.16 6.16 0 000-12.32zM12 16a4 4 0 110-8 4 4 0 010 8zm6.41-11.85a1.44 1.44 0 100 2.88 1.44 1.44 0 000-2.88z"})})})]})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-accent-400 font-bold text-lg mb-4",children:"About ACGC"}),r.jsx("p",{className:"text-sm text-slate-300 leading-relaxed",style:{textAlign:"justify"},children:"ACGC Forum Ltd is a company limited by guarantee incorporated at Companies House England and Wales with company number 13365486 at registered office address: 140A Tachbrook Street, London, United Kingdom SW1V 2NE."})]}),r.jsxs("div",{children:[r.jsx("h3",{className:"text-accent-400 font-bold text-lg mb-4",children:"Quick Links"}),r.jsxs("nav",{className:"flex flex-col gap-2",children:[r.jsx(Ka,{to:"/join",children:"Join ACGC"}),r.jsx(Ka,{to:"/login",children:"Login"}),r.jsx(Ka,{to:"/profile",children:"My Profile"}),r.jsx(Ka,{to:"/events",children:"Events"}),r.jsx(Ka,{to:"/resources",children:"Resources"}),r.jsx(Ka,{to:"/insights",children:"Insights"}),r.jsx(Ka,{to:"/partners-and-sponsors",children:"Partners & Sponsors"}),r.jsx(Ka,{to:"/about",children:"About"})]})]})]}),r.jsx("div",{className:"mt-12 pt-5 border-t border-white/15",children:r.jsxs("p",{className:"text-center text-sm text-slate-400",children:["© ",t,", African Corporate & Government Counsel Forum."]})})]})})}function od({href:t,label:e,children:s}){return r.jsx("a",{href:t,target:"_blank",rel:"noreferrer","aria-label":e,className:"h-8 w-8 rounded-full bg-white/10 hover:bg-accent-500/30 border border-white/15 hover:border-accent-500/50 grid place-items-center text-slate-300 hover:text-white transition",children:s})}function Ka({to:t,children:e}){return r.jsx(K,{to:t,className:"text-sm text-slate-300 hover:text-accent-300 transition",children:e})}function dV(){const t=jn();return r.jsxs("div",{className:"min-h-screen flex flex-col",children:[r.jsx(lV,{}),r.jsx("main",{className:"flex-1",children:r.jsx(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.32,ease:"easeOut"},children:r.jsx(JE,{})},t.pathname)}),r.jsx(cV,{})]})}function W({as:t="button",variant:e="primary",size:s="md",className:n="",...a}){const i="inline-flex items-center justify-center gap-2 rounded-2xl font-medium transition-all duration-200 focus:outline-none focus:ring-2 focus:ring-accent-400/50 disabled:opacity-60 disabled:cursor-not-allowed",o={primary:"bg-accent-600 text-white hover:bg-accent-500 active:bg-accent-700 shadow-soft hover:-translate-y-0.5",ghost:"bg-white text-brand-900 hover:bg-slate-50 border border-slate-200 hover:border-slate-300 hover:-translate-y-0.5",dark:"bg-brand-700 text-white hover:bg-brand-600 border border-brand-700/50 hover:-translate-y-0.5",outline:"bg-transparent text-white hover:bg-white/10 border border-white/25 hover:border-white/40 hover:-translate-y-0.5",portal:"bg-white/10 text-white hover:bg-white/15 border border-white/15 hover:border-white/25",danger:"bg-red-500 text-white hover:bg-red-400 active:bg-red-600"},l={sm:"h-9 px-3 text-sm",md:"h-11 px-4 text-sm",lg:"h-12 px-5 text-base"};return r.jsx(t,{className:`${i} ${o[e]} ${l[s]} ${n}`,...a})}function Ja({to:t,children:e}){return r.jsx(il,{to:t,end:t==="/hub",className:({isActive:s})=>`text-sm px-3 py-2 rounded-2xl transition border ${s?"bg-white/10 text-slate-50 border-white/15":"bg-transparent text-slate-300 border-transparent hover:bg-white/5 hover:border-white/10"}`,children:e})}function uV(){const{member:t,logout:e}=Oe(),s=Bn(),{t:n}=en(),a=(t==null?void 0:t.role)==="admin"||(t==null?void 0:t.role)==="editor",i=()=>{e(),s("/")};return r.jsx("div",{className:"sticky top-0 z-30 border-b border-white/10 bg-brand-900/70 backdrop-blur-md",children:r.jsxs("div",{className:"max-w-7xl mx-auto px-4 md:px-8 h-24 flex items-center",children:[r.jsx(K,{to:"/hub","aria-label":"ACGC Hub",className:"shrink-0 mr-auto",children:r.jsx(K3,{size:"xxl"})}),r.jsxs("div",{className:"hidden md:flex items-center gap-2",children:[r.jsx(Ja,{to:"/hub",children:n("nav.dashboard")}),r.jsx(Ja,{to:"/hub/directory",children:n("nav.directory")}),r.jsx(Ja,{to:"/hub/events",children:n("nav.events")}),r.jsx(Ja,{to:"/hub/resources",children:n("nav.resources")}),r.jsx(Ja,{to:"/hub/insights/manage",children:"Insights"}),r.jsx(Ja,{to:"/hub/jobs/manage",children:"Jobs"}),r.jsx(Ja,{to:"/hub/messages",children:"Messages"}),a&&r.jsx(Ja,{to:"/hub/admin",children:"Admin"})]}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs(K,{to:"/",className:"inline-flex items-center gap-1.5 text-sm text-slate-300 hover:text-white transition px-3 py-1.5 rounded-lg border border-white/10 hover:border-white/20 hover:bg-white/5",title:"Back to public site",children:[r.jsx(ur,{className:"h-3.5 w-3.5"}),"Back to Site"]}),r.jsx("div",{className:"hidden sm:block",children:r.jsx(Of,{variant:"portal"})}),r.jsx(K,{to:"/hub/profile",className:"h-9 w-9 rounded-full border-2 border-white/20 hover:border-accent-500/60 overflow-hidden bg-white/5 grid place-items-center transition shrink-0",title:"My Profile",children:t!=null&&t.avatar_url?r.jsx("img",{src:tt(t.avatar_url),alt:"",className:"h-full w-full object-cover"}):r.jsx(Ls,{className:"h-4 w-4 text-slate-400"})}),r.jsx(V.div,{whileHover:{y:-1},whileTap:{scale:.98},children:r.jsx(W,{variant:"portal",onClick:i,children:n("nav.logout")})})]})]})})}function hV(){const t=jn();return r.jsxs("div",{"data-surface":"portal",className:"min-h-screen",children:[r.jsx(uV,{}),r.jsx("main",{className:"max-w-6xl mx-auto px-4 md:px-6 py-8",children:r.jsx(V.div,{initial:{opacity:0,y:10}
710,animate:{opacity:1,y:0},transition:{duration:.32,ease:"easeOut"},children:r.jsx(JE,{})},t.pathname)})]})}const Lr={hidden:{opacity:0,y:20},visible:(t=0)=>({opacity:1,y:0,transition:{delay:t,duration:.5}})},mV=[{icon:On,title:"Learning & Knowledge Development",description:"A year-round programme of webinars, masterclasses, leadership sessions and the Annual Conference designed specifically for in-house and government counsel."},{icon:Wt,title:"Careers & Opportunities",description:"Full access to the ACGC Jobs & Opportunities Board, including in-house roles, secondments and leadership positions across Africa and internationally."},{icon:at,title:"Peer Network & Visibility",description:"Inclusion in the ACGC Member Directory and eligibility for editorial features, sector spotlights and speaking opportunities at ACGC events."},{icon:pt,title:"Pan-African & Global Connections",description:"Engage with trusted peers across 40+ countries and connect with international in-house legal organisations and associations."},{icon:Lf,title:"Influence & Thought Leadership",description:"Opportunities to contribute to surveys, research initiatives and publications shaping dialogue on in-house legal leadership in Africa."}];function fV(){const{t}=en(),[e,s]=v.useState(!1);return r.jsxs("div",{className:"bg-white text-[rgb(var(--fg))]",children:[r.jsxs("section",{className:"relative w-full h-[500px] md:h-[600px] overflow-hidden",children:[r.jsx("img",{src:"/Globe.png",alt:"Africa Globe",className:"w-full h-full object-cover",onError:n=>{n.currentTarget.style.display="none"}}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-[#1f0f3f]/80 via-[#1f0f3f]/60 to-[#1f0f3f]/40"}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 w-full text-center",children:r.jsxs(V.div,{initial:"hidden",animate:"visible",variants:Lr,custom:0,children:[r.jsx("h1",{className:"text-3xl md:text-5xl font-bold text-white leading-tight",children:"Africa's Community for In-House and Government Counsel"}),r.jsx("p",{className:"mt-4 text-lg md:text-xl text-white/90 font-medium",children:"3,000+ members | 40+ countries"}),r.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center gap-4",children:[r.jsx(K,{to:"/join",className:"inline-flex items-center justify-center px-6 py-3 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold transition shadow-lg",children:"Join ACGC"}),r.jsx(K,{to:"/directory",className:"inline-flex items-center justify-center px-6 py-3 rounded-lg border-2 border-white/80 text-white font-semibold hover:bg-white/10 transition",children:"Explore the Community"}),r.jsx("a",{href:"/joining-options",className:"inline-flex items-center justify-center px-6 py-3 rounded-lg border-2 border-white/80 text-white font-semibold hover:bg-white/10 transition",children:"View Membership Options"})]})]})})})]}),r.jsx("section",{className:"bg-[#1f0f3f]",children:r.jsx("div",{className:"max-w-5xl mx-auto px-4 md:px-6 py-6",children:r.jsxs(V.button,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Lr,custom:0,onClick:()=>s(!0),className:"w-full flex flex-col md:flex-row items-center gap-5 md:gap-8 rounded-2xl bg-white/5 border border-white/10 hover:bg-white/10 transition-all duration-300 p-5 md:p-6 group cursor-pointer text-left",children:[r.jsx("img",{src:"/OnTheHorizonSurveyACGC2025.png",alt:"On The Horizon: A 2025 African GC Perspective",className:"w-full md:w-48 h-auto rounded-xl shadow-lg object-contain shrink-0",onError:n=>{n.currentTarget.style.display="none"}}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-[#c08a2f]/20 px-3 py-1 text-xs font-semibold text-[#e6c784] uppercase tracking-wider mb-2",children:"New Report"}),r.jsx("h3",{className:"text-lg md:text-xl font-bold text-white leading-snug",children:"On The Horizon: A 2025 African GC Perspective"}),r.jsx("p",{className:"mt-2 text-sm text-white/70 leading-relaxed line-clamp-2",children:"The most comprehensive survey ever conducted on Africa's in-house legal community â insights from General Counsel across 41 African countries."}),r.jsxs("span",{className:"mt-3 inline-flex items-center gap-1.5 text-sm font-medium text-[#c08a2f] group-hover:text-[#e6c784] transition",children:[r.jsx(Ys,{className:"h-4 w-4"}),"Download the Report"]})]})]})})}),e&&r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-sm",onClick:()=>s(!1)}),r.jsx("div",{className:"relative max-w-2xl mx-auto my-8 px-4 pb-8",children:r.jsxs(V.div,{initial:{opacity:0,scale:.95,y:20}
710,animate:{opacity:1,scale:1,y:0},transition:{duration:.3},className:"rounded-3xl bg-white shadow-2xl overflow-hidden",children:[r.jsx("button",{onClick:()=>s(!1),className:"absolute top-4 right-4 z-10 h-9 w-9 rounded-full bg-black/30 backdrop-blur-sm flex items-center justify-center text-white hover:bg-black/50 transition",children:r.jsx(He,{className:"h-5 w-5"})}),r.jsx("img",{src:"/OnTheHorizonSurveyACGC2025.png",alt:"On The Horizon: A 2025 African GC Perspective",className:"w-full h-auto object-contain",onError:n=>{n.currentTarget.style.display="none"}}),r.jsxs("div",{className:"p-6 md:p-8",children:[r.jsx("div",{className:"inline-flex items-center gap-1.5 rounded-full bg-[#1f0f3f]/10 px-3 py-1 text-xs font-semibold text-[#1f0f3f] uppercase tracking-wider mb-3",children:"2025 Report"}),r.jsx("h2",{className:"text-xl md:text-2xl font-bold text-slate-900 leading-snug",children:"On The Horizon: A 2025 African GC Perspective"}),r.jsxs("div",{className:"mt-4 text-sm text-slate-600 leading-relaxed space-y-3",style:{textAlign:"justify"},children:[r.jsx("p",{children:"On The Horizon: A 2025 African GC Perspective is the most comprehensive survey ever conducted on Africa's in-house legal community. Developed by ACGC in collaboration with Afriwise, the report brings together insights from General Counsel across 41 African countries, offering a clear view of the challenges, priorities, and strategic shifts shaping the role of in-house counsel across the continent."}),r.jsx("p",{children:"Download the report to explore the data, commentary, and perspectives defining the future of legal leadership in Africa."})]}),r.jsx("div",{className:"mt-6",children:r.jsxs("a",{href:"/2025_GC_Survey.pdf",download:"On_The_Horizon_2025_African_GC_Perspective.pdf",className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-xl bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold text-sm transition shadow-lg w-full md:w-auto",children:[r.jsx(Ys,{className:"h-4 w-4"}),"Download Report"]})})]})]})})]}),r.jsx("section",{className:"bg-slate-50",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-6 md:px-8 py-16 md:py-20",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Lr,custom:0,className:"text-center",children:[r.jsx("h2",{className:"text-3xl md:text-4xl text-brand-900 font-bold mb-6",children:"Who We Are"}),r.jsxs("div",{className:"text-[15px] md:text-base text-slate-700 leading-relaxed space-y-4 max-w-3xl mx-auto",style:{textAlign:"justify"},children:[r.jsx("p",{children:"ACGC is a professional, member-led community for in-house and government counsel working across Africa. We bring together in-house and government counsel across Africa to exchange insight, build trusted relationships and strengthen the organisations they serve."}),r.jsxs("p",{children:["Today the ACGC community includes ",r.jsx("strong",{className:"text-brand-900",children:"3,000+"})," lawyers across more than ",r.jsx("strong",{className:"text-brand-900",children:"40 countries"}),", participating in conferences, roundtables, research initiatives and collaborative programmes designed for the realities of in-house practice."]})]})]}),r.jsx(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.15},className:"mt-10",children:r.jsx("img",{src:"/IMG_1917.jpg",alt:"ACGC members at an event",className:"w-full rounded-2xl shadow-xl object-cover max-h-[440px]",onError:n=>{n.currentTarget.style.display="none"}})})]})}),r.jsx("section",{className:"bg-slate-50 py-16 md:py-20",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[r.jsx(V.h2,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Lr,custom:0,className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] text-center mb-12",children:"The Benefits of Belonging to ACGC"}),r.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:mV.map((n,a)=>r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Lr,custom:a*.1,className:"bg-white rounded-2xl p-6 shadow-sm border border-slate-100",children:[r.jsx("div",{className:"h-12 w-12 rounded-xl bg-[#1f0f3f] flex items-center justify-center mb-4",children:r.jsx(n.icon,{className:"h-6 w-6 text-[#e6c784]"})}),r.jsx("h3",{className:"font-semibold text-lg text-slate-900 mb-2",children:n.title}),r.jsx("p",{className:"text-slate-600 text-[15px] leading-relaxed",children:n.description})]},n.title))}),r.jsx("div",{className:"text-center mt-12",children:r.jsx(K,{to:"/joining-options",className:"inline-flex items-center justify-center px-6 py-3 rounded-lg bg-[#c08a2f] hover:bg-[#a
71077324] text-white font-semibold transition shadow-md",children:"Explore Membership Options"})})]})}),r.jsxs("section",{className:"max-w-4xl mx-auto px-4 md:px-6 py-16 md:py-20",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Lr,custom:0,className:"text-center mb-8",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-4",children:"Understanding ACGC"}),r.jsx("p",{className:"text-slate-600 max-w-2xl mx-auto",children:"Watch this short overview to understand our mission, membership structure and the value of joining the ACGC community."})]}),r.jsx(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Lr,custom:.1,className:"aspect-video rounded-2xl overflow-hidden shadow-xl bg-slate-900",children:r.jsx("video",{src:"/ACGC Brochure June 2025 (1920 x 1080 px).mp4",controls:!0,className:"w-full h-full object-cover",preload:"metadata",children:"Your browser does not support the video tag."})})]}),r.jsx("section",{className:"bg-gradient-to-br from-[#1f0f3f] to-[#2a1654] text-white",children:r.jsx("div",{className:"max-w-6xl mx-auto px-6 md:px-8 py-16 md:py-20",children:r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Lr,custom:0,className:"grid md:grid-cols-2 gap-10 items-center",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-[#c08a2f]/20 text-[#f3c97a] text-xs font-semibold uppercase tracking-wide mb-4",children:[r.jsx(or,{className:"h-3.5 w-3.5"}),"Protected Access"]}),r.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Resource Hub"}),r.jsx("p",{className:"text-slate-300 text-lg leading-relaxed mb-6",children:"Explore the ACEP 2025 Resource Hub â session recordings, faculty insights and curated materials from ACGC's flagship programme. An access code is required to enter."}),r.jsxs(K,{to:"/acep-2025-hub",className:"inline-flex items-center gap-2 h-11 px-6 rounded-xl bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold transition shadow-md",children:["Enter the Resource Hub ",r.jsx(nt,{className:"h-4 w-4"})]})]}),r.jsx("div",{className:"relative",children:r.jsx("div",{className:"aspect-[4/3] rounded-2xl bg-white/5 border border-white/10 backdrop-blur-sm grid place-items-center p-8",children:r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"h-20 w-20 rounded-full bg-[#c08a2f]/20 grid place-items-center mx-auto mb-4",children:r.jsx(On,{className:"h-10 w-10 text-[#f3c97a]"})}),r.jsx("div",{className:"text-sm font-semibold text-[#f3c97a] uppercase tracking-wide mb-2",children:"Compliance Essentials"}),r.jsx("div",{className:"text-2xl font-bold text-white mb-2",children:"6 Sessions · Faculty Library"}),r.jsx("p",{className:"text-slate-300 text-sm",children:"Recordings, case studies and reference materials"})]})})})]})})}),r.jsx("section",{className:"bg-white border-t border-slate-200",children:r.jsxs("div",{className:"max-w-3xl mx-auto px-6 md:px-8 py-16 md:py-20",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Lr,custom:0,className:"text-center mb-8",children:[r.jsx("h2",{className:"text-2xl md:text-3xl text-brand-900 font-bold",children:"Stay Connected with the ACGC Community"}),r.jsx("p",{className:"mt-3 text-slate-600 max-w-xl mx-auto",children:"Receive insights, events and opportunities from Africa's leading network of in-house and government counsel."}),r.jsxs("div",{className:"mt-3 inline-flex items-center gap-1.5 text-sm text-[#c08a2f] font-medium",children:[r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-[#c08a2f]"}),"Free to subscribe"]})]}),r.jsx(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Lr,custom:.1,children:r.jsx(xV,{})})]})}),r.jsx("section",{className:"bg-brand-900 text-white",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-6 md:px-8 py-16 flex flex-col md:flex-row gap-6 md:items-center md:justify-between",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-2xl md:text-3xl",children:"Join Africa's Premier In-House Legal Community"}),r.jsx("p",{className:"mt-2 text-slate-300",children:"Become part of a growing network of 3,000+ in-house counsel across the continent."})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3 shrink-0",children:[r.jsxs(W,{as:K,to:"/join",size:"lg",className:"bg-accent-500 hover:bg-accent-600 text-white border border-accent-500",children:["Join ACGC ",r.jsx(nt,{className:"h-4 w-4"})]}),r.jsx(W,{as:K,to:"/events",size:"lg",variant:"outline",children:"Upcoming Events"})]})]})})]})}const pV=["Afghanistan","Albania","Algeria","Angola","Argentina","Australia","Austria","Bangladesh","Belgium","Benin","Botswana","Brazil","Burkina Faso","Burundi","Cameroon","Canada","Central African Republic","Chad","China","Colombia","Comoros","Congo","Côte d'Ivoire","Democratic Republic of Congo","Denmark","Djibouti","Egypt","Equatorial Guinea","Eritrea","Eswatini","Ethiopia","Finland","France","Gabon","Gambia","Germany","Ghana","Greece","Guinea","Guinea-Bissau","India","Indonesia","Ireland","Israel","Italy","Japan","Kenya","Lesotho","Liberia","Libya","Madagascar","Malawi","Mali","Mauritania","Mauritius","Mexico","Morocco","Mozambique","Namibia","Netherlands","New Zealand","Niger","Nigeria","Norway","Pakistan","Poland","Portugal","Rwanda","São Tomé and PrÃncipe","Senegal","Seychelles","Sierra Leone","Somalia","South Africa","South Korea","South Sudan","Spain","Sri Lanka","Sudan","Sweden","Switzerland","Tanzania","Togo","Tunisia","Turkey","Uganda","Ukraine","United Arab Emirates","United Kingdom","United States","Zambia","Zimbabwe"];function xV(){const[t,e]=v.useState({name:"",email:"",country:""}),[s,n]=v.useState(!1),[a,i]=v.useState(!1),[o,l]=v.useState(""),c=async u=>{var h;u.preventDefault(),l(""),i(!0);try{await U("/api/newsletter/subscribe",{method:"POST",body:{email:t.email,name:t.name,country:t.country,source:"homepage"}}),n(!0)}catch(m){(h=m.message)!=null&&h.includes("already_subscribed")?l("You are already subscribed!"):l(m.message||"Something went wrong. Please try again.")}finally{i(!1)}};if(s)return r.jsxs("div",{className:"text-center py-8 rounded-2xl border border-emerald-200 bg-emerald-50",children:[r.jsx("div",{className:"text-emerald-700 font-semibold text-lg",children:"Thank y
710ou for subscribing!"}),r.jsx("p",{className:"text-slate-500 text-sm mt-1",children:"We'll keep you updated with the latest insights and events."})]});const d="w-full h-11 rounded-xl border border-slate-200 bg-white px-4 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition";return r.jsxs("form",{onSubmit:c,className:"rounded-2xl border border-slate-200 bg-slate-50 p-6 md:p-8 space-y-4",children:[r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1.5",children:"Name"}),r.jsx("input",{type:"text",required:!0,placeholder:"Your full name",value:t.name,onChange:u=>e({...t,name:u.target.value}),className:d})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1.5",children:"Email address"}),r.jsx("input",{type:"email",required:!0,placeholder:"[email protected]",value:t.email,onChange:u=>e({...t,email:u.target.value}),className:d})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1.5",children:"Country"}),r.jsxs("select",{required:!0,value:t.country,onChange:u=>e({...t,country:u.target.value}),className:d,children:[r.jsx("option",{value:"",children:"Select your country"}),pV.map(u=>r.jsx("option",{value:u,children:u},u))]})]}),o&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-xl px-4 py-2",children:o}),r.jsx("div",{className:"pt-1",children:r.jsxs("button",{type:"submit",disabled:a,className:"inline-flex items-center gap-2 h-11 px-6 rounded-xl bg-[#c08a2f] hover:bg-[#a77324] text-white text-sm font-medium transition shadow-sm disabled:opacity-60",children:[r.jsx(ia,{className:"h-4 w-4"})," ",a?"Subscribingâ¦":"Get Updates"]})})]})}const gV="/ACGC%20Membership%20Brochure%202026.pdf",bV=[{name:"Cynthia Lareine",role:"Co-Founder",photo:"/TeamPhotos/CynthiaLareine.jpg",linkedin:"https://www.linkedin.com/in/cynthia-lareine-33941018/",instagram:"https://www.instagram.com/adaora75/"},{name:"Nankunda Katangaza",role:"Co-Founder",photo:"/TeamPhotos/NankundaKatangaza.jpg",linkedin:"https://www.linkedin.com/in/nankunda-katangaza-7b82808/",instagram:null},{name:"Oladimeji Balogun",role:"Community & Marketing Manager",photo:"/TeamPhotos/OladimejiBalogun.jpg",linkedin:"https://www.linkedin.com/in/balogun-oladimeji-21070a192/",instagram:"https://www.instagram.com/thisisdmj/"}],yV=[{icon:On,title:"Learning & Knowledge Development",description:"A year-round programme of webinars, masterclasses, leadership sessions and the Annual Conference designed specifically for in-house and government counsel."},{icon:Wt,title:"Careers & Opportunities",description:"Full access to the ACGC Jobs & Opportunities Board, including in-house roles, secondments and leadership positions across Africa and internationally."},{icon:at,title:"Peer Network & Visibility",description:"Inclusion in the ACGC Member Directory and eligibility for editorial features, sector spotlights and speaking opportunities at ACGC events."},{icon:pt,title:"Pan-African & Global Connections",description:"Engage with trusted peers across 40+ countries and connect with international in-house legal organisations and associations."},{icon:Lf,title:"Influence & Thought Leadership",description:"Opportunities to contribute to surveys, research initiatives and publications shaping dialogue on in-house legal leadership in Africa."}
710],vV=[{category:"Africa-based in-house & government lawyers",who:"In-house counsel and government lawyers working in Africa, including General Counsel, Heads of Legal and legal operations professionals",fee:"120",adminFee:"25"},{category:"Public sector / government counsel",who:"Lawyers employed directly by government ministries, departments, agencies or public institutions in Africa",fee:"85",adminFee:"10"},{category:"Early-career in-house lawyers (0â3 years)",who:"Lawyers in their first three years of in-house or government legal practice",fee:"60",adminFee:"15"},{category:"International Africa-focused in-house lawyers",who:"In-house lawyers based outside Africa with professional responsibility for Africa or African markets",fee:"200",adminFee:"30"}],xr={hidden:{opacity:0,y:20},visible:(t=0)=>({opacity:1,y:0,transition:{delay:t,duration:.5}})};function Hg({title:t,children:e,defaultOpen:s=!1}){const[n,a]=v.useState(s);return r.jsxs("div",{className:"border border-slate-200 rounded-xl overflow-hidden",children:[r.jsxs("button",{onClick:()=>a(!n),className:"w-full px-6 py-4 flex items-center justify-between bg-slate-50 hover:bg-slate-100 transition text-left",children:[r.jsx("span",{className:"font-semibold text-[#1f0f3f]",children:t}),r.jsx(ht,{className:`h-5 w-5 text-slate-500 transition-transform ${n?"rotate-180":""}`})]}),n&&r.jsx("div",{className:"px-6 py-5 bg-white",children:e})]})}function wV(){return r.jsxs("div",{className:"bg-white text-[rgb(var(--fg))]",children:[r.jsxs("section",{className:"relative w-full h-[500px] md:h-[600px] overflow-hidden",children:[r.jsx("img",{src:"/Globe.png",alt:"Africa Globe",className:"w-full h-full object-cover",onError:t=>{t.currentTarget.style.display="none"}}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-[#1f0f3f]/80 via-[#1f0f3f]/60 to-[#1f0f3f]/40"}),r.jsx("div",{className:"absolute inset-0 flex items-center",children:r.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 w-full",children:r.jsxs(V.div,{initial:"hidden",animate:"visible",variants:xr,custom:0,className:"max-w-2xl",children:[r.jsx("h1",{className:"text-3xl md:text-5xl font-bold text-white leading-tight",children:"Africa's Community for In-House and Government Counsel"}),r.jsx("p",{className:"mt-4 text-lg md:text-xl text-white/90 font-medium",children:"3,000+ members | 40+ countries"}),r.jsxs("div",{className:"mt-8 flex flex-wrap gap-4",children:[r.jsx(K,{to:"/join",className:"inline-flex items-center justify-center px-6 py-3 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold transition shadow-lg",children:"Join ACGC"}),r.jsx("a",{href:"#membership",className:"inline-flex items-center justify-center px-6 py-3 rounded-lg border-2 border-white/80 text-white font-semibold hover:bg-white/10 transition",children:"View Membership Options"})]})]})})})]}),r.jsx("section",{className:"max-w-4xl mx-auto px-4 md:px-6 py-16 md:py-20",children:r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:0,children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-8",children:"About ACGC"}),r.jsxs("div",{className:"space-y-6 text-slate-700 leading-relaxed text-[16px]",children:[r.jsx("p",{children:"ACGC is a professional, member-led community for in-house and government counsel working across Africa."}),r.jsx("p",{children:"We bring together 3,000+ lawyers across 40+ countries to exchange insight, strengthen their organisations and contribute to the evolution of in-house practice across the continent."}),r.jsx("p",{children:"Through conferences, roundtables, research initiatives and structured learning programmes, ACGC supports lawyers operating in complex corporate and public-sector environments."})]})]})}),r.jsx("section",{className:"bg-slate-50 py-16 md:py-20",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[r.jsx(V.h2,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:0,className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] text-center mb-12",children:"The Benefits of Belonging to ACGC"}),r.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-8",children:yV.map((t,e)=>
710r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:e*.1,className:"bg-white rounded-2xl p-6 shadow-sm border border-slate-100",children:[r.jsx("div",{className:"h-12 w-12 rounded-xl bg-[#1f0f3f] flex items-center justify-center mb-4",children:r.jsx(t.icon,{className:"h-6 w-6 text-[#e6c784]"})}),r.jsx("h3",{className:"font-semibold text-lg text-slate-900 mb-2",children:t.title}),r.jsx("p",{className:"text-slate-600 text-[15px] leading-relaxed",children:t.description})]},t.title))}),r.jsx("div",{className:"text-center mt-12",children:r.jsx("a",{href:"#membership",className:"inline-flex items-center justify-center px-6 py-3 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold transition shadow-md",children:"Explore Membership Options"})})]})}),r.jsxs("section",{className:"max-w-4xl mx-auto px-4 md:px-6 py-16 md:py-20",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:0,className:"text-center mb-8",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-4",children:"Intro to ACGC"}),r.jsx("p",{className:"text-slate-600 max-w-2xl mx-auto",children:"Watch this short overview to understand our mission, membership structure and the value of joining the ACGC community."})]}),r.jsx(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:.1,className:"aspect-video rounded-2xl overflow-hidden shadow-xl bg-slate-900",children:r.jsx("video",{src:"/ACGC Brochure June 2025 (1920 x 1080 px).mp4",controls:!0,className:"w-full h-full object-cover",preload:"metadata",children:"Your browser does not support the video tag."})})]}),r.jsx("section",{id:"membership",className:"bg-slate-50 py-16 md:py-20",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:0,className:"text-center mb-10",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-4",children:"Membership Options & Fees"}),r.jsx("p",{className:"text-slate-600 max-w-3xl mx-auto",children:"ACGC offers both individual and institutional membership pathways designed to reflect different professional contexts and organisational structures."})]}),r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:.1,className:"space-y-4",children:[r.jsxs(Hg,{title:"Individual Membership",defaultOpen:!0,children:[r.jsx("p",{className:"text-slate-600 mb-6",children:"Individual ACGC membership is designed for in-house and government lawyers who wish to actively participate in Africa's leading professional community for in-house legal leadership. Membership provides access to learning, peer exchange, professional visibility and leadership opportunities within a trusted pan-African platform."}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full text-sm border-collapse",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"bg-[#1f0f3f] text-white",children:[r.jsx("th",{className:"px-4 py-3 text-left font-semibold",children:"Membership category"}),r.jsx("th",{className:"px-4 py-3 text-left font-semibold",children:"Who this is for"}),r.jsx("th",{className:"px-4 py-3 text-center font-semibold whitespace-nowrap",children:"Annual fee (USD)"}),r.jsx("th",{className:"px-4 py-3 text-center font-semibold whitespace-nowrap",children:"Application / Admin Fee (USD)"})]})}),r.jsx("tbody",{children:vV.map((t,e)=>r.jsxs("tr",{className:e%2===0?"bg-slate-50":"bg-white",children:[r.jsx("td",{className:"px-4 py-3 font-medium text-slate-900",children:t.category}),r.jsx("td",{className:"px-4 py-3 text-slate-600",children:t.who}),r.jsx("td",{className:"px-4 py-3 text-center font-semibold text-[#1f0f3f]",children:t.fee}),r.jsx("td",{className:"px-4 py-3 text-center text-slate-600",children:t.adminFee})]},e))})]})}),r.jsxs("div",{className:"mt-4 text-xs text-slate-500 space-y-1",children:[r.jsx("p",{children:"*Individual membership is personal to the named member and cannot be transferred."}),r.jsx("p",{children:"*One-off application/admin fee applies."}),r.jsx("p",{children:"*Membership year runs from March to end February."})]}),r.jsx("div",{className:"mt-6",children:r.jsx(K,{to:"/join",className:"inline-flex items-center justify-center px-5 py-2.5 rounded-lg bg-[#c08a2f] hover:bg-[#a
71077324] text-white font-semibold text-sm transition",children:"Apply for Individual Membership"})})]}),r.jsxs(Hg,{title:"Corporate Legal Departments",children:[r.jsx("p",{className:"text-slate-600 mb-4",children:"Corporate Legal Department membership is designed for legal teams of three or more lawyers seeking structured institutional access to ACGC, flexibility to rotate nominated members, and enhanced value through team-based participation in learning, events and community engagement."}),r.jsx("p",{className:"text-2xl font-bold text-[#1f0f3f] mb-2",children:"From USD 600 â USD 4,000+ per year"}),r.jsx("p",{className:"text-slate-600 mb-6",children:"Pricing reflects department size and participation structure. Organisations may update nominated members during the membership year to reflect internal role changes."}),r.jsx("a",{href:"mailto:[email protected]?subject=Corporate%20Membership%20Enquiry",className:"inline-flex items-center justify-center px-5 py-2.5 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold text-sm transition",children:"Enquire About Corporate Membership"})]}),r.jsxs(Hg,{title:"Government Legal Departments",children:[r.jsx("p",{className:"text-slate-600 mb-4",children:"Government Legal Department membership is designed for ministries, departments, agencies and public institutions sponsoring multiple legal professionals to participate in ACGC through a structured departmental membership aligned to public-sector needs."}),r.jsx("p",{className:"text-2xl font-bold text-[#1f0f3f] mb-1",children:"From USD 500 per year"}),r.jsx("p",{className:"text-sm text-slate-500 mb-4",children:"(Custom pricing available for larger departments)"}),r.jsx("p",{className:"text-slate-600 mb-6",children:"Organisations may update nominated members during the membership year to reflect internal role changes."}),r.jsx("a",{href:"mailto:[email protected]?subject=Government%20Membership%20Enquiry",className:"inline-flex items-center justify-center px-5 py-2.5 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold text-sm transition",children:"Enquire About Government Membership"})]})]}),r.jsx("div",{className:"text-center mt-10",children:r.jsx(K,{to:"/join",className:"inline-flex items-center justify-center px-6 py-3 rounded-lg bg-[#1f0f3f] hover:bg-[#2a1654] text-white font-semibold transition shadow-md",children:"Apply for Membership"})})]})}),r.jsx("section",{className:"max-w-4xl mx-auto px-4 md:px-6 py-16 md:py-20",children:r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:0,className:"bg-gradient-to-br from-[#1f0f3f] to-[#2a1654] rounded-3xl p-8 md:p-12 text-center",children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-white mb-2",children:"ACGC Membership Handbook 2026"}),r.jsx("p",{className:"text-[#e6c784] font-medium mb-4",children:"Benefits, Eligibility & Pricing Framework"}),r.jsx("p",{className:"text-white/80 max-w-2xl mx-auto mb-6",children:"The Handbook sets out the full 2026 membership framework, including categories, pricing, participation privileges and governance structure."}),r.jsxs("ul",{className:"text-left max-w-md mx-auto text-white/90 text-sm space-y-2 mb-8",children:[r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Membership categories and eligibility"]}),r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Corporate and government department tiers"]}),r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Annual membership and application fees"]}),r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Core benefits and participation framework"]}),r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Membership year cycle (March 2026 â February 2027)"]})]}),r.jsxs("a",{href:gV,download:!0,className:"inline-flex items-center gap-2 px-6 py-3 rounded-lg bg-[#c08a2f] hover:bg-[#a
71077324] text-white font-semibold transition shadow-lg",children:[r.jsx(Ys,{className:"h-5 w-5"}),"Download the Handbook"]})]})}),r.jsx("section",{className:"bg-slate-50 py-16 md:py-20",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[r.jsx(V.h2,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:0,className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] text-center mb-12",children:"ACGC Team"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-8 max-w-4xl mx-auto",children:bV.map((t,e)=>r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:xr,custom:e*.1,className:"flex flex-col items-center text-center",children:[r.jsx("div",{className:"w-full aspect-[3/4] rounded-xl overflow-hidden border-4 border-[#c08a2f]/40 shadow-lg mb-4 bg-slate-100",children:r.jsx("img",{src:t.photo,alt:t.name,className:"w-full h-full object-cover",onError:s=>{s.currentTarget.style.display="none"}})}),r.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:t.name}),r.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:t.role}),r.jsxs("div",{className:"flex gap-2 mt-3",children:[t.linkedin&&r.jsx("a",{href:t.linkedin,target:"_blank",rel:"noopener noreferrer",className:"h-8 w-8 rounded-full bg-[#c08a2f] hover:bg-[#a77324] text-white flex items-center justify-center transition",children:r.jsx(bn,{className:"h-4 w-4"})}),t.instagram&&r.jsx("a",{href:t.instagram,target:"_blank",rel:"noopener noreferrer",className:"h-8 w-8 rounded-full bg-[#c08a2f] hover:bg-[#a77324] text-white flex items-center justify-center transition",children:r.jsx(oh,{className:"h-4 w-4"})})]})]},t.name))})]})})]})}function jV(t){return t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2)}const Wg={hidden:{opacity:0,y:20},visible:(t=0)=>({opacity:1,y:0,transition:{delay:t,duration:.5}})};function NV(){const[t,e]=v.useState([]),[s,n]=v.useState(!0);return v.useEffect(()=>{U("/api/advisory-board").then(a=>e(a.members||[])).catch(()=>{}).finally(()=>n(!1))},[]),r.jsxs("div",{className:"bg-white text-[rgb(var(--fg))]",children:[r.jsx("section",{className:"relative w-full bg-[#1f0f3f]",children:r.jsx("img",{src:"/Introducing_Our _New Board Members_20260407_201616_0000.png",alt:"ACGC Advisory Board Members",className:"w-full h-auto block",onError:a=>{a.currentTarget.style.display="none"}})}),r.jsx("section",{className:"max-w-4xl mx-auto px-4 md:px-6 py-12 md:py-16",children:r.jsxs(V.div,{initial:"hidden",animate:"visible",variants:Wg,custom:0,children:[r.jsx("p",{className:"text-slate-700 leading-relaxed text-[15px]",children:"We are pleased to announce the African Corporate & Government Counsel Forum (ACGC) Advisory Board 2026."}),r.jsx("p",{className:"text-slate-700 leading-relaxed text-[15px] mt-6",children:"The ACGC Advisory Board provides strategic guid
710ance and serves as a sounding board to the Executive Team as the organisation continues its transition into a self-sustaining, pan-African professional body for in-house counsel."}),r.jsx("p",{className:"text-slate-700 leading-relaxed text-[15px] mt-6",children:"The Board focuses on institutional sustainability, professional development, regional engagement and strategic positioning within Africa's legal ecosystem."}),r.jsx("p",{className:"text-slate-700 leading-relaxed text-[15px] mt-8 font-medium text-slate-800",children:"The 2026 Advisory Board is made up of nine senior in-house legal leaders representing corporate, public sector and multinational organisations across Africa and the Middle East."})]})}),r.jsxs("section",{className:"max-w-6xl mx-auto px-4 md:px-6 pb-16 md:pb-24",children:[r.jsx(V.h2,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Wg,custom:0,className:"text-2xl md:text-3xl font-bold text-[#1f0f3f] text-center mb-12",children:"ACGC Advisory Board Members 2026â2027"}),s?r.jsx("div",{className:"flex justify-center py-12",children:r.jsx("div",{className:"h-8 w-8 border-2 border-[#c08a2f] border-t-transparent rounded-full animate-spin"})}):r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-10 max-w-5xl mx-auto",children:t.map((a,i)=>{const o=[a.role_title,a.company].filter(Boolean).join(", "),l=a.bio_html||a.video_url||a.linkedin_url;return r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Wg,custom:i*.08,className:"flex flex-col items-center text-center",children:[r.jsx("div",{className:"w-48 h-48 rounded-full overflow-hidden border-4 border-[#c08a2f]/40 shadow-lg mb-5 bg-slate-100 flex-shrink-0",children:a.photo_url?r.jsx("img",{src:a.photo_url,alt:a.name,className:"w-full h-full object-cover",onError:c=>{c.currentTarget.style.display="none"}}):r.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-[#1f0f3f] to-[#3a1f6f]",children:r.jsx("span",{className:"text-3xl font-bold text-white/80",children:jV(a.name)})})}),r.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:a.name}),a.chair_title&&r.jsx("p",{className:"text-sm font-bold text-[#c08a2f] mt-1",children:a.chair_title}),r.jsx("p",{className:"text-sm text-slate-600 mt-1 max-w-[280px] leading-snug",children:o}),a.linkedin_url&&r.jsx("a",{href:a.linkedin_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 mt-2 text-sm text-[#0077b5] hover:text-[#005f8d] transition",children:r.jsx(bn,{className:"h-3.5 w-3.5"})}),l&&r.jsxs(K,{to:`/about/advisory-board/${a.id}`,className:"inline-flex items-center gap-1 mt-3 text-sm font-medium text-[#c08a2f] hover:text-[#a77324] transition",children:["Bio",r.jsx(ur,{className:"h-3.5 w-3.5"})]})]},a.id)})})]})]})}/*! @license DOMPurify 3.4.2 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.2/LICENSE */const{entries:J3,setPrototypeOf:bk,isFrozen:kV,getPrototypeOf:CV,getOwnPropertyDescriptor:SV}=Object;let{freeze:Ks,seal:lr,create:El}=Object,{apply:py,construct:xy}=typeof Reflect<"u"&&Reflect;Ks||(Ks=function(e){return e});lr||(lr=function(e){return e});py||(py=function(e,s){for(var n=arguments.length,a=new Array(n>2?n-2:0),i=2;i<n;i++)a[i-2]=arguments[i];return e.apply(s,a)});xy||(xy=function(e){for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];return new e(...n)});const ld=Yt(Array.prototype.forEach),_V=Yt(Array.prototype.lastIndexOf),yk=Yt(Array.prototype.pop),cd=Yt(Array.prototype.push),TV=Yt(Array.prototype.splice),Fs=Array.isArray,Td=Yt(String.prototype.toLowerCase),Gg=Yt(String.prototype.toString),vk=Yt(String.prototype.match),wl=Yt(String.prototype.replace),wk=Yt(String.prototype.indexOf),EV=Yt(String.prototype.trim),MV=Yt(Number.prototype.toString),AV=Yt(Boolean.prototype.toString),jk=typeof BigInt>"u"?null:Yt(BigInt.prototype.toString),Nk=typeof Symbol>"u"?null:Yt(Symbol.prototype.toString),_t=Yt(Object.prototype.hasOwnProperty),dd=Yt(Object.prototype.toString),ms=Yt(RegExp.prototype.test),Uh=PV(TypeError);function Yt(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var s=arguments.length,n=new Array(s>1?s-1:0),a=1;a<s;a++)n[a-1]=arguments[a];return py(t,e,n)}}function PV(t){return function(){for(var e=arguments.length,s=new Array(e),n=0;n<e;n++)s[n]=arguments[n];return xy(t,s)}}function Le(t,e){let s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Td;
vendor: 4,421 bytes, line 710
710if(bk&&bk(t,null),!Fs(e))return t;let n=e.length;for(;n--;){let a=e[n];if(typeof a=="string"){const i=s(a);i!==a&&(kV(e)||(e[n]=i),a=i)}t[a]=!0}return t}function DV(t){for(let e=0;e<t.length;e++)_t(t,e)||(t[e]=null);return t}function on(t){const e=El(null);for(const[s,n]of J3(t))_t(t,s)&&(Fs(n)?e[s]=DV(n):n&&typeof n=="object"&&n.constructor===Object?e[s]=on(n):e[s]=n);return e}function RV(t){switch(typeof t){case"string":return t;case"number":return MV(t);case"boolean":return AV(t);case"bigint":return jk?jk(t):"0";case"symbol":return Nk?Nk(t):"Symbol()";case"undefined":return dd(t);case"function":case"object":{if(t===null)return dd(t);const e=t,s=Ml(e,"toString");if(typeof s=="function"){const n=s(e);return typeof n=="string"?n:dd(n)}return dd(t)}default:return dd(t)}}function Ml(t,e){for(;t!==null;){const n=SV(t,e);if(n){if(n.get)return Yt(n.get);if(typeof n.value=="function")return Yt(n.value)}t=CV(t)}function s(){return null}return s}function LV(t){try{return ms(t,""),!0}catch{return!1}}const kk=Ks(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Yg=Ks(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),qg=Ks(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),OV=Ks(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),Kg=Ks(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),IV=Ks(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ck=Ks(["#text"]),Sk=Ks(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","
710spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),Jg=Ks(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),_k=Ks(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Hh=Ks(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),FV=lr(/\{\{[\w\W]*|[\w\W]*\}\}/gm),$V=lr(/<%[\w\W]*|[\w\W]*%>/gm),zV=lr(/\$\{[\w\W]*/gm),BV=lr(/^data-[\-\w.\u00B7-\uFFFF]+$/),VV=lr(/^aria-[\-\w]+$/),Q3=lr(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),UV=lr(/^(?:\w+script|data):/i),HV=lr(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),X3=lr(/^html$/i),WV=lr(/^[a-z][.\w]*(-[.\w]+)+$/i);var Tk=Object.freeze({__proto__:null,ARIA_ATTR:VV,ATTR_WHITESPACE:HV,CUSTOM_ELEMENT:WV,DATA_ATTR:BV,DOCTYPE_NAME:X3,ERB_EXPR:$V,IS_ALLOWED_URI:Q3,IS_SCRIPT_OR_DATA:UV,MUSTACHE_EXPR:FV,TMPLIT_EXPR:zV});const ud={element:1,text:3,progressingInstruction:7,comment:8,document:9},GV=function(){return typeof window>"u"?null:window},YV=function(e,s){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let n=null;const a="data-tt-policy-suffix";s&&s.hasAttribute(a)&&(n=s.getAttribute(a));const i="dompurify"+(n?"#"+n:"");try{return e.createPolicy(i,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+i+" could not be created."),null}},Ek=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Z3(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:GV();const e=_e=>Z3(_e);if(e.version="3.4.2",e.removed=[],!t||!t.document||t.document.nodeType!==ud.document||!t.Element)return e.isSupported=!1,e;let{document:s}=t;const n=s,a=n.currentScript,{DocumentFragment:i,HTMLTemplateElement:o,Node:l,Element:c,NodeFilter:d,NamedNodeMap:u=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:f}=t,p=c.prototype,g=Ml(p,"cloneNode"),x=Ml(p,"remove"),b=Ml(p,"nextSibling"),y=Ml(p,"childNodes"),w=Ml(p,"parentNode");if(typeof o=="function"){const _e=s.createElement("template");_e.content&&_e.content.ownerDocument&&(s=_e.content.ownerDocument)}let N,j="";const{implementation:S,createNodeIterator:k,createDocumentFragment:C,getElementsByTagName:T}=s,{importNode:A}=n;let E=Ek();e.isSupported=typeof J3=="function"&&typeof w=="function"&&S&&S.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:L,ERB_EXPR:D,TMPLIT_EXPR:P,DATA_ATTR:R,ARIA_ATTR:$,IS_SCRIPT_OR_DATA:O,ATTR_WHITESPACE:_,CUSTOM_ELEMENT:B}=Tk;let{IS_ALLOWED_URI:J}=Tk,Q=null;const ce=Le({},[...kk,...Yg,...qg,...Kg,...Ck]);let fe=null;const X=Le({},[...Sk,...Jg,..._k,...Hh]);let pe=Object.seal(El(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),be=null,q=null;const le=Object.seal(El(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let De=!0,$e=!0,H=!1,he=!0,oe=!1,F=!0,Z=!1,de=!1,Ve=!1,Pe=!1,z=!1,ye=!1,ve=!0,ze=!1;const Kt="user-content-";let zt=!0,sn=!1,hr={},hs=null;const io=Le({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let bh=null;const yh=Le({},["audio","video","img","source","image","track"]);let oo=null;const vh=Le({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fl="http://www.w3.org/1998/Math/MathML",pl="http://www.w3.org/2000/svg",Vn="http://www.w3.org/1999/xhtml";let ha=Vn,G=!1,Se=null;const Ye=Le({},[fl,pl,Vn],Gg);let nn=Le({},["mi","mo","mn","ms","mtext"]),rn=Le({},["annotation-xml"]);const ma=Le({},["title","style","font","a","script"]);let Ya=null;const qc=["application/xhtml+xml","text/html"],ej="text/html";let Jt=null,xl=null;const GP=s.createElement("form"),tj=function(I){return I instanceof RegExp||I
vendor: 11,903 bytes, lines 710-711
710instanceof Function},Kx=function(){let I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(xl&&xl===I)return;(!I||typeof I!="object")&&(I={}),I=on(I),Ya=qc.indexOf(I.PARSER_MEDIA_TYPE)===-1?ej:I.PARSER_MEDIA_TYPE,Jt=Ya==="application/xhtml+xml"?Gg:Td,Q=_t(I,"ALLOWED_TAGS")&&Fs(I.ALLOWED_TAGS)?Le({},I.ALLOWED_TAGS,Jt):ce,fe=_t(I,"ALLOWED_ATTR")&&Fs(I.ALLOWED_ATTR)?Le({},I.ALLOWED_ATTR,Jt):X,Se=_t(I,"ALLOWED_NAMESPACES")&&Fs(I.ALLOWED_NAMESPACES)?Le({},I.ALLOWED_NAMESPACES,Gg):Ye,oo=_t(I,"ADD_URI_SAFE_ATTR")&&Fs(I.ADD_URI_SAFE_ATTR)?Le(on(vh),I.ADD_URI_SAFE_ATTR,Jt):vh,bh=_t(I,"ADD_DATA_URI_TAGS")&&Fs(I.ADD_DATA_URI_TAGS)?Le(on(yh),I.ADD_DATA_URI_TAGS,Jt):yh,hs=_t(I,"FORBID_CONTENTS")&&Fs(I.FORBID_CONTENTS)?Le({},I.FORBID_CONTENTS,Jt):io,be=_t(I,"FORBID_TAGS")&&Fs(I.FORBID_TAGS)?Le({},I.FORBID_TAGS,Jt):on({}),q=_t(I,"FORBID_ATTR")&&Fs(I.FORBID_ATTR)?Le({},I.FORBID_ATTR,Jt):on({}),hr=_t(I,"USE_PROFILES")?I.USE_PROFILES&&typeof I.USE_PROFILES=="object"?on(I.USE_PROFILES):I.USE_PROFILES:!1,De=I.ALLOW_ARIA_ATTR!==!1,$e=I.ALLOW_DATA_ATTR!==!1,H=I.ALLOW_UNKNOWN_PROTOCOLS||!1,he=I.ALLOW_SELF_CLOSE_IN_ATTR!==!1,oe=I.SAFE_FOR_TEMPLATES||!1,F=I.SAFE_FOR_XML!==!1,Z=I.WHOLE_DOCUMENT||!1,Pe=I.RETURN_DOM||!1,z=I.RETURN_DOM_FRAGMENT||!1,ye=I.RETURN_TRUSTED_TYPE||!1,Ve=I.FORCE_BODY||!1,ve=I.SANITIZE_DOM!==!1,ze=I.SANITIZE_NAMED_PROPS||!1,zt=I.KEEP_CONTENT!==!1,sn=I.IN_PLACE||!1,J=LV(I.ALLOWED_URI_REGEXP)?I.ALLOWED_URI_REGEXP:Q3,ha=typeof I.NAMESPACE=="string"?I.NAMESPACE:Vn,nn=_t(I,"MATHML_TEXT_INTEGRATION_POINTS")&&I.MATHML_TEXT_INTEGRATION_POINTS&&typeof I.MATHML_TEXT_INTEGRATION_POINTS=="object"?on(I.MATHML_TEXT_INTEGRATION_POINTS):Le({},["mi","mo","mn","ms","mtext"]),rn=_t(I,"HTML_INTEGRATION_POINTS")&&I.HTML_INTEGRATION_POINTS&&typeof I.HTML_INTEGRATION_POINTS=="object"?on(I.HTML_INTEGRATION_POINTS):Le({},["annotation-xml"]);const te=_t(I,"CUSTOM_ELEMENT_HANDLING")&&I.CUSTOM_ELEMENT_HANDLING&&typeof I.CUSTOM_ELEMENT_HANDLING=="object"?on(I.CUSTOM_ELEMENT_HANDLING):El(null);if(pe=El(null),_t(te,"tagNameCheck")&&tj(te.tagNameCheck)&&(pe.tagNameCheck=te.tagNameCheck),_t(te,"attributeNameCheck")&&tj(te.attributeNameCheck)&&(pe.attributeNameCheck=te.attributeNameCheck),_t(te,"allowCustomizedBuiltInElements")&&typeof te.allowCustomizedBuiltInElements=="boolean"&&(pe.allowCustomizedBuiltInElements=te.allowCustomizedBuiltInElements),oe&&($e=!1),z&&(Pe=!0),hr&&(Q=Le({},Ck),fe=El(null),hr.html===!0&&(Le(Q,kk),Le(fe,Sk)),hr.svg===!0&&(Le(Q,Yg),Le(fe,Jg),Le(fe,Hh)),hr.svgFilters===!0&&(Le(Q,qg),Le(fe,Jg),Le(fe,Hh)),hr.mathMl===!0&&(Le(Q,Kg),Le(fe,_k),Le(fe,Hh))),le.tagCheck=null,le.attributeCheck=null,_t(I,"ADD_TAGS")&&(typeof I.ADD_TAGS=="function"?le.tagCheck=I.ADD_TAGS:Fs(I.ADD_TAGS)&&(Q===ce&&(Q=on(Q)),Le(Q,I.ADD_TAGS,Jt))),_t(I,"ADD_ATTR")&&(typeof I.ADD_ATTR=="function"?le.attributeCheck=I.ADD_ATTR:Fs(I.ADD_ATTR)&&(fe===X&&(fe=on(fe)),Le(fe,I.ADD_ATTR,Jt))),_t(I,"ADD_URI_SAFE_ATTR")&&Fs(I.ADD_URI_SAFE_ATTR)&&Le(oo,I.ADD_URI_SAFE_ATTR,Jt),_t(I,"FORBID_CONTENTS")&&Fs(I.FORBID_CONTENTS)&&(hs===io&&(hs=on(hs)),Le(hs,I.FORBID_CONTENTS,Jt)),_t(I,"ADD_FORBID_CONTENTS")&&Fs(I.ADD_FORBID_CONTENTS)&&(hs===io&&(hs=on(hs)),Le(hs,I.ADD_FORBID_CONTENTS,Jt)),zt&&(Q["#text"]=!0),Z&&Le(Q,["html","head","body"]),Q.table&&(Le(Q,["tbody"]),delete be.tbody),I.TRUSTED_TYPES_POLICY){if(typeof I.TRUSTED_TYPES_POLICY.createHTML!="function")throw Uh('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof I.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Uh('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');N=I.TRUSTED_TYPES_POLICY,j=N.createHTML("")}else N===void 0&&(N=YV(f,a)),N!==null&&typeof j=="string"&&(j=N.createHTML(""));Ks&&Ks(I),xl=I},sj=Le({},[...Yg,...qg,...OV]),nj=Le({},[...Kg,...IV]),YP=function(I){let te=w(I);(!te||!te.tagName)&&(te={namespaceURI:ha,tagName:"template"});const we=Td(I.tagName),it=Td(te.tagName);return Se[I.namespaceURI]?I.namespaceURI===pl?te.namespaceURI===Vn?we==="svg":te.namespaceURI===fl?we==="svg"&&(it==="annotation-xml"||nn[it]):!!sj[we]:I.namespaceURI===fl?te.namespaceURI===Vn?we==="math":te.namespaceURI===pl?we==="math"&&rn[it]:!!nj[we]:I.namespaceURI===Vn?te.namespaceURI===pl&&!rn[it]||te.namespaceURI===fl&&!nn[it]?!1:!nj[we]&&(ma[we]||!sj[we]):!!(Ya==="application/xhtml+xml"&&Se[I.namespaceURI]):!1},mr=function(I){cd(e.removed,{element:I});try{w(I).removeChild(I)}catch{x(I)}},lo=function(I,te){try{cd(e.removed,{attribute:te.getAttributeNode(I),from:te})}catch{cd(e.removed,{attribute:null,from:te})}if(te.removeAttribute(I),I==="is")if(Pe||z)try{mr(te)}catch{}else try{te.setAttribute(I,"")}catch{}},rj=function(I){let te=null,we=null;if(Ve)I="<remove></remove>"+I;else{const Bt=vk(I,/^[\r\n\t ]+/);we=Bt&&Bt[0]}Ya==="application/xhtml+xml"&&ha===Vn&&(I='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+I+"</body></html>");const it=N?N.createHTML(I):I;if(ha===Vn)try{te=new m().parseFromString(it,Ya)}catch{}if(!te||!te.documentElement){te=S.createDocument(ha,"template",null);try{te.documentElement.innerHTML=G?j:it}catch{}}const ks=te.body||te.documentElement;return I&&we&&ks.insertBefore(s.createTextNode(we),ks.childNodes[0]||null),ha===Vn?T.call(te,Z?"html":"body")[0]:Z?te.documentElement:ks},aj=function(I){return k.call(I.ownerDocument||I,I,d.SHOW_ELEMENT|d.SHOW_COMMENT|d.SHOW_TEXT|d.SHOW_PROCESSING_INSTRUCTION|d.SHOW_CDATA_SECTION,null)},Jx=function(I){return I instanceof h&&(typeof I.nodeName!="string"||typeof I.textContent!="string"||typeof I.removeChild!="function"||!(I.attributes instanceof u)||typeof I.removeAttribute!="function"||typeof I.setAttribute!="function"||typeof I.namespaceURI!="string"||typeof I.insertBefore!="function"||typeof I.hasChildNodes!="function")},Qx=function(I){return typeof l=="function"&&I instanceof l};function fa(_e,I,te){ld(_e,we=>{we.call(e,I,te,xl)})}const ij=function(I){let te=null;if(fa(E.beforeSanitizeElements,I,null),Jx(I))return mr(I),!0;const we=Jt(I.nodeName);if(fa(E.uponSanitizeElement,I,{tagName:we,allowedTags:Q}),F&&I.hasChildNodes()&&!Qx(I.firstElementChild)&&ms(/<[/\w!]/g,I.innerHTML)&&ms(/<[/\w!]/g,I.textContent)||F&&I.namespaceURI===Vn&&we==="style"&&Qx(I.firstElementChild)||I.nodeType===ud.progressingInstruction||F&&I.nodeType===ud.comment&&ms(/<[/\w]/g,I.data))return mr(I),!0;if(be[we]||!(le.tagCheck instanceof Function&&le.tagCheck(we))&&!Q[we]){if(!be[we]&&lj(we)&&(pe.tagNameCheck instanceof RegExp&&ms(pe.tagNameCheck,we)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(we)))return!1;if(zt&&!hs[we]){const it=w(I)||I.parentNode,ks=y(I)||I.childNodes;if(ks&&it){const Bt=ks.length;for(let an=Bt-1;an>=0;--an){const Un=g(ks[an],!0);it.insertBefore(Un,b(I))}}}return mr(I),!0}return I instanceof c&&!YP(I)||(we==="noscript"||we==="noembed"||we==="noframes")&&ms(/<\/no(script|embed|frames)/i,I.innerHTML)?(mr(I),!0):(oe&&I.nodeType===ud.text&&(te=I.textContent,ld([L,D,P],it=>{te=wl(te,it," ")}),I.textContent!==te&&(cd(e.removed,{element:I.cloneNode()}),I.textContent=te)),fa(E.afterSanitizeElements,I,null),!1)},oj=function(I,te,we){if(q[te]||ve&&(te==="id"||te==="name")&&(we in s||we in GP))return!1;const it=fe[te]||le.attributeCheck instanceof Function&&le.attributeCheck(te,I);if(!($e&&!q[te]&&ms(R,te))){if(!(De&&ms($,te))){if(!it||q[te]){if(!(lj(I)&&(pe.tagNameCheck instanceof RegExp&&ms(pe.tagNameCheck,I)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(I))&&(pe.attributeNameCheck instanceof RegExp&&ms(pe.attributeNameCheck,te)||pe.attributeNameCheck instanceof Function&&pe.attributeNameCheck(te,I))||te==="is"&&pe.allowCustomizedBuiltInElements&&(pe.tagNameCheck instanceof RegExp&&ms(pe.tagNameCheck,we)||pe.tagNameCheck instanceof Function&&pe.tagNameCheck(we))))return!1}else if(!oo[te]){if(!ms(J,wl(we,_,""))){if(!((te==="src"||te==="xlink:href"||te==="href")&&I!=="script"&&wk(we,"data:")===0&&bh[I])){if(!(H&&!ms(O,wl(we,_,"")))){if(we)return!1}}}}}}return!0},qP=Le({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),lj=function(I){return!qP[Td(I)]&&ms(B,I)},cj=function(I){fa(E.beforeSanitizeAttributes,I,null);const{attributes:te}=I;if(!te||Jx(I))return;const we={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:fe,forceKeepAttr:void 0};let it=te.length;for(;it--;){const ks=te[it],{name:Bt,namespaceURI:an,value:Un}=ks,fr=Jt(Bt),Xx=Un;let ss=Bt==="value"?Xx:EV(Xx);if(we.attrName=fr,we.attrValue=ss,we.keepAttr=!0,we.forceKeepAttr=void 0,fa(E.uponSanitizeAttribute,I,we),ss=we.attrValue,ze&&(fr==="id"||fr==="name")&&wk(ss,Kt)!==0&&(lo(Bt,I),ss=Kt+ss),F&&ms(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,ss)){lo(Bt,I);continue}if(fr==="attributename"&&vk(ss,"href")){lo(Bt,I);continue}if(we.forceKeepAttr)continue;if(!we.keepAttr){lo(Bt,I);continue}if(!he&&ms(/\/>/i,ss)){lo(Bt,I);continue}oe&&ld([L,D,P],hj=>{ss=wl(ss,hj," ")});const uj=Jt(I.nodeName);if(!oj(uj,fr,ss)){lo(Bt,I);continue}if(N&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!an)switch(f.getAttributeType(uj,fr)){case"TrustedHTML":{ss=N.createHTML(ss);break}case"TrustedScriptURL":{ss=N.createScriptURL(ss);break}}if(ss!==Xx)try{an?I.setAttributeNS(an,Bt,ss):I.setAttribute(Bt,ss),Jx(I)?mr(I):yk(e.removed)}catch{lo(Bt,I)}}fa(E.afterSanitizeAttributes,I,null)},dj=function(I){let te=null;const we=aj(I);for(fa(E.beforeSanitizeShadowDOM,I,null);te=we.nextNode();)fa(E.uponSanitizeShadowNode,te,null),ij(te),cj(te),te.content instanceof i&&dj(te.content);fa(E.afterSanitizeShadowDOM,I,null)};return e.sanitize=function(_e){let I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},te=null,we=null,it=null,ks=null;if(G=!_e,G&&(_e="<!-->"),typeof _e!="string"&&!Qx(_e)&&(_e=RV(_e),typeof _e!="string"))throw Uh("dirty is not a string, aborting");if(!e.isSupported)return _e;if(de||Kx(I),e.removed=[],typeof _e=="string"&&(sn=!1),sn){const Un=_e.nodeName;if(typeof Un=="string"){const fr=Jt(Un);if(!Q[fr]||be[fr])throw Uh("root node is forbidden and cannot be sanitized in-place")}}else if(_e instanceof l)te=rj("<!---->"),we=te.ownerDocument.importNode(_e,!0),we.nodeType===ud.element&&we.nodeName==="BODY"||we.nodeName==="HTML"?te=we:te.appendChild(we);else{if(!Pe&&!oe&&!Z&&_e.indexOf("<")===-1)return N&&ye?N.createHTML(_e):_e;if(te=rj(_e),!te)return Pe?null:ye?j:""}te&&Ve&&mr(te.firstChild);const Bt=aj(sn?_e:te);for(;it=Bt.nextNode();)ij(it),cj(it),it.content instanceof i&&dj(it.content);if(sn)return _e;if(Pe){if(oe){te.normalize();let Un=te.innerHTML;ld([L,D,P],fr=>{Un=wl(Un,fr," ")}),te.innerHTML=Un}if(z)for(ks=C.call(te.ownerDocument);te.firstChild;)ks.appendChild(te.firstChild);else ks=te;return(fe.shadowroot||fe.shadowrootmode)&&(ks=A.call(n,ks,!0)),ks}let an=Z?te.outerHTML:te.innerHTML;return Z&&Q["!doctype"]&&te.ownerDocument&&te.ownerDocument.doctype&&te.ownerDocument.doctype.name&&ms(X3,te.ownerDocument.doctype.name)&&(an="<!DOCTYPE "+te.ownerDocument.doctype.name+`> 711`+an),oe&&ld([L,D,P],Un=>{an=wl(an,Un," ")}),N&&ye?N.createHTML(an):an},e.setConfig=function(){let _e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Kx(_e),de=!0},e.clearConfig=function(){xl=null,de=!1},e.isValidAttribute=function(_e,I,te){xl||Kx({});const we=Jt(_e),it=Jt(I);return oj(we,it,te)},e.addHook=function(_e,I){typeof I=="function"&&cd(E[_e],I)},e.removeHook=function(_e,I){if(I!==void 0){const te=_V(E[_e],I);return te===-1?void 0:TV(E[_e],te,1)[0]}return yk(E[_e])},e.removeHooks=function(_e){E[_e]=[]},e.removeAllHooks=function(){E=Ek()},e}var un=Z3();function qV(t){return t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2)}function Mk(t){if(!t)return null;const e=t.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([^&?\s]+)/);return e?e[1]:null}function KV(){const{id:t}=al(),[e,s]=v.useState(null),[n,a]=v.useState(!0),[i,o]=v.useState("");
711if(v.useEffect(()=>{U(`/api/advisory-board/${t}`).then(c=>s(c.member)).catch(()=>o("Member not found")).finally(()=>a(!1))},[t]),n)return r.jsx("div",{className:"min-h-[60vh] flex items-center justify-center bg-white",children:r.jsx("div",{className:"h-8 w-8 border-2 border-[#c08a2f] border-t-transparent rounded-full animate-spin"})});if(i||!e)return r.jsxs("div",{className:"min-h-[60vh] flex flex-col items-center justify-center bg-white gap-4",children:[r.jsx("p",{className:"text-slate-600",children:i||"Member not found"}),r.jsx(K,{to:"/about/advisory-board",className:"text-[#c08a2f] hover:underline text-sm",children:"â Back to Advisory Board"})]});const l=[e.role_title,e.company].filter(Boolean).join(", ");return r.jsxs("div",{className:"bg-white text-[rgb(var(--fg))]",children:[r.jsxs("section",{className:"relative w-full h-[200px] md:h-[260px] overflow-hidden bg-[#1f0f3f]",children:[r.jsx("img",{src:"/Introducing_Our _New Board Members_20260407_201616_0000.png",alt:"",className:"w-full h-full object-cover",onError:c=>{c.currentTarget.style.display="none"}}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#1f0f3f]/80 to-[#1f0f3f]/30"}),r.jsx("div",{className:"absolute inset-0 flex items-end",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 pb-8 w-full",children:[r.jsxs(K,{to:"/about/advisory-board",className:"inline-flex items-center gap-1.5 text-white/80 hover:text-white text-sm mb-3 transition",children:[r.jsx(vn,{className:"h-4 w-4"})," Advisory Board"]}),r.jsx("h1",{className:"text-2xl md:text-4xl font-bold text-white drop-shadow-lg",children:e.name})]})})]}),r.jsxs("section",{className:"max-w-4xl mx-auto px-4 md:px-6 py-12 md:py-16",children:[r.jsxs(V.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},className:"flex flex-col md:flex-row gap-8 items-start",children:[r.jsx("div",{className:"w-48 h-48 rounded-full overflow-hidden border-4 border-[#c08a2f]/40 shadow-lg bg-slate-100 flex-shrink-0 mx-auto md:mx-0",children:e.photo_url?r.jsx("img",{src:e.photo_url,alt:e.name,className:"w-full h-full object-cover",onError:c=>{c.currentTarget.style.display="none"}}):r.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-[#1f0f3f] to-[#3a1f6f]",children:r.jsx("span",{className:"text-3xl font-bold text-white/80",children:qV(e.name)})})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("h2",{className:"text-2xl font-bold text-slate-900",children:e.name}),e.chair_title&&r.jsx("p",{className:"text-sm font-bold text-[#c08a2f] mt-1",children:e.chair_title}),l&&r.jsx("p",{className:"text-slate-600 mt-2 leading-snug",children:l}),r.jsx("div",{className:"flex items-center gap-3 mt-4",children:e.linkedin_url&&r.jsxs("a",{href:e.linkedin_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-medium text-[#0077b5] hover:text-[#005f8d] transition",children:[r.jsx(bn,{className:"h-4 w-4"})," LinkedIn"]})}),e.bio_html&&r.jsx("div",{className:"mt-8 prose prose-slate max-w-none text-[15px] leading-relaxed",dangerouslySetInnerHTML:{__html:un.sanitize(e.bio_html)}})]})]}),e.video_url&&Mk(e.video_url)&&r.jsxs(V.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.5},className:"mt-12",children:[r.jsx("h3",{className:"text-xl font-bold text-slate-900 mb-4",children:"Video Bio"}),r.jsx("div",{className:"rounded-2xl overflow-hidden shadow-lg bg-black aspect-video",children:r.jsx("iframe",{src:`https://www.youtube.com/embed/${Mk(e.video_url)}`,title:`${e.name} - Video Bio`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full"})})]})]})]})}const JV=[{name:"Cynthia Lareine",role:"Co-Founder",photo:"/TeamPhotos/CynthiaLareine.jpg",linkedin:"https://www.linkedin.com/in/cynthia-lareine-33941018/",instagram:"https://www.instagram.com/adaora75/"},{name:"Nankunda Katangaza",role:"Co-Founder",photo:"/TeamPhotos/NankundaKatangaza.jpg",linkedin:"https://www.linkedin.com/in/nankunda-katangaza-7b82808/",instagram:null},{name:"Oladimeji Balogun",role:"Community & Marketing Manager",photo:"/TeamPhotos/OladimejiBalogun.jpg",linkedin:"https://www.linkedin.com/in/balogun-oladimeji-21070a192/",instagram:"https://www.instagram.com/thisisdmj/"}],Ak={hidden:{opacity:0,y:20},visible:(t=0)=>({opacity:1,y:0,transition:{delay:t,duration:.5}})};function QV(){return r.jsx("div",{className:"bg-white text-[rgb(var(--fg))]",children:r.jsx("section",{className:"bg-slate-50 py-16 md:py-20",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[r.jsx(V.h2,{initial:"hidden",
711whileInView:"visible",viewport:{once:!0},variants:Ak,custom:0,className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] text-center mb-12",children:"ACGC Team"}),r.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-8 max-w-4xl mx-auto",children:JV.map((t,e)=>r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Ak,custom:e*.1,className:"flex flex-col items-center text-center",children:[r.jsx("div",{className:"w-full aspect-[3/4] rounded-xl overflow-hidden border-4 border-[#c08a2f]/40 shadow-lg mb-4 bg-slate-100",children:r.jsx("img",{src:t.photo,alt:t.name,className:"w-full h-full object-cover",onError:s=>{s.currentTarget.style.display="none"}})}),r.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:t.name}),r.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:t.role}),r.jsxs("div",{className:"flex gap-2 mt-3",children:[t.linkedin&&r.jsx("a",{href:t.linkedin,target:"_blank",rel:"noopener noreferrer",className:"h-8 w-8 rounded-full bg-[#c08a2f] hover:bg-[#a77324] text-white flex items-center justify-center transition",children:r.jsx(bn,{className:"h-4 w-4"})}),t.instagram&&r.jsx("a",{href:t.instagram,target:"_blank",rel:"noopener noreferrer",className:"h-8 w-8 rounded-full bg-[#c08a2f] hover:bg-[#a77324] text-white flex items-center justify-center transition",children:r.jsx(oh,{className:"h-4 w-4"})})]})]},t.name))})]})})})}const XV="/ACGC%20Membership%20Brochure%202026.pdf",ZV=[{category:"Africa-based in-house lawyers",who:"In-house counsel lawyers working in Africa, including General Counsel, Heads of Legal and legal operations professionals",fee:"120",adminFee:"25"},{category:"Public sector / government counsel",who:"Lawyers employed directly by government ministries, departments, agencies or public institutions in Africa",fee:"85",adminFee:"10"},{category:"Early-career in-house lawyers (0â3 years)",who:"Lawyers in their first three years of in-house or government legal practice",fee:"60",adminFee:"15"},{category:"International Africa-focused in-house lawyers",who:"In-house lawyers based outside Africa with professional responsibility for Africa or African markets",fee:"200",adminFee:"30"}],Qg={hidden:{opacity:0,y:20},visible:(t=0)=>({opacity:1,y:0,transition:{delay:t,duration:.5}})};function Xg({title:t,children:e,defaultOpen:s=!1}){const[n,a]=v.useState(s);return r.jsxs("div",{className:"border border-slate-200 rounded-xl overflow-hidden",children:[r.jsxs("button",{onClick:()=>a(!n),className:"w-full px-6 py-4 flex items-center justify-between bg-slate-50 hover:bg-slate-100 transition text-left",children:[r.jsx("span",{className:"font-semibold text-[#1f0f3f]",children:t}),r.jsx(ht,{className:`h-5 w-5 text-slate-500 transition-transform ${n?"rotate-180":""}`})]}),n&&r.jsx("div",{className:"px-6 py-5 bg-white",children:e})]})}function eU(){return r.jsxs("div",{className:"bg-white text-[rgb(var(--fg))]",children:[r.jsx("section",{id:"membership",className:"bg-slate-50 py-16 md:py-20",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Qg,custom:0,className:"text-center mb-10",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-4",children:"Membership Options & Fees"}),r.jsx("p",{className:"text-slate-600 max-w-3xl mx-auto",children:"ACGC offers both individual and institutional membership pathways designed to reflect different professional contexts and organisational structures."})]}),r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Qg,custom:.1,className:"space-y-4",children:[r.jsxs(Xg,{title:"Individual Membership",defaultOpen:!0,children:[r.jsx("p",{className:"text-slate-600 mb-6",children:"Individual ACGC membership is designed for in-house and government lawyers who wish to actively participate in Africa's leading professional community for in-house legal leadership. Membership provides access to learning, peer exchange, professional visibility and leadership opportunities within a trusted pan-African platform."}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full text-sm border-collapse",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"bg-[#1f0f3f] text-white",children:[r.jsx("th",{className:"px-4 py-3 text-left font-semibold",children:"Membership category"}),r.jsx("th",{className:"px-4 py-3 text-left font-semibold",children:"Who this is for"}),r.jsx("th",{className:"px-4 py-3 text-center font-semibold whitespace-nowrap",children:"Annual fee (USD)"}),r.jsx("th",{className:"px-4 py-3 text-center font-semibold whitespace-nowrap",children:"Application / Admin Fee (USD)"})]})}),r.jsx("tbody",{children:ZV.map((t,e)=>r.jsxs("tr",{className:e%2===0?"bg-slate-50":"bg-white",children:[r.jsx("td",{className:"px-4 py-3 font-medium text-slate-900",children:t.category}),r.jsx("td",{className:"px-4 py-3 text-slate-600",children:t.who}),r.jsx("td",{className:"px-4 py-3 text-center font-semibold text-[#1f0f3f]",children:t.fee}),r.jsx("td",{className:"px-4 py-3 text-center text-slate-600",children:t.adminFee})]},e))})]})}),r.jsxs("div",{className:"mt-4 text-xs text-slate-500 space-y-1",children:[r.jsx("p",{children:"*Individual membership is personal to the named member and cannot be transferred."}),r.jsx("p",{children:"*One-off application/admin fee applies."}),r.jsx("p",{children:"*Membership year runs from March to end February."})]}),r.jsx("div",{className:"mt-6",children:r.jsx(K,{to:"/join",className:"inline-flex items-center justify-center px-5 py-2.5 rounded-lg bg-[#c08a2f] hover:bg-[#a
71177324] text-white font-semibold text-sm transition",children:"Apply for Individual Membership"})})]}),r.jsxs(Xg,{title:"Corporate Legal Departments",children:[r.jsx("p",{className:"text-slate-600 mb-4",children:"Corporate Legal Department membership is designed for legal teams of three or more lawyers seeking structured institutional access to ACGC, flexibility to rotate nominated members, and enhanced value through team-based participation in learning, events and community engagement."}),r.jsx("p",{className:"text-2xl font-bold text-[#1f0f3f] mb-2",children:"From USD 600 â USD 4,000+ per year"}),r.jsx("p",{className:"text-slate-600 mb-6",children:"Pricing reflects department size and participation structure. Organisations may update nominated members during the membership year to reflect internal role changes."}),r.jsx("a",{href:"mailto:[email protected]?subject=Corporate%20Membership%20Enquiry",className:"inline-flex items-center justify-center px-5 py-2.5 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold text-sm transition",children:"Enquire About Corporate Membership"})]}),r.jsxs(Xg,{title:"Government Legal Departments",children:[r.jsx("p",{className:"text-slate-600 mb-4",children:"Government Legal Department membership is designed for ministries, departments, agencies and public institutions sponsoring multiple legal professionals to participate in ACGC through a structured departmental membership aligned to public-sector needs."}),r.jsx("p",{className:"text-2xl font-bold text-[#1f0f3f] mb-1",children:"From USD 500 per year"}),r.jsx("p",{className:"text-sm text-slate-500 mb-4",children:"(Custom pricing available for larger departments)"}),r.jsx("p",{className:"text-slate-600 mb-6",children:"Organisations may update nominated members during the membership year to reflect internal role changes."}),r.jsx("a",{href:"mailto:[email protected]?subject=Government%20Membership%20Enquiry",className:"inline-flex items-center justify-center px-5 py-2.5 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold text-sm transition",children:"Enquire About Government Membership"})]})]}),r.jsx("div",{className:"text-center mt-10",children:r.jsx(K,{to:"/join",className:"inline-flex items-center justify-center px-6 py-3 rounded-lg bg-[#1f0f3f] hover:bg-[#2a1654] text-white font-semibold transition shadow-md",children:"Apply for Membership"})})]})}),r.jsx("section",{className:"max-w-4xl mx-auto px-4 md:px-6 py-16 md:py-20",children:r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Qg,custom:0,className:"bg-gradient-to-br from-[#1f0f3f] to-[#2a1654] rounded-3xl p-8 md:p-12 text-center",children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-white mb-2",children:"ACGC Membership Handbook 2026"}),r.jsx("p",{className:"text-[#e6c784] font-medium mb-4",children:"Benefits, Eligibility & Pricing Framework"}),r.jsx("p",{className:"text-white/80 max-w-2xl mx-auto mb-6",children:"The Handbook sets out the full 2026 membership framework, including categories, pricing, participation privileges and governance structure."}),r.jsxs("ul",{className:"text-left max-w-md mx-auto text-white/90 text-sm space-y-2 mb-8",children:[r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Membership categories and eligibility"]}),r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Corporate and government department tiers"]}),r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Annual membership and application fees"]}),r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Core benefits and participation framework"]}),r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx("span",{className:"text-[#e6c784]",children:"â¢"}),"Membership year cycle (March 2026 â February 2027)"]})]}),r.jsxs("a",{href:XV,download:!0,className:"inline-flex items-center gap-2 px-6 py-3 rounded-lg bg-[#c08a2f] hover:bg-[#a
71177324] text-white font-semibold transition shadow-lg",children:[r.jsx(Ys,{className:"h-5 w-5"}),"Download the Handbook"]})]})})]})}const Nn={hidden:{opacity:0,y:20},visible:(t=0)=>({opacity:1,y:0,transition:{delay:t,duration:.5}})},tU=["USD","GBP","EUR","ZAR"],sU=[{label:"Online courses",examples:"e.g. Compliance Essentials, ACORP",range:"$100 â $300 USD"},{label:"In-person events",examples:"e.g. the Annual Conference",range:"$400 â $600 USD"}],nU=[{icon:Hi,title:"Champion",desc:"Champion equity and access across Africa's legal ecosystem."},{icon:E7,title:"Support",desc:"Support professionals with limited institutional support."},{icon:fy,title:"Build",desc:"Build your leadership legacy."}],eM=[{key:"nominate_sponsor",icon:at,title:"Nominate & Sponsor",desc:"Support someone you know. ACGC confirms their eligibility and handles the logistics."},{key:"open_contribution",icon:N7,title:"Open Contribution",desc:"Don't have someone specific in mind? ACGC can match your contribution with a vetted, eligible applicant."},{key:"multiple_sponsorship",icon:D7,title:"Multiple Sponsorships",desc:"Individuals, teams or organisations can support more than one person, with ACGC helping to coordinate this."}],rU={online_course:"Online Course",in_person_event:"In-Person Event",fellowship:"Fellowship",other:"Programme"},xt="w-full border border-slate-200 rounded-lg px-3 py-2 text-sm text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40 focus:border-[#c08a2f] bg-white",mt=({children:t,required:e})=>r.jsxs("label",{className:"block text-xs font-semibold text-slate-700 mb-1",children:[t,e&&r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]});function aU(){const[t,e]=eo(),[s,n]=v.useState([]),[a,i]=v.useState(!0),[o,l]=v.useState(!1),[c,d]=v.useState("open_contribution"),[u,h]=v.useState(!1),m=t.get("status"),f=t.get("ref");v.useEffect(()=>{let w=!1;return U("/api/lift/programmes").then(N=>{w||n(N.programmes||[])}).catch(()=>{}).finally(()=>{w||i(!1)}),()=>{w=!0}},[]);const p=()=>{const w=new URLSearchParams(t);w.delete("status"),w.delete("ref"),w.delete("cid"),e(w,{replace:!0})},g=w=>{d(w||"open_contribution"),l(!0)},x=v.useRef(null),{scrollYProgress:b}=Bw({target:x,offset:["start start","end start"]}),y=F3(b,[0,1],["0%","20%"]);return r.jsxs("div",{className:"bg-white text-[rgb(var(--fg))]",children:[m==="success"&&r.jsx("div",{className:"bg-emerald-600 text-white",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-3 flex items-center justify-between gap-3 flex-wrap text-sm",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(ls,{className:"h-5 w-5 shrink-0"}),r.jsxs("span",{children:["Thank you â your LIFT contribution was received",f?` (Ref: ${f})`:"",". A confirmation email is on its way."]})]}),r.jsx("button",{onClick:p,className:"text-white/80 hover:text-white",children:r.jsx(He,{className:"h-4 w-4"})})]})}),m==="cancelled"&&r.jsx("div",{className:"bg-slate-800 text-white",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 py-3 flex items-center justify-between gap-3 flex-wrap text-sm",children:[r.jsx("span",{children:"Your payment was cancelled â no charge was made. You can try again whenever you're ready."}),r.jsx("button",{onClick:p,className:"text-white/80 hover:text-white",children:r.jsx(He,{className:"h-4 w-4"})})]})}),r.jsxs("section",{ref:x,className:"relative w-full overflow-hidden",children:[r.jsx(V.img,{style:{y},src:"/lift-banner.png",alt:"ACGC L.I.F.T. â Leadership Initiative for Future Talent. Better Leaders, A Brighter Tomorrow.",className:"w-full h-auto block scale-110"}),r.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex flex-col items-center gap-1.5 text-white/70",children:[r.jsx("span",{className:"text-xs",children:"Scroll"}),r.jsx(ht,{className:"h-4 w-4 animate-bounce"})]})]}),r.jsx("section",{className:"bg-[#1f0f3f] text-white py-14 md:py-16 px-4",children:r.jsxs(V.div,{initial:"hidden",animate:"visible",variants:Nn,custom:0,className:"max-w-4xl mx-auto text-center",children:[r.jsx("p",{className:"text-sm font-semibold tracking-widest uppercase text-[#e8c76c] mb-3",children:"ACGC LIFT"}),r.jsx("p",{className:"text-lg md:text-xl text-white/80 italic mb-8",children:'"We Rise by Lifting Others"'}),r.jsx("p",{className:"text-white/70 max-w-2xl mx-auto mb-10 leading-relaxed",children:"ACGC LIFT is how members of the ACGC community, legal professionals in the diaspora, and others with a personal or professional connection to Africa give back â investing directly in the continent's next generation of legal leaders."}),r.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[r.jsxs("button",{onClick:()=>g("open_contribution"),className:"inline-flex items-center gap-2 px-6 py-3 rounded-full bg-[#c08a2f] hover:bg-[#a
71177324] text-white font-semibold transition",children:["Support Through LIFT ",r.jsx(nt,{className:"h-4 w-4"})]}),r.jsx("a",{href:"#programmes",className:"inline-flex items-center gap-2 px-6 py-3 rounded-full border border-white/30 hover:bg-white/10 text-white font-semibold transition",children:"Explore LIFT Programmes"})]})]})}),r.jsx("section",{className:"py-16 md:py-20 px-4 bg-slate-50",children:r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:0,className:"text-center mb-12",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-4",children:"Two Ways to Be Part of LIFT"}),r.jsx("p",{className:"text-slate-600 max-w-2xl mx-auto",children:"Every contribution counts, and you don't need to personally know a beneficiary to support one."})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:.1,className:"bg-white rounded-2xl border border-slate-200 p-8 flex flex-col",children:[r.jsx("h3",{className:"text-xl font-bold text-[#1f0f3f] mb-3",children:"For Those Who Want to Support"}),r.jsx("p",{className:"text-slate-600 mb-6 flex-1",children:"Individuals, legal departments, law firms, governments and others who want to help emerging African in-house counsel participate in ACGC programmes."}),r.jsx("button",{onClick:()=>g("open_contribution"),className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold text-sm transition self-start",children:"Support Through LIFT"})]}),r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:.2,className:"bg-white rounded-2xl border border-slate-200 p-8 flex flex-col",children:[r.jsx("h3",{className:"text-xl font-bold text-[#1f0f3f] mb-3",children:"For Those Who Need Support"}),r.jsx("p",{className:"text-slate-600 mb-6 flex-1",children:"African in-house counsel who would otherwise be unable to participate in relevant ACGC flagship programmes."}),r.jsx("button",{onClick:()=>h(!0),className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 rounded-lg border-2 border-[#1f0f3f] text-[#1f0f3f] hover:bg-[#1f0f3f] hover:text-white font-semibold text-sm transition self-start",children:"Apply for Support"})]})]})]})}),r.jsx("section",{className:"py-16 md:py-20 px-4",children:r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsx(V.h2,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:0,className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] text-center mb-12",children:"Why LIFT?"}),r.jsx("div",{className:"grid sm:grid-cols-3 gap-6",children:nU.map((w,N)=>r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:.1*N,className:"text-center bg-slate-50 rounded-2xl p-8 border border-slate-100",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-12 w-12 rounded-full bg-[#c08a2f]/10 mb-4",children:r.jsx(w.icon,{className:"h-6 w-6 text-[#c08a2f]"})}),r.jsx("h3",{className:"text-lg font-bold text-[#1f0f3f] mb-2",children:w.title}),r.jsx("p",{className:"text-slate-600 text-sm",children:w.desc})]},w.title))})]})}),r.jsx("section",{className:"py-16 md:py-20 px-4 bg-slate-50",children:r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:0,className:"text-center mb-12",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-4",children:"How Can People Support?"}),r.jsx("p",{className:"text-slate-600 max-w-2xl mx-auto",children:"There are three current ways to participate."})]}),r.jsx("div",{className:"grid md:grid-cols-3 gap-6",children:eM.map((w,N)=>r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:.1*N,className:"bg-white rounded-2xl border border-slate-200 p-7 flex flex-col",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-11 w-11 rounded-full bg-[#1f0f3f]/5 mb-4",children:r.jsx(w.icon,{className:"h-5 w-5 text-[#1f0f3f]"})}),r.jsx("h3",{className:"text-lg font-bold text-[#1f0f3f] mb-2",children:w.title}),r.jsx("p",{className:"text-slate-600 text-sm mb-6 flex-1",children:w.desc}),r.jsxs("button",{onClick:()=>g(w.key),className:"text-sm font-semibold text-[#c08a2f] hover:text-[#a77324] inline-flex items-center gap-1 self-start",children:["Support this way ",r.jsx(nt,{className:"h-3.5 w-3.5"})]})]},w.key))})]})}),r.jsx("section",{className:"py-16 md:py-20 px-4",children:r.jsxs("div",{className:"max-w-4xl mx-auto",children:[r.jsxs(V.div,{initial:"hidden",
711whileInView:"visible",viewport:{once:!0},variants:Nn,custom:0,className:"text-center mb-10",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-4",children:"What Does a Contribution Fund?"}),r.jsx("p",{className:"text-slate-600 max-w-2xl mx-auto",children:"Costs vary by programme. You can fund a full place or make a smaller contribution â every amount goes directly toward helping an eligible delegate participate."})]}),r.jsx("div",{className:"grid sm:grid-cols-2 gap-6",children:sU.map((w,N)=>r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:.1*N,className:"bg-slate-50 rounded-2xl border border-slate-100 p-7",children:[r.jsx("p",{className:"text-sm font-semibold text-slate-500 mb-1",children:w.label}),r.jsx("p",{className:"text-sm text-slate-500 mb-3",children:w.examples}),r.jsx("p",{className:"text-2xl font-bold text-[#1f0f3f]",children:w.range})]},w.label))})]})}),r.jsx("section",{id:"programmes",className:"py-16 md:py-20 px-4 bg-slate-50 scroll-mt-24",children:r.jsxs("div",{className:"max-w-5xl mx-auto",children:[r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:0,className:"text-center mb-12",children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-4",children:"Current ACGC LIFT Programmes"}),r.jsx("p",{className:"text-slate-600 max-w-2xl mx-auto",children:"More programmes are added over time â check back for the latest opportunities to give or receive support."})]}),a?r.jsx("div",{className:"flex justify-center py-10",children:r.jsx($a,{className:"h-6 w-6 animate-spin text-[#c08a2f]"})}):s.length===0?r.jsx("div",{className:"text-center text-slate-500 py-10",children:"Programme details are being finalised â check back soon."}):r.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:s.map(w=>r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 p-7",children:[r.jsx("div",{className:"flex items-center gap-2 mb-3",children:r.jsx("span",{className:"text-[11px] font-semibold uppercase tracking-wide px-2.5 py-1 rounded-full bg-[#1f0f3f]/5 text-[#1f0f3f]",children:rU[w.category]||"Programme"})}),r.jsx("h3",{className:"text-lg font-bold text-[#1f0f3f] mb-2",children:w.name}),w.description&&r.jsx("p",{className:"text-slate-600 text-sm mb-3",children:w.description}),w.cost_note&&r.jsx("p",{className:"text-sm font-semibold text-[#c08a2f] mb-4",children:w.cost_note}),r.jsxs("div",{className:"flex flex-wrap gap-3",children:[w.application_url&&r.jsxs("a",{href:w.application_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-[#1f0f3f] hover:text-[#c08a2f]",children:["Apply ",r.jsx(ur,{className:"h-3.5 w-3.5"})]}),w.flyer_url&&r.jsxs("a",{href:w.flyer_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-slate-500 hover:text-slate-700",children:["View flyer ",r.jsx(es,{className:"h-3.5 w-3.5"})]}),r.jsxs("button",{onClick:()=>g("nominate_sponsor"),className:"inline-flex items-center gap-1.5 text-sm font-semibold text-[#c08a2f] hover:text-[#a77324] ml-auto",children:["Sponsor a place ",r.jsx(nt,{className:"h-3.5 w-3.5"})]})]})]},w.id))})]})}),r.jsx("section",{className:"py-16 md:py-20 px-4",children:r.jsx("div",{className:"max-w-3xl mx-auto text-center",children:r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:0,children:[r.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-[#1f0f3f] mb-4",children:"Supporting LIFT"}),r.jsxs("p",{className:"text-slate-600 mb-6",children:["Contributions are accepted in USD, GBP, EUR or ZAR and processed securely online. Every contribution is issued a reference in the format ",r.jsx("span",{className:"font-mono text-[#1f0f3f]",children:"LIFT-[YourName]-[Programme]"}),", so it's easy to track what your support went toward."]}),r.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[r.jsxs("button",{onClick:()=>g("open_contribution"),className:"inline-flex items-center gap-2 px-6 py-3 rounded-full bg-[#c08a2f] hover:bg-[#a
71177324] text-white font-semibold transition",children:["Support Through LIFT ",r.jsx(nt,{className:"h-4 w-4"})]}),r.jsxs("a",{href:"mailto:[email protected]?subject=ACGC%20LIFT%20Enquiry",className:"inline-flex items-center gap-2 px-6 py-3 rounded-full border border-slate-300 hover:bg-slate-50 text-[#1f0f3f] font-semibold transition",children:[r.jsx(Ft,{className:"h-4 w-4"})," [email protected]"]})]})]})})}),r.jsx("section",{className:"py-20 px-4 bg-[#1f0f3f] text-white text-center",children:r.jsxs(V.div,{initial:"hidden",whileInView:"visible",viewport:{once:!0},variants:Nn,custom:0,className:"max-w-2xl mx-auto",children:[r.jsx("p",{className:"text-sm font-semibold tracking-widest uppercase text-[#e8c76c] mb-3",children:"Get Involved & Make a Difference"}),r.jsx("h2",{className:"text-2xl md:text-3xl font-bold mb-8",children:"Support a colleague. Shape a career. Strengthen a community."}),r.jsxs("button",{onClick:()=>g("open_contribution"),className:"inline-flex items-center gap-2 px-7 py-3.5 rounded-full bg-[#c08a2f] hover:bg-[#a77324] text-white font-bold transition",children:["SUPPORT THROUGH LIFT ",r.jsx(nt,{className:"h-4 w-4"})]})]})}),r.jsx(ir,{children:o&&r.jsx(iU,{initialSupportType:c,programmes:s,onClose:()=>l(!1)})}),r.jsx(ir,{children:u&&r.jsx(oU,{programmes:s,onClose:()=>h(!1)})})]})}function iU({initialSupportType:t,programmes:e,onClose:s}){const[n,a]=v.useState({support_type:t||"open_contribution",payment_method:"card",contributor_name:"",contributor_organisation:"",contributor_email:"",contributor_phone:"",nominee_name:"",nominee_email:"",programme_choice:"",programme_other:"",num_sponsorships:2,currency:"USD",coverage_type:"full",amount:"",message:""}),[i,o]=v.useState(!1),[l,c]=v.useState(""),[d,u]=v.useState(null),[h,m]=v.useState(!1),f=(x,b)=>a(y=>({...y,[x]:b}));v.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const p=async x=>{if(x.preventDefault(),!n.contributor_name.trim())return c("Please enter your full name.");if(!n.contributor_email.trim())return c("Please enter your email address.");if(n.support_type==="nominate_sponsor"&&!n.nominee_name.trim())return c("Please enter the name of the person you're nominating.");const b=Number(n.amount);if(!b||b<=0)return c("Please enter a contribution amount.");o(!0),c("");try{const y={support_type:n.support_type,contributor_name:n.contributor_name.trim(),contributor_organisation:n.contributor_organisation.trim()||void 0,contributor_email:n.contributor_email.trim(),contributor_phone:n.contributor_phone.trim()||void 0,nominee_name:n.support_type==="nominate_sponsor"?n.nominee_name.trim():void 0,nominee_email:n.support_type==="nominate_sponsor"&&n.nominee_email.trim()||void 0,programme_id:n.programme_choice&&n.programme_choice!=="other"?Number(n.programme_choice):void 0,programme_other:n.programme_choice==="other"?n.programme_other.trim()||"General LIFT Support":void 0,num_sponsorships:n.support_type==="multiple_sponsorship"?Number(n.num_sponsorships):void 0,currency:n.currency,coverage_type:n.coverage_type,amount:b,message:n.message.trim()||void 0};if(n.payment_method==="bank_transfer"){const w=await U("/api/lift/contributions",{method:"POST",body:{...y,payment_method:"bank_transfer"}});u({referenceCode:w.reference_code,bankDetails:w.bank_details})}else{const w=await U("/api/lift/checkout",{method:"POST",body:y}
711);window.location.href=w.checkoutUrl;return}}catch(y){c((y==null?void 0:y.message)||"Something went wrong. Please try again.")}finally{o(!1)}},g=()=>{var x;d!=null&&d.referenceCode&&((x=navigator.clipboard)==null||x.writeText(d.referenceCode).then(()=>{m(!0),setTimeout(()=>m(!1),2e3)}))};return r.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 backdrop-blur-sm overflow-y-auto py-6 px-4",children:r.jsxs(V.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:24},transition:{duration:.25},className:"relative w-full max-w-xl bg-white rounded-2xl shadow-2xl",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-5 bg-[#1f0f3f] rounded-t-2xl",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[#e8c76c] text-xs font-bold uppercase tracking-widest mb-0.5",children:"ACGC LIFT"}),r.jsx("h2",{className:"text-white font-bold text-lg leading-tight",children:"Support Through LIFT"})]}),r.jsx("button",{onClick:s,className:"text-white/60 hover:text-white transition rounded-full p-1",children:r.jsx(He,{className:"h-5 w-5"})})]}),d?r.jsxs("div",{className:"px-6 py-8 text-center",children:[r.jsx(ls,{className:"h-10 w-10 text-emerald-500 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-bold text-[#1f0f3f] mb-2",children:"Pledge received â thank you"}),r.jsx("p",{className:"text-slate-600 text-sm mb-5",children:"Please transfer your contribution using the details below, quoting your reference. We'll confirm your contribution as soon as the transfer is received."}),r.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-lg p-4 text-left mb-4",children:[r.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-1",children:"Your reference"}),r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsx("span",{className:"font-mono text-[#1f0f3f] font-semibold",children:d.referenceCode}),r.jsx("button",{type:"button",onClick:g,className:"text-slate-400 hover:text-[#1f0f3f] transition shrink-0",children:h?r.jsx(is,{className:"h-4 w-4 text-emerald-500"}):r.jsx(U3,{className:"h-4 w-4"})})]})]}),r.jsxs("div",{className:"bg-slate-50 border border-slate-200 rounded-lg p-4 text-left mb-6",children:[r.jsx("p",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wide mb-2",children:"Bank transfer details"}),r.jsx("p",{className:"text-sm text-slate-700 whitespace-pre-line",children:d.bankDetails})]}),r.jsxs("p",{className:"text-xs text-slate-400 mb-6",children:["Once you've made the transfer, email your proof of payment to"," ",r.jsx("a",{href:`mailto:[email protected]?subject=LIFT%20Transfer%20-%20${encodeURIComponent(d.referenceCode)}`,className:"text-[#c08a2f] font-semibold",children:"[email protected]"})," ","referencing ",d.referenceCode,"."]}),r.jsx("button",{onClick:s,className:"px-5 py-2.5 rounded-lg bg-[#1f0f3f] text-white font-semibold text-sm",children:"Close"})]}):r.jsxs("form",{onSubmit:p,className:"px-6 py-6 space-y-5 max-h-[75vh] overflow-y-auto",children:[r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"How would you like to support?"}),r.jsx("select",{className:xt,value:n.support_type,onChange:x=>f("support_type",x.target.value),children:eM.map(x=>r.jsx("option",{value:x.key,children:x.title},x.key))})]}),r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"How would you like to pay?"}),r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("button",{type:"button",onClick:()=>f("payment_method","card"),className:`flex items-center gap-2 justify-center rounded-lg border-2 px-4 py-2.5 text-sm font-semibold transition ${n.payment_method==="card"?"border-[#c08a2f] bg-[#c08a2f]/5 text-[#1f0f3f]":"border-slate-200 text-slate-500 hover:border-slate-300"}`,children:[r.jsx(gi,{className:"h-4 w-4"})," Card (Stripe)"]}),r.jsxs("button",{type:"button",onClick:()=>f("payment_method","bank_transfer"),className:`flex items-center gap-2 justify-center rounded-lg border-2 px-4 py-2.5 text-sm font-semibold transition ${n.payment_method==="bank_transfer"?"border-[#c08a2f] bg-[#c08a2f]/5 text-[#1f0f3f]":"border-slate-200 text-slate-500 hover:border-slate-300"}`,children:[r.jsx(Hw,{className:"h-4 w-4"})," Bank transfer"]})]})]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"Your full name"}),r.jsx("input",{className:xt,value:n.contributor_name,onChange:x=>f("contributor_name",x.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Organisation"}),r.jsx("input",{className:xt,value:n.contributor_organisation,onChange:x=>f("contributor_organisation",x.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"Your email"}),r.jsx("input",{type:"email",className:xt,value:n.contributor_email,onChange:x=>f("contributor_email",x.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Phone"}),r.jsx("input",{className:xt,value:n.contributor_phone,onChange:x=>f("contributor_phone",x.target.value)})]})]}),n.support_type==="nominate_sponsor"&&r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4 bg-slate-50 rounded-lg p-4",children:[r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"Nominee's full name"}),r.jsx("input",{className:xt,value:n.nominee_name,onChange:x=>f("nominee_name",x.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Nominee's email"}),r.jsx("input",{type:"email",className:xt,value:n.nominee_email,onChange:x=>f("nominee_email",x.target.value)})]})]}),n.support_type==="multiple_sponsorship"&&r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"Number of sponsorships"}),r.jsx("input",{type:"number",min:2,className:xt,value:n.num_sponsorships,onChange:x=>f("num_sponsorships",x.target.value)})]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(mt,{children:"Programme"}),r.jsxs("select",{className:xt,value:n.programme_choice,onChange:x=>f("programme_choice",x.target.value),children:[r.jsx("option",{value:"",children:"General LIFT Support"}),e.map(x=>r.jsx("option",{value:x.id,children:x.name},x.id)),r.jsx("option",{value:"other",children:"Other (specify)"})]})]}),n.programme_choice==="other"&&r.jsxs("div",{children:[r.jsx(mt,{children:"Programme name"}),r.jsx("input",{className:xt,value:n.programme_other,onChange:x=>f("programme_other",x.target.value)})]})]}),r.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"Coverage"}
711),r.jsxs("select",{className:xt,value:n.coverage_type,onChange:x=>f("coverage_type",x.target.value),children:[r.jsx("option",{value:"full",children:"Full place"}),r.jsx("option",{value:"partial",children:"Partial contribution"})]})]}),r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"Currency"}),r.jsx("select",{className:xt,value:n.currency,onChange:x=>f("currency",x.target.value),children:tU.map(x=>r.jsx("option",{value:x,children:x},x))})]}),r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"Amount"}),r.jsx("input",{type:"number",min:1,step:"0.01",className:xt,value:n.amount,onChange:x=>f("amount",x.target.value)})]})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Message (optional)"}),r.jsx("textarea",{rows:3,className:xt,value:n.message,onChange:x=>f("message",x.target.value)})]}),l&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-100 rounded-lg px-3 py-2",children:l}),r.jsx("button",{type:"submit",disabled:i,className:"w-full inline-flex items-center justify-center gap-2 px-6 py-3 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] disabled:opacity-60 text-white font-semibold transition",children:i?r.jsxs(r.Fragment,{children:[r.jsx($a,{className:"h-4 w-4 animate-spin"})," ",n.payment_method==="bank_transfer"?"Recording your pledgeâ¦":"Redirecting to paymentâ¦"]}):n.payment_method==="bank_transfer"?r.jsxs(r.Fragment,{children:["Get Bank Transfer Details ",r.jsx(nt,{className:"h-4 w-4"})]}):r.jsxs(r.Fragment,{children:["Continue to Payment ",r.jsx(nt,{className:"h-4 w-4"})]})}),r.jsx("p",{className:"text-xs text-slate-400 text-center",children:n.payment_method==="bank_transfer"?"We'll show your reference and our account details next â no card required.":"You'll be redirected to Stripe to complete your contribution securely."})]})]})})}function oU({programmes:t,onClose:e}){const[s,n]=v.useState({full_name:"",email:"",phone:"",country:"",organisation:"",role_title:"",programme_choice:"",programme_interest:"",why_support:""}),[a,i]=v.useState(!1),[o,l]=v.useState(""),[c,d]=v.useState(!1),u=(m,f)=>n(p=>({...p,[m]:f}));v.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const h=async m=>{if(m.preventDefault(),!s.full_name.trim())return l("Please enter your full name.");if(!s.email.trim())return l("Please enter your email address.");i(!0),l("");try{await U("/api/lift/support-requests",{method:"POST",body:{full_name:s.full_name.trim(),email:s.email.trim(),phone:s.phone.trim()||void 0,country:s.country.trim()||void 0,organisation:s.organisation.trim()||void 0,role_title:s.role_title.trim()||void 0,programme_id:s.programme_choice&&s.programme_choice!=="other"?Number(s.programme_choice):void 0,programme_interest:s.programme_choice==="other"&&s.programme_interest.trim()||void 0,why_support:s.why_support.trim()||void 0}}),d(!0)}catch(f){l((f==null?void 0:f.message)||"Something went wrong. Please try again.")}finally{i(!1)}};return r.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 backdrop-blur-sm overflow-y-auto py-6 px-4",children:r.jsxs(V.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:24},transition:{duration:.25},className:"relative w-full max-w-xl bg-white rounded-2xl shadow-2xl",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-5 bg-[#1f0f3f] rounded-t-2xl",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[#e8c76c] text-xs font-bold uppercase tracking-widest mb-0.5",children:"ACGC LIFT"}),r.jsx("h2",{className:"text-white font-bold text-lg leading-tight",children:"Apply for Support"})]}),r.jsx("button",{onClick:e,className:"text-white/60 hover:text-white transition rounded-full p-1",children:r.jsx(He,{className:"h-5 w-5"})})]}),c?r.jsxs("div",{className:"px-6 py-10 text-center",children:[r.jsx(ls,{className:"h-10 w-10 text-emerald-500 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-bold text-[#1f0f3f] mb-2",children:"Application received"}),r.jsxs("p",{className:"text-slate-600 text-sm mb-6",children:["Thank you â the ACGC team will review your eligibility and be in touch at ",s.email,"."]}),r.jsx("button",{onClick:e,className:"px-5 py-2.5 rounded-lg bg-[#1f0f3f] text-white font-semibold text-sm",children:"Close"})]}):r.jsxs("form",{onSubmit:h,className:"px-6 py-6 space-y-5 max-h-[75vh] overflow-y-auto",children:[r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"Full name"}),r.jsx("input",{className:xt,value:s.full_name,onChange:m=>u("full_name",m.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{required:!0,children:"Email"}),r.jsx("input",{type:"email",className:xt,value:s.email,onChange:m=>u("email",m.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Phone"}),r.jsx("input",{className:xt,value:s.phone,onChange:m=>u("phone",m.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Country"}),r.jsx("input",{className:xt,value:s.country,onChange:m=>u("country",m.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Organisation"}),r.jsx("input",{className:xt,value:s.organisation,onChange:m=>u("organisation",m.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Role / Job title"}),r.jsx("input",{className:xt,value:s.role_title,onChange:m=>u("role_title",m.target.value)})]})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Which programme are you interested in?"}),r.jsxs("select",{className:xt,value:s.programme_choice,onChange:m=>u("programme_choice",m.target.value),children:[r.jsx("option",{value:"",children:"Not sure yet"}),t.map(m=>r.jsx("option",{value:m.id,children:m.name},m.id)),r.jsx("option",{value:"other",children:"Other (specify)"})]})]}),s.programme_choice==="other"&&r.jsxs("div",{children:[r.jsx(mt,{children:"Programme name"}),r.jsx("input",{className:xt,value:s.programme_interest,onChange:m=>u("programme_interest",m.target.value)})]}),r.jsxs("div",{children:[r.jsx(mt,{children:"Why would this support make a difference for you?"}),r.jsx("textarea",{rows:4,className:xt,value:s.why_support,onChange:m=>u("why_support",m.target.value)})]}),o&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-100 rounded-lg px-3 py-2",children:o}),r.jsx("button",{type:"submit",disabled:a,className:"w-full inline-flex items-center justify-center gap-2 px-6 py-3 rounded-lg bg-[#1f0f3f] hover:bg-[#1f0f3f]/90 disabled:opacity-60 text-white font-semibold transition",children:a?r.jsxs(r.Fragment,{children:[r.jsx($a,{className:"h-4 w-4 animate-spin"})," Submittingâ¦"]}):"Submit Application"})]})]})})}function cr(t){if(t==null||t==="")return null;const e=new Date(String(t).trim());return Number.isNaN(e.getTime())?null:e}function gy(t){const e=cr(t);return e?e.toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"}):""}function oa(t,e={}){const s=cr(t);if(!s)return"";const{includeTimeZoneName:n=!0}=e;return s.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit",...n?{timeZoneName:"shortGeneric"}:{}})}function lU(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}}function wx(t){const[e,s]=M.useState(Date.now());M.useEffect(()=>{const c=setInterval(()=>s(Date.now()),1e3);return()=>clearInterval(c)},[]);const n=new Date(t).getTime()-e;if(n<=0)return null;const a=Math.floor(n/(1e3*60*60*24)),i=Math.floor(n/(1e3*60*60)%24),o=Math.floor(n/(1e3*60)%60),l=Math.floor(n/1e3%60);return{days:a,hours:i,minutes:o,seconds:l}}function If(t){return(t||"").replace(/[-:]/g,"").replace(/\.\d+/,"").replace("Z","")+"Z"}function qw(t){const e=If(t.start_at),s=t.end_at?If(t.end_at):e;return`https://calendar.google.com/calendar/render?${new URLSearchParams({action:"TEMPLATE",text:t.title,dates:`${e}/${s}`,details:t.summary||"",location:t.location||""}).toString()}`}function Kw(t){const e=If(t.start_at),s=t.end_at?If(t.end_at):e,n=["BEGIN:VCALENDAR","VERSION:2.0","BEGIN:VEVENT",`DTSTART:${e}`,`DTEND:${s}
711`,`SUMMARY:${t.title}`,`DESCRIPTION:${(t.summary||"").replace(/\n/g,"\\n")}`,`LOCATION:${t.location||""}`,"END:VEVENT","END:VCALENDAR"].join(`\r 712`),a=new Blob([n],{type:"text/calendar;charset=utf-8"}),i=URL.createObjectURL(a),o=document.createElement("a");o.href=i,o.download=`${(t.title||"event").replace(/[^a-zA-Z0-9]/g,"_")}.ics`,o.click(),URL.revokeObjectURL(i)}function Jw(t){const e=t.start_at,s=t.end_at||t.start_at;return`https://outlook.live.com/calendar/0/deeplink/compose?${new URLSearchParams({path:"/calendar/action/compose",rru:"addevent",subject:t.title,startdt:e,enddt:s,body:t.summary||"",location:t.location||""}).toString()}`}function Y({label:t,labelClassName:e="",hint:s,error:n,className:a="",required:i,showPasswordToggle:o=!1,type:l,...c}){const[d,u]=v.useState(!1),h=l==="password",m=h&&d?"text":l;return r.jsxs("label",{className:"block",children:[t?r.jsxs("div",{className:`acgc-label mb-1 text-sm text-slate-700 ${e}`,children:[t,i&&r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}):null,r.jsxs("div",{className:"relative",children:[r.jsx("input",{className:`acgc-input w-full h-11 rounded-2xl border px-4 text-slate-900 border-slate-200 focus:border-accent-600 focus:ring-2 focus:ring-accent-500/20 transition ${h&&o?"pr-12":""} ${a}`,required:i,type:m,...c}),h&&o&&r.jsx("button",{type:"button",onClick:()=>u(!d),className:"absolute right-3 top-1/2 -translate-y-1/2 text-slate-400 hover:text-slate-600 transition","aria-label":d?"Hide password":"Show password",children:d?r.jsx(gx,{className:"h-4 w-4"}):r.jsx(b7,{className:"h-4 w-4"})})]}),n?r.jsx("div",{className:"mt-1 text-sm text-red-600",children:n}):null,!n&&s?r.jsx("div",{className:"mt-1 text-xs text-slate-500",children:s}):null]})}function _r({eyebrow:t,title:e,subtitle:s,align:n="left",tone:a="public"}){const i=n==="center"?"text-center items-center":"text-left items-start",o=a==="portal"?"text-xs uppercase tracking-widest text-accent-200":"text-xs uppercase tracking-widest text-accent-700",l=a==="portal"?"text-2xl md:text-3xl font-semibold text-white":"text-2xl md:text-3xl font-semibold text-brand-900",c=a==="portal"?"text-slate-200 max-w-2xl":"text-slate-600 max-w-2xl";return r.jsxs("div",{className:`flex flex-col gap-2 ${i}`,children:[t?r.jsx("div",{className:o,children:t}):null,r.jsx("h2",{className:l,children:e}),s?r.jsx("p",{className:c,children:s}):null]})}function Te({children:t,tone:e="default",className:s=""}){return r.jsx("span",{className:`acgc-badge acgc-badge--${e} inline-flex items-center rounded-full border px-2.5 py-1 text-xs ${s}`,children:t})}const Pk={Conference:{icon:so,color:"bg-[#1f0f3f]",text:"text-white"},Webinar:{icon:Wi,color:"bg-[#0369a1]",text:"text-white"},Training:{icon:Uw,color:"bg-[#2d6a4f]",text:"text-white"},Workshop:{icon:In,color:"bg-[#7c3aed]",text:"text-white"},Roundtable:{icon:bx,color:"bg-[#c08a2f]",text:"text-white"},Networking:{icon:at,color:"bg-[#9f1239]",text:"text-white"},Other:{icon:z3,color:"bg-slate-700",text:"text-white"}};function jx(t){return Pk[t]||Pk.Other}function Vs(t,e){return t==null||t===0?"Free":new Intl.NumberFormat("en-US",{style:"currency",currency:e||"USD",minimumFractionDigits:0}).format(t)}function Qw(t){return t?t.startsWith("data:")||t.startsWith("http://")||t.startsWith("https://")?t:tt(t):null}function cU(){const{t}=en(),{token:e,member:s}=Oe(),[n,a]=v.useState([]),[i,o]=v.useState(!1),[l,c]=v.useState(""),[d,u]=v.useState("upcoming"),[h,m]=v.useState(""),[f,p]=v.useState(null),[g,x]=v.useState(null),[b,y]=eo(),[w,N]=v.useState(!1),[j,S]=v.useState(null),[k,C]=v.useState({full_name:"",email:"",job_title:"",organisation:"",phone:"",sector:"",privacy_accepted:!1,custom:{},group_quantity:3,group_org_name:"",group_code:""}),[T,A]=v.useState(!1),[E,L]=v.useState(null);v.useEffect(()=>{if(!g)return;const q=setTimeout(()=>x(null),4e3);return()=>clearTimeout(q)},[g]);const D=!!s;v.useEffect(()=>{const q=b.get("payment");q==="success"?(x({type:"success",message:"Payment successful! You are now registered for the event."}),b.delete("payment"),b.delete("event"),y(b,{replace:!0})):q==="cancelled"&&(x({type:"error",message:"Payment was cancelled."}),b.delete("payment"),y(b,{replace:!0}))},[]),v.useEffect(()=>{(async()=>{o(!0),c("");try{const De=await U(D?"/api/events/members":"/api/events",{token:e});a(De.events||[])}catch(le){c(le.message||"Failed to load events")}finally{o(!1)}})()},[D,e]);const P=async q=>{const le=n.find(H=>H.id===q),De=le.member_price!=null?Number(le.member_price):null,$e=D?De!=null?De>0:le.event_type==="paid":le.event_type==="paid"||le.non_member_price>0;if(le.capacity&&le.registered_count>=le.capacity){try{p(q),await U(`/api/events/members/${q}/waitlist`,{method:"POST",token:e,body:{}}),x({type:"success",message:"You have been added to the waitlist."})}catch(H){x({type:"error",message:H.message||"Failed to join waitlist"})}finally{p(null)}return}if($e)try{p(q);const H=await U(`/api/events/members/${q}/checkout`,{method:"POST",token:e});if(H.url){window.location.href=H.url;return}}catch(H){x({type:"error",message:H.message||"Failed to create payment session"})}finally{p(null)}else try{p(q),await U(`/api/events/members/${q}/rsvp`,{method:"POST",token:e,body:{}}),a(H=>H.map(he=>he.id===q?{...he,is_registered:!0,registered_count:(he.registered_count||0)+1}:he)),x({type:"success",message:`Registered for "${le.title}" successfully!`})}catch(H){x({type:"error",message:H.message||"Failed to register for event"})}finally{p(null)}},R=async q=>{try{p(q),await U(`/api/events/members/${q}/rsvp`,{method:"DELETE",token:e}),a(le=>le.map(De=>De.id===q?{...De,is_registered:!1,registered_count:Math.max(0,(De.registered_count||0)-1)}:De)),x({type:"success",message:"Registration cancelled."})}catch(le){x({type:"error",message:le.message||"Failed to cancel registration"})}finally{p(null)}},$=q=>
712{S(q),C({full_name:"",email:"",job_title:"",organisation:"",phone:"",sector:"",privacy_accepted:!1,custom:{},group_quantity:3,group_org_name:"",group_code:""}),A(!1),N(!0)},O=()=>{f||(N(!1),S(null))},_=async q=>{var F;if((F=q==null?void 0:q.preventDefault)==null||F.call(q),!j)return;const le=k.full_name.trim(),De=k.email.trim(),$e=k.phone.trim();if(!le||!De){x({type:"error",message:"Please enter your full name and email."});return}if(!k.privacy_accepted){x({type:"error",message:"Please accept the data privacy policy to continue."});return}const H={job_title:k.job_title.trim(),organisation:k.organisation.trim(),sector:k.sector,...k.custom||{}},oe=j.event_type==="paid"||j.non_member_price>0?`/api/events/${j.id}/guest-checkout`:`/api/events/${j.id}/guest-rsvp`;try{p(j.id);const Z=await U(oe,{method:"POST",body:{full_name:le,email:De,phone:$e,registration_data:H,group_quantity:T&&k.group_quantity||1,group_org_name:T&&k.group_org_name||"",group_code:T&&k.group_code||""}});if(Z.url){window.location.href=Z.url;return}a(de=>de.map(Ve=>Ve.id===j.id?{...Ve,registered_count:(Ve.registered_count||0)+1}:Ve)),x({type:"success",message:`Registered for "${j.title}" successfully!`}),O()}catch(Z){x({type:"error",message:Z.message||"Failed to register for event"})}finally{p(null)}},B=new Date,J=n.filter(q=>new Date(q.start_at)>=B),Q=n.filter(q=>new Date(q.start_at)<B).reverse(),ce=d==="upcoming"?J:Q,fe=h?ce.filter(q=>q.type===h):ce,X=J.filter(q=>q.featured),pe=d==="upcoming"?fe.filter(q=>!q.featured):fe,be=[...new Set(n.map(q=>q.type))].sort();return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-12",children:[r.jsx(_r,{eyebrow:"Events & Conferences",title:"ACGC Events",subtitle:"Webinars, conferences, training sessions, and networking opportunities for in-house and government counsel across Africa."}),d==="upcoming"&&X.length>0&&r.jsx("div",{className:"mt-8 grid gap-5",children:X.map((q,le)=>r.jsx(V.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{delay:le*.1,duration:.4},children:r.jsx(uU,{event:q,isLoggedIn:D,onRSVP:P,onCancel:R,onGuestRegister:$,rsvpingId:f,onGroupRegister:L})},q.id))}),r.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[r.jsx("div",{className:"flex gap-1 bg-slate-100 rounded-xl p-1",children:[{key:"upcoming",label:"Upcoming",count:J.length},{key:"past",label:"Past Events",count:Q.length}].map(q=>r.jsxs("button",{onClick:()=>{u(q.key),m("")},className:`px-4 py-2 rounded-lg text-sm font-medium transition ${d===q.key?"bg-white text-slate-900 shadow-sm":"text-slate-500 hover:text-slate-700"}`,children:[q.label,r.jsx("span",{className:`ml-1.5 text-xs ${d===q.key?"text-[#c08a2f]":"text-slate-400"}`,children:q.count})]},q.key))}),be.length>1&&r.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[r.jsx("button",{onClick:()=>m(""),className:`px-3 py-1 rounded-full text-xs font-medium border transition ${h?"bg-white text-slate-600 border-slate-200 hover:border-slate-400":"bg-[#1f0f3f] text-white border-[#1f0f3f]"}`,children:"All"}),be.map(q=>{const le=jx(q);return r.jsx("button",{onClick:()=>m(h===q?"":q),className:`px-3 py-1 rounded-full text-xs font-medium border transition ${h===q?`${le.color} ${le.text} border-transparent`:"bg-white text-slate-600 border-slate-200 hover:border-slate-400"}`,children:q},q)})]})]}),l&&r.jsx("div",{className:"mt-4 text-sm text-red-600",children:l}),r.jsx("div",{className:"mt-4 text-sm text-slate-500",children:i?"Loadingâ¦":`${fe.length} event${fe.length!==1?"s":""}`}),!i&&pe.length>0&&r.jsx("div",{className:"mt-5 grid sm:grid-cols-2 lg:grid-cols-3 gap-5",children:pe.map((q,le)=>r.jsx(V.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:le*.04,duration:.35},children:d==="past"?r.jsx(mU,{event:q}):r.jsx(hU,{event:q,isLoggedIn:D,onRSVP:P,onCancel:R,onGuestRegister:$,rsvpingId:f,onGroupRegister:L})},q.id))}),i&&r.jsx("div",{className:"mt-5 grid sm:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:6}).map((q,le)=>r.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white overflow-hidden animate-pulse",children:[r.jsx("div",{className:"h-3 w-20 bg-slate-100 rounded m-5"}),r.jsxs("div",{className:"px-5 pb-5 space-y-2",children:[r.jsx("div",{className:"h-5 w-3/4 bg-slate-100 rounded"}),r.jsx("div",{className:"h-3 w-1/2 bg-slate-100 rounded"}),r.jsx("div",{className:"h-3 w-2/3 bg-slate-100 rounded"})]})]},le))}),!i&&fe.length===0&&!l&&r.jsxs("div",{className:"mt-12 text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-16 w-16 rounded-full bg-slate-100 mb-4",children:r.jsx(Ds,{className:"h-7 w-7 text-slate-400"})}),r.jsx("div",{className:"text-lg font-semibold text-slate-800",children:d==="upcoming"?"No upcoming events":"No past events"}),r.jsx("p",{className:"mt-2 text-sm text-slate-500",children:d==="upcoming"?"New events will appear here as they are announced.":"Past events will appear here after they conclude."})]}),!D&&r.jsxs("div",{className:"mt-12 rounded-2xl border border-[#c08a2f]/20 bg-[#1f0f3f] p-6 md:p-8 flex flex-col md:flex-row gap-6 md:items-center md:justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-lg",children:"Get priority access to all events"}),r.jsx("div",{className:"mt-1 text-white/70 text-sm",children:"ACGC members enjoy discounted pricing, early registration, and exclusive access to post-event materials."})]}),r.jsx(K,{to:"/join",className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-xl bg-[#c08a2f] hover:bg-[#a
71277324] text-white font-medium text-sm transition shadow-lg shrink-0",children:"Join ACGC"})]})]}),g&&r.jsx("div",{className:"fixed bottom-6 right-6 z-50 animate-in slide-in-from-bottom-4",children:r.jsxs("div",{className:`flex items-center gap-3 px-5 py-3 rounded-xl shadow-lg text-sm font-medium ${g.type==="success"?"bg-green-600 text-white":"bg-red-600 text-white"}`,children:[g.type==="success"?r.jsx(Pr,{className:"h-4 w-4 shrink-0"}):null,g.message,r.jsx("button",{onClick:()=>x(null),className:"ml-2 text-white/70 hover:text-white",children:"Ã"})]})}),w&&j?r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:O,"aria-label":"Close guest registration modal"}),r.jsx("div",{className:"relative max-w-lg mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-slate-200 bg-white shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-slate-200 flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"text-slate-900 font-semibold",children:["Register for ",j.title]}),r.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:"Non-members can register directly here."})]}),r.jsx(W,{variant:"outline",onClick:O,disabled:!!f,children:"Close"})]}),r.jsx("div",{className:"p-4",children:r.jsxs("form",{className:"grid gap-4",onSubmit:_,children:[r.jsx(Y,{label:"Full Name *",value:k.full_name,onChange:q=>C(le=>({...le,full_name:q.target.value})),required:!0}),r.jsx(Y,{label:"Email Address *",type:"email",value:k.email,onChange:q=>C(le=>({...le,email:q.target.value})),required:!0}),r.jsx(Y,{label:"Job Title",value:k.job_title,onChange:q=>C(le=>({...le,job_title:q.target.value}))}),r.jsx(Y,{label:"Organisation",value:k.organisation,onChange:q=>C(le=>({...le,organisation:q.target.value}))}),r.jsx(Y,{label:"Contact Number",value:k.phone,onChange:q=>C(le=>({...le,phone:q.target.value}))}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Sector"}),r.jsxs("select",{value:k.sector,onChange:q=>C(le=>({...le,sector:q.target.value})),className:"w-full h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-700 bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40",children:[r.jsx("option",{value:"",children:"â Select Sector â"}),r.jsx("option",{value:"Private",children:"Private"}),r.jsx("option",{value:"Public",children:"Public"}),r.jsx("option",{value:"Both",children:"Both"})]})]}),(j.registration_form||[]).map((q,le)=>{const De=q.label||`custom_${le}`,$e=k.custom[De]||"",H=he=>C(oe=>({...oe,custom:{...oe.custom,[De]:he}}));if(q.type==="select"){const he=(q.options||"").split(",").map(oe=>oe.trim()).filter(Boolean);return r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[q.label,q.required?" *":""]}),r.jsxs("select",{value:$e,onChange:oe=>H(oe.target.value),required:q.required,className:"w-full h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-700 bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40",children:[r.jsx("option",{value:"",children:"â Select â"}),he.map(oe=>r.jsx("option",{value:oe,children:oe},oe))]})]},le)}return q.type==="checkbox"?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"checkbox",checked:$e==="yes",onChange:he=>H(he.target.checked?"yes":""),className:"rounded border-slate-300 text-[#c08a2f] focus:ring-[#c08a2f]"}),r.jsxs("label",{className:"text-sm text-slate-700",children:[q.label,q.required?" *":""]})]},le):q.type==="textarea"?r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[q.label,q.required?" *":""]}),r.jsx("textarea",{value:$e,onChange:he=>H(he.target.value),required:q.required,placeholder:q.placeholder||"",maxLength:q.max_length||void 0,rows:3,className:"w-full rounded-xl border border-slate-200 px-3 py-2 text-sm text-slate-700 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]},le):r.jsx(Y,{label:`${q.label}${q.required?" *":""}`,type:q.type||"text",value:$e,onChange:he=>H(he.target.value),required:q.required,placeholder:q.placeholder||"",maxLength:q.max_length||void 0},le)}),j.non_member_price>0&&r.jsxs("div",{className:"text-xs text-slate-500",children:["Non-member price: ",Vs(j.non_member_price,j.currency)]}),j.group_discount_enabled&&r.jsxs("div",{className:"rounded-xl border border-blue-100 bg-blue-50 overflow-hidden",children:[r.jsxs("button",{type:"button",onClick:()=>A(q=>!q),className:"w-full flex items-center justify-between px-4 py-3 text-sm font-medium text-blue-800 hover:bg-blue-100 transition",children:[r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(er,{className:"h-4 w-4"}),"Buying for a group or organisation?",r.jsxs("span",{className:"text-xs font-normal text-blue-600",children:["Save ",j.group_discount_percent||10,"% on ",j.group_discount_min_size||5,"+ tickets"]})]}),r.jsx(ll,{className:`h-4 w-4 transition-transform ${T?"rotate-90":""}`})]}),T&&(()=>{const q=Number(k.group_quantity)||1,le=j.non_member_price||0,De=j.group_discount_min_size||5,$e=j.group_discount_percent||10,H=q>=De,he=j.group_discount_requires_code,oe=(k.group_code||"").trim(),F=H&&(!he||oe.length>0),Z=F?le*(1-$e/100):le,de=Z*q;return r.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-blue-100",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3 pt-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Number of tickets *"}),r.jsx("input",{type:"number",min:"3",max:"500",value:k.group_quantity,onChange:Ve=>C(Pe=>({...Pe,group_quantity:Number(Ve.target.value)||""})),onBlur:Ve=>C(Pe=>({...Pe,group_quantity:Math.max(3,Number(Ve.target.value)||3)})),className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm text-slate-700 bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Organisation name"}),r.jsx("input",{type:"text",value:k.group_org_name,onChange:Ve=>C(Pe=>({...Pe,group_org_name:Ve.target.value})),placeholder:"Optional",className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm text-slate-700 bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]})]}),he&&r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Group / Promo Code"}),r.jsx("input",{type:"text",value:k.group_code,onChange:Ve=>C(Pe=>({...Pe,group_code:Ve.target.value})),placeholder:"Enter your group code",className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm text-slate-700 bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),le>0&&q>0&&r.jsxs("div",{className:"rounded-lg bg-white border border-blue-100 p-3 text-xs space-y-1.5",children:[r.jsxs("div",{className:"flex justify-between text-slate-600",children:[r.jsx("span",{children:"Price per ticket"}),r.jsx("span",{children:Vs(le,j.currency)})]}),F&&r.jsxs("div",{className:"flex justify-between text-green-700 font-medium",children:[r.jsxs("span",{children:["Group discount (",$e,"%)"]}),r.jsxs("span",{children:["â",Vs(le*$e/100,j.currency)]})]}),F&&r.jsxs("div",{className:"flex justify-between text-slate-700",children:[r.jsx("span",{children:"Discounted price per ticket"}),r.jsx("span",{className:"font-semibold",children:Vs(Z,j.currency)})]}),r.jsxs("div",{className:"flex justify-between border-t border-slate-100 pt-1.5 font-semibold text-slate-900",children:[r.jsxs("span",{children:["Total (",q," ticket",q!==1?"s":"",")"]}),r.jsx("span",{children:Vs(de,j.currency)})]}),F&&r.jsxs("div",{className:"text-center text-green-700 font-medium pt-0.5",children:["You save ",Vs(le*$e/100*q,j.currency),"!"]}),!H&&r.jsxs("div",{className:"text-center text-blue-600 pt-0.5",children:["Add ",De-q," more ticket",De-q!==1?"s":""," to unlock the ",$e,"% group discount"]})]})]})})()]}),r.jsx("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-4",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("input",{type:"checkbox",checked:k.privacy_accepted,onChange:q=>C(le=>({...le,privacy_accepted:q.target.checked})),className:"mt-0.5 rounded border-slate-300 text-[#c08a2f] focus:ring-[#c08a2f]",required:!0}),r.jsxs("label",{className:"text-xs text-slate-600 leading-relaxed",children:["I consent to the collection and processing of my personal data as provided above by the African Corporate Counsel Group (ACGC) for the purpose of event registration and communication. I understand that my data will be handled in accordance with applicable data protection laws and the ACGC Privacy Policy, and that I may withdraw my consent at any time by contacting ",r.jsx("a",{href:"mailto:[email protected]",className:"text-[#c08a2f] underline",children:"[email protected]"}),"."]})]})}),r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r.jsx(W,{variant:"outline",type:"button",onClick:O,disabled:!!f,children:"Cancel"}),r.jsx(W,{type:"submit",disabled:f===j.id,children:f===j.id?"Submitting...":j.non_member_price>0||j.event_type==="paid"?"Continue to Payment":"Register"})]})]})})]})})]}):null,E&&r.jsx(dU,{event:E,token:e,onClose:()=>L(null),onToast:x})]})}function dU({event:t,token:e,onClose:s,onToast:n}){const[a,i]=v.useState(3),[o,l]=v.useState(""),[c,d]=v.useState(""),[u,h]=v.useState(!1),m=t.member_price||0,f=t.group_discount_min_size||5,p=t.group_discount_percent||10,g=!!t.group_discount_requires_code,x=a>=f,b=!g||c.trim().length>0,y=x&&b,w=y?m*(1-p/100):m,N=w*a,j=y?(m-w)*a:0,S=async k=>{h(!0);try{const C=k?{group_quantity:a,group_org_name:o,group_code:c}:{},T=await U(`/api/events/members/${t.id}/checkout`,{method:"POST",token:e,body:C});T.url&&(window.location.href=T.url)}catch(C){n({type:"error",message:C.message||"Failed to start checkout"}),h(!1)}};return r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50 backdrop-blur-sm",onClick:()=>!u&&s(),"aria-label":"Close"}),r.jsx("div",{className:"relative max-w-md mx-auto my-10 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-slate-200 bg-white shadow-2xl overflow-hidden",children:[r.jsx("div",{className:"bg-gradient-to-r from-[#1f0f3f] to-[#2d1660] p-5",children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"inline-flex items-center gap-1.5 rounded-lg bg-blue-500/20 text-blue-200 px-2.5 py-1 text-xs font-medium mb-2",children:[r.jsx(er,{className:"h-3.5 w-3.5"})," Group / Organisation Booking"]}),r.jsx("h3",{className:"text-white font-semibold text-base leading-snug",children:t.title}),r.jsxs("p",{className:"text-white/60 text-xs mt-1",children:["Buy ",f,"+ tickets and save ",p,"% automatically"]})]}),r.jsx("button",{onClick:()=>!u&&s(),className:"text-white/50 hover:text-white mt-1",children:"â"})]})}),r.jsxs("div",{className:"p-5 space-y-4",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-semibold text-slate-700 mb-1.5",children:"Number of tickets"}),r.jsx("input",{type:"number",min:"3",max:"500",value:a,onChange:k=>i(Number(k.target.value)||""),onBlur:k=>i(Math.max(3,Number(k.target.value)||3)),className:"w-full h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-semibold text-slate-700 mb-1.5",children:["Organisation ",r.jsx("span",{className:"font-normal text-slate-400",children:"(optional)"})]}),r.jsx("input",{type:"text",value:o,onChange:k=>l(k.target.value),placeholder:"e.g. Acme Corp",className:"w-full h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]})]}),g&&r.jsxs("div",{children:[r.jsxs("label",{className:"block text-xs font-semibold text-slate-700 mb-1.5",children:["Group / Promo Code ",r.jsx("span",{className:"text-red-500",children:"*"})]}),r.jsx("input",{type:"text",value:c,onChange:k=>d(k.target.value),placeholder:"Enter your group code to unlock discount",className:"w-full h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),!x&&r.jsxs("div",{className:"rounded-xl border border-blue-100 bg-blue-50 px-4 py-3",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs text-blue-700 mb-2",children:[r.jsx("span",{children:"Tickets selected"}),r.jsxs("span",{className:"font-semibold",children:[a," / ",f," needed"]})]}),r.jsx("div",{className:"h-2 bg-blue-100 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-blue-500 rounded-full transition-all duration-300",style:{width:`${Math.min(100,a/f*100)}%`}})}),r.jsxs("p",{className:"text-xs text-blue-600 mt-2",children:["Add ",f-
712a," more ticket",f-a!==1?"s":""," to unlock the ",p,"% group discount"]})]}),m>0&&r.jsxs("div",{className:`rounded-xl border p-4 space-y-2 ${y?"border-green-200 bg-green-50":"border-slate-100 bg-slate-50"}`,children:[r.jsx("div",{className:"text-xs font-semibold text-slate-600 mb-1 uppercase tracking-wide",children:"Price Breakdown"}),r.jsxs("div",{className:"flex justify-between text-sm text-slate-600",children:[r.jsx("span",{children:"Per ticket (member rate)"}),r.jsx("span",{children:Vs(m,t.currency)})]}),y&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex justify-between text-sm text-green-700 font-medium",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Pr,{className:"h-3.5 w-3.5"})," Group discount (",p,"% off)"]}),r.jsxs("span",{children:["â",Vs(m*p/100,t.currency)]})]}),r.jsxs("div",{className:"flex justify-between text-sm text-slate-700",children:[r.jsx("span",{children:"Discounted price / ticket"}),r.jsx("span",{className:"font-semibold",children:Vs(w,t.currency)})]})]}),r.jsxs("div",{className:"border-t border-current/10 pt-2 flex justify-between font-bold text-slate-900",children:[r.jsxs("span",{children:["Total (",a," ticket",a!==1?"s":"",")"]}),r.jsx("span",{className:"text-[#1f0f3f]",children:Vs(N,t.currency)})]}),y&&j>0&&r.jsxs("div",{className:"text-center text-green-700 font-semibold text-sm pt-1",children:["ð You save ",Vs(j,t.currency)," with the group discount!"]})]}),r.jsxs("div",{className:"space-y-2 pt-1",children:[r.jsx("button",{onClick:()=>S(!0),disabled:u,className:"w-full inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold text-sm transition shadow-md disabled:opacity-50",children:u?"Redirecting to paymentâ¦":y?`Pay for ${a} Tickets (Group Rate)`:`Pay for ${a} Ticket${a!==1?"s":""}`}),r.jsx("button",{onClick:()=>S(!1),disabled:u,className:"w-full inline-flex items-center justify-center gap-2 px-5 py-2.5 rounded-xl border border-slate-200 text-slate-600 font-medium text-sm hover:bg-slate-50 transition disabled:opacity-50",children:"Register individually (1 ticket)"})]})]})]})})]})}function uU({event:t,isLoggedIn:e,onRSVP:s,onCancel:n,onGuestRegister:a,rsvpingId:i,onGroupRegister:o}){const l=wx(t.start_at),c=jx(t.type),d=c.icon,u=i===t.id,h=gy(t.start_at),m=oa(t.start_at),p=(t.end_at?cr(t.end_at):null)?oa(t.end_at,{includeTimeZoneName:!1}):null,g=Qw(t.banner_url||t.header_url||t.thumbnail_url);return r.jsxs("div",{className:"relative rounded-2xl overflow-hidden bg-[#1f0f3f] shadow-[0_8px_40px_-8px_rgba(0,0,0,0.3)]",children:[g&&r.jsx("div",{className:"absolute inset-0",children:r.jsx("img",{src:g,alt:"",className:"w-full h-full object-cover opacity-25",onError:x=>{x.currentTarget.style.display="none"}})}),r.jsxs("div",{className:"relative p-6 md:p-8 flex flex-col md:flex-row gap-6",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium ${c.color} ${c.text}`,children:[r.jsx(d,{className:"h-3.5 w-3.5"}),t.type]}),r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-lg bg-[#c08a2f] text-white px-2.5 py-1 text-xs font-medium",children:[r.jsx(An,{className:"h-3 w-3"}),"Featured"]}),t.access_level==="members_paid"&&r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-lg bg-white/10 text-white/80 px-2.5 py-1 text-xs font-medium",children:[r.jsx(Fn,{className:"h-3 w-3"}),"Members Only"]}),t.group_discount_enabled&&r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-lg bg-blue-500/80 text-white px-2.5 py-1 text-xs font-medium",children:[r.jsx(er,{className:"h-3 w-3"}),"Group Discount Available"]})]}),r.jsx(K,{to:`/events/${t.slug||t.id}`,className:"hover:opacity-90 transition",children:r.jsx("h2",{className:"mt-4 text-xl md:text-2xl font-bold text-white leading-tight",children:t.title})}),t.summary&&r.jsx("p",{className:"mt-2 text-sm text-white/70 leading-relaxed max-w-xl",children:t.summary}),r.jsxs(K,{to:`/events/${t.slug||t.id}`,className:"mt-2 inline-flex items-center gap-1 text-xs text-[#dcb26a] hover:text-[#c08a2f] font-medium transition",children:["View full details",r.jsx(ht,{className:"h-3 w-3 -rotate-90"})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-white/80",children:[r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(Ds,{className:"h-4 w-4 text-white/50"}),h]}),r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(cl,{className:"h-4 w-4 text-white/50"}),m,p?` â ${p}`:""]}),t.location&&r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(kt,{className:"h-4 w-4 text-white/50"}),t.location]}),t.is_virtual&&r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(pt,{className:"h-4 w-4 text-white/50"}),"Virtual Event"]})]}),(t.member_price!=null||t.non_member_price!=null)&&r.jsxs("div",{className:"mt-4 flex items-center gap-4 text-sm",children:[t.member_price!=null&&r.jsxs("span",{className:"inline-flex items-center gap-1 text-[#dcb26a] font-medium",children:["Members: ",Vs(t.member_price,t.currency)]}),t.non_member_price!=null&&r.jsxs("span",{className:"text-white/60",children:["Non-members: ",Vs(t.non_member_price,t.currency)]})]}),(t.registration_url||t.replay_url||t.materials_url)&&r.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-3",children:[t.registration_url&&r.jsxs("a",{href:t.registration_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-[#dcb26a] hover:text-white font-medium transition",children:[r.jsx(ur,{className:"h-3.5 w-3.5"})," Registration Link"]}),t.replay_url&&r.jsxs("a",{href:t.replay_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-[#dcb26a] hover:text-white font-medium transition",children:[r.jsx(wn,{className:"h-3.5 w-3.5"})," Watch Replay"]}),t.materials_url&&r.jsxs("a",{href:t.materials_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-[#dcb26a] hover:text-white font-medium transition",children:[r.jsx(es,{className:"h-3.5 w-3.5"})," Event Materials"]})]}),t.group_discount_enabled&&r.jsxs("div",{className:"mt-4 inline-flex items-center gap-2 rounded-xl bg-blue-500/15 border border-blue-400/20 text-blue-200 px-3 py-2 text-xs font-medium",children:[r.jsx(er,{className:"h-3.5 w-3.5 shrink-0"}),"Group discount: Buy ",t.group_discount_min_size||5,"+ tickets â Save ",t.group_discount_percent||10,"%"]}),r.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[e?r.jsx(r.Fragment,{children:t.is_registered?r.jsxs("button",{onClick:()=>n(t.id),disabled:u,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-green-600 hover:bg-green-700 text-white font-medium text-sm transition shadow-lg disabled:opacity-50",children:[r.jsx(Pr,{className:"h-3.5 w-3.5"})," Registered"]}):t.group_discount_enabled&&(t.event_type==="paid"||t.member_price>0)?r.jsx(r.Fragment,{children:r.jsxs("button",{onClick:()=>o(t),disabled:u,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-[#c08a2f] hover:bg-[#a
71277324] text-white font-semibold text-sm transition shadow-lg disabled:opacity-50",children:[r.jsx(er,{className:"h-3.5 w-3.5"}),u?"Processing...":"Register / Group Booking"]})}):r.jsx("button",{onClick:()=>s(t.id),disabled:u,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-[#c08a2f] hover:bg-[#a77324] text-white font-medium text-sm transition shadow-lg disabled:opacity-50",children:u?"Registering...":"Register"})}):r.jsx("button",{onClick:()=>a(t),className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-[#c08a2f] hover:bg-[#a77324] text-white font-medium text-sm transition shadow-lg",children:"Register"}),r.jsx(tM,{event:t})]})]}),l&&r.jsxs("div",{className:"shrink-0 flex flex-col items-center justify-center",children:[r.jsx("div",{className:"text-xs uppercase tracking-widest text-white/50 mb-3",children:"Starts in"}),r.jsx("div",{className:"flex gap-2",children:[{val:l.days,label:"Days"},{val:l.hours,label:"Hrs"},{val:l.minutes,label:"Min"},{val:l.seconds,label:"Sec"}].map(x=>r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsx("div",{className:"h-14 w-14 rounded-xl bg-white/10 backdrop-blur-sm flex items-center justify-center text-xl font-bold text-white",children:String(x.val).padStart(2,"0")}),r.jsx("div",{className:"mt-1 text-[10px] uppercase tracking-wider text-white/50",children:x.label})]},x.label))})]})]})]})}function hU({event:t,isLoggedIn:e,onRSVP:s,onCancel:n,onGuestRegister:a,rsvpingId:i,onGroupRegister:o}){const l=wx(t.start_at),c=jx(t.type),d=c.icon,u=i===t.id,h=cr(t.start_at)||new Date(t.start_at),m=h.toLocaleDateString(void 0,{month:"short"}),f=h.getDate(),p=h.toLocaleDateString(void 0,{weekday:"short"}),g=oa(t.start_at),b=(t.end_at?cr(t.end_at):null)?oa(t.end_at,{includeTimeZoneName:!1}):null,y=Qw(t.banner_url||t.header_url||t.thumbnail_url),w=`/events/${t.slug||t.id}`,N=t.event_type==="paid"&&t.member_price==null&&t.non_member_price==null&&(!t.ticket_price_cents||t.ticket_price_cents===0),j=t.event_type==="paid"||t.member_price>0||t.non_member_price>0,S=t.capacity&&t.registered_count>=t.capacity,k=e&&j&&!N&&t.group_discount_enabled&&!t.is_registered&&!S;return r.jsxs("div",{className:"group rounded-2xl border border-slate-200/60 bg-white shadow-sm hover:shadow-lg hover:border-[#c08a2f]/30 transition-all duration-300 overflow-hidden h-full flex flex-col",children:[y?r.jsxs("div",{className:"relative h-44 bg-gradient-to-br from-slate-100 to-slate-200 overflow-hidden shrink-0",children:[r.jsx("img",{src:y,alt:t.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",onError:C=>{C.currentTarget.style.display="none"}}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 via-black/10 to-transparent"}),r.jsxs("div",{className:"absolute top-3 left-3 flex items-center gap-1.5 flex-wrap",children:[r.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-1 text-[11px] font-semibold ${c.color} ${c.text} shadow-sm`,children:[r.jsx(d,{className:"h-3 w-3"}),t.type]}),t.access_level==="members_paid"&&r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#1f0f3f]/80 text-white px-2.5 py-1 text-[11px] font-medium backdrop-blur-sm shadow-sm",children:[r.jsx(Fn,{className:"h-3 w-3"}),"Members"]})]}),t.group_discount_enabled&&r.jsx("div",{className:"absolute top-3 right-3",children:r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-blue-600 text-white px-2.5 py-1 text-[11px] font-semibold shadow-sm",children:[r.jsx(er,{className:"h-3 w-3"}),t.group_discount_percent||10,"% Group"]})}),r.jsxs("div",{className:"absolute bottom-3 left-3 right-3 flex items-end justify-between",children:[r.jsx("div",{className:"flex items-center gap-2",children:r.jsxs("div",{className:"bg-white rounded-xl px-2.5 py-1.5 text-center shadow-sm min-w-[44px]",children:[r.jsx("div",{className:"text-[9px] uppercase tracking-widest text-slate-400 font-semibold leading-none",children:m}),r.jsx("div",{className:"text-lg font-black text-slate-900 leading-tight",children:f}),r.jsx("div",{className:"text-[9px] uppercase tracking-widest text-slate-400 font-medium leading-none",children:p})]})}),r.jsx("div",{children:N?r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-500 text-white px-2.5 py-1 text-[11px] font-semibold shadow-sm",children:[r.jsx(Zl,{className:"h-3 w-3"})," Pricing TBD"]}):j?r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#c08a2f] text-white px-2.5 py-1 text-[11px] font-semibold shadow-sm",children:[r.jsx(Rf,{className:"h-3 w-3"})," Paid"]}):r.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-500 text-white px-2.5 py-1 text-[11px] font-semibold shadow-sm",children:"Free"})})]})]}):r.jsxs("div",{className:"px-5 pt-5 pb-0 flex items-start gap-4",children:[r.jsxs("div",{className:"shrink-0 w-14 roun
712ded-2xl bg-gradient-to-b from-[#1f0f3f] to-[#2d1660] flex flex-col items-center justify-center py-2 shadow-md",children:[r.jsx("div",{className:"text-[9px] uppercase tracking-widest text-white/60 font-semibold leading-none",children:m}),r.jsx("div",{className:"text-2xl font-black text-white leading-tight",children:f}),r.jsx("div",{className:"text-[9px] uppercase tracking-widest text-white/50 font-medium leading-none",children:p})]}),r.jsx("div",{className:"min-w-0 flex-1 pt-1",children:r.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[r.jsxs("span",{className:`inline-flex items-center gap-1 rounded-full px-2.5 py-0.5 text-[11px] font-semibold ${c.color} ${c.text}`,children:[r.jsx(d,{className:"h-3 w-3"}),t.type]}),t.access_level==="members_paid"&&r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#c08a2f]/10 text-[#8b6914] border border-[#c08a2f]/20 px-2.5 py-0.5 text-[11px] font-semibold",children:[r.jsx(Fn,{className:"h-3 w-3"}),"Members"]}),j?r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#c08a2f]/10 text-[#8b6914] border border-[#c08a2f]/20 px-2.5 py-0.5 text-[11px] font-semibold",children:[r.jsx(Rf,{className:"h-3 w-3"})," Paid"]}):r.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-50 text-green-700 border border-green-200 px-2.5 py-0.5 text-[11px] font-semibold",children:"Free"}),t.group_discount_enabled&&r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-blue-50 text-blue-700 border border-blue-200 px-2.5 py-0.5 text-[11px] font-semibold",children:[r.jsx(er,{className:"h-3 w-3"})," Group Discount"]})]})})]}),r.jsxs("div",{className:"px-5 pt-4 flex-1 min-w-0",children:[r.jsx(K,{to:w,className:"group/title block",children:r.jsx("h3",{className:"text-[15px] font-bold text-slate-900 leading-snug line-clamp-2 group-hover/title:text-[#c08a2f] transition-colors duration-200",children:t.title})}),t.summary&&r.jsx("p",{className:"mt-1.5 text-xs text-slate-500 leading-relaxed line-clamp-2",children:t.summary}),t.group_discount_enabled&&r.jsxs("div",{className:"mt-2.5 inline-flex items-center gap-1.5 rounded-lg bg-blue-50 border border-blue-100 px-2.5 py-1.5 text-[11px] text-blue-700 font-medium",children:[r.jsx(er,{className:"h-3 w-3 shrink-0"}),"Buy ",t.group_discount_min_size||5,"+ tickets â Save ",t.group_discount_percent||10,"%"]}),r.jsxs("div",{className:"mt-3 space-y-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[r.jsx(cl,{className:"h-3.5 w-3.5 text-slate-400 shrink-0"}),r.jsxs("span",{children:[g,b?` â ${b}`:""]})]}),t.location&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[r.jsx(kt,{className:"h-3.5 w-3.5 text-slate-400 shrink-0"}),r.jsx("span",{className:"truncate",children:t.location})]}),t.is_virtual&&!t.location&&r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[r.jsx(pt,{className:"h-3.5 w-3.5 text-slate-400 shrink-0"}),"Virtual Event"]})]}),(t.member_price!=null||t.non_member_price!=null)&&r.jsxs("div",{className:"mt-3 flex items-center gap-3 text-xs",children:[t.member_price!=null&&t.member_price>0&&r.jsxs("span",{className:"font-semibold text-[#8b6914]",children:["Members: ",Vs(t.member_price,t.currency)]}),t.non_member_price!=null&&t.non_member_price>0&&r.jsxs("span",{className:"text-slate-400",children:["Others: ",Vs(t.non_member_price,t.currency)]})]}),l&&r.jsxs("div",{className:"mt-3 flex items-center gap-1.5",children:[[{val:l.days,label:"d"},{val:l.hours,label:"h"},{val:l.minutes,label:"m"}].map(C=>r.jsxs("span",{className:"inline-flex items-baseline gap-0.5 rounded-lg bg-[#1f0f3f]/5 border border-[#1f0f3f]/10 px-2 py-1 text-[11px] font-mono font-bold text-[#1f0f3f]",children:[C.val,r.jsx("span",{className:"text-[9px] font-medium text-slate-400",children:C.label})]},C.label)),r.jsx("span",{className:"text-[10px] text-slate-400",children:"remaining"})]}),r.jsxs(K,{to:w,className:"mt-3 inline-flex items-center gap-1 text-xs text-[#c08a2f] hover:text-[#8b6914] font-semibold transition-colors",children:["View details",r.jsx(ht,{className:"h-3 w-3 -rotate-90"})]})]}),r.jsx("div",{className:"mx-5 mt-4 border-t border-slate-100"}),r.jsxs("div",{className:"px-5 py-3.5 flex items-center gap-2",children:[N?r.jsxs("div",{className:"inline-flex items-center justify-center gap-1.5 rounded-xl px-3.5 py-2 text-xs font-semibold bg-slate-100 text-slate-500 flex-1 cursor-not-allowed",children:[r.jsx(Zl,{className:"h-3.5 w-3.5"})," Pricing Coming Soon"]}):e?r.jsx(r.Fragment,{children:t.is_registered?r.jsxs("button",{onClick:()=>n(t.id),disabled:u,className:"inline-flex items-center justify-center gap-1.5 rounded-xl px-3.5 py-2 text-xs font-semibold bg-green-600 text-white hover:bg-green-700 transition flex-1 disabled:opacity-50",children:[r.jsx(Pr,{className:"h-3.5 w-3.5"}),"Registered"]}):S?r.jsxs("button",{onClick:()=>s(t.id),disabled:u,className:"inline-flex items-center justify-center gap-1.5 rounded-xl px-3.5 py-2 text-xs font-semibold bg-orange-500 text-white hover:bg-orange-600 transition flex-1 disabled:opacity-50",children:[r.jsx(at,{className:"h-3.5 w-3.5"}),u?"Joining...":"Join Waitlist"]}):k?r.jsxs("div",{className:"flex gap-2 flex-1",children:[r.jsx("button",{onClick:()=>s(t.id),disabled:u,className:"inline-flex items-center justify-center gap-1.5 rounded-xl px-3 py-2 text-xs font-semibold bg-[#1f0f3f] text-white hover:bg-[#2a1654] transition flex-1 disabled:opacity-50",children:u?"Registering...":"Register"}),r.jsxs("button",{onClick:()=>o(t),className:"inline-flex items-center justify-center gap-1 rounded-xl px-3 py-2 text-xs font-semibold bg-blue-600 text-white hover:bg-blue-700 transition shrink-0",title:`Group booking â save ${t.group_discount_percent||10}%`,children:[r.jsx(er,{className:"h-3.5 w-3.5"}),"Group"]})]}):r.jsx("button",{onClick:()=>s(t.id),disabled:u,className:"inline-flex items-center justify-center gap-1.5 rounded-xl px-3.5 py-2 text-xs font-semibold bg-[#1f0f3f] text-white hover:bg-[#2a1654] transition flex-1 disabled:opacity-50",children:u?"Registering...":"Register"})}):r.jsx("button",{onClick:()=>a(t),className:"inline-flex items-center justify-center gap-1.5 rounded-xl px-3.5 py-2 text-xs font-semibold bg-[#1f0f3f] text-white hover:bg-[#2a1654] transition flex-1",children:"Register"}),r.jsx(tM,{event:t,compact:!0})]})]})}function mU({event:t}
712){const e=jx(t.type),s=e.icon,n=cr(t.start_at),a=n?n.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"",i=t.replay_url||t.materials_url;return r.jsxs("div",{className:"group rounded-2xl border border-slate-200/80 bg-white shadow-[0_4px_24px_-8px_rgba(0,0,0,0.06)] hover:shadow-[0_8px_30px_-6px_rgba(0,0,0,0.12)] hover:border-slate-300 transition-all duration-300 overflow-hidden h-full flex flex-col",children:[r.jsxs("div",{className:"relative h-36 bg-gradient-to-br from-slate-50 to-slate-100 overflow-hidden flex items-center justify-center shrink-0",children:[r.jsx(s,{className:"h-10 w-10 text-slate-200"}),t.thumbnail_url&&r.jsx("img",{src:Qw(t.thumbnail_url),alt:t.title,className:"absolute inset-0 w-full h-full object-cover group-hover:scale-105 transition-transform duration-500 opacity-80",onError:o=>{o.currentTarget.style.display="none"}}),t.thumbnail_url&&r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/40 to-transparent pointer-events-none"}),r.jsx("div",{className:"absolute top-2.5 left-2.5 z-10",children:r.jsxs("span",{className:`inline-flex items-center gap-1 rounded-lg px-2 py-1 text-xs font-medium ${e.color} ${e.text}`,children:[r.jsx(s,{className:"h-3 w-3"}),t.type]})}),r.jsx("div",{className:"absolute bottom-2.5 left-2.5 text-xs text-slate-400 font-medium z-10",children:a})]}),r.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[r.jsx(K,{to:`/events/${t.slug||t.id}`,className:"hover:text-[#c08a2f] transition",children:r.jsx("h3",{className:"text-sm font-semibold text-slate-900 leading-snug line-clamp-2",children:t.title})}),t.summary&&r.jsx("p",{className:"mt-1.5 text-xs text-slate-500 leading-relaxed line-clamp-2",children:t.summary}),t.location&&r.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs text-slate-400",children:[r.jsx(kt,{className:"h-3 w-3"}),t.location]}),r.jsxs("div",{className:"mt-auto pt-3 flex flex-wrap gap-2",children:[t.replay_url&&r.jsxs("a",{href:t.replay_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs font-medium bg-[#1f0f3f] text-white hover:bg-[#2a1654] transition",children:[r.jsx(wn,{className:"h-3 w-3"}),"Watch Replay"]}),t.materials_url&&r.jsxs("a",{href:t.materials_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs font-medium bg-slate-100 text-slate-700 hover:bg-slate-200 transition",children:[r.jsx(es,{className:"h-3 w-3"}),"Materials"]}),!i&&r.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs font-medium bg-slate-50 text-slate-400 cursor-default",children:"Event concluded"})]})]})]})}function tM({event:t,compact:e=!1}){const[s,n]=v.useState(!1),a=v.useRef(null);return v.useEffect(()=>{const i=o=>{a.current&&!a.current.contains(o.target)&&n(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]),r.jsxs("div",{className:"relative",ref:a,children:[r.jsxs("button",{onClick:()=>n(!s),className:`inline-flex items-center justify-center gap-1.5 rounded-lg border transition ${e?"h-8 w-8 border-slate-200 bg-white text-slate-500 hover:border-slate-400 hover:text-slate-700":"px-3 py-2 border-white/20 bg-white/10 text-white/80 hover:bg-white/20 text-xs font-medium"}`,title:"Add to calendar",children:[r.jsx(Xl,{className:e?"h-4 w-4":"h-3.5 w-3.5"}),!e&&"Add to Calendar"]}),s&&r.jsxs(V.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.12},className:"absolute right-0 bottom-full mb-2 w-48 rounded-xl bg-white border border-slate-200 shadow-lg py-1.5 z-50",children:[r.jsx("a",{href:qw(t),target:"_blank",rel:"noreferrer",onClick:()=>n(!1),className:"block px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 transition",children:"Google Calendar"}),r.jsx("a",{href:Jw(t),target:"_blank",rel:"noreferrer",onClick:()=>n(!1),className:"block px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 transition",children:"Outlook"}),r.jsx("button",{onClick:()=>{Kw(t),n(!1)},className:"block w-full text-left px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 transition",children:"Download .ics (Apple / Other)"})]})]})}const Dk={Conference:{icon:so,color:"bg-[#1f0f3f]",text:"text-white"},Webinar:{icon:Wi,color:"bg-[#0369a1]",text:"text-white"},Training:{icon:Uw,color:"bg-[#2d6a4f]",text:"text-white"},Workshop:{icon:In,color:"bg-[#7c3aed]",text:"text-white"},Roundtable:{icon:bx,color:"bg-[#c08a2f]",text:"text-white"},Networking:{icon:at,color:"bg-[#9f1239]",text:"text-white"},Other:{icon:z3,color:"bg-slate-700",text:"text-white"}};function fU(t){return Dk[t]||Dk.Other}function Sn(t,e){return t==null||t===0?"Free":new Intl.NumberFormat("en-US",{style:"currency",currency:e||"USD",minimumFractionDigits:0}).format(t)}function pU(t){return t?/<(?:p|div|h[1-6]|ul|ol|li|br|blockquote|table|img)[\s>/]/i.test(t)?t:t.split(/\n\s*\n/).filter(e=>e.trim()).map(e=>`<p>${e.replace(/\n/g,"<br>")}</p>`).join(` 713`):""}function xU(t){return t?t.startsWith("data:")||t.startsWith("http")?t:tt(t):null}function gU({event:t}){const[e,s]=v.useState(!1);return r.jsxs("div",{children:[r.jsxs("button",{onClick:()=>s(n=>!n),className:"w-full inline-flex items-center justify-center gap-1.5 px-4 py-2.5 rounded-xl border border-slate-200 text-sm font-medium text-slate-700 hover:bg-slate-50 transition",children:[r.jsx(Xl,{className:"h-4 w-4"})," Add to Calendar"]}),e&&r.jsxs("div",{className:"mt-2 rounded-xl border border-slate-200 bg-white shadow-sm overflow-hidden",children:[r.jsxs("a",{href:qw(t),target:"_blank",rel:"noreferrer",className:"flex items-center gap-2.5 px-4 py-3 text-sm text-slate-700 hover:bg-slate-50 transition border-b border-slate-100",children:[r.jsx(Xl,{className:"h-4 w-4 text-[#4285F4]"}),"Google Calendar"]}),r.jsxs("a",{href:Jw(t),target:"_blank",rel:"noreferrer",className:"flex items-center gap-2.5 px-4 py-3 text-sm text-slate-700 hover:bg-slate-50 transition border-b border-slate-100",children:[r.jsx(Xl,{className:"h-4 w-4 text-[#0078D4]"}),"Outlook Calendar"]}),r.jsxs("button",{onClick:()=>{Kw(t),s(!1)},className:"w-full flex items-center gap-2.5 px-4 py-3 text-sm text-slate-700 hover:bg-slate-50 transition",children:[r.jsx(Xl,{className:"h-4 w-4 text-[#1f0f3f]"}),"iCal"]})]})]})}function bU({event:t,onClose:e,onToast:s}
713){const[n,a]=v.useState({full_name:"",email:"",job_title:"",organisation:"",phone:"",sector:"",privacy_accepted:!1,custom:{}}),[i,o]=v.useState(!1),[l,c]=v.useState(!1),[d,u]=v.useState(1),[h,m]=v.useState(""),[f,p]=v.useState(""),g=(y,w)=>a(N=>({...N,[y]:w})),x=(y,w)=>a(N=>({...N,custom:{...N.custom,[y]:w}})),b=async y=>{var S;if((S=y==null?void 0:y.preventDefault)==null||S.call(y),!n.full_name.trim()||!n.email.trim()){s({type:"error",message:"Please enter your full name and email."});return}if(!n.privacy_accepted){s({type:"error",message:"Please accept the data privacy policy."});return}const w={job_title:n.job_title.trim(),organisation:n.organisation.trim(),sector:n.sector,...n.custom||{}},j=t.event_type==="paid"||t.non_member_price>0?`/api/events/${t.id}/guest-checkout`:`/api/events/${t.id}/guest-rsvp`;try{o(!0);const k={full_name:n.full_name.trim(),email:n.email.trim(),phone:n.phone.trim(),registration_data:w,group_quantity:l?d:1,group_org_name:l?h:"",group_code:l?f:""},C=await U(j,{method:"POST",body:k});if(C.url){window.location.href=C.url;return}s({type:"success",message:`Registered for "${t.title}" successfully!`}),e(!0)}catch(k){s({type:"error",message:k.message||"Failed to register"})}finally{o(!1)}};return r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:()=>!i&&e(!1),"aria-label":"Close"}),r.jsx("div",{className:"relative max-w-lg mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-slate-200 bg-white shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"p-5 border-b border-slate-200 flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"text-slate-900 font-semibold",children:["Register for ",t.title]}),r.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:"Non-members can register directly here."})]}),r.jsx(W,{variant:"outline",onClick:()=>e(!1),disabled:i,children:"Close"})]}),r.jsx("div",{className:"p-5",children:r.jsxs("form",{className:"grid gap-4",onSubmit:b,children:[r.jsx(Y,{label:"Full Name *",value:n.full_name,onChange:y=>g("full_name",y.target.value),required:!0}),r.jsx(Y,{label:"Email Address *",type:"email",value:n.email,onChange:y=>g("email",y.target.value),required:!0}),r.jsx(Y,{label:"Job Title",value:n.job_title,onChange:y=>g("job_title",y.target.value)}),r.jsx(Y,{label:"Organisation",value:n.organisation,onChange:y=>g("organisation",y.target.value)}),r.jsx(Y,{label:"Contact Number",value:n.phone,onChange:y=>g("phone",y.target.value)}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Sector"}),r.jsxs("select",{value:n.sector,onChange:y=>g("sector",y.target.value),className:"w-full h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-700 bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40",children:[r.jsx("option",{value:"",children:"â Select Sector â"}),r.jsx("option",{value:"Private",children:"Private"}),r.jsx("option",{value:"Public",children:"Public"}),r.jsx("option",{value:"Both",children:"Both"})]})]}),(t.registration_form||[]).map((y,w)=>{const N=y.label||`custom_${w}`,j=n.custom[N]||"";if(y.type==="select"){const S=(y.options||"").split(",").map(k=>k.trim()).filter(Boolean);return r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[y.label,y.required?" *":""]}),r.jsxs("select",{value:j,onChange:k=>
713x(N,k.target.value),required:y.required,className:"w-full h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-700 bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40",children:[r.jsx("option",{value:"",children:"â Select â"}),S.map(k=>r.jsx("option",{value:k,children:k},k))]})]},w)}return y.type==="checkbox"?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"checkbox",checked:j==="yes",onChange:S=>x(N,S.target.checked?"yes":""),className:"rounded border-slate-300 text-[#c08a2f] focus:ring-[#c08a2f]"}),r.jsxs("label",{className:"text-sm text-slate-700",children:[y.label,y.required?" *":""]})]},w):y.type==="textarea"?r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:[y.label,y.required?" *":""]}),r.jsx("textarea",{value:j,onChange:S=>x(N,S.target.value),required:y.required,placeholder:y.placeholder||"",rows:3,className:"w-full rounded-xl border border-slate-200 px-3 py-2 text-sm text-slate-700 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]},w):r.jsx(Y,{label:`${y.label}${y.required?" *":""}`,type:y.type||"text",value:j,onChange:S=>x(N,S.target.value),required:y.required,placeholder:y.placeholder||""},w)}),t.non_member_price>0&&r.jsxs("div",{className:"text-xs text-slate-500",children:["Non-member price: ",Sn(t.non_member_price,t.currency)]}),t.group_discount_enabled&&r.jsxs("div",{className:"rounded-xl border border-blue-100 bg-blue-50 overflow-hidden",children:[r.jsxs("button",{type:"button",onClick:()=>c(y=>!y),className:"w-full flex items-center justify-between px-4 py-3 text-sm font-medium text-blue-800 hover:bg-blue-100 transition",children:[r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(er,{className:"h-4 w-4"}),"Buying for a group or organisation?"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsxs("span",{className:"text-xs text-blue-600",children:["Save ",t.group_discount_percent||10,"% on ",t.group_discount_min_size||5,"+ tickets"]}),r.jsx(ll,{className:`h-4 w-4 transition-transform ${l?"rotate-90":""}`})]})]}),l&&(()=>{const y=t.non_member_price||0,w=t.group_discount_min_size||5,N=t.group_discount_percent||10,j=d>=w,S=t.group_discount_requires_code,k=j&&(!S||f.trim().length>0),C=k?y*(1-N/100):y,T=C*d;return r.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-blue-100",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Number of tickets"}),r.jsx("input",{type:"number",min:"1",max:"500",value:d,onChange:A=>u(Math.max(1,Number(A.target.value)||1)),className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Organisation"}),r.jsx("input",{type:"text",value:h,onChange:A=>m(A.target.value),placeholder:"Optional",className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]})]}),S&&r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Group / Promo Code"}),r.jsx("input",{type:"text",value:f,onChange:A=>p(A.target.value),placeholder:"Enter your group code",className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),y>0&&r.jsxs("div",{className:"rounded-lg bg-white border border-blue-100 p-3 text-xs space-y-1.5",children:[r.jsxs("div",{className:"flex justify-between text-slate-600",children:[r.jsx("span",{children:"Price per ticket"}),r.jsx("span",{children:Sn(y,t.currency)})]}),k&&r.jsxs("div",{className:"flex justify-between text-green-700 font-medium",children:[r.jsxs("span",{children:["Group discount (",N,"%)"]}),r.jsxs("span",{children:["â",Sn(y*N/100,t.currency)]})]}),k&&r.jsxs("div",{className:"flex justify-between text-slate-700",children:[r.jsx("span",{children:"Discounted price / ticket"}),r.jsx("span",{className:"font-semibold",children:Sn(C,t.currency)})]}),r.jsxs("div",{className:"flex justify-between border-t border-slate-100 pt-1.5 font-semibold text-slate-900",children:[r.jsxs("span",{children:["Total (",d," ticket",d!==1?"s":"",")"]}),r.jsx("span",{children:Sn(T,t.currency)})]}),k&&r.jsxs("div",{className:"text-center text-green-700 font-medium pt-0.5",children:["You save ",Sn(y*N/100*d,t.currency),"!"]}),!j&&r.jsxs("div",{className:"text-center text-blue-600 pt-0.5",children:["Add ",w-d," more ticket",w-d!==1?"s":""," to unlock the ",N,"% discount"]})]})]})})()]}),r.jsx("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-4",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("input",{type:"checkbox",checked:n.privacy_accepted,onChange:y=>g("privacy_accepted",y.target.checked),className:"mt-0.5 rounded border-slate-300 text-[#c08a2f] focus:ring-[#c08a2f]",required:!0}),r.jsxs("label",{className:"text-xs text-slate-600 leading-relaxed",children:["I consent to the collection and processing of my personal data by the African Corporate Counsel Group (ACGC) for event registration and communication. I understand my data will be handled per applicable data protection laws and the ACGC Privacy Policy, and I may withdraw consent by contacting ",r.jsx("a",{href:"mailto:[email protected]",className:"text-[#c08a2f] underline",children:"[email protected]"}),"."]})]})}),r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r.jsx(W,{variant:"outline",type:"button",onClick:()=>e(!1),disabled:i,children:"Cancel"}),r.jsx(W,{type:"submit",disabled:i,children:i?"Submitting...":t.non_member_price>0||t.event_type==="paid"?"Continue to Payment":"Register"})]})]})})]})})]})}function yU(){const{slug:t}=al(),e=Bn(),{token:s,member:n}=Oe(),[a,i]=eo(),[o,l]=v.useState(null),[c,d]=v.useState(!0),[u,h]=v.useState(""),[m,f]=v.useState(!1),[p,g]=v.useState(null),[x,b]=v.useState(!1),[y,w]=v.useState(!1),[N,j]=v.useState(!1),[S,k]=v.useState(1),[C,T]=v.useState(""),[A,E]=v.useState(""),L=!!n,D=wx(o==null?void 0:o.start_at);v.useEffect(()=>{if(!p)return;const oe=setTimeout(()=>g(null),4e3);return()=>clearTimeout(oe)},[p]),v.useEffect(()=>{const oe=a.get("payment");oe==="success"?(g({type:"success",message:"Payment successful! You are now registered."}),a.delete("payment"),a.delete("event"),i(a,{replace:!0})):oe==="cancelled"&&(g({type:"error",message:"Payment was cancelled."}),a.delete("payment"),i(a,{replace:!0}))},[]),v.useEffect(()=>{(async()=>{d(!0),h("");try{const oe=await U(`/api/events/${t}`);oe.event?(l(oe.event),/^\d+$/.test(t)&&oe.event.slug&&e(`/events/${oe.event.slug}`,{replace:!0})):h("Event not found")}catch(oe){h(oe.message||"Failed to load event")}finally{d(!1)}})()},[t]),v.useEffect(()=>{!L||!o||(async()=>{try{const F=((await U("/api/events/members",{token:s})).events||[]).find(Z=>Z.id===o.id);F&&l(Z=>({...Z,is_registered:F.is_registered}))}catch{}})()},[L,o==null?void 0:o.id,s]);const P=async()=>
713{if(!o)return;const oe=o.member_price!=null?Number(o.member_price):null,F=L?oe!=null?oe>0:o.event_type==="paid":o.event_type==="paid"||o.non_member_price>0;if(o.capacity&&o.registered_count>=o.capacity){try{f(!0),await U(`/api/events/members/${o.id}/waitlist`,{method:"POST",token:s,body:{}}),g({type:"success",message:"Added to waitlist."})}catch(Z){g({type:"error",message:Z.message||"Failed"})}finally{f(!1)}return}if(F)try{f(!0);const Z=N&&o.group_discount_enabled?{group_quantity:S,group_org_name:C,group_code:A}:{},de=await U(`/api/events/members/${o.id}/checkout`,{method:"POST",token:s,body:Z});if(de.url){window.location.href=de.url;return}}catch(Z){g({type:"error",message:Z.message||"Failed"})}finally{f(!1)}else try{f(!0),await U(`/api/events/members/${o.id}/rsvp`,{method:"POST",token:s,body:{}}),l(Z=>({...Z,is_registered:!0,registered_count:(Z.registered_count||0)+1})),g({type:"success",message:`Registered for "${o.title}"!`})}catch(Z){g({type:"error",message:Z.message||"Failed"})}finally{f(!1)}},R=async()=>{try{f(!0),await U(`/api/events/members/${o.id}/rsvp`,{method:"DELETE",token:s}),l(oe=>({...oe,is_registered:!1,registered_count:Math.max(0,(oe.registered_count||0)-1)})),g({type:"success",message:"Registration cancelled."})}catch(oe){g({type:"error",message:oe.message||"Failed"})}finally{f(!1)}},$=()=>{navigator.clipboard.writeText(window.location.href).then(()=>{b(!0),setTimeout(()=>b(!1),2e3)})};if(c)return r.jsxs("div",{className:"min-h-screen bg-slate-50",children:[r.jsx("div",{className:"h-[340px] bg-[#1f0f3f] animate-pulse"}),r.jsx("div",{className:"max-w-5xl mx-auto px-4 -mt-16",children:r.jsxs("div",{className:"bg-white rounded-2xl shadow-lg p-8 animate-pulse",children:[r.jsx("div",{className:"h-8 w-2/3 bg-slate-200 rounded mb-4"}),r.jsx("div",{className:"h-4 w-1/2 bg-slate-100 rounded mb-3"}),r.jsx("div",{className:"h-4 w-3/4 bg-slate-100 rounded"})]})})]});if(u||!o)return r.jsx("div",{className:"min-h-screen bg-slate-50 flex items-center justify-center",children:r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-20 w-20 rounded-full bg-slate-100 mb-5",children:r.jsx(Ds,{className:"h-9 w-9 text-slate-400"})}),r.jsx("h1",{className:"text-2xl font-bold text-slate-800",children:"Event Not Found"}),r.jsx("p",{className:"mt-2 text-slate-500",children:u||"This event does not exist or has been removed."}),r.jsxs(K,{to:"/events",className:"mt-6 inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-[#1f0f3f] text-white font-medium text-sm hover:bg-[#2a1654] transition",children:[r.jsx(vn,{className:"h-4 w-4"})," Back to Events"]})]})});const O=fU(o.type),_=O.icon,B=xU(o.banner_url||o.thumbnail_url),J=new Date(o.start_at)<new Date,Q=o.capacity&&o.registered_count>=o.capacity,ce=o.event_type==="paid"&&o.member_price==null&&o.non_member_price==null&&(!o.ticket_price_cents||o.ticket_price_cents===0),fe=o.event_type==="paid"||o.member_price>0||o.non_member_price>0,X=cr(o.start_at),pe=gy(o.start_at),be=oa(o.start_at),q=o.end_at?cr(o.end_at):null,le=q?oa(o.end_at,{includeTimeZoneName:!1}):null,De=q?gy(o.end_at):null,$e=!!(X&&q&&X.toDateString()===q.toDateString()),H=lU(),he=o.capacity?Math.max(0,o.capacity-(o.registered_count||0)):null;return r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"relative bg-[#1f0f3f] overflow-hidden",style:{minHeight:"260px"},children:[B&&r.jsx("img",{src:B,alt:o.title,className:"absolute inset-0 w-full h-full object-cover",onError:oe=>{oe.currentTarget.style.display="none"}}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#1f0f3f] via-[#1f0f3f]/50 to-[#1f0f3f]/20"}),!B&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"absolute -top-24 -right-24 w-64 h-64 rounded-full bg-[#c08a2f]/10 blur-3xl"}),r.jsx("div",{className:"absolute -bottom-16 -left-16 w-56 h-56 rounded-full bg-[#2a1654]/60 blur-2xl"})]}),r.jsx("div",{className:"absolute top-4 left-4 z-10",children:r.jsxs(K,{to:"/events",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-white/10 backdrop-blur-md text-white text-sm font-medium hover:bg-white/20 transition border border-white/10",children:[r.jsx(vn,{className:"h-4 w-4"})," All Events"]})}),r.jsx("div",{className:"absolute top-4 right-4 z-10",children:r.jsx("button",{onClick:$,className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-white/10 backdrop-blur-md text-white text-sm font-medium hover:bg-white/20 transition border border-white/10",children:x?r.jsxs(r.Fragment,{children:[r.jsx(is,{className:"h-4 w-4"})," Copied!"]}):r.jsxs(r.Fragment,{children:[r.jsx(G3,{className:"h-4 w-4"})," Share"]})})}),r.jsxs(V.div,{initial:{opacity:0,y:16}
713,animate:{opacity:1,y:0},transition:{duration:.45,ease:"easeOut"},className:"relative z-10 flex flex-col justify-end h-full px-6 md:px-10 pb-14 pt-20 max-w-5xl mx-auto",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap mb-3",children:[r.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-3 py-1 text-xs font-semibold ${O.color} ${O.text} shadow`,children:[r.jsx(_,{className:"h-3.5 w-3.5"}),o.type]}),fe?r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#c08a2f] text-white px-3 py-1 text-xs font-semibold shadow",children:[r.jsx(Rf,{className:"h-3 w-3"})," Paid"]}):r.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-green-500 text-white px-3 py-1 text-xs font-semibold shadow",children:"Free"}),o.access_level==="members_paid"&&r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-white/20 text-white border border-white/20 px-3 py-1 text-xs font-semibold backdrop-blur-sm",children:[r.jsx(Fn,{className:"h-3 w-3"})," Members Only"]}),J&&r.jsx("span",{className:"inline-flex items-center rounded-full bg-white/10 text-white/70 border border-white/10 px-3 py-1 text-xs font-medium",children:"Past Event"})]}),r.jsx("h1",{className:"text-2xl md:text-3xl lg:text-4xl font-bold text-white leading-tight max-w-3xl drop-shadow-md",children:o.title}),o.summary&&r.jsx("p",{className:"mt-2 text-white/70 text-sm md:text-base max-w-2xl leading-relaxed line-clamp-2",children:o.summary})]})]}),r.jsx("div",{className:"max-w-5xl mx-auto px-4 md:px-6 -mt-6 relative z-10 pb-16",children:r.jsxs("div",{className:"grid lg:grid-cols-3 gap-6",children:[r.jsx(V.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"lg:col-span-2",children:r.jsx("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200/60 overflow-hidden",children:r.jsxs("div",{className:"p-6 md:p-8",children:[o.group_discount_enabled&&r.jsxs("div",{className:"mb-5 flex items-center gap-2.5 rounded-xl bg-blue-50 border border-blue-100 px-4 py-3",children:[r.jsx(er,{className:"h-4 w-4 text-blue-600 shrink-0"}),r.jsxs("span",{className:"text-sm text-blue-800 font-medium",children:["Group Discount Available â Buy ",o.group_discount_min_size||5,"+ tickets and save ",o.group_discount_percent||10,"%"]})]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-slate-50 border border-slate-100",children:[r.jsx(Ds,{className:"h-5 w-5 text-[#c08a2f] mt-0.5 shrink-0"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider",children:"Date"}),r.jsx("div",{className:"mt-1 text-sm font-semibold text-slate-800",children:pe}),q&&!$e&&r.jsxs("div",{className:"text-sm text-slate-600",children:["to ",De]})]})]}),r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-slate-50 border border-slate-100",children:[r.jsx(cl,{className:"h-5 w-5 text-[#c08a2f] mt-0.5 shrink-0"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider",children:"Time"}),r.jsxs("div",{className:"mt-1 text-sm font-semibold text-slate-800",children:[be,le?` â ${le}`:""]}),H?r.jsxs("div",{className:"mt-1.5 text-xs text-slate-500",children:["Shown in your time zone (",H,")."]}):null]})]}),o.location&&r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-slate-50 border border-slate-100",children:[r.jsx(kt,{className:"h-5 w-5 text-[#c08a2f] mt-0.5 shrink-0"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider",children:"Location"}),r.jsx("div",{className:"mt-1 text-sm font-semibold text-slate-800",children:o.location})]})]}),o.is_virtual&&r.jsxs("div",{className:"flex items-start gap-3 p-4 rounded-xl bg-slate-50 border border-slate-100",children:[r.jsx(pt,{className:"h-5 w-5 text-[#c08a2f] mt-0.5 shrink-0"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider",children:"Format"}),r.jsx("div",{className:"mt-1 text-sm font-semibold text-slate-800",children:"Virtual Event"})]})]})]}),o.header_url&&r.jsx("div",{className:"mt-8 rounded-xl overflow-hidden border border-slate-100",children:r.jsx("img",{src:o.header_url,alt:o.title,className:"w-full h-auto object-cover",onError:oe=>{oe.currentTarget.closest("div.rounded-xl").style.display="none"}})}),(o.full_description||o.short_description)&&r.jsxs("div",{className:"mt-8",children:[r.jsx("h2",{className:"text-lg font-semibold text-slate-900 mb-3",children:"About This Event"}),r.jsx("div",{className:"prose prose-slate prose-sm max-w-none text-slate-600 leading-relaxed whitespace-pre-line",dangerouslySetInnerHTML:{__html:un.sanitize(pU(o.full_description||o.short_description))}})]}),(o.replay_url||o.materials_url||o.registration_url)&&r.jsxs("div",{className:"mt-8 flex flex-wrap gap-3",children:[o.registration_url&&r.jsxs("a",{href:o.registration_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-xl border border-slate-200 text-sm font-medium text-slate-700 hover:bg-slate-50 transition",children:[r.jsx(ur,{className:"h-4 w-4"}),"External Registration"]}),o.replay_url&&r.jsxs("a",{href:o.replay_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-xl border border-slate-200 text-sm font-medium text-slate-700 hover:bg-slate-50 transition",children:[r.jsx(wn,{className:"h-4 w-4"}),"Watch Replay"]}),o.materials_url&&r.jsxs("a",{href:o.materials_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-xl border border-slate-200 text-sm font-medium text-slate-700 hover:bg-slate-50 transition",children:[r.jsx(es,{className:"h-4 w-4"}),"Event Materials"]})]})]})})}),r.jsxs(V.div,{initial:{opacity:0,y:20}
713,animate:{opacity:1,y:0},transition:{duration:.4,delay:.1},className:"space-y-5",children:[r.jsx("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200/60 overflow-hidden",children:r.jsxs("div",{className:"p-6",children:[ce?r.jsxs("div",{className:"mb-5 text-center py-3 rounded-xl bg-slate-50 border border-slate-200",children:[r.jsx("div",{className:"text-sm font-semibold text-slate-600",children:"Pricing Coming Soon"}),r.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:"Registration will open once pricing is confirmed."})]}):fe?r.jsxs("div",{className:"mb-5",children:[r.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider mb-2",children:"Pricing"}),o.member_price!=null&&r.jsxs("div",{className:"flex items-center justify-between py-2 border-b border-slate-100",children:[r.jsx("span",{className:"text-sm text-slate-600",children:"Members"}),r.jsx("span",{className:"text-sm font-bold text-[#c08a2f]",children:Sn(o.member_price,o.currency)})]}),o.non_member_price!=null&&r.jsxs("div",{className:"flex items-center justify-between py-2",children:[r.jsx("span",{className:"text-sm text-slate-600",children:"Non-members"}),r.jsx("span",{className:"text-sm font-semibold text-slate-800",children:Sn(o.non_member_price,o.currency)})]})]}):r.jsx("div",{className:"mb-5 text-center py-3 rounded-xl bg-green-50 border border-green-100",children:r.jsx("span",{className:"text-sm font-semibold text-green-700",children:"Free Event"})}),o.capacity&&r.jsxs("div",{className:"mb-4",children:[r.jsxs("div",{className:"flex items-center justify-between text-xs text-slate-500 mb-1.5",children:[r.jsxs("span",{children:[o.registered_count||0," registered"]}),r.jsxs("span",{children:[o.capacity," spots"]})]}),r.jsx("div",{className:"h-2 bg-slate-100 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(100,(o.registered_count||0)/o.capacity*100)}%`,backgroundColor:Q?"#dc2626":"#c08a2f"}})}),he!=null&&he<=10&&he>0&&r.jsxs("div",{className:"mt-1.5 text-xs text-orange-600 font-medium",children:["Only ",he," spot",he!==1?"s":""," left!"]})]}),!J&&fe&&L&&!o.is_registered&&!Q&&o.group_discount_enabled&&r.jsxs("div",{className:"mb-4 rounded-xl border border-blue-100 bg-blue-50 overflow-hidden",children:[r.jsxs("button",{type:"button",onClick:()=>j(oe=>!oe),className:"w-full flex items-center justify-between px-4 py-3 text-sm font-medium text-blue-800 hover:bg-blue-100 transition",children:[r.jsxs("span",{className:"flex items-center gap-2",children:[r.jsx(er,{className:"h-4 w-4"}),"Group / Organisation booking"]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsxs("span",{className:"text-xs text-blue-600",children:["Save ",o.group_discount_percent||10,"% on ",o.group_discount_min_size||5,"+ tickets"]}),r.jsx(ll,{className:`h-4 w-4 transition-transform ${N?"rotate-90":""}`})]})]}),N&&(()=>{const oe=o.member_price||0,F=o.group_discount_min_size||5,Z=o.group_discount_percent||10,de=S>=F,Ve=o.group_discount_requires_code,Pe=de&&(!Ve||A.trim().length>0),z=Pe?oe*(1-Z/100):oe,ye=z*S;return r.jsxs("div",{className:"px-4 pb-4 space-y-3 border-t border-blue-100",children:[r.jsxs("div",{className:"grid grid-cols-2 gap-2 pt-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Number of tickets"}),r.jsx("input",{type:"number",min:"1",max:"500",value:S,onChange:ve=>k(Math.max(1,Number(ve.target.value)||1)),className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Organisation"}),r.jsx("input",{type:"text",value:C,onChange:ve=>T(ve.target.value),placeholder:"Optional",className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]})]}),Ve&&r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-700 mb-1",children:"Group / Promo Code"}),r.jsx("input",{type:"text",value:A,onChange:ve=>E(ve.target.value),placeholder:"Enter your group code",className:"w-full h-9 rounded-lg border border-slate-200 px-3 text-sm bg-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),oe>0&&r.jsxs("div",{className:"rounded-lg bg-white border border-blue-100 p-3 text-xs space-y-1.5",children:[r.jsxs("div",{className:"flex justify-between text-slate-600",children:[r.jsx("span",{children:"Price per ticket (member)"}),r.jsx("span",{children:Sn(oe,o.currency)})]}),Pe&&r.jsxs("div",{className:"flex justify-between text-green-700 font-medium",children:[r.jsxs("span",{children:["Group discount (",Z,"%)"]}),r.jsxs("span",{children:["â",Sn(oe*Z/100,o.currency)]})]}),Pe&&r.jsxs("div",{className:"flex justify-between text-slate-700",children:[r.jsx("span",{children:"Discounted price / ticket"}),r.jsx("span",{className:"font-semibold",children:Sn(z,o.currency)})]}),r.jsxs("div",{className:"flex justify-between border-t border-slate-100 pt-1.5 font-semibold text-slate-900",children:[r.jsxs("span",{children:["Total (",S," ticket",S!==1?"s":"",")"]}),r.jsx("span",{children:Sn(ye,o.currency)})]}),Pe&&r.jsxs("div",{className:"text-center text-green-700 font-medium pt-0.5",children:["You save ",Sn(oe*Z/100*S,o.currency),"!"]}),!de&&r.jsxs("div",{className:"text-center text-blue-600 pt-0.5",children:["Add ",F-S," more ticket",F-S!==1?"s":""," to unlock the ",Z,"% discount"]})]})]})})()]}),o.is_virtual&&o.is_registered&&o.webinar_url&&r.jsxs("a",{href:o.webinar_url,target:"_blank",rel:"noreferrer",className:"mb-3 w-full inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-blue-600 hover:bg-blue-700 text-white font-medium text-sm transition shadow-lg",children:[r.jsx(pt,{className:"h-4 w-4"})," Join Virtual Event"]}),J?r.jsx("div",{className:"text-center py-3 rounded-xl bg-slate-50 border border-slate-100",children:r.jsx("span",{className:"text-sm text-slate-500",children:"This event has ended"})}):r.jsxs("div",{className:"space-y-3",children:[ce?r.jsx("div",{className:"w-full text-center px-5 py-3 rounded-xl bg-slate-100 text-slate-500 text-sm font-medium cursor-not-allowed",children:"Registration Opens Soon"}):L?o.is_registered?r.jsxs("button",{onClick:R,disabled:m,className:"w-full inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-green-600 hover:bg-green-700 text-white font-medium text-sm transition disabled:opacity-50",children:[r.jsx(Pr,{className:"h-4 w-4"})," Registered â Click to Cancel"]}):Q?r.jsxs("button",{onClick:P,disabled:m,className:"w-full inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-orange-600 hover:bg-orange-700 text-white font-medium text-sm transition disabled:opacity-50",children:[r.jsx(at,{className:"h-4 w-4"})," ",m?"Joining...":"Join Waitlist"]}):r.jsx("button",{onClick:P,disabled:m,className:"w-full inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-[#c08a2f] hover:bg-[#a
71377324] text-white font-medium text-sm transition shadow-lg disabled:opacity-50",children:m?"Registering...":fe?"Register & Pay":"Register Now"}):r.jsxs(r.Fragment,{children:[r.jsx("button",{onClick:()=>w(!0),className:"w-full inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-[#c08a2f] hover:bg-[#a77324] text-white font-medium text-sm transition shadow-lg",children:"Register as Guest"}),r.jsx(K,{to:"/login",className:"w-full inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl border border-slate-200 text-slate-700 font-medium text-sm hover:bg-slate-50 transition",children:"Sign in to Register"})]}),r.jsx(gU,{event:o})]})]})}),D&&r.jsxs("div",{className:"bg-white rounded-2xl shadow-lg border border-slate-200/60 overflow-hidden p-6",children:[r.jsx("div",{className:"text-xs text-slate-500 font-medium uppercase tracking-wider text-center mb-4",children:"Event Starts In"}),r.jsx("div",{className:"grid grid-cols-4 gap-2",children:[{val:D.days,label:"Days"},{val:D.hours,label:"Hours"},{val:D.minutes,label:"Min"},{val:D.seconds,label:"Sec"}].map(oe=>r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"h-14 rounded-xl bg-[#1f0f3f] flex items-center justify-center text-xl font-bold text-white",children:String(oe.val).padStart(2,"0")}),r.jsx("div",{className:"mt-1.5 text-[10px] uppercase tracking-wider text-slate-500 font-medium",children:oe.label})]},oe.label))})]}),!L&&r.jsxs("div",{className:"rounded-2xl border border-[#c08a2f]/20 bg-[#1f0f3f] p-5 text-center",children:[r.jsx("div",{className:"text-white font-semibold text-sm",children:"Get priority access"}),r.jsx("div",{className:"mt-1 text-white/70 text-xs",children:"ACGC members enjoy discounted pricing and exclusive access."}),r.jsx(K,{to:"/join",className:"mt-4 inline-flex items-center justify-center gap-2 px-5 py-2.5 rounded-xl bg-[#c08a2f] hover:bg-[#a77324] text-white font-medium text-sm transition w-full",children:"Join ACGC"})]})]})]})}),p&&r.jsx("div",{className:"fixed bottom-6 right-6 z-50 animate-in slide-in-from-bottom-4",children:r.jsxs("div",{className:`flex items-center gap-3 px-5 py-3 rounded-xl shadow-lg text-sm font-medium ${p.type==="success"?"bg-green-600 text-white":"bg-red-600 text-white"}`,children:[p.type==="success"&&r.jsx(Pr,{className:"h-4 w-4 shrink-0"}),p.message,r.jsx("button",{onClick:()=>g(null),className:"ml-2 text-white/70 hover:text-white",children:"Ã"})]})}),y&&o&&r.jsx(bU,{event:o,onClose:oe=>{w(!1),oe&&l(F=>({...F,registered_count:(F.registered_count||0)+1}))},onToast:g})]})}function ne({className:t="",...e}){return r.jsx("div",{className:`acgc-card rounded-2xl border shadow-soft ${t}`,...e})}function $s({className:t="",...e}){return r.jsx("div",{className:`p-5 pb-0 ${t}`,...e})}function re({className:t="",...e}){return r.jsx("div",{className:`p-5 ${t}`,...e})}function vU(){const{token:t,member:e}=Oe(),[s,n]=v.useState([]),[a,i]=v.useState(!1),[o,l]=v.useState("");v.useEffect(()=>{(async()=>{if(t)try{i(!0);const m=await U("/api/events/members/my-registrations",{token:t});n(m.registrations||[])}catch(m){l(m.message||"Failed to fetch your events")}finally{i(!1)}})()},[t]);const c=async h=>{try{await U(`/api/events/members/${h}/rsvp`,{method:"DELETE",token:t}),n(m=>m.filter(f=>f.event_id!==h))}catch(m){l(m.message||"Failed to cancel registration")}},d=s.filter(h=>new Date(h.start_at)>new Date),u=s.filter(h=>new Date(h.start_at)<=new Date);return t?r.jsxs("div",{className:"max-w-6xl mx-auto px-4 py-12",children:[r.jsxs(V.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{duration:.4,ease:"easeOut"},className:"mb-8",children:[r.jsx("h1",{className:"text-3xl font-bold text-slate-900 mb-2",children:"My Events"}),r.jsx("p",{className:"text-slate-600",children:"Events you've registered for and your attendance history"})]}),o&&r.jsx("div",{className:"mb-6 p-4 bg-red-50 border border-red-200 rounded-lg text-red-700",children:o}),a?r.jsxs("div",{className:"text-center py-12",children:[r.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-[#c08a2f] mx-auto"}),r.jsx("p",{className:"mt-2 text-slate-600",children:"Loading your events..."})]}):s.length===0?r.jsxs("div",{className:"text-center py-12",children:[r.jsx(Fn,{className:"h-16 w-16 text-slate-400 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl font-semibold text-slate-900 mb-2",children:"No events registered yet"}),r.jsx("p",{className:"text-slate-600 mb-6",children:"Browse upcoming events and register to attend"}),r.jsx(K,{to:"/events",children:r.jsx(W,{children:"Browse Events"})})]}):r.jsxs(r.Fragment,{children:[d.length>0&&r.jsxs("div",{className:"mb-12",children:[r.jsx("h2",{className:"text-xl font-semibold text-slate-900 mb-4",children:"Upcoming Events"}),r.jsx("div",{className:"grid gap-6",children:d.map(h=>r.jsx(Rk,{registration:h,onCancel:()=>c(h.event_id),isUpcoming:!0},h.id))})]}),u.length>0&&r.jsxs("div",{children:[r.jsx("h2",{className:"text-xl font-semibold text-slate-900 mb-4",children:"Past Events"}),r.jsx("div",{className:"grid gap-6",children:u.map(h=>r.jsx(Rk,{registration:h,isUpcoming:!1},h.id))})]})]})]}):r.jsx("div",{className:"max-w-4xl mx-auto px-4 py-12",children:r.jsxs("div",{className:"text-center",children:[r.jsx(Fn,{className:"h-16 w-16 text-slate-400 mx-auto mb-4"}),r.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-2",children:"My Events"}),r.jsx("p",{className:"text-slate-600 mb-6",children:"Please log in to view your registered events"}),r.jsx(K,{to:"/login",children:r.jsx(W,{children:"Log In"})})]})})}function Rk({registration:t,onCancel:e,isUpcoming:s}){const n=cr(t.start_at)||new Date(t.start_at),a=t.end_at?cr(t.end_at):null,i=t.payment_status==="paid",o=i&&t.ticket_price_cents>0,l=i&&(!t.ticket_price_cents||t.ticket_price_cents===0),c=t.payment_status==="waitlist",d=oa(t.start_at),u=a?oa(t.end_at,{includeTimeZoneName:!1}):null;return r.jsx(V.div,{initial:{opacity:0,y:20}
713,animate:{opacity:1,y:0},transition:{duration:.3},children:r.jsx(ne,{className:"h-full",children:r.jsx(re,{children:r.jsxs("div",{className:"flex items-start justify-between gap-4",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-2 flex-wrap",children:[r.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:t.event_title}),r.jsxs("div",{className:"flex gap-2",children:[o&&r.jsx(Te,{variant:"success",children:"Paid"}),l&&r.jsx(Te,{variant:"success",children:"Registered"}),c&&r.jsx(Te,{variant:"warning",children:"Waitlist"}),t.attended&&r.jsx(Te,{variant:"success",children:"Attended"})]})]}),r.jsxs("div",{className:"space-y-2 text-sm text-slate-600",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ds,{className:"h-4 w-4"}),n.toLocaleDateString("en-US",{weekday:"long",year:"numeric",month:"long",day:"numeric"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(cl,{className:"h-4 w-4"}),d,u?` â ${u}`:""]}),t.location&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(kt,{className:"h-4 w-4"}),t.location]}),t.ticket_price_cents>0&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Rf,{className:"h-4 w-4"}),"$",(t.ticket_price_cents/100).toFixed(2)]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Fn,{className:"h-4 w-4"}),"Registered: ",new Date(t.registered_at).toLocaleDateString()]})]}),t.qr_code&&r.jsx("div",{className:"mt-4 p-3 bg-slate-50 rounded-lg",children:r.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-600",children:[r.jsx(Pr,{className:"h-4 w-4 text-green-600"}),"QR Code: ",t.qr_code]})})]}),r.jsxs("div",{className:"flex flex-col gap-2",children:[r.jsx(K,{to:"/events",children:r.jsxs(W,{variant:"outline",size:"sm",children:[r.jsx(ur,{className:"h-4 w-4 mr-1"}),"View Event"]})}),s&&!c&&r.jsx(W,{variant:"outline",size:"sm",onClick:e,className:"text-red-600 border-red-200 hover:bg-red-50",children:"Cancel Registration"})]})]})})})})}function wr({children:t,delay:e=0,y:s=20,duration:n=.5,once:a=!0,as:i="div",...o}){const l=V[i]||V.div;return r.jsx(l,{initial:{opacity:0,y:s},whileInView:{opacity:1,y:0},viewport:{once:a,margin:"-60px"},transition:{duration:n,delay:e,ease:"easeOut"},...o,children:t})}function by({children:t,stagger:e=.08,y:s,duration:n,once:a,as:i="div",...o}){const l=v.Children.toArray(t),c=i;return r.jsx(c,{...o,children:l.map((d,u)=>r.jsx(wr,{delay:u*e,y:s,duration:n,once:a,children:d},d.key??u))})}const Gi=["Financial Services","Insurance","Technology","Media","Telecommunications","Energy and Infrastructure","Transport & Logistics","Mining","Manufacturing & Engineering","Real Estate & Construction","Aerospace & Defence","Charity / Not-for-profit","Healthcare & Pharma","Retail & Leisure","Fintech","Tourism","Higher Education","Private Security"],ch=[{value:"private",label:"Private"},{value:"public",label:"Public"}],sM=[{id:"ind_africa",name:"Africa-based in-house lawyers",tier:1,annualFee:12e3,applicationFee:2500,price:14500,priceLabel:"$120",applicationFeeLabel:"$25",eligibility:"In-house counsel lawyers working in Africa, including General Counsel, Heads of Legal and legal operations professionals."},{id:"ind_gov",name:"Public sector / government counsel",tier:2,annualFee:8500,applicationFee:1e3,price:9500,priceLabel:"$85",applicationFeeLabel:"$10",eligibility:"Lawyers employed directly by government ministries, departments, agencies or public institutions in Africa."},{id:"ind_early",name:"Early-career in-house lawyers (0â3 years)",tier:3,annualFee:6e3,applicationFee:1500,price:7500,priceLabel:"$60",applicationFeeLabel:"$15",eligibility:"Lawyers in their first three years of in-house or government legal practice, counted from the date of their first-ever in-house or government legal role."},{id:"ind_intl",name:"International Africa-focused in-house lawyers",tier:4,annualFee:2e4,applicationFee:3e3,price:23e3,priceLabel:"$200",applicationFeeLabel:"$30",eligibility:"In-house lawyers based outside Africa with professional responsibility for Africa or African markets, or a clear professional interest in engaging with and contributing to Africa-related legal, regulatory or institutional work."}],nM=[{id:"corp_tier1",name:"Standard Corporate Membership",tier:1,price:6e4,priceLabel:"$600",maxMembers:3,eligibility:"Open to any corporation with three or more legal professionals.",benefits:["Nominate up to 3 legal staff as members","Access to all individual member benefits","3 complimentary job postings on ACGC's job board per year","Exclusive invitations to ACGC in-person networking events","Extend ACGC's online learning & networking to 1 additional non-legal team member"]},{id:"corp_tier2",name:"Premium Corporate Membership",tier:2,price:15e4,priceLabel:"$1,500",maxMembers:6,eligibility:"Open to any corporation with up to six legal professionals.",benefits:["Nominate up to 6 legal staff as members","Access to all individual member benefits","1 complimentary annual conference pass","6 complimentary job postings on ACGC's job board per year","Extend ACGC's online learning & networking to 2 non-legal team members"]},{id:"corp_tier3",name:"Executive Corporate Membership",tier:3,price:225e3,priceLabel:"$2,250",maxMembers:10,eligibility:"Open to any corporation with up to ten (10) legal professionals.",benefits:["Nominate up to 10 legal staff as members","Full access to individual member benefits","2 complimentary passes to the annual conference","10 complimentary job postings on the ACGC job board","Extend ACGC's online learning & networking to 3 non-legal team members"]},{id:"corp_tier4",name:"Elite Corporate Membership",tier:4,price:3e5,priceLabel:"$3,000",maxMembers:15,eligibility:"Open to any corporation with up to 15 legal professionals.",benefits:["Nominate up to 15 legal staff as members","Premium access to all individual member benefits","3 complimentary passes to the annual conference","Unlimited job postings on the ACGC job board","Opportunities to host webinars and position as a thought leader","Extend ACGC's online learning & networking to 4 non-legal team members","Priority support and consulting for custom research inquiries"]},{id:"corp_tier5",name:"Corporate Plus Membership",tier:5,price:4e5,priceLabel:"$4,000",maxMembers:25,eligibility:"For teams of 15 to 25 members.",benefits:["Nominate up to 25 legal staff as members","Enhanced access to individual member benefits","4 complimentary passes to the annual conference","Priority access to ACGC w
713orkshops and seminars","Invitations to exclusive leadership events","Extend ACGC's educational webinars & networking to 5 additional team members"]},{id:"corp_tier6",name:"Corporate Elite Membership",tier:6,price:null,priceLabel:"Custom pricing",maxMembers:null,eligibility:"For teams above 25 members.",benefits:["Nominate an unlimited number of legal staff as members","All benefits of Corporate Plus Membership","Customized number of complimentary annual conference passes","Featured corporate profile on ACGC platforms","Host exclusive sessions or workshops at ACGC events","Complimentary access to premium legal resources and databases","Extend ACGC's educational webinars & networking to 5 additional team members"]}],rM=[{id:"gov_micro",name:"Micro Government Membership",tier:1,price:5e4,priceLabel:"$500",maxMembers:3,eligibility:"Up to 3 legal professionals.",benefits:["Full access to standard membership resources","1 complimentary job posting per year","Invitations to ACGC events tailored for government professionals"]},{id:"gov_small",name:"Small Department Government Membership",tier:2,price:125e3,priceLabel:"$1,250",maxMembers:10,eligibility:"Up to 10 legal professionals.",benefits:["2 complimentary annual conference passes","3 complimentary job postings","Priority access to specialised workshops","Enhanced directory visibility"]},{id:"gov_large",name:"Large Department Government Membership",tier:3,price:null,priceLabel:"Custom pricing",maxMembers:null,eligibility:"Custom pricing based on team size and specific needs.",benefits:["Full portal access","Customised training & webinars","Complimentary conference passes (with discounted additional passes)","Featured department profile","Access to closed sessions","Interdepartmental inclusion benefits"]}],aM=["Conference Materials","Webinars","Learning Resources","Tips, Tricks & Guides","Research & Reports","Community Videos","Programmes","Session Videos","In-House Life Videos","Webinar Highlights","Full Webinars","Microsoft AI Intelligence Hub"],Lu=[{value:"watch",label:"Watch"},{value:"read",label:"Read"},{value:"download",label:"Download"},{value:"profile",label:"Profile"}],iM={Webinars:["Webinar Highlight","Full Webinar"],"Community Videos":["In-House Life Video"],Programmes:["ACEP"]},oM=["AI & Technology","ESG & Compliance","Legal Skills & Practice","Career & Wellbeing","Leadership & GC Effectiveness","Growth & Business Development","Public Sector & Government Legal","Member Insights & Spotlights","Research & Data","ACGC Community & Events","ACEP","Sector tags (as grouped set)"];function wU(t){return t?t.startsWith("data:")||t.startsWith("http://")||t.startsWith("https://")?t:tt(t):null}const jU={"Conference Materials":{icon:so,desc:"Conference packs, slides, and supporting materials.",color:"bg-[#1f0f3f]"},Webinars:{icon:Wi,desc:"Webinar recordings and replay resources.",color:"bg-[#2a1654]"},"Learning Resources":{icon:On,desc:"Practical learning content and resources.",color:"bg-[#2a1654]"},"Tips, Tricks & Guides":{icon:Lf,desc:"Practical guidance and how-to content.",color:"bg-[#c08a2f]"},"Research & Reports":{icon:Vw,desc:"Research insights, surveys, and reports.",color:"bg-[#7c3aed]"},"Community Videos":{icon:at,desc:"Community stories and highlight videos.",color:"bg-[#2d6a4f]"},Programmes:{icon:On,desc:"Programme-specific content and material.",color:"bg-[#0f766e]"},"Microsoft AI Intelligence Hub":{icon:Lf,desc:"Sponsored Microsoft-curated AI resources for legal teams.",color:"bg-[#0078d4]",poweredBy:"Microsoft"}},Lk=aM.map(t=>{const e=jU[t]||{icon:On,desc:"Curated resources from the ACGC library.",color:"bg-slate-600"};return{key:t,label:t,shortLabel:t,...e}});function NU(t){const e=(t||"").toLowerCase();return e.includes("watch")||e.includes("video")||e.includes("webinar")?wn:e.includes("download")||e.includes("file")?Ys:es}function kU(t){return t.source_type==="partner"&&t.partner_name?t.partner_name:"ACGC"}const Wh=12;function CU(){var P;const{t}=en(),{token:e,member:s,loading:n}=Oe(),[a,i]=eo(),o=a.get("category")||"",l=a.get("content_format")||"",c=a.get("topic")||"",d=a.get("series")||"",[u,h]=v.useState([]),[m,f]=v.useState([]),[p,g]=v.useState(!1),[x,b]=v.useState(""),[y,w]=v.useState(""),[N,j]=v.useState(Wh),S=["Microsoft AI Intelligence Hub","Research & Reports"];v.useEffect(()=>{S.includes(o)?U("/api/resources/surveys").then(R=>f(R.surveys||[])).catch(()=>f([])):f([])},[o]),v.useEffect(()=>{if(n)return;g(!0),b("");const R=new URLSearchParams;o&&R.set("category",o),l&&R.set("content_format",l),c&&R.set("topic",c),d&&R.set("series",d);const $=R.toString()?`?${R.toString()}`:"",O=e?`/api/resources/members${$}`:`/api/resources${$}`;U(O,e?{token:e}:{}).then(_=>{h(_.resources||[]),j(Wh)}).catch(_=>{b(_.message||"Failed to load resources"),h([])}).finally(()=>g(!1))},[o,l,c,d,e,n]);const k=v.useMemo(()=>{const R=y.trim().toLowerCase();return R?u.filter($=>`${$.title||""} ${$.summary||""} ${$.category||""} ${$.partner_name||""}`.toLowerCase().includes(R)):u},[u,y]),C=k.slice(0,N),T=R=>{const $=new URLSearchParams(a);R?$.set("category",R):$.delete("category"),i($),w("")},A=R=>{const $=new URLSearchParams(a);R?$.set("content_format",R):$.delete("content_format"),i($)},E=R=>{const $=new URLSearchParams(a);R?$.set("topic",R):$.delete("topic"),i($)},L=R=>{const $=new URLSearchParams(a);R?$.set("series",R):$.delete("series"),i($)};if(n)return r.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-16 text-center text-slate-500",children:"Loadingâ¦"});const D=Lk.find(R=>R.key===o);return r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-12",children:[r.jsx(_r,{eyebrow:"Members",title:"Resource Library",subtitle:"Exclusive content for ACGC members â
713conference materials, webinars, guides, research, and more."}),!e&&r.jsxs("div",{className:"mt-6 rounded-2xl border border-[#c08a2f]/20 bg-[#c08a2f]/5 p-4 flex flex-col sm:flex-row gap-4 sm:items-center sm:justify-between",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(or,{className:"h-5 w-5 text-[#c08a2f] mt-0.5 shrink-0"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-900 font-semibold",children:"Unlock the full library"}),r.jsx("div",{className:"mt-0.5 text-sm text-slate-600",children:"Some resources are exclusive to ACGC members. Sign up or log in to access everything."})]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx(W,{as:K,to:"/login",state:{from:"/resources"},className:"bg-white border border-slate-300 text-slate-700 hover:bg-slate-50",children:"Log in"}),r.jsx(W,{as:K,to:"/join",className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a]",children:"Join ACGC"})]})]}),s&&s.payment_status!=="paid"&&s.role!=="admin"&&s.role!=="editor"&&r.jsxs("div",{className:"mt-6 rounded-2xl border border-[#c08a2f]/20 bg-[#c08a2f]/5 p-4 flex flex-col sm:flex-row gap-4 sm:items-center sm:justify-between",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(or,{className:"h-5 w-5 text-[#c08a2f] mt-0.5 shrink-0"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-900 font-semibold",children:"Unlock the full library"}),r.jsx("div",{className:"mt-0.5 text-sm text-slate-600",children:"Some resources are exclusive to paid members. Upgrade to access everything."})]})]}),r.jsx(W,{as:K,to:"/billing",className:"shrink-0 bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a]",children:"Upgrade"})]}),r.jsx(by,{className:"mt-8 grid sm:grid-cols-2 lg:grid-cols-3 gap-4",stagger:.04,y:12,duration:.35,children:Lk.map(R=>{const $=R.icon,O=o===R.key;return r.jsxs("button",{onClick:()=>T(O?"":R.key),className:`group relative rounded-2xl border p-5 text-left transition-all duration-300 ${O?"border-[#1f0f3f] bg-[#1f0f3f] text-white shadow-[0_8px_30px_-6px_rgba(0,0,0,0.25)]":"border-slate-200/80 bg-white text-slate-900 shadow-[0_4px_24px_-8px_rgba(0,0,0,0.06)] hover:shadow-[0_8px_30px_-6px_rgba(0,0,0,0.12)] hover:border-slate-300"}`,children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:`h-10 w-10 rounded-xl grid place-items-center shrink-0 ${O?"bg-white/15":`${R.color} text-white`}`,children:r.jsx($,{className:"h-5 w-5"})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"font-semibold text-sm leading-snug",children:R.label}),r.jsx("div",{className:`mt-1 text-xs leading-relaxed ${O?"text-white/70":"text-slate-500"}`,children:R.desc}),R.poweredBy&&r.jsx("div",{className:`mt-2 inline-flex items-center gap-1 text-[10px] font-semibold tracking-wide px-2 py-0.5 rounded-full ${O?"bg-white/15 text-white/80":"bg-[#0078d4]/10 text-[#0078d4]"}`,children:"Microsoft AI Intelligence Hub"})]})]}),O&&r.jsx("div",{className:"absolute top-2.5 right-2.5",children:r.jsx(He,{className:"h-4 w-4 text-white/50"})})]},R.key)})}),r.jsxs("div",{className:"mt-8 grid md:grid-cols-2 gap-3",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Ua,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),r.jsx("input",{type:"text",value:y,onChange:R=>{w(R.target.value),j(Wh)},placeholder:D?`Search in ${D.shortLabel}â¦`:"Search all resourcesâ¦",className:"w-full h-11 pl-10 pr-4 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition shadow-sm"})]}),r.jsxs("select",{value:l,onChange:R=>A(R.target.value),className:"h-11 px-3 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition shadow-sm",children:[r.jsx("option",{value:"",children:"All content formats"}),Lu.map(R=>r.jsx("option",{value:R.value,children:R.label},R.value))]}),r.jsxs("select",{value:c,onChange:R=>E(R.target.value),className:"h-11 px-3 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition shadow-sm",children:[r.jsx("option",{value:"",children:"All topics"}),oM.map(R=>r.jsx("option",{value:R,children:R},R))]}),r.jsxs("select",{value:d,onChange:R=>L(R.target.value),className:"h-11 px-3 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition shadow-sm",children:[r.jsx("option",{value:"",children:"All series/subtypes"}),(iM[o]||[]).map(R=>r.jsx("option",{value:R,children:R},R))]})]}),(o||l||c||d)&&r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-sm",children:[o&&r.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-[#1f0f3f] text-white px-3 py-1 text-xs font-medium",children:[(D==null?void 0:D.shortL
713abel)||o,r.jsx("button",{onClick:()=>T(""),className:"hover:text-white/70",children:r.jsx(He,{className:"h-3 w-3"})})]}),l&&r.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-slate-700 text-white px-3 py-1 text-xs font-medium",children:[((P=Lu.find(R=>R.value===l))==null?void 0:P.label)||l,r.jsx("button",{onClick:()=>A(""),className:"hover:text-white/70",children:r.jsx(He,{className:"h-3 w-3"})})]}),c&&r.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-slate-700 text-white px-3 py-1 text-xs font-medium",children:["Topic: ",c,r.jsx("button",{onClick:()=>E(""),className:"hover:text-white/70",children:r.jsx(He,{className:"h-3 w-3"})})]}),d&&r.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-slate-700 text-white px-3 py-1 text-xs font-medium",children:["Series: ",d,r.jsx("button",{onClick:()=>L(""),className:"hover:text-white/70",children:r.jsx(He,{className:"h-3 w-3"})})]}),r.jsx("button",{onClick:()=>{T(""),A(""),E(""),L("")},className:"text-xs text-slate-500 hover:text-slate-800 transition",children:"Clear all"})]}),r.jsx("div",{className:"mt-4 text-sm text-slate-500",children:p?"Loadingâ¦":`${k.length} resource${k.length!==1?"s":""}`}),x&&r.jsx("div",{className:"mt-4 text-sm text-red-600",children:x}),m.length>0&&r.jsxs("div",{className:"mt-6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx("div",{className:"h-5 w-5 rounded bg-[#0078d4] grid place-items-center",children:r.jsx(Ys,{className:"h-3 w-3 text-white"})}),r.jsx("span",{className:"text-xs font-semibold text-[#0078d4] tracking-wide uppercase",children:"Microsoft Intelligence Hub â Survey Documents"})]}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-5",children:m.map(R=>r.jsxs("a",{href:R.url,target:"_blank",rel:"noopener noreferrer",className:"group flex flex-col gap-3 rounded-2xl border border-[#0078d4]/20 bg-white p-5 shadow-sm hover:shadow-md hover:border-[#0078d4]/40 transition",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-xl bg-[#0078d4] grid place-items-center shrink-0",children:r.jsx(Ys,{className:"h-5 w-5 text-white"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"font-semibold text-sm text-slate-900 leading-snug group-hover:text-[#0078d4] transition",children:R.name}),r.jsx("div",{className:"mt-1 text-xs text-slate-500",children:"Survey Document · PDF"})]})]}),r.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-medium text-[#0078d4]",children:[r.jsx(ur,{className:"h-3.5 w-3.5"}),"View / Download"]})]},R.id))})]}),!p&&C.length>0&&r.jsx("div",{className:"mt-5 grid sm:grid-cols-2 lg:grid-cols-3 gap-5",children:C.map((R,$)=>r.jsx(V.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:$*.03,duration:.35},children:r.jsx(SU,{resource:R,isGuest:!e})},R.id))}),!p&&N<k.length&&r.jsx("div",{className:"mt-8 text-center",children:r.jsxs("button",{onClick:()=>j(R=>R+Wh),className:"inline-flex items-center gap-2 px-6 py-2.5 rounded-xl border border-slate-200 bg-white text-sm font-medium text-slate-700 hover:border-slate-400 hover:bg-slate-50 transition shadow-sm",children:["Load more (",k.length-N," remaining)"]})}),p&&r.jsx("div",{className:"mt-5 grid sm:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:6}).map((R,$)=>r.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white overflow-hidden animate-pulse",children:[r.jsx("div",{className:"h-40 bg-slate-100"}),r.jsxs("div",{className:"p-4 space-y-2",children:[r.jsx("div",{className:"h-4 w-3/4 bg-slate-100 rounded"}),r.jsx("div",{className:"h-3 w-full bg-slate-100 rounded"}),r.jsx("div",{className:"h-3 w-1/2 bg-slate-100 rounded"})]})]},$))}),!p&&k.length===0&&!x&&r.jsxs("div",{className:"mt-12 text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-16 w-16 rounded-full bg-slate-100 mb-4",children:r.jsx(es,{className:"h-7 w-7 text-slate-400"})}),r.jsx("div",{className:"text-lg font-semibold text-slate-800",children:o?`No resources in "${(D==null?void 0:D.label)||o}
713" yet`:"No resources found"}),r.jsx("p",{className:"mt-2 text-sm text-slate-500",children:y?"Try a different search term.":"Resources will appear here once they are published by the ACGC team."})]})]})}function SU({resource:t,isGuest:e}){const s=NU(t.content_format||t.type),n=kU(t),a=e&&t.gated;t.youtube_url||t.file_url,t.body,t.youtube_url||t.file_url;const i=(t.content_format||t.type||"").replace(/_/g," ").replace(/\b\w/g,l=>l.toUpperCase()),o=(()=>{const l=(t.content_format||"").toLowerCase();return l==="watch"?"Watch":l==="download"?"Download":"Read"})();return r.jsxs("div",{className:"group rounded-2xl border border-slate-200/80 bg-white shadow-[0_4px_24px_-8px_rgba(0,0,0,0.06)] hover:shadow-[0_8px_30px_-6px_rgba(0,0,0,0.12)] hover:border-slate-300 transition-all duration-300 overflow-hidden h-full flex flex-col",children:[r.jsxs("div",{className:"relative h-40 bg-gradient-to-br from-slate-50 to-slate-100 overflow-hidden flex items-center justify-center shrink-0",children:[r.jsx(s,{className:"h-10 w-10 text-slate-300"}),t.thumbnail_url&&r.jsx("img",{src:wU(t.thumbnail_url),alt:t.title,className:"absolute inset-0 w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",onError:l=>{l.currentTarget.style.display="none"}}),r.jsx("div",{className:"absolute top-2.5 left-2.5 z-10",children:r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-lg bg-black/50 backdrop-blur-sm text-white px-2 py-1 text-xs font-medium",children:[r.jsx(s,{className:"h-3 w-3"}),i]})}),a&&r.jsx("div",{className:"absolute top-2.5 right-2.5 z-10",children:r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-lg bg-[#c08a2f]/90 backdrop-blur-sm text-white px-2 py-1 text-xs font-medium",children:[r.jsx(or,{className:"h-3 w-3"}),"Members Only"]})})]}),r.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[r.jsx("h3",{className:"text-sm font-semibold text-slate-900 leading-snug line-clamp-2 group-hover:text-[#1f0f3f] transition",children:t.title}),t.summary&&r.jsx("p",{className:"mt-1.5 text-xs text-slate-500 leading-relaxed line-clamp-2",children:t.summary}),r.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-x-3 gap-y-1 text-xs text-slate-400",children:[t.year&&r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx(Ds,{className:"h-3 w-3"})," ",t.year]}),r.jsxs("span",{className:"inline-flex items-center gap-1",children:[r.jsx(Gt,{className:"h-3 w-3"}),n]}),t.source_type==="partner"&&r.jsx("span",{className:"inline-flex items-center rounded-full bg-purple-50 text-purple-700 px-1.5 py-0.5 text-[10px] font-medium",children:"Partner"})]}),r.jsx("div",{className:"mt-auto pt-3",children:a?r.jsxs(K,{to:`/resources/${t.id}`,className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs font-medium bg-[#c08a2f] text-white hover:bg-[#a77324] transition w-full justify-center",children:[r.jsx(or,{className:"h-3 w-3"}),"Preview Resource"]}):r.jsxs(K,{to:`/resources/${t.id}`,className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-2 text-xs font-medium bg-[#1f0f3f] text-white hover:bg-[#2a1654] transition w-full justify-center",children:[o,r.jsx(ur,{className:"h-3 w-3"})]})})]})]})}function Zg(t){return t?t.startsWith("data:")||t.startsWith("http://")||t.startsWith("https://")?t:tt(t):null}function _U(t){return t?/<(?:p|div|h[1-6]|ul|ol|li|br|blockquote|table|img)[\s>/]/i.test(t)?t:t.split(/\n\s*\n/).filter(e=>e.trim()).map(e=>`<p>${e.replace(/\n/g,"<br>")}</p>`).join(` 714`):""}function TU(t){return t.source_type==="partner"&&t.partner_name?t.partner_name:"ACGC"}function EU(t){const e=(t||"").toLowerCase();return e.includes("video")||e.includes("webinar")?wn:es}function MU(){const{id:t}=al(),{token:e,loading:s}=Oe(),[n,a]=v.useState(null),[i,o]=v.useState(!0),[l,c]=v.useState("");if(v.useEffect(()=>{if(s)return;(async()=>{o(!0),c("");try{const f=e?`/api/resources/members/${t}`:`/api/resources/${t}`,p=await U(f,e?{token:e}:{});a(p.resource)}catch(f){c(f.message||"Resource not found")}finally{o(!1)}})()},[t,e,s]),s||i)return r.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-16 text-center text-slate-500",children:"Loadingâ¦"});if(l||!n)return r.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-16",children:r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"text-lg font-semibold text-slate-800",children:"Resource not found"}),r.jsx("p",{className:"mt-2 text-slate-500",children:l||"The resource you are looking for does not exist."}),r.jsx("div",{className:"mt-6",children:r.jsx(W,{as:K,to:"/resources",className:"bg-[#c08a2f] hover:bg-[#a
71477324] text-white border border-[#dcb26a]",children:"Back to Resources"})})]})});const d=EU(n.type),u=n.published_at?new Date(n.published_at).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):null,h=(n.type||"").replace(/_/g," ").replace(/\b\w/g,m=>m.toUpperCase());return r.jsxs("div",{className:"bg-[rgb(var(--bg))] text-[rgb(var(--fg))]",children:[r.jsx("section",{className:"bg-[#1f0f3f] text-white",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-12",children:[r.jsxs(K,{to:"/resources",className:"inline-flex items-center gap-2 text-sm text-slate-300 hover:text-white transition mb-6",children:[r.jsx(vn,{className:"h-4 w-4"})," Back to Resources"]}),r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx(d,{className:"h-4 w-4 text-[#e6c784]"}),r.jsx("span",{className:"text-xs uppercase tracking-[0.2em] text-[#e6c784]",children:h})]}),r.jsx(V.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"text-3xl md:text-4xl lg:text-5xl leading-tight",children:n.title}),n.summary?r.jsx(V.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.1},className:"mt-4 text-lg text-slate-200 max-w-3xl",children:n.summary}):null,r.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-4 text-sm text-slate-300",children:[u?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(aa,{className:"h-4 w-4"}),r.jsx("span",{children:u})]}):null,r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Gt,{className:"h-4 w-4"}),r.jsx("span",{children:TU(n)})]})]})]})}),n.thumbnail_url?r.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-6 -mt-6",children:r.jsx("div",{className:"rounded-2xl overflow-hidden shadow-lg",children:r.jsx("img",{src:Zg(n.thumbnail_url),alt:n.title,className:"w-full h-auto",onError:m=>{m.currentTarget.closest("div.rounded-2xl").style.display="none"}})})}):null,n.gated&&!e?r.jsx("article",{className:"max-w-4xl mx-auto px-4 md:px-6 py-10",children:r.jsx("div",{className:"rounded-3xl border border-slate-200 bg-white overflow-hidden",children:r.jsx("div",{className:"p-6 md:p-8",children:r.jsxs("div",{className:"rounded-2xl bg-[#1f0f3f] p-6 md:p-8 text-white shadow-xl",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx(or,{className:"h-5 w-5 text-[#e6c784]"}),r.jsx("span",{className:"text-sm font-semibold text-[#e6c784]",children:"Members Only Content"})]}),r.jsx("div",{className:"text-xl md:text-2xl",children:"Sign up or log in to access this resource"}),r.jsx("div",{className:"mt-2 text-slate-200",children:"This resource is exclusively available to ACGC members. Join the association to unlock the full library of conference materials, webinars, guides, research, and more."}),r.jsxs("div",{className:"mt-5 flex flex-wrap gap-3",children:[r.jsx(W,{as:K,to:"/join",className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a]",children:"Join ACGC"}),r.jsx(W,{as:K,to:"/login",state:{from:`/resources/${t}`},className:"bg-white/10 hover:bg-white/20 text-white border border-white/20",children:"Log in"}),r.jsx(W,{as:K,to:"/joining-options",className:"bg-white/10 hover:bg-white/20 text-white border border-white/20",children:"View membership options"})]})]})})})}):r.jsxs("article",{className:"max-w-4xl mx-auto px-4 md:px-6 py-10",children:[n.youtube_url&&r.jsx("div",{className:"mb-8 rounded-2xl overflow-hidden shadow-lg bg-slate-950",children:/youtube\.com|youtu\.be|vimeo\.com/.test(n.youtube_url)?r.jsx("iframe",{src:n.youtube_url.replace(/watch\?v=/,"embed/").replace(/youtu\.be\//,"youtube.com/embed/").replace(/vimeo\.com\/(\d+)/,"player.vimeo.com/video/$1"),className:"w-full aspect-video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Video"}):r.jsx("video",{src:Zg(n.youtube_url),controls:!0,className:"w-full h-auto max-h-[640px]",preload:"metadata"})}),n.body?r.jsx(V.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,delay:.15},className:"prose prose-slate prose-lg max-w-none",dangerouslySetInnerHTML:{__html:un.sanitize(_U(n.body))}}):n.youtube_url?null:r.jsx("div",{className:"text-slate-500 italic",children:"Full resource content coming soon."}),n.file_url&&r.jsx("div",{className:"mt-8",children:r.jsxs(W,{as:"a",href:Zg(n.file_url),target:"_blank",rel:"noreferrer",className:"bg-[#c08a2f] hover:bg-[#a
71477324] text-white border border-[#dcb26a]",children:[r.jsx(Ys,{className:"h-4 w-4 mr-2"})," Download Resource"]})})]}),r.jsx("section",{className:"max-w-4xl mx-auto px-4 md:px-6 pb-12",children:r.jsx("div",{className:"rounded-3xl p-8 md:p-10 text-white",style:{background:"#1f0f3f"},children:r.jsxs("div",{className:"flex flex-col md:flex-row gap-6 md:items-center md:justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-2xl",children:"Explore more resources"}),r.jsx("div",{className:"mt-2 text-slate-200",children:"Reports, articles, webinars, and learning materials for ACGC members."})]}),r.jsx(W,{as:K,to:"/resources",className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a] shrink-0",children:"All Resources"})]})})})]})}function Xw(t){return t?t.startsWith("data:")||t.startsWith("http://")||t.startsWith("https://")?t:tt(t):null}const AU=[{key:"in_house_insights",title:"In-House Insights",icon:On,description:"Expert analysis on risk, strategy, and the evolving role of in-house counsel across Africa."},{key:"newsletter",title:"'In-House Africa' â Newsletter",icon:Ww,description:"Monthly dispatches covering the challenges, disruptions, and opportunities shaping Africa's legal profession."},{key:"in_house_life",title:"My In-House Life",icon:Ls,description:"Profiles and conversations with Africa's leading general counsel, legal directors, and in-house counsel."}],Gh=4;function PU(){return r.jsxs("div",{className:"bg-[rgb(var(--bg))] text-[rgb(var(--fg))]",children:[r.jsx("section",{className:"bg-[#1f0f3f] text-white",children:r.jsxs(V.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5,ease:"easeOut"},className:"max-w-6xl mx-auto px-4 md:px-6 py-14",children:[r.jsx("div",{className:"text-xs uppercase tracking-[0.24em] text-[#e6c784]",children:"Insights"}),r.jsx("h1",{className:"text-4xl md:text-5xl mt-3 leading-tight",children:"Intelligence that moves the needle."}),r.jsx("p",{className:"mt-3 text-lg text-slate-200 max-w-3xl",children:"Articles, newsletters, and profiles from Africa's leading in-house counsel and legal practitioners. Published by the ACGC community."})]})}),AU.map(t=>r.jsx(DU,{section:t},t.key)),r.jsx("section",{className:"max-w-6xl mx-auto px-4 md:px-6 py-12",children:r.jsx(wr,{className:"rounded-3xl p-8 md:p-10 text-white",style:{background:"#1f0f3f"},children:r.jsxs("div",{className:"flex flex-col md:flex-row gap-6 md:items-center md:justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-2xl md:text-3xl",children:"Have something to share?"}),r.jsx("div",{className:"mt-2 text-slate-200",children:"Members can submit articles, profiles, and thought leadership for publication."})]}),r.jsx(W,{as:K,to:"/join",size:"lg",className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a] shrink-0",children:"Join the association"})]})})})]})}function DU({section:t}){const[e,s]=v.useState([]),[n,a]=v.useState(null),[i,o]=v.useState(!1),[l,c]=v.useState(Gh),[d,u]=v.useState(!1),[h,m]=v.useState(0);v.useEffect(()=>{(async()=>{o(!0);try{const y=await U(`/api/insights?category=${t.key}&limit=50`);a(y.insights||[]),s(y.insights||[]),u(y.hasMore),m((y.insights||[]).length)}catch{s([])}finally{o(!1)}})()},[t.key]);const f=e.slice(0,l),p=l<e.length||d,g=async()=>{if(l<e.length){c(b=>b+Gh);return}if(d){o(!0);try{const b=await U(`/api/insights?category=${t.key}&limit=${Gh}&offset=${h}`);if(b.insights&&b.insights.length>0){const y=[...e,...b.insights];s(y),m(h+b.insights.length),u(b.hasMore),c(w=>w+Gh)}else u(!1)}catch{u(!1)}finally{o(!1)}}},x=t.icon;return r.jsxs("section",{className:"max-w-6xl mx-auto px-4 md:px-6 py-10 border-b border-slate-200/60 last:border-0",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[r.jsx(x,{className:"h-5 w-5 text-[#c08a2f]"}),r.jsx("div",{className:"text-xs uppercase tracking-[0.2em] text-[#2a1654]",children:t.key.replace(/_/g," ")})]}),r.jsx("h2",{className:"text-3xl md:text-4xl text-[rgb(var(--fg))]",children:t.title}),r.jsx("p",{className:"mt-2 text-slate-600 max-w-3xl",children:t.description}),i&&e.length===0?r.jsx("div",{className:"mt-8 grid sm:grid-cols-2 lg:grid-cols-4 gap-
7145",children:Array.from({length:4}).map((b,y)=>r.jsxs("div",{className:"rounded-2xl border border-slate-200/70 bg-white overflow-hidden animate-pulse",children:[r.jsx("div",{className:"h-44 bg-slate-100"}),r.jsxs("div",{className:"p-4 space-y-3",children:[r.jsx("div",{className:"h-4 bg-slate-100 rounded w-3/4"}),r.jsx("div",{className:"h-3 bg-slate-100 rounded w-full"}),r.jsx("div",{className:"h-3 bg-slate-100 rounded w-2/3"})]})]},y))}):!i&&e.length===0?r.jsxs("div",{className:"mt-8 text-center py-8",children:[r.jsx(x,{className:"h-10 w-10 text-slate-300 mx-auto mb-3"}),r.jsx("div",{className:"text-slate-500 text-sm",children:"No content published yet in this section."})]}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"mt-8 grid sm:grid-cols-2 lg:grid-cols-4 gap-5",children:f.map((b,y)=>r.jsx(RU,{index:y,children:t.key==="in_house_life"?r.jsx(IU,{item:b}):t.key==="newsletter"?r.jsx(OU,{item:b}):r.jsx(LU,{item:b})},b.id))}),p?r.jsx("div",{className:"mt-8 flex justify-center",children:r.jsx(W,{onClick:g,disabled:i,className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a] px-8",children:i?"Loadingâ¦":"Load More"})}):null]})]})}function RU({children:t,index:e}){const s=v.useRef(null),n=o7(s,{once:!0,margin:"-40px"});return r.jsx(V.div,{ref:s,initial:{opacity:0,y:40},animate:n?{opacity:1,y:0}:{opacity:0,y:40},transition:{duration:.45,delay:e*.06,ease:"easeOut"},children:t})}function LU({item:t}){return r.jsxs(K,{to:`/insights/${t.id}`,className:"group rounded-2xl border border-slate-200/70 bg-white shadow-[0_12px_30px_-18px_rgba(0,0,0,0.25)] overflow-hidden h-full flex flex-col cursor-pointer hover:shadow-lg transition-shadow",children:[r.jsxs("div",{className:"h-44 bg-[#1f0f3f] relative overflow-hidden flex items-center justify-center shrink-0",children:[r.jsx(On,{className:"h-10 w-10 text-white/30"}),t.thumbnail_url&&r.jsx("img",{src:Xw(t.thumbnail_url),alt:t.title,className:"absolute inset-0 w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",onError:e=>{e.currentTarget.style.display="none"}})]}),r.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[r.jsx("h3",{className:"font-semibold text-[rgb(var(--fg))] leading-snug group-hover:text-[#c08a2f] transition",children:t.title}),t.summary?r.jsx("p",{className:"mt-2 text-sm text-slate-600 line-clamp-3",children:t.summary}):null,r.jsx("div",{className:"mt-auto pt-3",children:r.jsxs("span",{className:"text-sm font-medium text-[#c08a2f] inline-flex items-center gap-1 group-hover:gap-2 transition-all",children:["Read More ",r.jsx(nt,{className:"h-3.5 w-3.5"})]})})]})]})}function OU({item:t}){return r.jsxs(K,{to:`/insights/${t.id}`,className:"group rounded-2xl border border-slate-200/70 bg-white shadow-[0_12px_30px_-18px_rgba(0,0,0,0.25)] overflow-hidden h-full flex flex-col cursor-pointer hover:shadow-lg transition-shadow",children:[r.jsxs("div",{className:"h-48 bg-gradient-to-br from-[#e6c784]/20 to-[#c08a2f]/10 relative overflow-hidden flex items-center justify-center shrink-0",children:[r.jsx(Ww,{className:"h-10 w-10 text-[#c08a2f]/40"}),t.thumbnail_url&&r.jsx("img",{src:Xw(t.thumbnail_url),alt:t.title,className:"absolute inset-0 w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",onError:e=>{e.currentTarget.style.display="none"}})]}),r.jsxs("div",{className:"p-4 flex-1 flex flex-col items-center text-center",children:[r.jsx("h3",{className:"font-semibold text-[#c08a2f] text-lg",children:t.title}),t.summary?r.jsx("p",{className:"mt-2 text-sm text-slate-600 line-clamp-2",children:t.summary}):null]})]})}function IU({item:t}){return r.jsxs(K,{to:`/insights/${t.id}`,className:"group rounded-2xl border border-slate-200/70 bg-white shadow-[0_12px_30px_-18px_rgba(0,0,0,0.25)] overflow-hidden h-full flex flex-col cursor-pointer hover:shadow-lg transition-shadow",children:[r.jsxs("div",{className:"h-52 bg-gradient-to-br from-slate-100 to-slate-200 relative overflow-hidden flex items-center justify-center shrink-0",children:[r.jsx(Ls,{className:"h-12 w-12 text-slate-300"}),t.thumbnail_url&&r.jsx("img",{src:Xw(t.thumbnail_url),alt:t.title,className:"absolute inset-0 w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",onError:e=>{e.currentTarget.style.display="none"}})]}),r.jsxs("div",{className:"p-4 flex-1 flex flex-col",children:[r.jsx("h3",{className:"font-semibold text-[rgb(var(--fg))] leading-snug",children:t.title}),t.summary?r.jsx("p",{className:"mt-2 text-sm text-slate-600 line-clamp-3",children:t.summary}):null,r.jsx("div",{className:"mt-auto pt-3",children:r.jsxs("span",{className:"text-sm font-medium text-[#c08a2f] inline-flex items-center gap-1 group-hover:gap-2 transition-all",children:["Read More ",r.jsx(nt,{className:"h-3.5 w-3.5"})]})})]})]})}function Ok(t){return t?t.startsWith("data:")||t.startsWith("http://")||t.startsWith("https://")?t:tt(t):null}const FU={in_house_insights:"In-House Insights",newsletter:"Newsletter",in_house_life:"My In-House Life"};function $U(t){return t==="newsletter"?Ww:t==="in_house_life"?Ls:On}function e0(t){return t?/<(?:p|div|h[1-6]|ul|ol|li|br|blockquote|table|img)[\s>/]/i.test(t)?t:t.split(/\n\s*\n/).filter(e=>e.trim()).map(e=>`<p>${e.replace(/\n/g,"<br>")}</p>`).join(` 715`):""}function zU(t){return(t||"").replace(/<style[\s\S]*?<\/style>/gi," ").replace(/<script[\s\S]*?<\/script>/gi," ").replace(/<[^>]+>/g," ").replace(/ /gi," ").replace(/\s+/g," ").trim()}function BU(t){const e=zU(t);if(!e)return"";const s=e.slice(0,650).trim(),n=e.length>650?"â¦":"";return`<p>${s}${n}</p>`}function VU(){const{id:t}=al(),{member:e,loading:s}=Oe(),[n,a]=v.useState(null),[i,o]=v.useState(!0),[l,c]=v.useState("");
715if(v.useEffect(()=>{(async()=>{o(!0),c("");try{const w=await U(`/api/insights/${t}`);a(w.insight)}catch(w){c(w.message||"Insight not found")}finally{o(!1)}})()},[t]),i)return r.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-16 text-center text-slate-500",children:"Loadingâ¦"});if(l||!n)return r.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-16",children:r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"text-lg font-semibold text-slate-800",children:"Insight not found"}),r.jsx("p",{className:"mt-2 text-slate-500",children:l||"The article you are looking for does not exist."}),r.jsx("div",{className:"mt-6",children:r.jsx(W,{as:K,to:"/insights",className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a]",children:"Back to Insights"})})]})});const d=$U(n.category),u=FU[n.category]||n.category,h=n.published_at?new Date(n.published_at).toLocaleDateString(void 0,{year:"numeric",month:"long",day:"numeric"}):null,f=n.category==="in_house_life"||(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor"||(e==null?void 0:e.payment_status)==="paid",p=BU(n.body),g=!!n.body&&!s&&!f,x=e?"/billing":"/join",b=e?"Become a member to keep reading":"Join the association to keep reading";return r.jsxs("div",{className:"bg-[rgb(var(--bg))] text-[rgb(var(--fg))]",children:[r.jsx("section",{className:"bg-[#1f0f3f] text-white",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6 py-12",children:[r.jsxs(K,{to:"/insights",className:"inline-flex items-center gap-2 text-sm text-slate-300 hover:text-white transition mb-6",children:[r.jsx(vn,{className:"h-4 w-4"})," Back to Insights"]}),r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx(d,{className:"h-4 w-4 text-[#e6c784]"}),r.jsx("span",{className:"text-xs uppercase tracking-[0.2em] text-[#e6c784]",children:u})]}),r.jsx(V.h1,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"text-3xl md:text-4xl lg:text-5xl leading-tight",children:n.title}),n.summary&&r.jsx(V.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4,delay:.1},className:"mt-4 text-lg text-slate-200 max-w-3xl",children:n.summary}),r.jsxs("div",{className:"mt-6 flex flex-wrap items-center gap-4 text-sm text-slate-300",children:[n.author_name&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ls,{className:"h-4 w-4"}),r.jsx("span",{children:n.author_name}),n.author_title&&r.jsxs("span",{className:"text-slate-400",children:["â ",n.author_title]})]}),h&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(aa,{className:"h-4 w-4"}),r.jsx("span",{children:h})]})]})]})}),n.thumbnail_url&&r.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-6 -mt-6",children:r.jsx("div",{className:"rounded-2xl overflow-hidden shadow-lg",children:r.jsx("img",{src:Ok(n.thumbnail_url),alt:n.title,className:"w-full h-auto",onError:y=>{y.currentTarget.closest("div.rounded-2xl").style.display="none"}})})}),n.video_url&&r.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-6 mt-8",children:r.jsx("div",{className:"rounded-2xl overflow-hidden shadow-lg bg-slate-950",children:/youtube\.com|youtu\.be|vimeo\.com/.test(n.video_url)?r.jsx("iframe",{src:n.video_url.replace(/watch\?v=/,"embed/").replace(/youtu\.be\//,"youtube.com/embed/").replace(/vimeo\.com\/(\d+)/,"player.vimeo.com/video/$1"),className:"w-full aspect-video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Video"}):r.jsx("video",{src:Ok(n.video_url),controls:!0,className:"w-full h-auto max-h-[640px]",preload:"metadata"})})}),r.jsxs("article",{className:n.category==="newsletter"?"bg-slate-100 py-12 px-4":"max-w-4xl mx-auto px-4 md:px-6 py-10",children:[n.body&&!g?r.jsx(V.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,delay:.15},className:n.category==="newsletter"?"mx-auto max-w-[680px] bg-white rounded-xl shadow-md overflow-hidden":"prose prose-slate prose-lg max-w-none",children:n.category==="newsletter"?r.jsx("div",{className:"px-8 md:px-12 py-10 prose prose-lg max-w-none [&_p]:text-justify [&_p]:leading-relaxed [&_h1]:text-center [&_h1]:text-[#1f0f3f] [&_h2]:text-[#1f0f3f] [&_h3]:text-[#1f0f3f] [&_a]:text-[#6d28d9] [&_hr]:border-[#c08a2f] [&_table]:!w-full [&_table]:!max-w-full [&_td]:!max-w-full [&_img]:!max-w-full [&_img]:!h-auto",dangerouslySetInnerHTML:{__html:un.sanitize(e0(n.body))}}):r.jsx("div",{dangerouslySetInnerHTML:{__html:un.sanitize(e0(n.body))}})}):g?r.jsxs("div",{className:"space-y-8",children:[r.jsx(V.div,{initial:{opacity:0,y:20}
715,animate:{opacity:1,y:0},transition:{duration:.4,delay:.15},className:n.category==="newsletter"?"mx-auto max-w-[680px] bg-white rounded-xl shadow-md overflow-hidden":"prose prose-slate prose-lg max-w-none",children:n.category==="newsletter"?r.jsx("div",{className:"px-8 md:px-12 py-10 prose prose-lg max-w-none [&_p]:text-justify [&_h1]:text-center [&_h1]:text-[#1f0f3f] [&_a]:text-[#6d28d9] [&_table]:!w-full [&_img]:!max-w-full [&_img]:!h-auto",dangerouslySetInnerHTML:{__html:un.sanitize(p)}}):r.jsx("div",{dangerouslySetInnerHTML:{__html:un.sanitize(p)}})}),r.jsx("div",{className:n.category==="newsletter"?"mx-auto max-w-[680px]":"",children:r.jsxs("div",{className:"relative overflow-hidden rounded-3xl border border-slate-200 bg-white",children:[r.jsx("div",{className:"pointer-events-none max-h-[420px] overflow-hidden px-6 py-8 opacity-80 blur-[3px] select-none",children:r.jsx("div",{className:"prose prose-slate prose-lg max-w-none",dangerouslySetInnerHTML:{__html:un.sanitize(e0(n.body))}})}),r.jsx("div",{className:"absolute inset-x-0 bottom-0 top-24 bg-gradient-to-t from-white via-white/95 to-white/10"}),r.jsx("div",{className:"absolute inset-x-0 bottom-0 p-6 md:p-8",children:r.jsxs("div",{className:"rounded-2xl bg-[#1f0f3f] p-6 md:p-8 text-white shadow-xl",children:[r.jsx("div",{className:"text-xl md:text-2xl",children:"Continue reading as a member"}),r.jsx("div",{className:"mt-2 text-slate-200",children:"You can read the opening section for free. Become an ACGC member to unlock the full article, newsletter, and profile archive."}),r.jsxs("div",{className:"mt-5 flex flex-wrap gap-3",children:[r.jsx(W,{as:K,to:x,className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a]",children:b}),r.jsx(W,{as:K,to:"/joining-options",className:"bg-white/10 hover:bg-white/20 text-white border border-white/20",children:"View membership options"})]})]})})]})})]}):r.jsx("div",{className:"text-slate-500 italic",children:"Full article content coming soon."}),n.external_url&&r.jsx("div",{className:"mt-8",children:r.jsx(W,{as:"a",href:n.external_url,target:"_blank",rel:"noreferrer",className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a]",children:"Read on external site"})})]}),r.jsx("section",{className:"max-w-4xl mx-auto px-4 md:px-6 pb-12",children:r.jsx("div",{className:"rounded-3xl p-8 md:p-10 text-white",style:{background:"#1f0f3f"},children:r.jsxs("div",{className:"flex flex-col md:flex-row gap-6 md:items-center md:justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-2xl",children:"Explore more insights"}),r.jsx("div",{className:"mt-2 text-slate-200",children:"Articles, newsletters, and profiles from Africa's leading in-house counsel."})]}),r.jsx(W,{as:K,to:"/insights",className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a] shrink-0",children:"All Insights"})]})})})]})}function yy({recipient:t,onClose:e,onSent:s}){const{token:n}=Oe(),[a,i]=v.useState(""),[o,l]=v.useState(""),[c,d]=v.useState(!1),[u,h]=v.useState(""),[m,f]=v.useState(!1),p=o.trim().length>0&&o.length<=5e3,g=async w=>{if(w.preventDefault(),!!p){h(""),d(!0);try{await U("/api/messages",{token:n,method:"POST",body:{to_member_id:t.id,subject:a.trim()||null,body:o.trim()}}),f(!0),s&&s()}catch(N){const j=N.message||"Failed to send message";j.includes("rate_limit")?h("You are sending messages too quickly. Please wait a moment."):j.includes("recipient_disabled_messages")?h("This member has disabled messages."):h(j)}finally{d(!1)}}},x=`${t.first_name||""} ${t.last_name||""}`.trim(),b=t.avatar_url?tt(t.avatar_url):null,y=`${(t.first_name||"")[0]||""}${(t.last_name||"")[0]||""}`.toUpperCase();return r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[r.jsx(V.div,{initial:{opacity:0}
715,animate:{opacity:1},exit:{opacity:0},className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:e}),r.jsxs(V.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:"relative w-full max-w-lg bg-white rounded-2xl shadow-2xl border border-slate-200 overflow-hidden",children:[r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 border-b border-slate-100",children:[r.jsx("h3",{className:"text-base font-semibold text-slate-900",children:"Send Message"}),r.jsx("button",{onClick:e,className:"h-8 w-8 rounded-lg hover:bg-slate-100 grid place-items-center transition text-slate-400 hover:text-slate-600",children:r.jsx(He,{className:"h-4 w-4"})})]}),r.jsx("div",{className:"px-5 py-3 bg-slate-50 border-b border-slate-100",children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-full bg-brand-100 text-brand-700 flex items-center justify-center text-sm font-bold shrink-0 overflow-hidden",children:b?r.jsx("img",{src:b,alt:"",className:"h-full w-full object-cover"}):y}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-sm font-semibold text-slate-900 truncate",children:x}),t.job_title&&r.jsxs("div",{className:"text-xs text-slate-500 flex items-center gap-1 truncate",children:[r.jsx(Wt,{className:"h-3 w-3 shrink-0"}),t.job_title]}),r.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-400 mt-0.5",children:[t.organisation&&r.jsxs("span",{className:"flex items-center gap-1 truncate",children:[r.jsx(Gt,{className:"h-3 w-3 shrink-0"}),t.organisation]}),t.country&&r.jsxs("span",{className:"flex items-center gap-1 truncate",children:[r.jsx(kt,{className:"h-3 w-3 shrink-0"}),t.country]})]})]})]})}),r.jsx("div",{className:"px-5 py-4",children:m?r.jsxs("div",{className:"text-center py-4",children:[r.jsx("div",{className:"text-green-600 font-semibold",children:"Message sent!"}),r.jsxs("p",{className:"mt-1 text-sm text-slate-500",children:["Your message to ",x," has been delivered."]}),r.jsx(W,{variant:"primary",size:"sm",className:"mt-4",onClick:e,children:"Close"})]}):r.jsxs("form",{onSubmit:g,className:"grid gap-3",children:[r.jsx(Y,{label:"Subject",placeholder:"Optional subject line",value:a,onChange:w=>i(w.target.value),maxLength:200}),r.jsxs("div",{children:[r.jsxs("label",{className:"block",children:[r.jsxs("div",{className:"acgc-label mb-1 text-sm text-slate-700",children:["Message",r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),r.jsx("textarea",{value:o,onChange:w=>l(w.target.value),placeholder:"Write your messageâ¦",rows:5,maxLength:5e3,required:!0,className:"acgc-input w-full rounded-2xl border px-4 py-3 text-slate-900 border-slate-200 focus:border-accent-600 focus:ring-2 focus:ring-accent-500/20 transition resize-none"})]}),r.jsxs("div",{className:"mt-1 text-xs text-slate-400 text-right",children:[o.length,"/5,000"]})]}),u&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-xl px-4 py-2",children:u}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(W,{type:"button",variant:"ghost",size:"sm",onClick:e,children:"Cancel"}),r.jsxs(W,{type:"submit",variant:"primary",size:"sm",disabled:c||!p,children:[r.jsx(ia,{className:"h-3.5 w-3.5"}),c?"Sendingâ¦":"Send"]})]})]})})]})]})}function UU(t,e){const[s,n]=v.useState(t);return v.useEffect(()=>{const a=setTimeout(()=>n(t),e);return()=>clearTimeout(a)},[t,e]),s}const t0=12;function HU(){const{t}=en(),{token:e,member:s,loading:n}=Oe(),[a,i]=v.useState(""),[o,l]=v.useState(""),[c,d]=v.useState(""),[u,h]=v.useState(""),[m,f]=v.useState(!1),p=UU(a,250),[g,x]=v.useState([]),[b,y]=v.useState(!1),[w,N]=v.useState(""),[j,S]=v.useState(null),[k,C]=v.useState(t0),A=(s==null?void 0:s.role)==="admin"||(s==null?void 0:s.role)==="editor"||(s==null?void 0:s.payment_status)==="paid";if(v.useEffect(()=>{if(!e||!A)return;(async()=>{y(!0),N("");try{const P=new URLSearchParams;p&&P.set("q",p),o&&P.set("country",o),c&&P.set("sector",c),u&&P.set("industry",u);const R=await U(`/api/directory/members?${P.toString()}`,{token:e});x(R.members),C(t0)}catch(P){N(P.message||"Failed to load directory")}finally{y(!1)}})()},[e,p,o,c,u,A]),n)return r.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-16 text-center text-slate-500",children:"Loadingâ¦"});if(!e)return r.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-16",children:r.jsxs("div",{className:"max-w-xl mx-auto text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-16 w-16 rounded-full bg-[#1f0f3f]/10 mb-5",children:r.jsx(or,{className:"h-7 w-7 text-[#1f0f3f]"})}),r.jsx("div",{className:"text-xs uppercase tracking-[0.28em] text-[#c08a2f] font-semibold",children:"Members"}),r.jsx("h2",{className:"text-2xl font-semibold text-slate-900",children:"Member Directory"}),r.jsx("p",{className:"mt-3 text-slate-600",children:"The Member Directory is available exclusively to ACGC members. Join the community to connect with 3,000+ in-house and government counsel across 40+ African countries."}),r.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row gap-3 justify-center",children:[r.jsx(W,{as:K,to:"/join",className:"bg-[#c08a2f] hover:bg-[#a
71577324] text-white border border-[#dcb26a]",children:"Become a Member"}),r.jsx(W,{as:K,to:"/login",variant:"ghost",children:"Already a member? Log in"})]})]})});if(!A)return r.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-16",children:r.jsxs("div",{className:"max-w-xl mx-auto text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-16 w-16 rounded-full bg-[#1f0f3f]/10 mb-5",children:r.jsx(or,{className:"h-7 w-7 text-[#1f0f3f]"})}),r.jsx("h2",{className:"text-2xl font-semibold text-slate-900",children:"Member Directory"}),r.jsx("p",{className:"mt-3 text-slate-600",children:"The Member Directory is available exclusively to paid ACGC members. Upgrade your membership to connect with 3,000+ in-house and government counsel across Africa."}),r.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row gap-3 justify-center",children:[r.jsx(W,{as:K,to:"/billing",className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a]",children:"Upgrade membership"}),r.jsx(W,{as:K,to:"/",variant:"ghost",children:"Back to home"})]})]})});const E=[o,c,u].filter(Boolean).length,L=g.slice(0,k);return r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-12",children:[r.jsx(_r,{eyebrow:"Members",title:"Member Directory",subtitle:"Connect with in-house and government counsel across 40+ African countries."}),r.jsxs("div",{className:"mt-8",children:[r.jsxs("div",{className:"flex gap-3",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Ua,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 h-4.5 w-4.5 text-slate-400"}),r.jsx("input",{type:"text",value:a,onChange:D=>i(D.target.value),placeholder:"Search by name, role, organisation, or countryâ¦",className:"w-full h-12 pl-11 pr-4 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition shadow-sm"})]}),r.jsxs("button",{onClick:()=>f(!m),className:`inline-flex items-center gap-2 h-12 px-4 rounded-xl border text-sm font-medium transition shadow-sm ${m||E>0?"bg-[#1f0f3f] text-white border-[#1f0f3f]":"bg-white text-slate-600 border-slate-200 hover:border-slate-400"}`,children:[r.jsx(G7,{className:"h-4 w-4"}),"Filters",E>0&&r.jsx("span",{className:"inline-flex items-center justify-center h-5 w-5 rounded-full bg-[#c08a2f] text-white text-xs font-bold",children:E})]})]}),m&&r.jsxs(V.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},transition:{duration:.2},className:"mt-3 rounded-xl border border-slate-200 bg-white p-4 shadow-sm",children:[r.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-500 uppercase tracking-wider mb-1.5",children:"Country / Jurisdiction"}),r.jsx("input",{type:"text",value:o,onChange:D=>l(D.target.value),placeholder:"e.g. Kenya, Nigeria, South Africa",className:"w-full h-10 px-3 rounded-lg border border-slate-200 bg-white text-sm text-slate-900 placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-500 uppercase tracking-wider mb-1.5",children:"Sector"}),r.jsxs("select",{value:c,onChange:D=>d(D.target.value),className:"w-full h-10 px-3 rounded-lg border border-slate-200 bg-white text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition",children:[r.jsx("option",{value:"",children:"All sectors"}),ch.map(D=>r.jsx("option",{value:D.value,children:D.label},D.value))]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-500 uppercase tracking-wider mb-1.5",children:"Industry"}),r.jsxs("select",{value:u,onChange:D=>h(D.target.value),className:"w-full h-10 px-3 rounded-lg border border-slate-200 bg-white text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition",children:[r.jsx("option",{value:"",children:"All industries"}),Gi.map(D=>r.jsx("option",{value:D,children:D},D))]})]})]}),E>0&&r.jsx("div",{className:"mt-3 flex items-center gap-2",children:r.jsxs("button",{onClick:()=>{l(""),d(""),h("")},className:"inline-flex items-center gap-1 text-xs text-slate-500 hover:text-slate-800 transition",children:[r.jsx(He,{className:"h-3 w-3"})," Clear all filters"]})})]})]}),r.jsx("div",{className:"mt-5 flex items-center justify-between",children:r.jsxs("div",{className:"text-sm text-slate-500 flex items-center gap-2",children:[r.jsx(at,{className:"h-4 w-4"}),b?"Searchingâ¦":`${g.length} member${g.length!==1?"s":""} found`]})}),w&&r.jsx("div",{className:"mt-4 text-sm text-red-600",children:w}),!b&&L.length>0&&r.jsx("div",{className:"mt-6 grid sm:grid-cols-2 lg:grid-cols-3 gap-5",children:L.map((D,P)=>r.jsx(V.div,{initial:{opacity:0,y:12}
715,animate:{opacity:1,y:0},transition:{delay:P*.025,duration:.35},children:r.jsx(YU,{m:D,onMessage:s?R=>S({id:R.id,first_name:R.first_name,last_name:R.last_name,job_title:R.job_title,avatar_url:R.avatar_url,organisation:R.organisation_name,country:R.country}):null})},D.id))}),!b&&k<g.length&&r.jsx("div",{className:"mt-8 text-center",children:r.jsxs("button",{onClick:()=>C(D=>D+t0),className:"inline-flex items-center gap-2 px-6 py-2.5 rounded-xl border border-slate-200 bg-white text-sm font-medium text-slate-700 hover:border-slate-400 hover:bg-slate-50 transition shadow-sm",children:["Show more members (",g.length-k," remaining)"]})}),!b&&g.length===0&&!w&&r.jsxs("div",{className:"mt-12 text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-16 w-16 rounded-full bg-slate-100 mb-4",children:r.jsx(at,{className:"h-7 w-7 text-slate-400"})}),r.jsx("div",{className:"text-lg font-semibold text-slate-800",children:"No members found"}),r.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Try adjusting your search or filters."})]}),b&&r.jsx("div",{className:"mt-6 grid sm:grid-cols-2 lg:grid-cols-3 gap-5",children:Array.from({length:6}).map((D,P)=>r.jsx("div",{className:"rounded-2xl border border-slate-200 bg-white p-5 animate-pulse",children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:"h-14 w-14 rounded-full bg-slate-100"}),r.jsxs("div",{className:"flex-1 space-y-2",children:[r.jsx("div",{className:"h-4 w-32 bg-slate-100 rounded"}),r.jsx("div",{className:"h-3 w-24 bg-slate-100 rounded"}),r.jsx("div",{className:"h-3 w-40 bg-slate-100 rounded"})]})]})},P))}),j&&r.jsx(yy,{recipient:j,onClose:()=>S(null),onSent:()=>{}})]})}const Ik=["bg-[#1f0f3f] text-white","bg-[#2a1654] text-white","bg-[#2a1654] text-white","bg-[#c08a2f] text-white","bg-[#2d6a4f] text-white","bg-[#7c3aed] text-white","bg-[#0369a1] text-white","bg-[#9f1239] text-white"];function WU(t){let e=0;for(let s=0;s<t.length;s++)e=t.charCodeAt(s)+((e<<5)-e);return Ik[Math.abs(e)%Ik.length]}function GU(t){const e=(t||"").toLowerCase();return e.includes("general counsel")||e.includes("legal")||e.includes("counsel")||e.includes("attorney")?"âï¸":e.includes("director")||e.includes("board")?"ðï¸":e.includes("ceo")||e.includes("chief executive")||e.includes("managing director")?"ð":e.includes("cfo")||e.includes("chief financial")||e.includes("finance")?"ð":e.includes("cto")||e.includes("chief technology")||e.includes("technology")?"ð»":e.includes("compliance")||e.includes("risk")?"ð¡ï¸":e.includes("hr")||e.includes("human")||e.includes("people")?"ð¤":e.includes("investor")||e.includes("partner")||e.includes("venture")?"ð¼":e.includes("secretary")||e.includes("company secretary")?"ð":"ð¤"}function YU({m:t,onMessage:e}){const s=`${t.first_name} ${t.last_name}`,n=`${(t.first_name||"")[0]||""}${(t.last_name||"")[0]||""}`.toUpperCase(),a=WU(s),i=GU(t.job_title);return r.jsxs("div",{className:"group rounded-2xl border border-slate-200/80 bg-white shadow-[0_4px_24px_-8px_rgba(0,0,0,0.06)] hover:shadow-[0_8px_30px_-6px_rgba(0,0,0,0.12)] hover:border-slate-300 transition-all duration-300 p-5 h-full flex flex-col",children:[r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:`h-14 w-14 rounded-full ${a} flex items-center justify-center text-lg font-bold shrink-0 shadow-sm`,children:n}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsx("div",{className:"text-base font-semibold text-slate-900 truncate",children:s}),r.jsxs("div",{className:"mt-0.5 text-sm text-slate-600 flex items-start gap-1.5 leading-snug break-words",children:[r.jsx("span",{children:i}),t.job_title]})]})]}),r.jsxs("div",{className:"mt-4 space-y-2 text-sm flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[r.jsx(Gt,{className:"h-4 w-4 text-slate-400 shrink-0"}),r.jsx("span",{className:"truncate",children:t.organisation_name})]}),r.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[r.jsx(kt,{className:"h-4 w-4 text-slate-400 shrink-0"}),r.jsx("span",{className:"truncate",children:t.country})]}),r.jsxs("div",{className:"flex items-center gap-2 text-slate-600",children:[r.jsx(Wt,{className:"h-4 w-4 text-slate-400 shrink-0"}),r.jsx("span",{className:"truncate",children:t.industry})]})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap gap-1.5",children:[r.jsx("span",{className:"inline-flex items-center gap-1 rounded-full bg-slate-100 px-2.5 py-0.5 text-xs font-medium text-slate-600",children:t.sector_type==="public"?"Public Sector":"Private Sector"}),t.role!=="admin"&&r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#c08a2f]/10 px-2.5 py-0.5 text-xs font-medium text-[#8b6914]",children:[r.jsx(Ds,{className:"h-3 w-3"}),"Member since ",t.member_since_year]}
715),t.group_name&&r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-full bg-[#1f0f3f]/10 px-2.5 py-0.5 text-xs font-medium text-[#1f0f3f]",children:[r.jsx(Gt,{className:"h-3 w-3"}),t.group_name]})]}),r.jsxs("div",{className:"mt-4 pt-3 border-t border-slate-100 flex items-center gap-2",children:[e&&r.jsxs("button",{onClick:()=>e(t),className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium bg-[#1f0f3f]/10 text-[#1f0f3f] hover:bg-[#1f0f3f]/20 transition",children:[r.jsx(In,{className:"h-3.5 w-3.5"}),"Message"]}),t.linkedin_url&&r.jsxs("a",{href:t.linkedin_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium bg-[#0077b5]/10 text-[#0077b5] hover:bg-[#0077b5]/20 transition",children:[r.jsx(bn,{className:"h-3.5 w-3.5"}),"LinkedIn"]}),t.twitter_url&&r.jsxs("a",{href:t.twitter_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium bg-slate-100 text-slate-700 hover:bg-slate-200 transition",children:[r.jsx(lh,{className:"h-3.5 w-3.5"}),"X"]})]})]})}const lM={1:{medal:"ð¥",color:"from-amber-400 to-yellow-300",ring:"ring-amber-400",shadow:"shadow-amber-200",badge:"bg-amber-400 text-amber-900"},2:{medal:"ð¥",color:"from-slate-400 to-slate-300",ring:"ring-slate-400",shadow:"shadow-slate-200",badge:"bg-slate-400 text-slate-900"},3:{medal:"ð¥",color:"from-orange-400 to-amber-300",ring:"ring-orange-400",shadow:"shadow-orange-200",badge:"bg-orange-400 text-orange-900"}},qU=[{icon:K7,label:"Likes",desc:"+1 point for every like received on your posts",points:"+1"},{icon:q3,label:"New Followers",desc:"+3 points for every new follower you gain on Instagram & X",points:"+3"},{icon:my,label:"Comments",desc:"+2 points for comments on ACGC Posts",points:"+2"},{icon:H7,label:"Reposts",desc:"+3 points for reposts directly or with thoughts on LinkedIn & X",points:"+3"},{icon:p7,label:"Attend & Participate",desc:"+7 points for attending and participating in ACGC events",points:"+7"},{icon:In,label:"WhatsApp Discussions",desc:"+4 points for starting discussions on ACGC WhatsApp Community",points:"+4"},{icon:G3,label:"Share Meaningful Content",desc:"+4 points for sharing articles, case studies, and blog posts",points:"+4"},{icon:Ds,label:"Register for Events",desc:"+4 points for registering for webinars and in-person meetings",points:"+4"},{icon:x7,label:"Promote 2025 Survey",desc:"+5 points for participating in quizzes, polls, and survey activities",points:"+5"},{icon:X7,label:"Subscribe on YouTube",desc:"+4 points for subscribing to the ACGC YouTube channel",points:"+4"},{icon:at,label:"Refer New Members",desc:"+8 points for each successful member referral",points:"+8"},{icon:j7,label:"Referrals for Sponsorship",desc:"+10 points for each successful sponsorship referral",points:"+10"}];function cM(t,e){return`${(t||"")[0]||""}${(e||"")[0]||""}`.toUpperCase()}const Fk=["bg-[#1f0f3f] text-white","bg-[#2a1654] text-white","bg-[#c08a2f] text-white","bg-[#2d6a4f] text-white","bg-[#7c3aed] text-white","bg-[#0369a1] text-white","bg-[#9f1239] text-white","bg-[#b45309] text-white"];function KU(t){let e=0;for(let s=0;s<t.length;s++)e=t.charCodeAt(s)+((e<<5)-e);return Fk[Math.abs(e)%Fk.length]}function JU({entry:t,delay:e}){const s=t.rank===1,n=lM[t.rank],a=`${t.first_name} ${t.last_name}`;return r.jsxs(V.div,{initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{delay:e,duration:.5,ease:"easeOut"},className:`flex flex-col items-center ${s?"order-first md:order-none md:-mt-6":""}`,children:[r.jsx("div",{className:`text-5xl mb-3 drop-shadow-lg ${s?"text-6xl":""}`,children:n.medal}),r.jsxs("div",{className:`relative ring-4 ${n.ring} rounded-full shadow-xl ${n.shadow} ${s?"h-24 w-24":"h-20 w-20"}`,children:[t.avatar_url?r.jsx("img",{src:t.avatar_url,alt:a,className:"h-full w-full rounded-full object-cover"}):r.jsx("div",{className:`h-full w-full rounded-full bg-gradient-to-br ${n.color} flex items-center justify-center text-white font-bold ${s?"text-2xl":"text-xl"}`,children:cM(t.first_name,t.last_name)}),r.jsxs("span",{className:`absolute -bottom-2 left-1/2 -translate-x-1/2 text-xs font-bold px-2 py-0.5 rounded-full whitespace-nowrap ${n.badge}`,children:["#",t.rank]})]}),r.jsxs("div",{className:"mt-5 text-center",children:[r.jsx("div",{className:`font-bold text-slate-900 ${s?"text-lg":"text-base"}`,children:a}),r.jsx("div",{className:"mt-0.5 text-sm text-slate-500",children:t.job_title}),r.jsx("div",{className:"mt-0.5 text-xs font-medium text-[#c08a2f]",children:t.organisation})]})]})}function QU(){const[t,e]=v.useState([]),[s,n]=v.useState(!0),[a,i]=v.useState(""),[o,l]=v.useState("rank"),[c,d]=v.useState("asc");v.useEffect(()=>{U("/api/leaderboard").then(x=>e(x.leaderboard||[])).catch(()=>{}).finally(()=>n(!1))},[]);const u=t.filter(x=>x.rank<=3).sort((x,b)=>x.rank-b.rank),h=u.length===3?[u[1],u[0],u[2]]:u,m=x=>{o===x?d(b=>b==="asc"?"desc":"asc"):(l(x),d("asc"))},f=v.useMemo(()=>t.map(x=>({...x,name:`${x.first_name} ${x.last_name}`})),[t]),p=v.useMemo(()=>{const x=a.toLowerCase();let b=a?f.filter(y=>y.name.toLowerCase().includes(x)||(y.job_title||"").toLowerCase().includes(x)||(y.organisation||"").toLowerCase().includes(x)):[...f];return b.sort((y,w)=>{let N=y[o],j=w[o];return typeof N=="string"&&(N=N.toLowerCase()),typeof j=="string"&&(j=j.toLowerCase()),N<j?c==="asc"?-1:1:N>j?c==="asc"?1:-1:0}),b},[a,o,c,f]);function g({field:x}){return o!==x?r.jsx(Vi,{className:"h-3.5 w-3.5 text-slate-300"}):c==="asc"?r.jsx(Vi,{className:"h-3.5 w-3.5 text-[#c08a2f]"}):r.jsx(ht,{className:"h-3.5 w-3.5 text-[#c08a2f]"})}return r.jsxs("div",{className:"min-h-screen bg-gradient-to-b from-[#0d0620] via-[#1f0f3f] to-[#2a1654]",children:[r.jsxs("div",{className:"relative overflow-hidden",children:[r.jsx("div",{className:"absolute inset-0 pointer-events-none",children:Array.from({length:40}).map((x,b)=>r.jsx("div",{className:"absolute rounded-full bg-white/20",style:{width:Math.random()*3+1,height:Math.random()*3+1,top:`${Math.random()*100}%`,left:`${Math.random()*100}%`,opacity:Math.random()*.6+.2}},b))}),r.jsx("div",{className:"relative max-w-5xl mx-auto px-4 md:px-6 pt-16 pb-10 text-center",children:r.jsxs(V.div,{initial:{opacity:0,y:-20}
715,animate:{opacity:1,y:0},transition:{duration:.6},children:[r.jsxs("div",{className:"inline-flex items-center gap-2 rounded-full bg-[#c08a2f]/20 border border-[#c08a2f]/40 px-4 py-1.5 text-sm font-semibold text-[#e8c76c] mb-4",children:[r.jsx(Yw,{className:"h-4 w-4"}),"ACGC Leaderboard"]}),r.jsxs("h1",{className:"text-4xl md:text-5xl font-extrabold text-white leading-tight",children:["Recognising Africa's"," ",r.jsx("span",{className:"text-transparent bg-clip-text bg-gradient-to-r from-[#e8c76c] to-[#c08a2f]",children:"Top Contributors"})]}),r.jsx("p",{className:"mt-4 text-lg text-slate-300 max-w-2xl mx-auto",children:"The ACGC Leaderboard celebrates members who actively expand ACGC's reach and contribute to our community across LinkedIn, Instagram, YouTube, WhatsApp, and X."})]})})]}),r.jsx("div",{className:"max-w-3xl mx-auto px-4 md:px-6 pb-16",children:r.jsxs("div",{className:"bg-white/5 backdrop-blur-sm border border-white/10 rounded-3xl p-8 md:p-12",children:[r.jsx("div",{className:"text-center mb-10",children:r.jsxs("div",{className:"inline-flex items-center gap-2 text-[#e8c76c] font-semibold text-sm uppercase tracking-widest",children:[r.jsx(An,{className:"h-4 w-4 fill-current"}),"Current Leaders",r.jsx(An,{className:"h-4 w-4 fill-current"})]})}),s&&r.jsx("div",{className:"text-center text-white/60 text-sm py-8",children:"Loading rankingsâ¦"}),!s&&u.length===0&&r.jsx("div",{className:"text-center text-white/60 text-sm py-8",children:"Rankings will appear here once the leaderboard launches."}),!s&&u.length>0&&r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"flex flex-col md:flex-row items-center md:items-end justify-center gap-8 md:gap-12",children:h.map((x,b)=>r.jsx(JU,{entry:x,delay:b*.15},x.id))}),r.jsx("div",{className:"hidden md:flex items-end justify-center gap-12 mt-8",children:h.map(x=>r.jsx("div",{className:"flex flex-col items-center",children:r.jsx("div",{className:`w-24 rounded-t-lg bg-gradient-to-t ${lM[x.rank].color} opacity-40`,style:{height:x.rank===1?56:x.rank===2?40:28}})},x.id))})]})]})}),r.jsx("div",{className:"bg-white rounded-t-[2.5rem] shadow-2xl",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6 py-16 space-y-20",children:[r.jsxs("section",{children:[r.jsx(_r,{eyebrow:"Explainer",title:"What is the ACGC Leaderboard?",subtitle:"Watch this short video to understand how the leaderboard works and how you can climb to the top."}),r.jsxs("div",{className:"mt-8 rounded-2xl bg-gradient-to-br from-[#1f0f3f]/5 to-[#c08a2f]/5 border border-[#c08a2f]/20 p-6 md:p-8",children:[r.jsxs("p",{className:"text-slate-700 leading-relaxed",children:["The ",r.jsx("span",{className:"font-semibold text-[#1f0f3f]",children:"ACGC Leaderboard"})," recognises and celebrates members who actively contribute to expanding ACGC's reach. By engaging across platforms like LinkedIn, Instagram, YouTube, WhatsApp, and X, members can earn points for activity that helps grow our community."]}),r.jsx("p",{className:"mt-3 text-slate-700 leading-relaxed",children:"This initiative is more than just participation â it's about fostering a stronger network, amplifying ACGC's impact, and acknowledging those who help drive our mission forward."})]})]}),r.jsxs("section",{children:[r.jsx(_r,{eyebrow:"Earn Points",title:"How to Climb the Leaderboard",subtitle:"Every action counts. Engage with our community across platforms to earn points and rise to the top."}),r.jsx("div",{className:"mt-8 grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:qU.map((x,b)=>{const y=x.icon;return r.jsxs(V.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:b*.05,duration:.4}
715,className:"group flex items-start gap-4 rounded-xl border border-slate-200 bg-white p-5 shadow-sm hover:shadow-md hover:border-[#c08a2f]/30 transition-all duration-200",children:[r.jsx("div",{className:"shrink-0 h-10 w-10 rounded-lg bg-[#1f0f3f]/8 flex items-center justify-center group-hover:bg-[#c08a2f]/10 transition-colors",children:r.jsx(y,{className:"h-5 w-5 text-[#1f0f3f] group-hover:text-[#c08a2f] transition-colors"})}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"font-semibold text-slate-900 text-sm",children:x.label}),r.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-[#c08a2f] px-2 py-0.5 text-xs font-bold text-white",children:x.points})]}),r.jsx("p",{className:"mt-0.5 text-xs text-slate-500 leading-relaxed",children:x.desc})]})]},x.label)})})]}),r.jsxs("section",{children:[r.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4",children:[r.jsx(_r,{eyebrow:"Rankings",title:"Full Leaderboard",subtitle:t.length>0?`${t.length} active contributors ranked by engagement.`:"Full rankings will be published once the leaderboard launches."}),t.length>0&&r.jsxs("div",{className:"relative shrink-0 w-full sm:w-72",children:[r.jsx(Ua,{className:"absolute left-3.5 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),r.jsx("input",{type:"text",value:a,onChange:x=>i(x.target.value),placeholder:"Search membersâ¦",className:"w-full h-11 pl-10 pr-4 rounded-xl border border-slate-200 text-sm focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition shadow-sm"})]})]}),s&&r.jsx("div",{className:"mt-6 py-12 text-center text-slate-500 text-sm",children:"Loadingâ¦"}),!s&&t.length===0&&r.jsx("div",{className:"mt-6 rounded-2xl border border-slate-200 py-16 text-center text-slate-400 text-sm",children:"Rankings coming soon. Check back after the leaderboard launches."}),!s&&t.length>0&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"mt-6 rounded-2xl border border-slate-200 overflow-hidden shadow-sm",children:[r.jsxs("div",{className:"bg-[#1f0f3f] text-white grid grid-cols-[3rem_1fr_1fr] text-xs font-semibold uppercase tracking-wider",children:[r.jsxs("button",{onClick:()=>m("rank"),className:"flex items-center justify-center gap-1 px-4 py-4 hover:bg-white/10 transition",children:["# ",r.jsx(g,{field:"rank"})]}),r.jsxs("button",{onClick:()=>m("name"),className:"flex items-center gap-1 px-4 py-4 hover:bg-white/10 transition text-left",children:["Name ",r.jsx(g,{field:"name"})]}),r.jsxs("button",{onClick:()=>m("organisation"),className:"hidden md:flex items-center gap-1 px-4 py-4 hover:bg-white/10 transition text-left",children:["Organisation ",r.jsx(g,{field:"organisation"})]})]}),r.jsxs("div",{className:"divide-y divide-slate-100",children:[p.length===0&&r.jsx("div",{className:"py-12 text-center text-slate-500 text-sm",children:"No members match your search."}),p.map((x,b)=>{const y=KU(x.name),w=x.rank<=3;return r.jsxs(V.div,{initial:{opacity:0}
715,whileInView:{opacity:1},viewport:{once:!0},transition:{delay:b*.02},className:`grid grid-cols-[3rem_1fr_1fr] items-center hover:bg-slate-50 transition-colors ${w?"bg-[#c08a2f]/4":""}`,children:[r.jsx("div",{className:"flex items-center justify-center px-4 py-3.5",children:x.rank===1?r.jsx("span",{className:"text-xl",children:"ð¥"}):x.rank===2?r.jsx("span",{className:"text-xl",children:"ð¥"}):x.rank===3?r.jsx("span",{className:"text-xl",children:"ð¥"}):r.jsx("span",{className:"text-sm font-semibold text-slate-500",children:x.rank})}),r.jsxs("div",{className:"flex items-center gap-3 px-4 py-3.5 min-w-0",children:[r.jsx("div",{className:`h-9 w-9 shrink-0 rounded-full ${y} flex items-center justify-center text-xs font-bold shadow-sm overflow-hidden`,children:x.avatar_url?r.jsx("img",{src:x.avatar_url,alt:x.name,className:"h-full w-full object-cover"}):cM(x.first_name,x.last_name)}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:`text-sm font-semibold truncate ${w?"text-[#1f0f3f]":"text-slate-900"}`,children:x.name}),r.jsx("div",{className:"text-xs text-slate-500 truncate",children:x.job_title}),r.jsx("div",{className:"md:hidden text-xs text-[#c08a2f] font-medium truncate mt-0.5",children:x.organisation})]})]}),r.jsx("div",{className:"hidden md:flex items-center px-4 py-3.5 min-w-0",children:r.jsx("span",{className:"text-sm text-slate-600 truncate",children:x.organisation})})]},x.id)})]})]}),r.jsx("p",{className:"mt-4 text-center text-xs text-slate-400",children:"Leaderboard updated regularly. Points are calculated based on verifiable engagement activity."})]})]}),r.jsxs("section",{className:"rounded-3xl bg-gradient-to-br from-[#1f0f3f] to-[#2a1654] p-8 md:p-12 text-center text-white",children:[r.jsx(F7,{className:"h-10 w-10 text-[#e8c76c] mx-auto mb-4"}),r.jsx("h3",{className:"text-2xl md:text-3xl font-bold",children:"Ready to earn your spot?"}),r.jsx("p",{className:"mt-3 text-slate-300 max-w-xl mx-auto",children:"Join ACGC today and start engaging with our community across all platforms. Every like, comment, share, and referral moves you up the leaderboard."}),r.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row gap-3 justify-center",children:[r.jsxs("a",{href:"/join",className:"inline-flex items-center justify-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a77324] px-7 py-3 text-sm font-bold text-white transition shadow-lg",children:[r.jsx(q3,{className:"h-4 w-4"}),"Become a Member"]}),r.jsxs("a",{href:"/directory",className:"inline-flex items-center justify-center gap-2 rounded-full border border-white/20 bg-white/10 hover:bg-white/20 px-7 py-3 text-sm font-bold text-white transition",children:[r.jsx(at,{className:"h-4 w-4"}),"Member Directory"]})]})]})]})})]})}const Ou=["Algeria","Angola","Benin","Botswana","Burkina Faso","Burundi","Cabo Verde","Cameroon","Central African Republic","Chad","Comoros","Congo (Brazzaville)","Congo (DRC)","Côte d'Ivoire","Djibouti","Egypt","Equatorial Guinea","Eritrea","Eswatini","Ethiopia","Gabon","Gambia","Ghana","Guinea","Guinea-Bissau","Kenya","Lesotho","Liberia","Libya","Madagascar","Malawi","Mali","Mauritania","Mauritius","Morocco","Mozambique","Namibia","Niger","Nigeria","Rwanda","São Tomé and PrÃncipe","Senegal","Seychelles","Sierra Leone","Somalia","South Africa","South Sudan","Sudan","Tanzania","Togo","Tunisia","Uganda","Zambia","Zimbabwe"],Zw=["Afghanistan","Albania","Andorra","Antigua and Barbuda","Argentina","Armenia","Australia","Austria","Azerbaijan","Bahamas","Bahrain","Bangladesh","Barbados","Belarus","Belgium","Belize","Bhutan","Bolivia","Bosnia and Herzegovina","Brazil","Brunei","Bulgaria","Cambodia","Canada","Chile","China","Colombia","Costa Rica","Croatia","Cuba","Cyprus","Czech Republic","Denmark","Dominica","Dominican Republic","Ecuador","El Salvador","Estonia","Fiji","Finland","France","Georgia","Germany","Greece","Grenada","Guatemala","Guyana","Haiti","Honduras","Hungary","Iceland","India","Indonesia","Iran","Iraq","Ireland","Israel","Italy","Jamaica","Japan","Jordan","Kazakhstan","Kiribati","Kosovo","Kuwait","Kyrgyzstan","Laos","Latvia","Lebanon","Liechtenstein","Lithuania","Luxembourg","Malaysia","Maldives","Malta","Marshall Islands","Mexico","Micronesia","Moldova","Monaco","Mongolia","Montenegro","Myanmar","Nauru","Nepal","Netherlands","New Zealand","Nicaragua","North Korea","North Macedonia","Norway","Oman","Pakistan","Palau","Palestine","Panama","Papua New Guinea","Paraguay","Peru","Philippines","Poland","Portugal","Qatar","Romania","Russia","Saint Kitts and Nevis","Saint Lucia","Saint Vincent and the Grenadines","S
715amoa","San Marino","Saudi Arabia","Serbia","Singapore","Slovakia","Slovenia","Solomon Islands","South Korea","Spain","Sri Lanka","Suriname","Sweden","Switzerland","Syria","Taiwan","Tajikistan","Thailand","Timor-Leste","Tonga","Trinidad and Tobago","Turkey","Turkmenistan","Tuvalu","Ukraine","United Arab Emirates","United Kingdom","United States","Uruguay","Uzbekistan","Vanuatu","Vatican City","Venezuela","Vietnam","Yemen"],vy=[...Ou,...Zw],XU=[{label:"About",href:"#about"},{label:"Sponsors",href:"#sponsors"},{label:"Programme",href:"#programme"},{label:"Tickets",href:"#tickets"},{label:"Loyalty",href:"#loyalty"},{label:"Highlights",href:"#highlights"},{label:"Awards",href:"#awards"},{label:"Travel & Visa",href:"#visa"},{label:"Accommodation",href:"#accommodation"},{label:"Excursion",href:"#excursion"},{label:"Speakers",href:"#speakers"}];function $k(t){return{name:t.name,area:t.area,dist:t.distance,rating:t.rating,price:t.price_range,phone:t.phone,email:t.email,website:t.website,mapLink:t.map_url}}function ZU(t){const e=[];for(const s of t||[]){const n=e[e.length-1],a={name:s.name,sub:s.sub_name||void 0,logo:s.logo_url};n&&n.tier===s.tier&&n.tierLabel===s.tier_label&&n.accent===s.accent?n.sponsors.push(a):e.push({tier:s.tier,tierLabel:s.tier_label,accent:s.accent,sub:s.sub||void 0,sponsors:[a]})}return e}function fs(t){if(t==null)return"";const e=t/100;return`$${Number.isInteger(e)?e:e.toFixed(2)}`}function eH(t){const e=new Date(new Date(t).getTime()-864e5);return`${e.getUTCDate()} ${e.toLocaleString("en-US",{month:"long",timeZone:"UTC"})}`}function tH(t,e){const s=new Date(t),n=new Date(e),a=s.toLocaleString("en-US",{month:"long",timeZone:"UTC"}),i=n.toLocaleString("en-US",{month:"long",timeZone:"UTC"}),o=n.getUTCFullYear();return a===i?`${s.getUTCDate()}â${n.getUTCDate()} ${a} ${o}`:`${s.getUTCDate()} ${a} â ${n.getUTCDate()} ${i} ${o}`}const sH={member_early_bird:{label:"Early Bird",note:null},member_standard:{label:"Standard",note:null},member_public_sector:{label:"Public Sector",note:null},member_gc_junior:{label:"GC + Junior Package",note:"1 GC + 1 junior colleague"},non_member_early_bird:{label:"Early Bird",note:null},non_member_standard:{label:"Standard",note:null},non_member_public_sector:{label:"Public Sector",note:null},non_member_gc_junior:{label:"GC + Junior Package",note:"1 GC + 1 junior colleague"},single_awards:{label:"Awards Evening Only",note:"2 Oct evening"},single_socials:{label:"Socials Pass",note:"Welcome Drinks + Awards"},single_house_skills_member:{label:"In House Skills Institute (Member)",note:"2 Oct, 9:00am â 12:00pm"},single_house_skills_non_member:{label:"In House Skills Institute (Non-Member)",note:"2 Oct, 9:00am â 12:00pm"}},s0={member:"ACGC Member Rates",non_member:"Non-Member Rates",single:"Single-Event Passes"};function dM(t,e,s,n){const a=Date.now()<new Date(n).getTime(),i=(a?e:s)/100;return(t||[]).map(o=>{const l=o.membership_fee_cents/100,c=i+l;return{id:o.tier_key,label:o.name,price:`$${c}`,note:`${a?"Early Bird":"Standard"} conference rate ($${i}) + $${l} membership fee â application fee waived`,closed:o.is_active===!1}})}function nH(t){const e=t.conference,s={member:[],non_member:[],single:[]};for(const n of t.tickets||[]){if(n.ticket_key==="member_founding_early_bird")continue;const a=sH[n.ticket_key],i=s[n.category];!a||!i||i.push({id:n.ticket_key,label:a.label,price:fs(n.price_cents),note:a.note,closed:!n.is_active})}return[{group:s0.member,tickets:s.member},{group:"Join + Attend Bundle",tickets:dM(t.join_attend_tiers,e.join_attend_rate_early_cents,e.join_attend_rate_standard_cents,e.early_bird_deadline)},{group:s0.non_member,tickets:s.non_member},{group:s0.single,tickets:s.single}]}const rH=[{icon:es,title:"Research & Reports",desc:"Download the latest ACGC research publications and conference white papers.",cta:"Browse Resources",href:"/resources"},{icon:In,title:"Delegate Feedback Form",desc:"Share your experience and help us shape future ACGC conferences. Your feedback matters.",cta:"Give Feedback",href:"#"},{icon:vx,title:"Speak at ACGC 2027",desc:"Interested in speaking at the 9th Annual ACGC Conference? Submit your speaker interest form.",cta:"Express Interest",href:"#speakers"}],aH=["â African Countries â",...Ou,"â Other Countries â",...Zw],iH=["Banking & Finance","Technology","Energy","Telecoms","Manufacturing","FMCG","Government","Development Finance","Professional Services","Mining & Natural Resources","Healthcare","Other"],oH={fullName:"",email:"",mobileNumber:"",organisationName:"",jobTitle:"",countryOfResidence:"",primaryJurisdictions:"",sectorType:"",organisationType:"",industryCategory:"",isCurrentMember:!1,additionalActivities:[],abidjanExperienceInterest:"",dietaryPreference:"None",dietaryRestrictions:"",requiresVisaLetter:!1,receiveUpdates:!0,primaryReason:"",referralSource:"",referralName:"",juniorFullName:"",juniorEmail:"",linkedIn:"",password:"",confirmPassword:""};function lH({member:t,initialTicket:e,ticketOptions:s,conferenceId:n,editionTitle:a,onClose:i,onOpenExcursion:o}){const[l,c]=v.useState(e||""),[d,u]=v.useState(()=>
715({...oH,...t?{fullName:[t.first_name,t.last_name].filter(Boolean).join(" "),email:t.email||"",organisationName:t.organisation_name||"",jobTitle:t.job_title||"",countryOfResidence:t.country||"",sectorType:t.sector_type||"",industryCategory:t.industry||"",isCurrentMember:!0}:{}})),[h,m]=v.useState(!1),[f,p]=v.useState(""),g=E=>L=>{const D=L.target.type==="checkbox"?L.target.checked:L.target.value;u(P=>({...P,[E]:D}))},x=E=>{u(L=>{const D=L.additionalActivities;return{...L,additionalActivities:D.includes(E)?D.filter(P=>P!==E):[...D,E]}})},b=d.additionalActivities.includes("Optional Abidjan Experience"),y=!!t,w=l==="member_gc_junior"||l==="non_member_gc_junior",N=l.startsWith("join_attend_"),j=s.filter(E=>E.group==="ACGC Member Rates"?y:E.group==="Join + Attend Bundle"||E.group==="Non-Member Rates"?!y:!0),S=s.flatMap(E=>E.tickets).find(E=>E.id===l),k=async E=>{if(E.preventDefault(),!l){p("Please select a ticket type.");return}if(!d.fullName.trim()){p("Please enter your full name.");return}if(!d.email.trim()){p("Please enter your email address.");return}if(w){if(!d.juniorFullName.trim()){p("Please enter your junior colleague's full name.");return}if(!d.juniorEmail.trim()){p("Please enter your junior colleague's email address.");return}}if(N){if(!d.linkedIn.trim()){p("Please enter your LinkedIn profile URL.");return}if(!d.organisationName.trim()){p("Please enter your organisation name.");return}if(!d.jobTitle.trim()){p("Please enter your job title.");return}if(!d.countryOfResidence.trim()){p("Please select your country of residence.");return}if(!d.organisationType.trim()){p("Please select your organisation type.");return}if(!d.industryCategory.trim()){p("Please select your industry.");return}if(!d.password||d.password.length<8){p("Password must be at least 8 characters long.");return}if(!/\d/.test(d.password)){p("Password must contain at least one number.");return}if(!/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~`]/.test(d.password)){p("Password must contain at least one special character.");return}if(d.password!==d.confirmPassword){p("Passwords do not match.");return}}m(!0),p("");try{const L=await U("/api/conference/register",{method:"POST",body:{ticketType:l,memberId:(t==null?void 0:t.id)||null,conferenceId:n,...d}});window.location.href=L.checkoutUrl}catch(L){p((L==null?void 0:L.message)||"Something went wrong. Please try again."),m(!1)}};v.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const C=({children:E,required:L})=>r.jsxs("label",{className:"block text-xs font-semibold text-slate-700 mb-1",children:[E,L&&r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),T="w-full border border-slate-200 rounded-lg px-3 py-2 text-sm text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40 focus:border-[#c08a2f] bg-white",A=T;return r.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 backdrop-blur-sm overflow-y-auto py-6 px-4",children:r.jsxs(V.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:24},transition:{duration:.25},className:"relative w-full max-w-2xl bg-white rounded-2xl shadow-2xl",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-5 bg-[#1f0f3f] rounded-t-2xl",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[#e8c76c] text-xs font-bold uppercase tracking-widest mb-0.5",children:a}),r.jsx("h2",{className:"text-white font-bold text-lg leading-tight",children:"Conference Registration"})]}),r.jsx("button",{onClick:i,className:"text-white/60 hover:text-white transition rounded-full p-1",children:r.jsx(He,{className:"h-5 w-5"})})]}),r.jsxs("form",{onSubmit:k,className:"px-6 py-6 space-y-8",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-3",children:"Select Your Ticket"}),y&&r.jsxs("div",{className:"mb-4 rounded-xl bg-[#c08a2f]/10 border border-[#c08a2f]/30 px-4 py-3 flex items-center gap-2",children:[r.jsx(is,{className:"h-4 w-4 text-[#c08a2f] shrink-0"}),r.jsx("p",{className:"text-xs text-[#8b6020] font-semibold",children:"Member rates applied â you're registered as an ACGC member."})]}),j.map(E=>r.jsxs("div",{className:"mb-4",children:[r.jsx("div",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wider mb-2",children:E.group}),r.jsx("div",{className:"grid sm:grid-cols-2 gap-2",children:E.tickets.map(L=>r.jsxs("button",{type:"button",disabled:L.closed,onClick:()=>
715!L.closed&&c(L.id),className:`text-left rounded-xl border-2 px-4 py-3 transition ${L.closed?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-70":l===L.id?"border-[#c08a2f] bg-[#fdf6e3]":"border-slate-200 bg-white hover:border-[#c08a2f]/40"}`,children:[r.jsxs("div",{className:"flex items-center justify-between mb-0.5",children:[r.jsx("span",{className:`text-sm font-semibold ${L.closed?"text-slate-400":"text-[#1f0f3f]"}`,children:L.label}),L.closed?r.jsx("span",{className:"inline-flex items-center rounded-full bg-slate-200 text-slate-500 text-[10px] font-bold uppercase tracking-wide px-2 py-0.5",children:"Booking Closed"}):r.jsx("span",{className:"text-sm font-extrabold text-[#c08a2f]",children:L.price})]}),L.note&&!L.closed&&r.jsx("div",{className:"text-xs text-slate-400",children:L.note}),!L.closed&&l===L.id&&r.jsxs("div",{className:"mt-1 flex items-center gap-1 text-xs text-[#c08a2f] font-semibold",children:[r.jsx(is,{className:"h-3 w-3"})," Selected"]})]},L.id))})]},E.group))]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-4",children:"Core Registration Information"}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"sm:col-span-2",children:[r.jsx(C,{required:!0,children:"Full Name"}),r.jsx("input",{className:T,value:d.fullName,onChange:g("fullName"),placeholder:"e.g. Amara Diallo",required:!0})]}),r.jsxs("div",{children:[r.jsx(C,{required:!0,children:"Email Address"}),r.jsx("input",{type:"email",className:T,value:d.email,onChange:g("email"),placeholder:"[email protected]",required:!0})]}),r.jsxs("div",{children:[r.jsx(C,{children:"Mobile Number"}),r.jsx("input",{className:T,value:d.mobileNumber,onChange:g("mobileNumber"),placeholder:"+234 800 000 0000"})]}),r.jsxs("div",{children:[r.jsx(C,{required:N,children:"Organisation Name"}),r.jsx("input",{className:T,value:d.organisationName,onChange:g("organisationName"),placeholder:"Your organisation"})]}),r.jsxs("div",{children:[r.jsx(C,{required:N,children:"Job Title"}),r.jsx("input",{className:T,value:d.jobTitle,onChange:g("jobTitle"),placeholder:"e.g. General Counsel"})]}),r.jsxs("div",{children:[r.jsx(C,{required:N,children:"Country of Residence"}),r.jsxs("select",{className:A,value:d.countryOfResidence,onChange:g("countryOfResidence"),children:[r.jsx("option",{value:"",children:"Select country"}),aH.map(E=>E.startsWith("â")?r.jsx("option",{disabled:!0,children:E},E):r.jsx("option",{value:E,children:E},E))]})]}),r.jsxs("div",{children:[r.jsx(C,{children:"Primary Jurisdiction(s) of Practice"}),r.jsx("input",{className:T,value:d.primaryJurisdictions,onChange:g("primaryJurisdictions"),placeholder:"e.g. Nigeria, Ghana"})]}),N&&r.jsxs("div",{className:"sm:col-span-2",children:[r.jsx(C,{required:!0,children:"LinkedIn"}),r.jsx("input",{type:"url",className:T,value:d.linkedIn,onChange:g("linkedIn"),placeholder:"https://www.linkedin.com/in/your-profile"})]})]}),N&&r.jsxs("div",{className:"mt-5 rounded-xl border border-[#c08a2f]/30 bg-[#fdf6e3] p-4",children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-1",children:"Create Your ACGC Member Account"}),r.jsx("p",{className:"text-xs text-slate-500 mb-4",children:"The Join + Attend Bundle includes ACGC membership â set a password so you can log in to the member portal once your payment is confirmed."}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(C,{required:!0,children:"Password"}),r.jsx("input",{type:"password",className:T,value:d.password,onChange:g("password"),placeholder:"At least 8 characters",autoComplete:"new-password"})]}),r.jsxs("div",{children:[r.jsx(C,{required:!0,children:"Confirm Password"}),r.jsx("input",{type:"password",className:T,value:d.confirmPassword,onChange:g("confirmPassword"),placeholder:"Re-enter your password",autoComplete:"new-password"})]})]}),r.jsx("p",{className:"text-[11px] text-slate-400 mt-2",children:"Must be 8+ characters and include a number and a special character."})]}),w&&r.jsxs(V.div,{initial:{opacity:0,height:0}
715,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"mt-5 rounded-xl border border-[#c08a2f]/30 bg-[#fdf6e3] p-4",children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-3",children:"Junior Colleague Details"}),r.jsx("p",{className:"text-xs text-slate-500 mb-4",children:"This package covers 1 GC + 1 junior colleague (0â3 years in-house experience). Please provide their details below."}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(C,{required:!0,children:"Junior Colleague's Full Name"}),r.jsx("input",{className:T,value:d.juniorFullName,onChange:g("juniorFullName"),placeholder:"e.g. Kwame Mensah"})]}),r.jsxs("div",{children:[r.jsx(C,{required:!0,children:"Junior Colleague's Email Address"}),r.jsx("input",{type:"email",className:T,value:d.juniorEmail,onChange:g("juniorEmail"),placeholder:"[email protected]"})]})]})]})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-4",children:"Professional Information"}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[y?r.jsxs("div",{children:[r.jsx(C,{children:"Sector"}),r.jsxs("select",{className:A,value:d.sectorType,onChange:g("sectorType"),children:[r.jsx("option",{value:"",children:"Select sector"}),r.jsx("option",{value:"Private",children:"Private"}),r.jsx("option",{value:"Public",children:"Public"}),r.jsx("option",{value:"Both",children:"Both"})]})]}):r.jsxs("div",{children:[r.jsx(C,{required:N,children:"Organisation Type"}),r.jsxs("select",{className:A,value:d.organisationType,onChange:g("organisationType"),children:[r.jsx("option",{value:"",children:"Select type"}),r.jsx("option",{children:"Private Sector"}),r.jsx("option",{children:"Public Sector"}),r.jsx("option",{children:"Multilateral / Development Institution"}),r.jsx("option",{children:"Professional Services"}),r.jsx("option",{children:"Other"})]})]}),r.jsxs("div",{children:[r.jsx(C,{required:N,children:"Industry / Sector"}),r.jsxs("select",{className:A,value:d.industryCategory,onChange:g("industryCategory"),children:[r.jsx("option",{value:"",children:"Select industry"}),iH.map(E=>r.jsx("option",{children:E},E))]})]}),!y&&r.jsxs("div",{className:"sm:col-span-2",children:[r.jsx(C,{children:"Are you currently an ACGC member?"}),r.jsx("div",{className:"flex gap-6 mt-1",children:["Yes","No"].map(E=>r.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"isCurrentMember",checked:d.isCurrentMember===(E==="Yes"),onChange:()=>u(L=>({...L,isCurrentMember:E==="Yes"})),className:"accent-[#c08a2f]"}),E]},E))})]})]})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-4",children:"Additional Conference Activities"}),r.jsx(C,{children:"Which additional conference activities would you be interested in attending? (Select all that apply)"}),r.jsx("div",{className:"mt-2 space-y-2",children:["Welcome Reception / Networking Drinks","Awards Ceremony","Optional Abidjan Experience","I am only planning to attend the main conference sessions"].map(E=>r.jsxs("label",{className:"flex items-start gap-3 cursor-pointer group",children:[r.jsx("div",{className:`mt-0.5 h-4 w-4 shrink-0 rounded border-2 flex items-center justify-center transition ${d.additionalActivities.includes(E)?"border-[#c08a2f] bg-[#c08a2f]":"border-slate-300 bg-white group-hover:border-[#c08a2f]/60"}`,onClick:()=>x(E),children:d.additionalActivities.includes(E)&&r.jsx(is,{className:"h-2.5 w-2.5 text-white"})}),r.jsx("span",{className:"text-sm text-slate-700 leading-snug",onClick:()=>x(E),children:E})]},E))}),b&&r.jsxs(V.div,{initial:{opacity:0,y:-8},animate:{opacity:1,y:0},className:"mt-4 rounded-xl border border-[#c08a2f]/30 bg-[#fdf6e3] p-4 space-y-4",children:[r.jsxs("div",{children:[r.jsx(C,{children:"Optional Abidjan Experience"}),r.jsx("p",{className:"text-xs text-slate-500 mb-2",children:"Join fellow delegates for our optional Abidjan Experience taking place after the conference. View the programme and reserve your place below."}),r.jsx("p",{className:"text-xs font-semibold text-slate-700 mb-2",children:"Would you like to receive information and book the excursion?"}),r.jsx("div",{className:"flex gap-6",children:["Yes","No"].map(E=>r.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"abidjanInterest",checked:d.abidjanExperienceInterest===E,onChange:()=>u(L=>({...L,abidjanExperienceInterest:E})),className:"accent-[#c08a2f]"}),E]},E))})]}),d.abidjanExperienceInterest==="Yes"&&r.jsxs("button",{type:"button",onClick:o,className:"inline-flex items-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a
71577324] px-5 py-2.5 text-xs font-bold text-white transition",children:[r.jsx(Fn,{className:"h-3.5 w-3.5"})," View Programme & Reserve Your Place"]})]})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-4",children:"Dietary Requirements"}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(C,{children:"Dietary Preference"}),r.jsx("select",{className:A,value:d.dietaryPreference,onChange:g("dietaryPreference"),children:["None","Vegetarian","Vegan","Halal","Other"].map(E=>r.jsx("option",{children:E},E))})]}),r.jsxs("div",{children:[r.jsx(C,{children:"Allergies or dietary restrictions"}),r.jsx("input",{className:T,value:d.dietaryRestrictions,onChange:g("dietaryRestrictions"),placeholder:"e.g. nut allergy, gluten-free"})]})]})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-4",children:"Travel & Logistics"}),r.jsx(C,{children:"Do you require an invitation letter for visa purposes?"}),r.jsx("div",{className:"flex gap-6 mt-1",children:["Yes","No"].map(E=>r.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"visaLetter",checked:d.requiresVisaLetter===(E==="Yes"),onChange:()=>u(L=>({...L,requiresVisaLetter:E==="Yes"})),className:"accent-[#c08a2f]"}),E]},E))})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-4",children:"Communications & Conference Objectives"}),r.jsxs("div",{className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx(C,{children:"Would you like to continue receiving ACGC updates and event information after the conference?"}),r.jsx("div",{className:"flex gap-6 mt-1",children:["Yes","No"].map(E=>r.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700 cursor-pointer",children:[r.jsx("input",{type:"radio",name:"receiveUpdates",checked:d.receiveUpdates===(E==="Yes"),onChange:()=>u(L=>({...L,receiveUpdates:E==="Yes"})),className:"accent-[#c08a2f]"}),E]},E))})]}),r.jsxs("div",{children:[r.jsx(C,{children:"What is your primary reason for attending the conference?"}),r.jsxs("select",{className:A,value:d.primaryReason,onChange:g("primaryReason"),children:[r.jsx("option",{value:"",children:"Select a reason"}),["Networking","Learning & Insights","Regional Engagement","Business Development","Benchmarking with Peers","Exploring Partnerships","Other"].map(E=>r.jsx("option",{children:E},E))]})]})]})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-4",children:"Referral Tracking"}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(C,{children:"How did you hear about the conference?"}),r.jsxs("select",{className:A,value:d.referralSource,onChange:g("referralSource"),children:[r.jsx("option",{value:"",children:"Select an option"}),["ACGC Email","LinkedIn","Colleague / Referral","Sponsor / Partner","Previous Attendee","Other"].map(E=>r.jsx("option",{children:E},E))]})]}),r.jsxs("div",{children:[r.jsx(C,{children:"If referred by someone, please indicate their name"}),r.jsx("input",{className:T,value:d.referralName,onChange:g("referralName"),placeholder:"Optional"})]})]})]}),S&&r.jsxs("div",{className:"rounded-xl border-2 border-[#c08a2f] bg-[#fdf6e3] p-4 flex items-center justify-between",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-[#c08a2f] font-semibold uppercase tracking-wider",children:"Selected Ticket"}),r.jsx("div",{className:"text-sm font-bold text-[#1f0f3f] mt-0.5",children:S.label}),S.note&&r.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:S.note})]}),r.jsx("div",{className:"text-2xl font-extrabold text-[#c08a2f]",children:S.price})]}),f&&r.jsx("div",{className:"rounded-lg bg-red-50 border border-red-200 px-4 py-3 text-sm text-red-700",children:f}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-3 pt-2",children:[r.jsx("button",{type:"submit",disabled:h,className:"w-full sm:w-auto flex-1 inline-flex items-center justify-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a
71577324] disabled:opacity-60 px-8 py-3 text-sm font-bold text-white transition shadow",children:h?r.jsxs(r.Fragment,{children:[r.jsx($a,{className:"h-4 w-4 animate-spin"})," Processingâ¦"]}):r.jsxs(r.Fragment,{children:[r.jsx(Fn,{className:"h-4 w-4"})," Proceed to Payment"]})}),r.jsx("button",{type:"button",onClick:i,className:"text-sm text-slate-500 hover:text-slate-700 transition",children:"Cancel"})]}),r.jsx("p",{className:"text-xs text-slate-400 text-center",children:"You will be redirected to a secure Stripe payment page. All prices in USD."})]})]})})}function cH({member:t,initialOption:e,excursionOptions:s,conferenceId:n,onClose:a}){const[i,o]=v.useState(e||""),[l,c]=v.useState(()=>({fullName:t?[t.first_name,t.last_name].filter(Boolean).join(" "):"",email:(t==null?void 0:t.email)||"",mobileNumber:"",organisationName:(t==null?void 0:t.organisation_name)||"",dietaryRequirements:""})),[d,u]=v.useState(!1),[h,m]=v.useState(""),f=b=>y=>{const w=y.target.value;c(N=>({...N,[b]:w}))},p=async b=>{if(b.preventDefault(),!i){m("Please select a booking option.");return}if(!l.fullName.trim()){m("Please enter your full name.");return}if(!l.email.trim()){m("Please enter your email address.");return}u(!0),m("");try{const y=await U("/api/conference/excursion",{method:"POST",body:{optionType:i,conferenceId:n,...l}});window.location.href=y.checkoutUrl}catch(y){m((y==null?void 0:y.message)||"Something went wrong. Please try again."),u(!1)}};v.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}),[]);const g=({children:b,required:y})=>r.jsxs("label",{className:"block text-xs font-semibold text-slate-700 mb-1",children:[b,y&&r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),x="w-full border border-slate-200 rounded-lg px-3 py-2 text-sm text-slate-800 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40 focus:border-[#c08a2f] bg-white";return r.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/60 backdrop-blur-sm overflow-y-auto py-6 px-4",children:r.jsxs(V.div,{initial:{opacity:0,y:24},animate:{opacity:1,y:0},exit:{opacity:0,y:24},transition:{duration:.25},className:"relative w-full max-w-lg bg-white rounded-2xl shadow-2xl",children:[r.jsxs("div",{className:"flex items-center justify-between px-6 py-5 bg-[#1f0f3f] rounded-t-2xl",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-[#e8c76c] text-xs font-bold uppercase tracking-widest mb-0.5",children:"Saturday 3 October 2026"}),r.jsx("h2",{className:"text-white font-bold text-lg leading-tight",children:"Reserve Your Place â Experience Abidjan"})]}),r.jsx("button",{onClick:a,className:"text-white/60 hover:text-white transition rounded-full p-1",children:r.jsx(He,{className:"h-5 w-5"})})]}),r.jsxs("form",{onSubmit:p,className:"px-6 py-6 space-y-6",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#c08a2f] mb-3",children:"Select Your Option"}),r.jsx("div",{className:"grid gap-3",children:Object.entries(s).map(([b,y])=>{const w=i===b,N=!y.isActive,j=y.name.includes("â")?y.name.split("â")[1].trim():"";return r.jsx("button",{type:"button",disabled:N,onClick:()=>!N&&o(b),className:"w-full text-left rounded-xl border-2 px-4 py-3 transition "+(N?"border-slate-200 bg-slate-50 cursor-not-allowed opacity-70":w?"border-[#c08a2f] bg-[#fdf6e3]":"border-slate-200 bg-white hover:border-[#c08a2f]/40"),children:r.jsxs("div",{className:"flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:`text-sm font-bold ${N?"text-slate-400":"text-[#1f0f3f]"}`,children:y.name}),j&&!N&&r.jsx("div",{className:"text-xs text-slate-500",children:j})]}),r.jsx("div",{className:"text-right shrink-0",children:N?r.jsx("span",{className:"inline-flex items-center rounded-full bg-slate-200 text-slate-500 text-[10px] font-bold uppercase tracking-wide px-2 py-0.5",children:"Booking Closed"}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"text-base font-extrabold text-[#1f0f3f]",children:y.price}),r.jsx("div",{className:"text-[10px] text-slate-500",children:"per delegate"})]})})]})},b)})})]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(g,{required:!0,children:"Full Name"}),r.jsx("input",{className:x,value:l.fullName,onChange:f("fullName"),autoComplete:"name"})]}),r.jsxs("div",{children:[r.jsx(g,{required:!0,children:"Email Address"}),r.jsx("input",{type:"email",className:x,value:l.email,onChange:f("email"),autoComplete:"email"})]}),r.jsxs("div",{children:[r.jsx(g,{children:"Mobile Number"}),r.jsx("input",{className:x,value:l.mobileNumber,onChange:f("mobileNumber"),autoComplete:"tel"})]}),r.jsxs("div",{children:[r.jsx(g,{children:"Organisation"}),r.jsx("input",{className:x,value:l.organisationName,onChange:f("organisationName"),autoComplete:"organization"})]})]}),r.jsx(ir,{initial:!1,children:i==="tour_lunch"&&r.jsxs(V.div,{initial:{opacity:0,height:0}
715,animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"overflow-hidden",children:[r.jsx(g,{children:"Dietary Requirements"}),r.jsx("input",{className:x,value:l.dietaryRequirements,onChange:f("dietaryRequirements"),placeholder:"e.g. vegetarian, halal, allergies"})]})}),r.jsxs("div",{className:"rounded-xl border border-[#c08a2f]/30 bg-[#fdf6e3] px-4 py-3 text-xs text-slate-600 leading-relaxed",children:[r.jsx("strong",{className:"text-[#1f0f3f]",children:"Please note:"})," the excursion will proceed subject to sufficient delegate registrations. Please reserve your place by ",r.jsx("strong",{className:"text-[#1f0f3f]",children:"Friday 7 August 2026"}),"."]}),h&&r.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:h}),r.jsx("button",{type:"submit",disabled:d,className:"w-full inline-flex items-center justify-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a77324] disabled:opacity-60 px-6 py-3.5 text-sm font-bold text-white transition",children:d?r.jsxs(r.Fragment,{children:[r.jsx($a,{className:"h-4 w-4 animate-spin"})," Processingâ¦"]}):r.jsxs(r.Fragment,{children:[r.jsx(Fn,{className:"h-4 w-4"})," Proceed to Payment"]})})]})]})})}function dH({type:t}){const e=t==="break",s=e?V3:vx,n=e?"text-[#c08a2f] bg-[#c08a2f]/10":"text-[#1f0f3f] bg-[#1f0f3f]/10";return r.jsx("div",{className:`h-9 w-9 rounded-full flex items-center justify-center shrink-0 ${n}`,children:r.jsx(s,{className:"h-4 w-4"})})}function uH({day:t}){const[e,s]=v.useState(!1);return t.comingSoon?r.jsx("div",{className:"rounded-xl border border-slate-200 bg-slate-50 overflow-hidden",children:r.jsxs("div",{className:"flex items-center justify-between px-5 py-4 gap-4",children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[r.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-slate-200 text-slate-500 text-xs font-bold px-3 py-1",children:t.badge}),r.jsx("span",{className:"text-sm font-medium text-slate-400 italic",children:"Coming soon"})]}),r.jsx("span",{className:"hidden sm:block text-sm text-slate-400 font-medium truncate",children:t.title})]})}):r.jsxs("div",{className:`rounded-xl border overflow-hidden transition-shadow ${e?"border-[#1f0f3f]/30 shadow-md":"border-slate-200 shadow-sm hover:shadow-md"}`,children:[r.jsxs("button",{onClick:()=>s(!e),className:"w-full flex items-center justify-between px-5 py-4 gap-4 text-left bg-white hover:bg-slate-50/60 transition-colors","aria-expanded":e,children:[r.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[r.jsx("span",{className:"shrink-0 inline-flex items-center rounded-full bg-[#c08a2f] text-white text-xs font-bold px-3 py-1",children:t.badge}),r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"text-xs text-slate-400 font-medium",children:[t.dayLabel," · ",t.date]}),r.jsx("div",{className:"text-sm sm:text-base font-bold text-[#1f0f3f] leading-tight",children:t.title})]})]}),r.jsx("div",{className:"shrink-0 h-7 w-7 rounded-full bg-slate-100 flex items-center justify-center",children:e?r.jsx(Vi,{className:"h-4 w-4 text-slate-500"}):r.jsx(ht,{className:"h-4 w-4 text-slate-500"})})]}),r.jsx(ir,{initial:!1,children:e&&r.jsx(V.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.28,ease:"easeInOut"},className:"overflow-hidden",children:r.jsx("div",{className:"border-t border-slate-100 bg-white px-5 py-5",children:r.jsx("div",{className:"relative pl-5 border-l-2 border-slate-100 space-y-0",children:t.sessions.map((n,a)=>r.jsxs("div",{className:"relative flex gap-4 pb-7 last:pb-0",children:[r.jsx("div",{className:"absolute -left-[22px] top-0",children:r.jsx(dH,{type:n.type})}),r.jsxs("div",{className:"ml-6 min-w-0",children:[r.jsx("div",{className:"text-xs font-semibold text-slate-500 flex items-center gap-1.5 mb-1",children:r.jsx("span",{children:n.time})}),r.jsx("div",{className:`text-sm font-bold leading-snug ${n.type==="break"?"text-[#c08a2f]":"text-[#1f0f3f]"}`,children:n.title}),n.titleFr&&r.jsx("div",{className:"mt-0.5 text-xs italic text-slate-400 leading-snug",children:n.titleFr}),n.speaker&&n.speaker.length>0&&r.jsx("div",{className:"mt-1 space-y-1",children:n.speaker.map((i,o)=>{const[l,...c]=i.split(", "),d=c.join(", ");return r.jsxs("div",{className:"text-sm leading-snug text-slate-700",children:[r.jsx("span",{className:"font-bold text-[#1f0f3f]",children:l}),d&&r.jsxs("span",{children:[", ",d]})]},o)})}),r.jsx("p",{className:"mt-1 text-sm text-slate-500 leading-relaxed whitespace-pre-line",children:n.desc}),n.descItems&&r.jsx("ol",{className:"mt-2 space-y-3 text-sm list-none",children:n.descItems.map((i,o)=>r.jsxs("li",{className:"flex gap-2",children:[r.jsxs("span",{className:"shrink-0 font-semibold text-[#1f0f3f]",children:["(",o+1,")"]}),r.jsxs("div",{children:[r.jsxs("span",{children:[r.jsx("span",{className:"font-semibold text-slate-700",children:i.title}),i.body&&r.jsxs("span",{className:"text-slate-500",children:[" â ",i.body]})]}),i.speakers&&i.speakers.length>0&&r.jsx("div",{className:"mt-1 space-y-0.5",children:i.speakers.map((l,c)=>{const[d,...u]=l.split(", "),h=u.join(", ");return r.jsxs("div",{className:"text-sm leading-snug text-slate-700",children:[r.jsx("span",{className:"font-bold text-[#1f0f3f]",children:d}),h&&r.jsxs("span",{children:[", ",h]})]},c)})})]})]},o))})]})]},a))})})},"content")})]})}function hH({faq:t}){const[e,s]=v.useState(!1);return r.jsxs("div",{className:`rounded-xl border transition-all ${e?"border-[#1f0f3f]/30 shadow-sm":"border-slate-200"}`,children:[r.jsxs("button",{onClick:()=>s(!e),className:"w-full flex items-start justify-between gap-4 px-5 py-4 text-left hover:bg-slate-50/60 transition-colors rounded-xl",children:[r.jsx("span",{className:"text-sm font-semibold text-slate-900 leading-snug",children:t.q}),r.jsx("div",{className:"shrink-0 h-6 w-6 rounded-full bg-slate-100 flex items-center justify-center mt-0.5",children:e?r.jsx(Vi,{className:"h-3.5 w-3.5 text-slate-500"}):r.jsx(ht,{className:"h-3.5 w-3.5 text-slate-500"})})]}),r.jsx(ir,{initial:!1,children:e&&r.jsx(V.div,{initial:{height:0,opacity:0}
715,animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.22,ease:"easeInOut"},className:"overflow-hidden",children:r.jsx("div",{className:"px-5 pb-4 text-sm text-slate-600 leading-relaxed border-t border-slate-100 pt-3",children:t.a})})})]})}function mH(){const[t,e]=v.useState(!1),s="https://drive.google.com/file/d/1colF6Hj1zYSjbCtCzP5TVEfo0IH1yoBb/preview";return v.useEffect(()=>{if(t)return document.body.style.overflow="hidden",()=>{document.body.style.overflow=""}},[t]),r.jsxs(r.Fragment,{children:[r.jsxs("button",{onClick:()=>e(!0),className:"fixed bottom-24 right-6 z-50 flex items-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a77324] text-white px-4 py-3 shadow-2xl transition-all hover:scale-105","aria-label":"Watch how to navigate the conference page",children:[r.jsx(xx,{className:"h-5 w-5"}),r.jsx("span",{className:"text-sm font-semibold",children:"How to Navigate"})]}),r.jsx(ir,{children:t&&r.jsx(V.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"fixed inset-0 z-[60] flex items-center justify-center bg-black/90",onClick:()=>e(!1),children:r.jsxs(V.div,{initial:{opacity:0,scale:.96},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.96},transition:{duration:.2},className:"relative w-full h-full max-w-6xl max-h-[90vh] mx-4",onClick:n=>n.stopPropagation(),children:[r.jsx("button",{onClick:()=>e(!1),className:"absolute -top-12 right-0 sm:top-2 sm:-right-12 text-white/80 hover:text-white transition p-2","aria-label":"Close video",children:r.jsx(He,{className:"h-7 w-7"})}),r.jsx("div",{className:"w-full h-full rounded-xl overflow-hidden shadow-2xl bg-black",children:r.jsx("iframe",{src:s,className:"w-full h-full",allow:"autoplay",allowFullScreen:!0,title:"How to navigate the ACGC Conference page"})})]})})})]})}function fH(){const{scrollYProgress:t}=Bw();return r.jsx(V.div,{style:{scaleX:t},className:"fixed top-0 left-0 right-0 h-1 bg-[#c08a2f] origin-left z-[70]"})}function pH({targetDate:t}){const e=v.useMemo(()=>new Date(t).getTime(),[t]),[s,n]=v.useState(()=>e-Date.now());if(v.useEffect(()=>{n(e-Date.now());const c=setInterval(()=>n(e-Date.now()),1e3);return()=>clearInterval(c)},[e]),s<=0)return null;const a=Math.floor(s/(1e3*60*60*24)),i=Math.floor(s/(1e3*60*60)%24),o=Math.floor(s/(1e3*60)%60),l=Math.floor(s/1e3%60);return r.jsx("div",{className:"bg-[#1f0f3f] py-2",children:r.jsxs("div",{className:"max-w-7xl mx-auto px-4 flex items-center justify-center gap-5 sm:gap-10 text-white",children:[r.jsx("span",{className:"text-xs uppercase tracking-widest text-[#e8c76c] font-bold hidden sm:inline",children:"Conference begins in"}),[{label:"Days",value:a},{label:"Hrs",value:i},{label:"Min",value:o},{label:"Sec",value:l}].map(c=>r.jsxs("div",{className:"text-center",children:[r.jsx("div",{className:"text-xl sm:text-2xl font-extrabold tabular-nums",children:String(c.value).padStart(2,"0")}),r.jsx("div",{className:"text-[10px] uppercase tracking-wider text-slate-400",children:c.label})]},c.label))]})})}function xH({value:t,className:e}){const s=t.match(/^(\d+)(.*)$/),[n,a]=v.useState(s?"0"+s[2]:t),i=v.useRef(null),o=v.useRef(!1);return v.useEffect(()=>{if(!s)return;const l=parseInt(s[1],10),c=s[2],d=i.current;if(!d)return;const u=new IntersectionObserver(([h])=>{if(h.isIntersecting&&!o.current){o.current=!0;const m=1200,f=performance.now(),p=g=>{const x=Math.min((g-f)/m,1),b=1-Math.pow(1-x,3);a(Math.round(b*l)+c),x<1&&requestAnimationFrame(p)};requestAnimationFrame(p)}},{threshold:.4});return u.observe(d),()=>u.disconnect()},[]),r.jsx("div",{ref:i,className:e,children:n})}function gH(){const[t,e]=v.useState(!1),[s,n]=v.useState(""),[a,i]=v.useState([{role:"assistant",text:"Hi! I'm the ACGC AI assistant. Ask me anything about the 2026 conference â dates, venue, programme, tickets, and more."}]),o=()=>{s.trim()&&(i(l=>[...l,{role:"user",text:s},{role:"assistant",text:"Thank you for your question. Full AI responses will be available closer to the conference. In the meantime, please email [email protected] for any queries."}]),n(""))};return r.jsxs(r.Fragment,{children:[r.jsxs("button",{onClick:()=>e(!0),className:"fixed bottom-6 right-6 z-50 flex items-center gap-2 rounded-full bg-[#1f0f3f] hover:bg-[#2a1654] text-white px-4 py-3 shadow-2xl transition-all hover:scale-105","aria-label":"Ask ACGC AI",children:[r.jsx(hk,{className:"h-5 w-5"}),r.jsx("span",{className:"text-sm font-semibold",children:"Ask ACGC AI"})]}),r.jsx(ir,{children:t&&r.jsxs(V.div,{initial:{opacity:0,y:20,scale:.95}
715,animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{duration:.2},className:"fixed bottom-20 right-6 z-50 w-80 rounded-2xl bg-white shadow-2xl border border-slate-200 flex flex-col overflow-hidden",style:{maxHeight:"420px"},children:[r.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-[#1f0f3f]",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(hk,{className:"h-4 w-4 text-[#e8c76c]"}),r.jsx("span",{className:"text-sm font-bold text-white",children:"Ask ACGC AI"})]}),r.jsx("button",{onClick:()=>e(!1),className:"text-white/60 hover:text-white transition",children:r.jsx(He,{className:"h-4 w-4"})})]}),r.jsx("div",{className:"flex-1 overflow-y-auto px-4 py-3 space-y-3 bg-slate-50",children:a.map((l,c)=>r.jsx("div",{className:`flex ${l.role==="user"?"justify-end":"justify-start"}`,children:r.jsx("div",{className:`max-w-[85%] rounded-xl px-3 py-2 text-sm leading-relaxed ${l.role==="user"?"bg-[#1f0f3f] text-white rounded-br-none":"bg-white border border-slate-200 text-slate-700 rounded-bl-none"}`,children:l.text})},c))}),r.jsxs("div",{className:"flex items-center gap-2 px-3 py-2.5 border-t border-slate-200 bg-white",children:[r.jsx("input",{value:s,onChange:l=>n(l.target.value),onKeyDown:l=>l.key==="Enter"&&o(),placeholder:"Ask a questionâ¦",className:"flex-1 text-sm border border-slate-200 rounded-lg px-3 py-1.5 focus:outline-none focus:ring-1 focus:ring-[#c08a2f]"}),r.jsx("button",{onClick:o,className:"h-8 w-8 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] flex items-center justify-center transition",children:r.jsx(ia,{className:"h-3.5 w-3.5 text-white"})})]})]})})]})}function bH({hotel:t,onClose:e}){return t?r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:e,children:[r.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),r.jsxs(V.div,{initial:{opacity:0,scale:.95,y:8},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95},transition:{duration:.15},className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-md p-6 z-10",onClick:s=>s.stopPropagation(),children:[r.jsx("button",{onClick:e,className:"absolute top-4 right-4 p-1.5 rounded-full text-slate-400 hover:text-slate-700 hover:bg-slate-100 transition",children:r.jsx(He,{className:"h-4 w-4"})}),r.jsxs("div",{className:"flex items-start gap-3 mb-4",children:[r.jsx("div",{className:"h-10 w-10 rounded-xl bg-slate-100 flex items-center justify-center shrink-0",children:r.jsx(yx,{className:"h-5 w-5 text-slate-500"})}),r.jsxs("div",{children:[r.jsx("h3",{className:"font-bold text-[#1f0f3f] leading-tight",children:t.name}),r.jsxs("div",{className:"flex items-center gap-2 mt-1 flex-wrap",children:[r.jsx("span",{className:"text-xs text-slate-500 bg-slate-100 px-2 py-0.5 rounded-full",children:t.area}),r.jsxs("span",{className:"text-xs text-slate-500",children:[t.dist," from venue"]}),t.rating&&r.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-amber-600 font-semibold",children:[r.jsx(An,{className:"h-3 w-3 fill-current"}),t.rating]})]})]})]}),r.jsxs("div",{className:"rounded-xl bg-slate-50 border border-slate-100 px-4 py-3 mb-4",children:[r.jsx("div",{className:"text-xs text-slate-500 uppercase tracking-wider font-semibold mb-0.5",children:"Approx. rate per night"}),r.jsx("div",{className:"text-lg font-bold text-[#1f0f3f]",children:t.price}),r.jsx("div",{className:"text-xs text-slate-400",children:"Public rate, before taxes"})]}),r.jsxs("div",{className:"space-y-2.5",children:[t.phone&&r.jsxs("a",{href:`tel:${t.phone.replace(/\s/g,"")}`,className:"flex items-center gap-2.5 text-sm text-slate-700 hover:text-[#c08a2f] transition group",children:[r.jsx(Ai,{className:"h-4 w-4 text-slate-400 group-hover:text-[#c08a2f] shrink-0"}),t.phone]}),t.email&&r.jsxs("a",{href:`mailto:${t.email}`,className:"flex items-center gap-2.5 text-sm text-slate-700 hover:text-[#c08a2f] transition group",children:[r.jsx(Ft,{className:"h-4 w-4 text-slate-400 group-hover:text-[#c08a2f] shrink-0"}),t.email]}),t.website&&r.jsxs("a",{href:t.website,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2.5 text-sm text-slate-700 hover:text-[#c08a2f] transition group",children:[r.jsx(ur,{className:"h-4 w-4 text-slate-400 group-hover:text-[#c08a2f] shrink-0"}),t.website.replace(/^https?:\/\//,"")]})]}),t.mapLink&&r.jsxs("a",{href:t.mapLink,target:"_blank",rel:"noopener noreferrer",className:"mt-4 flex items-center justify-center gap-2 w-full rounded-xl bg-[#1f0f3f] hover:bg-[#2a1654] px-4 py-2.5 text-sm font-bold text-white transition",children:[r.jsx(kt,{className:"h-4 w-4"}),"View on Google Maps"]})]})]}):null}function yH({hotel:t,onClick:e}){return r.jsx("button",{onClick:()=>e(t),className:"w-full text-left rounded-xl border border-slate-200 bg-white p-4 hover:border-[#c08a2f]/50 hover:shadow-md transition group",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"h-9 w-9 rounded-lg bg-slate-100 flex items-center justify-center shrink-0",children:r.jsx(yx,{className:"h-4 w-4 text-slate-400 group-hover:text-[#c08a2f] transition"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm font-semibold text-slate-800 group-hover:text-[#1f0f3f] leading-tight",children:t.name}),r.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[t.area," · ",t.dist," from venue"]}),r.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[r.jsx("span",{className:"text-sm font-bold text-slate-700",children:t.price}),t.rating?r.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-amber-500 font-semibold ml-auto",children:[r.jsx(An,{className:"h-3 w-3 fill-current"}),t.rating]}):null]})]})]})})}function vH({hotels:t,bnbs:e,onClose:s,onSelectHotel:n}){const[a,i]=v.useState("hotels"),[o,l]=v.useState("distance"),d=v.useMemo(()=>{const u=a==="hotels"?[...t]:[...e];return o==="distance"?u.sort((h,m)=>parseFloat(h.dist)-parseFloat(m.dist)):o==="rating"?u.sort((h,m)=>(m.rating||0)-(h.rating||0)):o==="price"?u.sort((h,m)=>parseInt(h.price.replace(/[^0-9]/g,""))-parseInt(m.price.replace(/[^0-9]/g,""))):u},[a,o,t,e]);return r.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:s,children:[r.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm"}),r.jsxs(V.div,{initial:{opacity:0,scale:.96,y:10}
715,animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96},transition:{duration:.18},className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-4xl max-h-[88vh] flex flex-col z-10",onClick:u=>u.stopPropagation(),children:[r.jsxs("div",{className:"flex items-center justify-between px-6 pt-6 pb-4 border-b border-slate-100 shrink-0",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-xl font-bold text-[#1f0f3f]",children:"All Accommodation Options"}),r.jsx("p",{className:"text-sm text-slate-500 mt-0.5",children:"Abidjan â click any entry for contact & map details"})]}),r.jsx("button",{onClick:s,className:"p-2 rounded-full text-slate-400 hover:text-slate-700 hover:bg-slate-100 transition shrink-0",children:r.jsx(He,{className:"h-5 w-5"})})]}),r.jsxs("div",{className:"flex items-center justify-between gap-3 px-6 pt-4 shrink-0 flex-wrap",children:[r.jsx("div",{className:"flex gap-2",children:[{key:"hotels",label:`Hotels (${t.length})`},{key:"bnb",label:`BnB & Guesthouses (${e.length})`}].map(u=>r.jsx("button",{onClick:()=>i(u.key),className:`px-4 py-1.5 rounded-full text-sm font-semibold transition ${a===u.key?"bg-[#1f0f3f] text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200"}`,children:u.label},u.key))}),r.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-slate-500",children:[r.jsx("span",{className:"font-medium",children:"Sort by:"}),[{key:"distance",label:"Distance"},{key:"rating",label:"Rating"},{key:"price",label:"Price"}].map(u=>r.jsx("button",{onClick:()=>l(u.key),className:`px-2.5 py-1 rounded-full font-semibold transition ${o===u.key?"bg-[#c08a2f]/10 text-[#c08a2f]":"hover:bg-slate-100"}`,children:u.label},u.key))]})]}),r.jsx("div",{className:"overflow-y-auto flex-1 px-6 py-4",children:r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-3",children:d.map(u=>r.jsx(yH,{hotel:u,onClick:n},u.name))})}),r.jsxs("div",{className:"px-6 py-3 border-t border-slate-100 shrink-0 flex items-center justify-between",children:[r.jsx("p",{className:"text-xs text-slate-400",children:"Rates are approximate public rates before taxes."}),r.jsxs("a",{href:"https://docs.google.com/spreadsheets/d/1pHtQqLei5Q63hH4yR8MYzek-NAP2L8rdLKYuIZOa8U8/edit?usp=sharing",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 text-xs font-semibold text-[#c08a2f] hover:underline",children:[r.jsx(es,{className:"h-3.5 w-3.5"}),"Open full spreadsheet"]})]})]})]})}const wH=["Hotel Tiama","Seen Hotel Abidjan Plateau","Ibis Styles Abidjan Plateau"];function jH({hotels:t,bnbs:e,venueLabel:s}){const[n,a]=v.useState(!1),[i,o]=v.useState(null),l=v.useMemo(()=>wH.map(d=>t.find(u=>u.name===d)).filter(Boolean),[t]),c=d=>{a(!1),o(d)};return r.jsxs(r.Fragment,{children:[r.jsx("h3",{className:"text-lg font-bold text-[#1f0f3f] mb-1",children:"Additional Accommodation Options"}),r.jsxs("p",{className:"text-sm text-slate-500 mb-5",children:["Alternative hotels near the ",s,"."]}),r.jsx("div",{className:"grid sm:grid-cols-3 gap-4 mb-5",children:l.map((d,u)=>r.jsxs(V.button,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:u*.08,duration:.4},onClick:()=>o(d),className:"text-left rounded-xl border border-slate-200 bg-white p-5 hover:border-[#c08a2f]/50 hover:shadow-md hover:-translate-y-1 transition-all group",children:[r.jsx("div",{className:"h-9 w-9 rounded-lg bg-slate-100 flex items-center justify-center mb-3",children:r.jsx(yx,{className:"h-4 w-4 text-slate-400 group-hover:text-[#c08a2f] transition"})}),r.jsx("div",{className:"text-sm font-bold text-slate-800 group-hover:text-[#1f0f3f]",children:d.name}),r.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[d.area," · ",d.dist," from venue"]}),r.jsxs("div",{className:"flex items-center gap-2 mt-2",children:[r.jsx("span",{className:"border border-slate-200 rounded-full px-2 py-0.5 text-xs text-slate-600",children:"Hotel"}),d.rating&&r.jsxs("span",{className:"flex items-center gap-0.5 text-xs text-amber-500 font-semibold",children:[r.jsx(An,{className:"h-3 w-3 fill-current"}),d.rating]})]}),r.jsxs("div",{className:"mt-3 text-sm font-bold text-slate-800",children:[d.price," / night"]}),r.jsx("div",{className:"text-xs text-slate-400",children:"Public rate, before taxes"})]},d.name))}),r.jsxs("div",{className:"rounded-xl border border-slate-200 bg-slate-50 px-5 py-4 flex flex-col sm:flex-row items-start sm:items-center gap-4",children:[r.jsx("p",{className:"text-sm text-slate-600 flex-1",children:"Looking for a self-catering or short-stay option? We've compiled a broader list of apartments and rentals across Abidjan."}),r.jsxs("button",{onClick:()=>a(!0),className:"shrink-0 inline-flex items-center gap-2 rounded-xl border border-slate-300 bg-white px-4 py-2.5 text-sm font-semibold text-slate-700 hover:bg-slate-100 transition whitespace-nowrap",children:[r.jsx(es,{className:"h-4 w-4"}),"View full accommodation list"]})]}),r.jsxs(ir,{children:[n&&r.jsx(vH,{hotels:t,bnbs:e,onClose:()=>a(!1),onSelectHotel:c}),i&&r.jsx(bH,{hotel:i,onClose:()=>o(null)})]})]})}function NH({src:t,name:e,isPlat:s,isGold:n}){const[a,i]=v.useState(!1);return a?r.jsx("span",{className:`font-bold text-center leading-tight 716 ${s?"text-2xl text-[#c08a2f]":"text-base text-slate-600"} 717 `,children:e}):r.jsx("img",{src:t,alt:e,style:{maxHeight:s?96:n?76:84},className:"w-auto max-w-full object-contain block",loading:"eager",onError:()=>i(!0)})}function kH(){var le,De,$e,H,he,oe;const{slug:t}=al(),{member:e}=Oe(),s=v.useRef(null),[n,a]=v.useState(null),[i,o]=v.useState(!0),[l,c]=v.useState(""),[d,u]=v.useState(!1),[h,m]=v.useState(null),[f,p]=v.useState(!1),[g,x]=v.useState(null),[b,y]=v.useState("");v.useEffect(()=>{let F=!1;return(async()=>{o(!0),c("");try{const Z=await U(`/api/conferences/${t}`);F||a(Z)}catch(Z){F||c((Z==null?void 0:Z.message)||"Failed to load conference")}finally{F||o(!1)}})(),()=>{F=!0}},[t]);const w=v.useMemo(()=>n?nH(n):[],[n]),N=v.useMemo(()=>{const F={};
717for(const Z of(n==null?void 0:n.excursion_options)||[])F[Z.option_key]={name:Z.name,price:fs(Z.price_cents),priceCents:Z.price_cents,isActive:Z.is_active!==!1};return F},[n]),j=v.useMemo(()=>((n==null?void 0:n.hotels)||[]).filter(F=>!F.is_bnb).map($k),[n]),S=v.useMemo(()=>((n==null?void 0:n.hotels)||[]).filter(F=>F.is_bnb).map($k),[n]),k=v.useMemo(()=>ZU((n==null?void 0:n.sponsors)||[]),[n]),C=v.useMemo(()=>((n==null?void 0:n.faqs)||[]).map(F=>({q:F.question,a:F.answer})),[n]),T=v.useMemo(()=>{const F={};for(const Z of(n==null?void 0:n.tickets)||[])F[Z.ticket_key]=Z.price_cents;return F},[n]),A=v.useMemo(()=>{const F={};for(const Z of(n==null?void 0:n.tickets)||[])F[Z.ticket_key]=Z.is_active!==!1;return F},[n]),E=v.useMemo(()=>n?dM(n.join_attend_tiers,n.conference.join_attend_rate_early_cents,n.conference.join_attend_rate_standard_cents,n.conference.early_bird_deadline):[],[n]),L=n?Date.now()<new Date(n.conference.early_bird_deadline).getTime():!0,D=(F=null)=>{m(F),u(!0)},P=(F=null)=>{x(F),p(!0)};v.useEffect(()=>{const F=new URLSearchParams(window.location.search);(F.has("excursion_success")||F.has("excursion_cancelled"))&&(y(F.has("excursion_success")?"success":"cancelled"),window.history.replaceState({},"",window.location.pathname),setTimeout(()=>{var Z;(Z=document.getElementById("excursion"))==null||Z.scrollIntoView({behavior:"smooth",block:"start"})},300))},[]),v.useEffect(()=>{if(window.location.hash){const F=window.location.hash.replace("#","");setTimeout(()=>{var Z;(Z=document.getElementById(F))==null||Z.scrollIntoView({behavior:"smooth",block:"start"})},300)}},[]);const R=v.useRef(null),{scrollYProgress:$}=Bw({target:R,offset:["start start","end start"]}),O=F3($,[0,1],["0%","25%"]);if(i)return r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white",children:r.jsxs("div",{className:"flex flex-col items-center gap-3 text-slate-400",children:[r.jsx($a,{className:"h-8 w-8 animate-spin text-[#c08a2f]"}),r.jsx("span",{className:"text-sm font-medium",children:"Loading conferenceâ¦"})]})});if(l||!n)return r.jsx("div",{className:"min-h-screen flex items-center justify-center bg-white px-4",children:r.jsxs("div",{className:"text-center max-w-sm",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-16 w-16 rounded-full bg-slate-100 mb-5",children:r.jsx(aa,{className:"h-8 w-8 text-slate-400"})}),r.jsx("h1",{className:"text-xl font-bold text-[#1f0f3f]",children:"Conference Not Found"}),r.jsx("p",{className:"mt-2 text-sm text-slate-500",children:l||"This conference does not exist or has been removed."}),r.jsx(K,{to:"/conference",className:"mt-6 inline-flex items-center gap-2 rounded-full bg-[#1f0f3f] hover:bg-[#2a1654] px-6 py-2.5 text-sm font-bold text-white transition",children:"Back to Conferences"})]})});const _=n.conference,B=`${_.edition_label} ${_.title}`.trim(),J=tH(_.start_date,_.end_date),Q=`${_.venue_name}, ${_.city}`,ce=_.country?`${Q}, ${_.country}`:Q,fe=(_.tagline||"").split(":")[0].trim(),X=(_.tagline||"").includes(":")?_.tagline.split(":").slice(1).join(":").trim():"",pe=`ACGC${_.year}`,be=({ticketType:F=null,className:Z,children:de,closed:Ve=!1})=>Ve?r.jsx("button",{type:"button",disabled:!0,className:`${Z} !bg-slate-200 !border-slate-200 !text-slate-500 !shadow-none cursor-not-allowed`,children:"Booking Closed"}):r.jsx("button",{type:"button",onClick:()=>D(F),className:Z,children:de}),q=F=>{const Z=F.replace("#",""),de=document.getElementById(Z);de&&(de.scrollIntoView({behavior:"smooth",block:"start"}),window.history.replaceState(null,"",F))};return r.jsxs("div",{className:"bg-white",children:[r.jsx(fH,{}),r.jsxs("section",{id:"hero",ref:R,className:"relative w-full overflow-hidden",children:[r.jsx(V.img,{style:{y:O},src:_.banner_url,alt:`${B} â ${fe}, ${J}, ${ce}`,className:"w-full h-auto block scale-110"}),r.jsxs("div",{className:"absolute bottom-4 left-1/2 -translate-x-1/2 flex flex-col items-center gap-1.5 text-white/40",children:[r.jsx("span",{className:"text-xs",children:"Scroll"}),r.jsx(ht,{className:"h-4 w-4 animate-bounce"})]})]}),r.jsxs("div",{ref:s,className:"sticky top-24 z-20 bg-[#c08a2f] border-b border-white/10 shadow-lg",children:[r.jsx("div",{className:"max-w-7xl mx-auto px-4",children:r.jsxs("div",{className:"flex items-center gap-0 overflow-x-auto scrollbar-hide",children:[XU.map(F=>r.jsx("a",{href:F.href,onClick:Z=>{Z.preventDefault(),q(F.href)},className:"shrink-0 px-5 py-5 text-xs font-bold text-white hover:text-[#4f0459] hover:bg-white/5 transition whitespace-nowrap border-b-2.5 border-transparent hover:border-[#390340]",children:F.label},F.href)),r.jsx(be,{ticketType:null,className:"shrink-0 ml-auto mr-0 px-4 py-2 my-2 rounded-full bg-[#4f0459] hover:bg-[#390340] text-white text-xs font-bold transition whitespace-nowrap",children:"Register Now"})]})}),r.jsx(pH,{targetDate:_.countdown_target})]}),r.jsx("section",{id:"about",className:"py-20 bg-white scroll-mt-[236px]",children:r.jsx("div",{className:"max-w-5xl mx-auto px-4 md:px-6",children:r.jsxs("div",{className:"grid md:grid-cols-2 gap-12 items-center",children:[r.jsxs(V.div,{initial:{opacity:0,x:-24},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.6},children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"About the Conference"}),r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-[#1f0f3f] leading-tight",children:"Africa's Premier Gathering for In-House Counsel"}),r.jsx("div",{className:"mt-4 space-y-3 text-slate-600 leading-relaxed [&_strong]:text-[#1f0f3f]",dangerouslySetInnerHTML:{__html:un.sanitize(((le=n.content_blocks)==null?void 0:le.about)||"")}}),r.jsx("div",{className:"mt-6 flex flex-col gap-3",children:[{icon:aa,text:J},{icon:kt,text:ce},{icon:at,text:"Senior in-house and government lawyers from 40+ African jurisdictions. Bilingual programme with full English-French interpretation. Welcome Drinks, Community Awards evening, and optional group excursion to explore Abidjan."}].map(({icon:F,text:Z})=>r.jsxs("div",{className:"flex items-center gap-3 text-sm text-slate-700",children:[r.jsx("div",{className:"h-8 w-8 rounded-lg bg-[#4f0459]/10 flex items-center justify-center shrink-0",children:r.jsx(F,{className:"h-4 w-4 text-[#4f0459]"})}),Z]},Z))}
717),r.jsxs(be,{ticketType:null,className:"mt-8 inline-flex items-center gap-2 rounded-full bg-[#1f0f3f] hover:bg-[#2a1654] px-6 py-3 text-sm font-bold text-white transition",children:["Reserve Your Place ",r.jsx(nt,{className:"h-4 w-4"})]})]}),r.jsx(V.div,{initial:{opacity:0,x:24},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.6,delay:.1},children:r.jsxs("div",{className:"rounded-2xl bg-gradient-to-br from-[#1f0f3f] to-[#2a1654] p-8 text-white",children:[r.jsx("div",{className:"text-[#e8c76c] text-xs font-bold uppercase tracking-widest mb-4",children:"Conference at a Glance"}),r.jsx("div",{className:"grid grid-cols-2 gap-6",children:[{number:(_.edition_label||"").split(" ")[0]||_.edition_label,label:"Annual Conference"},{number:"40+",label:"Countries represented"},{number:"Bilingual",label:"English & French interpretation"},{number:"3",label:"Days of programme"}].map(F=>r.jsxs("div",{children:[r.jsx(xH,{value:F.number,className:"text-3xl font-extrabold text-[#e8c76c]"}),r.jsx("div",{className:"text-xs text-slate-300 mt-0.5",children:F.label})]},F.label))}),r.jsxs("div",{className:"mt-6 pt-6 border-t border-white/10",children:[r.jsx("div",{className:"text-xs text-slate-300 mb-2",children:"Theme"}),r.jsx("div",{className:"text-xl font-bold text-white",children:fe||_.tagline}),X&&r.jsx("div",{className:"mt-1 text-sm text-slate-300 italic",children:X})]})]})})]})})}),r.jsx("section",{id:"sponsors",className:"py-20 bg-white scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Partners"}),r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-[#1f0f3f]",children:"Sponsors & Partners"}),r.jsxs("p",{className:"mt-3 text-slate-600 max-w-xl mx-auto",children:["The ",B," is made possible through the generous support of our sponsors and partners."]})]}),r.jsx("div",{className:"mb-10 space-y-4",children:k.map((F,Z)=>{const de=F.accent==="gold",Ve=F.accent==="slate",Pe=F.sponsors.length>1;return r.jsx(V.div,{initial:{opacity:0,y:12},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:Z*.07},className:`grid gap-4 ${Pe?"sm:grid-cols-2":"max-w-lg mx-auto w-full"}`,children:F.sponsors.map(z=>r.jsxs("div",{className:`relative rounded-2xl bg-white flex flex-col items-center gap-4 overflow-hidden 718 ${de?"border-2 border-[#c08a2f] shadow-[0_0_0_4px_rgba(192,138,47,0.08)] py-8 px-10":Ve?"border-2 border-slate-300 shadow-md py-7 px-8":"border border-slate-200 shadow-sm py-6 px-8"} 719 `,children:[de&&r.jsx("div",{className:"absolute top-0 left-0 right-0 h-1 bg-gradient-to-r from-[#c08a2f] via-[#e8c76c] to-[#c08a2f]"}),r.jsx("div",{className:`flex items-center justify-center rounded-xl w-full 720 ${de?"bg-[#fdf8ef] h-32 px-10":Ve?"bg-slate-50 h-28 px-8":"bg-white h-28 px-6"} 721 `,children:r.jsx(NH,{src:z.logo,name:z.name,isPlat:de,isGold:Ve})}),r.jsxs("div",{className:"text-center space-y-1",children:[r.jsx("div",{className:`inline-block rounded-full px-3 py-0.5 text-xs font-bold tracking-wide 722 ${de?"bg-[#c08a2f]/10 text-[#c08a2f]":Ve?"bg-slate-100 text-slate-600":"bg-slate-100 text-slate-500"} 723 `,children:F.tier}),r.jsx("div",{className:`text-sm font-semibold 724 ${de?"text-[#c08a2f]":Ve?"text-slate-700":"text-slate-600"} 725 `,children:F.tierLabel}),F.sub&&r.jsx("div",{className:"text-xs text-slate-400",children:F.sub}),z.sub&&r.jsx("div",{className:"text-xs text-slate-400",children:z.sub})]})]},z.name))},`${F.tier}-${F.tierLabel}-${Z}`)})}),r.jsxs("div",{className:"rounded-2xl border-2 border-dashed border-slate-200 p-8 text-center",children:[r.jsx("div",{className:"text-slate-400 text-sm mb-2",children:"Additional sponsors and partners â TBC"}),r.jsxs("p",{className:"text-slate-500 text-xs max-w-md mx-auto mb-4",children:["Sponsorship opportunities are available for the ",B,". Contact us to discu
725ss partnership packages."]}),r.jsxs("a",{href:"mailto:[email protected]",className:"inline-flex items-center gap-2 rounded-full border border-[#1f0f3f] text-[#1f0f3f] hover:bg-[#1f0f3f] hover:text-white px-5 py-2 text-sm font-semibold transition",children:["Enquire About Sponsorship ",r.jsx(nt,{className:"h-4 w-4"})]})]})]})}),r.jsx("section",{id:"programme",className:"py-20 bg-gradient-to-br from-[#f9f6ff] to-[#f0ebff] scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Schedule"}),r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-[#1f0f3f]",children:"Conference Programme"}),r.jsx("p",{className:"mt-3 text-slate-600 max-w-xl mx-auto",children:"The full programme is being finalised. Session titles, speakers, and descriptions will be updated as confirmed. Click any day to expand the schedule."})]}),r.jsxs("div",{className:"flex items-center justify-center gap-6 mb-8 text-xs text-slate-500",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"h-6 w-6 rounded-full bg-[#c08a2f]/10 flex items-center justify-center",children:r.jsx(V3,{className:"h-3 w-3 text-[#c08a2f]"})}),"Breaks & logistics"]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("div",{className:"h-6 w-6 rounded-full bg-[#1f0f3f]/10 flex items-center justify-center",children:r.jsx(vx,{className:"h-3 w-3 text-[#1f0f3f]"})}),"Keynotes & plenaries"]})]}),r.jsx("div",{className:"space-y-3",children:(_.programme_json||[]).map(F=>r.jsx(uH,{day:F},F.id))})]})}),r.jsx("section",{id:"tickets",className:"py-20 bg-white scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-14",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Pricing"}),r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-[#1f0f3f]",children:"Ticket Fees"})]}),r.jsxs("div",{className:"mb-14",children:[r.jsxs("div",{className:"mb-1",children:[r.jsx("h3",{className:"text-2xl font-bold text-[#1f0f3f]",children:"ACGC Members"}),r.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Current paid members. Your membership status will be verified at checkout."})]}),e&&r.jsxs("div",{className:"mt-4 rounded-xl bg-[#c08a2f]/10 border border-[#c08a2f]/40 px-4 py-3 flex items-center gap-3",children:[r.jsx(is,{className:"h-5 w-5 text-[#c08a2f] shrink-0"}),r.jsx("p",{className:"text-sm font-semibold text-[#8b6020]",children:"You're logged in as an ACGC member â member rates will be applied automatically."})]}),!e&&r.jsxs("div",{className:"mt-4 rounded-xl bg-slate-50 border border-slate-200 px-4 py-3 flex items-center gap-3",children:[r.jsx(Zl,{className:"h-4 w-4 text-slate-400 shrink-0"}),r.jsxs("p",{className:"text-sm text-slate-500",children:["Already a member?"," ",r.jsx(K,{to:"/login",className:"font-semibold text-[#c08a2f] underline hover:text-[#a77324] transition",children:"Log in"})," ","to access member rates."]})]}),r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:`mt-6 rounded-2xl border-2 p-6 md:p-8 mb-6 shadow-md ${A.member_founding_early_bird?"border-[#c08a2f] bg-gradient-to-br from-[#fdf6e3] to-[#fef9ed]":"border-slate-200 bg-slate-50"}`,children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(An,{className:`h-5 w-5 fill-current ${A.member_founding_early_bird?"text-[#c08a2f]":"text-slate-400"}`}),r.jsx("span",{className:`text-sm font-bold uppercase tracking-wider ${A.member_founding_early_bird?"text-[#c08a2f]":"text-slate-400"}`,children:"Founding Member Early Bird"})]}),!A.member_founding_early_bird&&r.jsx("span",{className:"inline-flex items-center rounded-full bg-slate-200 text-slate-500 text-[10px] font-bold uppercase tracking-wide px-2.5 py-1 shrink-0",children:"Booking Closed"})]}),r.jsx("div",{className:`text-5xl font-extrabold mb-2 ${A.member_founding_early_bird?"text-[#1f0f3f]":"text-slate-400"}`,children:fs(T.member_founding_early_bird)}),r.jsx("p",{className:"text-sm text-slate-700 mb-2",children:"Available to those who register before 31 August."}),r.jsxs("p",{className:"text-sm text-slate-700 mb-5",children:["Not yet a member?"," ",r.jsx(K,{to:"/join",className:"font-semibold text-[#c08a2f] underline hover:text-[#a77324] transition",children:"Join ACGC now"})," ","to secure your Founding Member rate before places fill."]}),r.jsxs(be,{ticketType:"member_founding_early_bird",closed:!A.member_founding_early_bird,className:"inline-flex items-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a
72577324] px-6 py-2.5 text-sm font-bold text-white transition shadow",children:["Register Now ",r.jsx(nt,{className:"h-4 w-4"})]})]}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[{label:"Early Bird",price:fs(T.member_early_bird),note:"Applies once 75 Founding Member places are filled",ticketId:"member_early_bird"},{label:"Standard",price:fs(T.member_standard),note:null,ticketId:"member_standard"},{label:"Public Sector",price:fs(T.member_public_sector),note:null,ticketId:"member_public_sector"},{label:"GC + Junior Package",price:fs(T.member_gc_junior),note:"1 GC + 1 junior colleague, 0â3 years in-house experience",ticketId:"member_gc_junior"}].map((F,Z)=>{const de=!A[F.ticketId];return r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:Z*.07},className:`rounded-xl border p-5 shadow-sm flex flex-col transition-all ${de?"border-slate-200 bg-slate-50":"border-slate-200 bg-white hover:-translate-y-1 hover:shadow-lg"}`,children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[r.jsx("div",{className:`text-xs font-semibold uppercase tracking-wider ${de?"text-slate-400":"text-[#c08a2f]"}`,children:"Member Rate"}),de&&r.jsx("span",{className:"inline-flex items-center rounded-full bg-slate-200 text-slate-500 text-[9px] font-bold uppercase tracking-wide px-2 py-0.5 shrink-0",children:"Closed"})]}),r.jsx("div",{className:`text-base font-bold mb-1 ${de?"text-slate-400":"text-[#1f0f3f]"}`,children:F.label}),r.jsx("div",{className:`text-2xl font-extrabold mb-2 ${de?"text-slate-400":"text-slate-800"}`,children:F.price}),F.note&&!de&&r.jsx("p",{className:"text-xs text-slate-400 leading-relaxed flex-1",children:F.note}),r.jsx(be,{ticketType:F.ticketId,closed:de,className:"mt-4 block text-center rounded-xl bg-[#1f0f3f] hover:bg-[#2a1654] px-4 py-2 text-sm font-bold text-white transition",children:"Register Now"})]},F.label)})})]}),!e&&r.jsxs("div",{className:"mb-14",children:[r.jsx("div",{className:"mb-1",children:r.jsx("h3",{className:"text-2xl font-bold text-[#1f0f3f]",children:"Not Yet a Member?"})}),r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"mt-6 relative rounded-2xl border-2 border-[#1f0f3f] bg-gradient-to-b from-[#1f0f3f] to-[#2a1654] p-6 md:p-8 mb-6 text-white shadow-xl",children:[r.jsx("div",{className:"absolute -top-3 left-8",children:r.jsx("span",{className:"inline-flex items-center rounded-full bg-[#c08a2f] px-3 py-1 text-xs font-bold text-white shadow",children:"Best Value"})}),r.jsx("div",{className:"text-[#e8c76c] text-xs font-bold uppercase tracking-wider mb-2",children:"Join + Attend Bundle"}),r.jsx("div",{className:"text-xl font-bold text-white mb-3",children:"Register for the conference and become an ACGC member in one step."}),r.jsx("p",{className:"text-slate-300 text-sm leading-relaxed mb-3",children:"Your membership runs through 1 March 2027 and includes year-round access to all programming, recordings, toolkits, and the ACGC community. Price includes your conference pass plus the membership fee for your category below â application fee waived."}),r.jsx("div",{className:"inline-flex items-center gap-2 rounded-full bg-white/10 border border-white/20 px-3 py-1 text-xs font-bold text-[#e8c76c] uppercase tracking-wider mb-4",children:L?`Early Bird conference rate ($${_.join_attend_rate_early_cents/100}) â ends ${eH(_.early_bird_deadline)}`:`Standard conference rate ($${_.join_attend_rate_standard_cents/100})`}),r.jsx("div",{className:"grid sm:grid-cols-2 gap-4 mb-3",children:E.map(F=>r.jsxs("div",{className:`rounded-xl border p-4 ${F.closed?"bg-white/5 border-white/10":"bg-white/10 border-white/20"}`,children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[r.jsx("div",{className:`text-xs font-semibold uppercase tracking-wider ${F.closed?"text-white/40":"text-[#e8c76c]"}`,children:F.label}),F.closed&&r.jsx("span",{className:"inline-flex items-center rounded-full bg-white/10 text-white/50 text-[9px] font-bold uppercase tracking-wide px-2 py-0.5
725shrink-0",children:"Closed"})]}),r.jsx("div",{className:`text-3xl font-extrabold ${F.closed?"text-white/30":"text-[#e8c76c]"}`,children:F.closed?"â":F.price})]},F.id))}),r.jsx("p",{className:"text-xs text-slate-400 mb-5",children:"Select your membership category at checkout to confirm your price."}),r.jsxs(be,{ticketType:null,className:"inline-flex items-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a77324] px-6 py-2.5 text-sm font-bold text-white transition shadow",children:["Join + Attend ",r.jsx(nt,{className:"h-4 w-4"})]})]}),r.jsx("p",{className:"text-sm text-slate-500 mb-5",children:"Prefer to attend without membership? Standard non-member rates below."}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[{label:"Early Bird",price:fs(T.non_member_early_bird),note:null,ticketId:"non_member_early_bird"},{label:"Standard",price:fs(T.non_member_standard),note:null,ticketId:"non_member_standard"},{label:"Public Sector",price:fs(T.non_member_public_sector),note:null,ticketId:"non_member_public_sector"},{label:"GC + Junior Package",price:fs(T.non_member_gc_junior),note:"1 GC + 1 junior colleague, 0â3 years in-house experience",ticketId:"non_member_gc_junior"}].map((F,Z)=>{const de=!A[F.ticketId];return r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:Z*.07},className:`rounded-xl border p-5 shadow-sm flex flex-col transition-all ${de?"border-slate-200 bg-slate-50":"border-slate-200 bg-white hover:-translate-y-1 hover:shadow-lg"}`,children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-wider text-slate-400",children:"Non-Member Rate"}),de&&r.jsx("span",{className:"inline-flex items-center rounded-full bg-slate-200 text-slate-500 text-[9px] font-bold uppercase tracking-wide px-2 py-0.5 shrink-0",children:"Closed"})]}),r.jsx("div",{className:`text-base font-bold mb-1 ${de?"text-slate-400":"text-[#1f0f3f]"}`,children:F.label}),r.jsx("div",{className:`text-2xl font-extrabold mb-2 ${de?"text-slate-400":"text-slate-800"}`,children:F.price}),F.note&&!de&&r.jsx("p",{className:"text-xs text-slate-400 leading-relaxed flex-1",children:F.note}),r.jsx(be,{ticketType:F.ticketId,closed:de,className:"mt-4 block text-center rounded-xl bg-[#1f0f3f] hover:bg-[#2a1654] px-4 py-2 text-sm font-bold text-white transition",children:"Register Now"})]},F.label)})})]}),r.jsxs("div",{className:"mb-10",children:[r.jsxs("div",{className:"mb-1",children:[r.jsx("h3",{className:"text-2xl font-bold text-[#1f0f3f]",children:"Single-Event Passes"}),r.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Can't make the full conference? Single-event passes are available for the Awards evening, both social events, or the In House Skills Institute."})]}),r.jsx("div",{className:"mt-6 grid sm:grid-cols-3 gap-4",children:[{label:"Awards Evening Only",sub:"2 Oct, 7:30pm",price:fs(T.single_awards),ticketId:"single_awards",active:A.single_awards},{label:"Socials Pass",sub:"Welcome Drinks + Awards",price:fs(T.single_socials),ticketId:"single_socials",active:A.single_socials},{label:"In House Skills Institute",sub:"2 Oct, 9:00am â 12:00pm",price:`${fs(T.single_house_skills_member)} members / ${fs(T.single_house_skills_non_member)} non-members`,ticketId:"single_house_skills_member",active:A.single_house_skills_member||A.single_house_skills_non_member}].map((F,Z)=>{const de=F.active===void 0?!A[F.ticketId]:!F.active;return r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:Z*.07},className:`rounded-xl border p-5 shadow-sm flex flex-col transition-all ${de?"border-slate-200 bg-slate-50":"border-slate-200 bg-white hover:-translate-y-1 hover:shadow-lg"}`,children:[r.jsxs("div",{className:"flex items-center justify-between gap-2",children:[r.jsx("div",{className:`text-base font-bold mb-0.5 ${de?"text-slate-400":"text-[#1f0f3f]"}`,children:F.label}),de&&r.jsx("span",{className:"inline-flex items-center rounded-full bg-slate-200 text-slate-500 text-[9px] font-bold uppercase tracking-wide px-2 py-0.5
725shrink-0",children:"Closed"})]}),F.sub&&r.jsx("div",{className:"text-xs text-slate-500 mb-2",children:F.sub}),r.jsx("div",{className:`text-xl font-extrabold mt-1 mb-4 flex-1 ${de?"text-slate-400":"text-slate-800"}`,children:F.price}),r.jsx(be,{ticketType:F.ticketId,closed:de,className:"block text-center rounded-xl bg-[#1f0f3f] hover:bg-[#2a1654] px-4 py-2 text-sm font-bold text-white transition",children:"Register Now"})]},F.label)})})]}),r.jsx("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-6 space-y-3",children:["Conference passes include all sessions across both conference days (1â2 October), Welcome Drinks (30 September evening), and the ACGC Community Awards (2 October evening).","GC + Junior Package: Attending with a junior colleague (0â3 years in-house experience)? The GC + Junior package covers both of you at a reduced combined rate.","Public Sector: Reduced rates are available for lawyers employed directly by government ministries, departments, agencies, or public institutions in Africa.","All prices in USD."].map((F,Z)=>r.jsx("p",{className:"text-xs text-slate-500 leading-relaxed",children:F},Z))}),r.jsxs("div",{className:"mt-10 rounded-2xl border border-slate-200 bg-white p-6 md:p-8",children:[r.jsx("h3",{className:"text-xl font-bold text-[#1f0f3f] mb-4",children:"Ticket Cancellation, Refund & Transfer Policy"}),r.jsx("div",{className:"space-y-5 text-sm text-slate-600 leading-relaxed",dangerouslySetInnerHTML:{__html:un.sanitize(((De=n.content_blocks)==null?void 0:De.cancellation_policy)||"")}})]})]})}),r.jsx("section",{id:"loyalty",className:"py-20 bg-gradient-to-br from-[#f9f6ff] to-[#f0ebff] scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Returning Delegates"}),r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-[#1f0f3f]",children:"ACGC Conference Loyalty Pass
725port"}),r.jsx("div",{className:"mt-4 text-slate-600 max-w-2xl mx-auto",dangerouslySetInnerHTML:{__html:un.sanitize((($e=n.content_blocks)==null?void 0:$e.loyalty_intro)||"")}})]}),r.jsxs("div",{className:"mt-10 rounded-2xl bg-[#1f0f3f] p-6 md:p-8 text-center text-white",children:[r.jsx("div",{className:"text-[#e8c76c] text-sm font-semibold mb-2",children:"Is this your first ACGC Conference?"}),r.jsxs("p",{className:"text-slate-300 text-sm max-w-xl mx-auto",children:["Every delegate who attends the ",_.year," conference automatically joins the Loyalty Passport programme. Your journey starts in ",_.city,"."]}),r.jsxs(be,{ticketType:null,className:"mt-4 inline-flex items-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a77324] px-6 py-2.5 text-sm font-bold text-white transition",children:["Register for ",_.year," ",r.jsx(nt,{className:"h-4 w-4"})]})]}),r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"mt-8 rounded-2xl border border-[#1f0f3f]/10 bg-white p-6 md:p-8 shadow-sm",children:[r.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-lg bg-[#c08a2f]/10 flex items-center justify-center shrink-0",children:r.jsx(at,{className:"h-5 w-5 text-[#c08a2f]"})}),r.jsx("h3",{className:"text-xl font-bold text-[#1f0f3f]",children:"Refer a Colleague"})]}),r.jsxs("p",{className:"text-sm text-slate-600 mb-5",children:["Know someone who should be in the room? Invite a first-time attendee to register for ACGC ",fe||_.title," ",_.year,". Here's how:"]}),r.jsx("div",{className:"space-y-3 mb-6",children:["Invite a first-time attendee to register and attend.",`They mention your name on the registration form (final question: "How did you hear about ACGC ${fe||_.title} ${_.year}?").`,"Once their registration is confirmed, you receive a $30 discount on your own registration."].map((F,Z)=>r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"shrink-0 h-6 w-6 rounded-full bg-[#c08a2f] flex items-center justify-center text-white text-xs font-bold mt-0.5",children:Z+1}),r.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:F})]},F))}),r.jsxs("div",{className:"rounded-xl bg-slate-50 border border-slate-200 p-4",children:[r.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-2",children:"Examples after discount"}),r.jsx("ul",{className:"space-y-1 text-sm text-slate-700",children:[{label:"Founding Member Early Bird",key:"member_founding_early_bird"},{label:"Member Early Bird",key:"member_early_bird"},{label:"Member Standard",key:"member_standard"}].map(({label:F,key:Z})=>r.jsxs("li",{children:[F,": ",fs(T[Z])," â ",fs((T[Z]||0)-3e3)]},Z))})]})]})]})}),r.jsx("section",{id:"highlights",className:"py-20 bg-white scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-10",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Highlights"}),r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-[#1f0f3f]",children:"Video Highlights"}),r.jsx("p",{className:"mt-3 text-slate-600",children:"Relive the energy of the 7th Annual ACGC Conference â Livingstone, Zambia 2025"})]}),r.jsx("div",{className:"aspect-video rounded-2xl overflow-hidden shadow-xl border border-slate-200",children:r.jsx("iframe",{className:"w-full h-full",src:"https://www.youtube.com/embed/SAig7-Hkev4",title:"2025 Livingstone Highlights",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})}),r.jsx("p",{className:"mt-4 text-center text-xs text-slate-400",children:"7th Annual ACGC Conference · David Livingstone Safari Lodge & Spa · Livingstone, Zambia · October 2025"})]})}),r.jsx("section",{id:"awards",className:"py-20 bg-[#1f0f3f] scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6 text-white",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#e8c76c] mb-2",children:"ACGC Awards"}),r.jsxs("h2",{className:"text-3xl md:text-4xl font-extrabold text-white",children:["The ACGC Community Choice Awards ",_.year]}),r.jsx("div",{className:"mt-4 text-slate-300 max-w-2xl mx-auto",dangerouslySetInnerHTML:{__html:un.sanitize(((H=n.content_blocks)==null?void 0:H.awards_intro)||"")}})]}),r.jsx("div",{className:"text-center",children:r.jsxs("a",{href:"https://acgc-events.my.canva.site/acgc-community-awards-2026",target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-2 rounded-full bg-[#c08a2f]/20 border border-[#c08a2f]/40 px-4 py-2 text-sm text-[#e8c76c] font-medium hover:bg-[#c08a2f]/30 transition",children:[r.jsx(Df,{className:"h-4 w-4"}),"Click here to see awards"]})})]})}),r.jsx("section",{id:"visa",className:"py-20 bg-white scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-10",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Travel"}),r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-[#1f0f3f]",children:"Visa Facilitation"}),r.jsxs("p",{className:"mt-3 text-slate-600",children:["Entry to ",_.country," for ACGC ",_.year," delegates"]})]}),r.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-6 md:p-8 mb-6",children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:"h-10 w-10 rounded-lg bg-[#c08a2f]/10 flex items-center justify-center shrink-0",children:r.jsx(pt,{className:"h-5 w-5 text-[#c08a2f]"})}),r.jsxs("div",{children:[r.jsx("div",{className:"font-bold text-[#1f0f3f]",children:"Entry Requirements â Côte d'Ivoire"}),r.jsx("p",{className:"mt-1 text-sm text-slate-600",children:"Visa requirements for Côte d'Ivoire vary by nationality. For delegates and speakers attending the ACGC Annual Conference who require a visa, ACGC is able to facilitate a Visa on Arrival arrangement through the African Development Bank (AfDB) Protocol Office. To benefit from this arrangement, delegates and speakers must register for the conference and submit the required passport and travel information by Friday, 28 August 2026."})]})]})}),r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},className:"rounded-2xl border-2 border-[#c08a2f] bg-gradient-to-br from-[#fdf6e3] to-[#fef9ed] p-6 md:p-8 mb-6 shadow-md",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[r.jsx(An,{className:"h-5 w-5 text-[#c08a2f] fill-current"}),r.jsx("span",{className:"text-sm font-bold text-[#c08a2f] uppercase tracking-wider",children:"AfDB Visa on Arrival Facilitation for ACGC Delegates"})]}),r.jsx("p",{className:"text-sm text-slate-700 leading-relaxed mb-4",children:"Through the support of the African Development Bank (AfDB) Protocol Office, ACGC is able to facilitate a Visa on Arrival arrangement for international delegates and speakers attending the ACGC Annual Conference who require a visa to enter Côte d'Ivoire. The AfDB Protocol Office will submit a single group request covering delegates and speakers who provide the required information. Those included in the request will be able to obtain their visa upon arrival in Abidjan rather than following the standard visa application process before travel."}),r.jsxs("p",{className:"text-sm text-slate-700 leading-relaxed mb-5",children:["To be included in the group request, you must register for the conference and"," ",r.jsx("strong",{className:"font-bold text-[#1f0f3f]",children:"complete the Visa Facilitation Form by Friday, 28 August 2026"}),". This is a one-time facilitation. Delegates and speakers who require a visa but do not submit their information by 28 August will need to make their own visa arrangements and should not rely on the ACGC / AfDB Visa on Arrival facilitation."]}),r.jsxs("a",{href:"https://forms.gle/kzWcEdcimVMCmfA66",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a
72577324] px-6 py-2.5 text-sm font-bold text-white transition shadow",children:["Complete the Visa Facilitation Form ",r.jsx(nt,{className:"h-4 w-4"})]}),r.jsx("p",{className:"mt-4 text-xs text-slate-500 leading-relaxed",children:"Please ensure that all passport and travel information submitted is accurate and matches your passport exactly."})]}),r.jsx("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-6 md:p-8 mb-6",children:r.jsx("div",{className:"grid sm:grid-cols-2 gap-4",children:[{title:"Visa Exemptions",desc:"Citizens of ECOWAS member states may enter Côte d'Ivoire using a valid national identity card for stays of up to three months. Citizens of Andorra, Chad, Monaco, Morocco, Seychelles, Tunisia and Vatican City are also visa exempt for stays of less than three months."},{title:"E-Visa",desc:"Delegates who do not use the ACGC / AfDB Visa on Arrival facilitation may make their own visa arrangements through the standard Côte d'Ivoire e-Visa process. Most international visitors may apply online through the Côte d'Ivoire e-Visa system before travel. Once approved, travellers receive an approval letter which must be presented on arrival at Abidjan Airport, where the visa is issued into the passport.",cta:{label:"Apply for an E-Visa",href:"https://snedai.com/e-visa/"}},{title:"Airport Arrival",desc:"The following arrival guidance applies to delegates travelling under the standard E-Visa process. E-Visa holders should follow signs to the E-Visa office on arrival at Félix Houphouët-Boigny International Airport to complete visa issuance before proceeding through immigration. Processing times may vary depending on passenger volumes."}].map(F=>r.jsxs("div",{className:"rounded-xl border border-slate-200 bg-white p-4",children:[r.jsx("div",{className:"text-sm font-semibold text-[#1f0f3f] mb-1",children:F.title}),r.jsx("p",{className:"text-xs text-slate-500 leading-relaxed",children:F.desc}),F.cta&&r.jsxs("a",{href:F.cta.href,target:"_blank",rel:"noopener noreferrer",className:"mt-3 inline-flex items-center gap-1.5 text-xs font-semibold text-[#c08a2f] hover:underline",children:[r.jsx(ur,{className:"h-3.5 w-3.5"}),F.cta.label]})]},F.title))})}),r.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-6 md:p-8 mb-6",children:[r.jsx("div",{className:"font-bold text-[#1f0f3f] mb-3",children:"General Visa Requirements"}),r.jsx("p",{className:"text-sm text-slate-600 leading-relaxed mb-3",children:"The requirements below are general guidance for travellers making their own visa arrangements and may vary depending on nationality and visa route."}),r.jsxs("ul",{className:"space-y-1.5 text-sm text-slate-600 list-disc list-inside",children:[r.jsx("li",{children:"Completed visa application"}),r.jsx("li",{children:"Passport valid for at least six months"}),r.jsx("li",{children:"Recent passport photograph"}),r.jsx("li",{children:"Official invitation letter (where applicable)"}),r.jsx("li",{children:"Yellow Fever vaccination certificate"}),r.jsx("li",{children:"Copy of return or onward air ticket"}),r.jsx("li",{children:"Additional documentation may be requested depending on nationality."}),r.jsx("li",{children:"For minors, a letter signed by a parent or guardian may be required."})]})]}),r.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-slate-50 p-6 md:p-8 mb-6",children:[r.jsx("div",{className:"font-bold text-[#1f0f3f] mb-3",children:"Applying Through an Embassy or Consulate"}),r.jsxs("p",{className:"text-sm text-slate-600 leading-relaxed",children:["Travellers may also apply for a visa through the nearest Embassy or Consulate of Côte d'Ivoire before travelling. Delegates should check the requirements applicable in their country of residence."," ",r.jsx("a",{href:"#",className:"underline font-medium text-[#c08a2f]",children:"Find an Embassy or Consulate"}),"."]})]}),r.jsxs("div",{className:"rounded-xl border border-amber-200 bg-amber-50 p-4 flex items-start gap-3",children:[r.jsx(Zl,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-sm text-amber-800",children:[r.jsx("strong",{children:"Important Delegate Note:"})," If you require a visa and wish to use the ACGC / AfDB Visa on Arrival facilitation, you must register and submit your passport and travel information by Friday, 28 August 2026. After this deadline, delegates requiring a visa will be responsible for making their own visa arrangements. No exceptions will be made to the group submission deadline."]})]})]})}),r.jsx("section",{id:"accommodation",className:"py-20 bg-gradient-to-br from-[#f9f6ff] to-[#f0ebff] scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-10",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Where to Stay"}),r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-[#1f0f3f]",children:"Special Accommodation Offer"}),r.jsx("p",{className:"mt-3 text-slate-600",children:"Stay where the action is â at the conference venue"})]}),r.jsxs("div",{className:"rounded-2xl border-2 border-[#c08a2f]/40 bg-white shadow-lg overflow-hidden mb-8",children:[r.jsxs("div",{className:"bg-gradient-to-r from-[#1f0f3f] to-[#2a1654] px-6 py-4 flex items-center gap-3",children:[r.jsx("div",{className:"h-8 w-8 rounded-lg bg-[#c08a2f]/20 flex items-center justify-center",children:r.jsx(An,{className:"h-4 w-4 text-[#e8c76c] fill-current"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-[#e8c76c] font-semibold uppercase tracking-wider",children:"Conference Venue Hotel"}),r.jsx("div",{className:"text-white font-bold",children:Q})]})]}),r.jsx("div",{className:"p-6 md:p-8",children:r.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"text-sm font-semibold text-[#1f0f3f] mb-2",children:["About the ",_.venue_name]}),r.jsx("div",{className:"text-sm text-slate-600 leading-relaxed",dangerouslySetInnerHTML:{__html:un.sanitize(((he=n.content_blocks)==null?void 0:he.accommodation_intro)||"")}}),r.jsxs("div",{className:"mt-4 space-y-2 text-sm text-slate-600",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(kt,{className:"h-4 w-4 text-[#c08a2f] shrink-0"}),ce.replace(`${_.venue_name}, `,"")]}),r.jsxs("div",{className:"flex items-start gap-2",children:[r.jsx(yx,{className:"h-4 w-4 text-[#c08a2f] shrink-0 mt-0.5"}),r.jsxs("span",{children:["Delegate room rate: 113,000 CFA / $200 USD per room per night"," ",r.jsx("span",{className:"inline-block bg-green-100 text-green-700 text-xs font-semibold px-2 py-0.5 rounded-full",children:"40% discount"})]})]})]})]}),r.jsxs("div",{className:"rounded-xl bg-slate-50 border border-slate-200 p-5",children:[r.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"How to Book"}),r.jsx("p",{className:"text-sm text-slate-600 mb-3",children:"Email the reservations team quoting the code"}),r.jsx("div",{className:"inline-block bg-white border border-slate-200 rounded-lg px-3 py-1.5 text-sm font-mono font-bold text-[#1f0f3f] mb-4",children:pe}),r.jsxs("div",{className:"space-y-2 text-sm",children:[r.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-2 text-blue-600 hover:underline",children:[r.jsx(Ft,{className:"h-3.5 w-3.5 shrink-0"}),"[email protected]"]}),r.jsxs("div",{className:"text-slate-500 text-xs pl-5",children:["Copy: Adam Koffi â"," ",r.jsx("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:underline",children:"[email protected]"})]}),r.jsxs("div",{className:"text-slate-500 text-xs pl-5",children:["Copy: Souleymane Drame â"," ",r.jsx("a",{href:"mailto:[email protected]",className:"text-blue-600 hover:underline",children:"[email protected]"})]})]})]})]})})]}),r.jsx(jH,{hotels:j,bnbs:S,venueLabel:Q})]})}),r.jsxs("section",{id:"excursion",className:"bg-white scroll-mt-[236px]",children:[r.jsxs("div",{className:"relative overflow-hidden h-[520px] md:h-[620px]",children:[r.jsx("img",{src:"/experience-abidjan/hero-cocody-bridge.jpg",alt:"The Cocody Bridge, Abidjan",className:"absolute inset-0 w-full h-full object-cover acgc-kenburns"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#1f0f3f]/95 via-[#1f0f3f]/50 to-[#1f0f3f]/30"}),r.jsx("div",{className:"relative h-full max-w-4xl mx-auto px-4 md:px-6 flex flex-col items-center justify-center text-center",children:r.jsxs(V.div,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.7},children:[r.jsxs("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#e8c76c] mb-4",children:["Saturday 3 October 2026 · ",_.city,", ",_.country]}),r.jsx("h2",{className:"text-4xl md:text-6xl font-extrabold text-white mb-4",children:"Experience Abidjan"}),r.jsx("p",{className:"text-lg md:text-xl text-white/85 max-w-2xl mx-auto mb-8",children:"An exclusive post-conference experience for ACGC delegates"}),r.jsxs("button",{type:"button",onClick:()=>P(),className:"inline-flex items-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a
72577324] px-8 py-3.5 text-sm font-bold text-white transition shadow-lg",children:["Reserve Your Place ",r.jsx(nt,{className:"h-4 w-4"})]})]})})]}),b&&r.jsx("div",{className:"max-w-3xl mx-auto px-4 md:px-6 mt-8",children:b==="success"?r.jsxs("div",{className:"rounded-2xl border border-green-200 bg-green-50 px-5 py-4 flex items-start gap-3",children:[r.jsx(is,{className:"h-5 w-5 text-green-600 shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-sm text-green-800",children:[r.jsx("strong",{children:"Your place is reserved!"})," Thank you for booking Experience Abidjan â a confirmation email is on its way to you."]})]}):r.jsxs("div",{className:"rounded-2xl border border-amber-200 bg-amber-50 px-5 py-4 flex items-start gap-3",children:[r.jsx(Zl,{className:"h-5 w-5 text-amber-600 shrink-0 mt-0.5"}),r.jsx("div",{className:"text-sm text-amber-800",children:"Your booking was not completed and you have not been charged. You can reserve your place below whenever you're ready."})]})}),r.jsx("div",{className:"py-16 md:py-20",children:r.jsx(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"max-w-3xl mx-auto px-4 md:px-6 text-center",children:r.jsx("div",{className:"text-slate-600 leading-relaxed [&>p]:mb-5 [&>p:last-child]:mb-0 [&>p:first-child]:text-lg [&>p:first-child]:text-slate-700",dangerouslySetInnerHTML:{__html:un.sanitize(((oe=n.content_blocks)==null?void 0:oe.excursion_intro)||"")}})})}),r.jsx("div",{className:"py-16 md:py-20 bg-gradient-to-br from-[#f9f6ff] to-[#f0ebff]",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Why Join?"}),r.jsx("h3",{className:"text-3xl font-extrabold text-[#1f0f3f]",children:"One Final Afternoon, Well Spent"})]}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-
7255",children:[{icon:Y7,title:"Curated Experience",desc:"Professionally organised exclusively for ACGC delegates."},{icon:bx,title:"Continue the Conversation",desc:"Network with fellow delegates in a relaxed setting after the conference."},{icon:xx,title:"Discover Abidjan",desc:"Experience some of the city's most iconic landmarks, markets and waterfront."},{icon:f7,title:"We've Done the Planning",desc:"Private transport, local guide and itinerary all taken care of."}].map((F,Z)=>{const de=F.icon;return r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:Z*.08,duration:.45},className:"rounded-2xl border border-slate-200 bg-white p-6 shadow-sm hover:shadow-md hover:border-[#c08a2f]/30 transition-all",children:[r.jsx("div",{className:"h-11 w-11 rounded-xl bg-[#c08a2f]/10 flex items-center justify-center mb-4",children:r.jsx(de,{className:"h-6 w-6 text-[#c08a2f]"})}),r.jsx("div",{className:"text-base font-bold text-[#1f0f3f] mb-1.5",children:F.title}),r.jsx("p",{className:"text-sm text-slate-500 leading-relaxed",children:F.desc})]},F.title)})})]})}),r.jsx("div",{className:"py-16 md:py-20",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Tour Highlights"}),r.jsx("h3",{className:"text-3xl font-extrabold text-[#1f0f3f]",children:"A Curated Afternoon in the City"})]}),r.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:[{img:"/experience-abidjan/le-plateau.jpg",title:"Le Plateau",desc:"Discover the commercial heart of Côte d'Ivoire and one of West Africa's leading business districts."},{img:"/experience-abidjan/centre-artisanal.jpg",title:"Centre Artisanal",desc:"Browse authentic Ivorian handicrafts, artwork and locally made souvenirs while supporting talented local artisans."}
725,{img:"/experience-abidjan/la-pyramide.jpg",title:"La Pyramide",desc:"Visit one of Africa's most distinctive examples of modernist architecture and an iconic Abidjan landmark."},{img:"/experience-abidjan/ebrie-lagoon.jpg",title:"Ãbrié Lagoon",desc:"Relax beside the lagoon and enjoy one of the city's best-known waterfront settings before returning to your hotel."}].map((F,Z)=>r.jsxs(V.div,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:Z%2*.1,duration:.5},className:"group relative rounded-2xl overflow-hidden shadow-lg h-80 md:h-96",children:[r.jsx("img",{src:F.img,alt:F.title,loading:"lazy",className:"absolute inset-0 w-full h-full object-cover transition-transform duration-[3000ms] ease-out group-hover:scale-110"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#1f0f3f]/90 via-[#1f0f3f]/20 to-transparent"}),r.jsxs("div",{className:"absolute bottom-0 inset-x-0 p-6",children:[r.jsx("div",{className:"text-xl font-extrabold text-white mb-1.5",children:F.title}),r.jsx("p",{className:"text-sm text-white/80 leading-relaxed",children:F.desc})]})]},F.title))})]})}),r.jsx("div",{className:"py-16 md:py-20 bg-[#1f0f3f]",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#e8c76c] mb-2",children:"What's Included"}),r.jsx("h3",{className:"text-3xl font-extrabold text-white",children:"Everything Taken Care Of"})]}),r.jsxs("div",{className:"grid sm:grid-cols-2 gap-6",children:[r.jsxs(V.div,{initial:{opacity:0,x:-20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.5},className:"rounded-2xl bg-white/5 border border-white/10 p-6 md:p-8",children:[r.jsx("div",{className:"text-sm font-bold uppercase tracking-wider text-[#e8c76c] mb-5",children:"Included"}),r.jsx("ul",{className:"space-y-3",children:["Private air-conditioned transport","Professional English-speaking guide","Driver","Fuel","Toll charges","Curated sightseeing itinerary","Lunch (if the lunch option is selected)"].map(F=>r.jsxs("li",{className:"flex items-start gap-3 text-sm text-slate-200",children:[r.jsx(is,{className:"h-4 w-4 text-[#e8c76c] shrink-0 mt-0.5"}),F]},F))})]}),r.jsxs(V.div,{initial:{opacity:0,x:20},whileInView:{opacity:1,x:0},viewport:{once:!0},transition:{duration:.5},className:"rounded-2xl bg-white/5 border border-white/10 p-6 md:p-8",children:[r.jsx("div",{className:"text-sm font-bold uppercase tracking-wider text-slate-400 mb-5",children:"Not Included"}),r.jsx("ul",{className:"space-y-3",children:["Personal shopping","Personal expenses","Optional gratuities"].map(F=>r.jsxs("li",{className:"flex items-start gap-3 text-sm text-slate-400",children:[r.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-slate-500 shrink-0 mt-1.5"}),F]},F))})]})]})]})}),r.jsx("div",{className:"py-16 md:py-20",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Tour Information"}),r.jsx("h3",{className:"text-3xl font-extrabold text-[#1f0f3f]",children:"The Practical Details"})]}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-
7255",children:[{icon:Ds,label:"Date",value:"Saturday 3 October 2026"},{icon:cl,label:"Time",value:"9.30am â approximately 3.00pm"},{icon:M7,label:"Duration",value:"Approximately 5 hours"},{icon:at,label:"Group Size",value:"Limited places available"}].map((F,Z)=>{const de=F.icon;return r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:Z*.08,duration:.45},className:"rounded-2xl border border-slate-200 bg-white p-6 text-center shadow-sm",children:[r.jsx("div",{className:"mx-auto h-11 w-11 rounded-full bg-[#1f0f3f]/5 flex items-center justify-center mb-4",children:r.jsx(de,{className:"h-5 w-5 text-[#c08a2f]"})}),r.jsx("div",{className:"text-xs font-semibold uppercase tracking-wider text-slate-400 mb-1",children:F.label}),r.jsx("div",{className:"text-sm font-bold text-[#1f0f3f]",children:F.value})]},F.label)})})]})}),r.jsx("div",{className:"py-16 md:py-20 bg-gradient-to-br from-[#f9f6ff] to-[#f0ebff]",children:r.jsxs("div",{className:"max-w-4xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-12",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Pricing"}),r.jsx("h3",{className:"text-3xl font-extrabold text-[#1f0f3f]",children:"Choose Your Experience"})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-6",children:[(()=>{var Z,de;const F=!((Z=N.tour_only)!=null&&Z.isActive);return r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:`rounded-2xl border p-8 shadow-sm flex flex-col ${F?"border-slate-200 bg-slate-50":"border-slate-200 bg-white"}`,children:[r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-slate-400",children:"Option 1"}),F&&r.jsx("span",{className:"inline-flex items-center rounded-full bg-slate-200 text-slate-500 text-[10px] font-bold uppercase tracking-wide px-2.5 py-1 shrink-0",children:"Booking Closed"})]}),r.jsx("div",{className:`text-lg font-bold mb-1 ${F?"text-slate-400":"text-[#1f0f3f]"}`,children:"Experience Abidjan"}),r.jsx("div",{className:"text-sm text-slate-500 mb-6",children:"Tour only"}),r.jsxs("div",{className:"mb-6",children:[r.jsxs("span",{className:`text-4xl font-extrabold ${F?"text-slate-400":"text-[#1f0f3f]"}`,children:["USD ",(((de=N.tour_only)==null?void 0:de.priceCents)||0)/100]}),r.jsx("span",{className:"text-sm text-slate-500 ml-2",children:"per delegate"})]}),r.jsx("button",{type:"button",disabled:F,onClick:()=>!F&&P("tour_only"),className:F?"mt-auto inline-flex items-center justify-center gap-2 rounded-full border-2 border-slate-200 bg-slate-100 px-6 py-3 text-sm font-bold text-slate-400 cursor-not-allowed":"mt-auto inline-flex items-center justify-center gap-2 rounded-full border-2 border-[#c08a2f] px-6 py-3 text-sm font-bold text-[#c08a2f] hover:bg-[#c08a2f] hover:text-white transition",children:F?"Booking Closed":"Reserve Your Place"})]})})(),(()=>{var Z,de;const F=!((Z=N.tour_lunch)!=null&&Z.isActive);return r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:.1,duration:.5},className:`relative rounded-2xl border-2 p-8 shadow-lg flex flex-col overflow-hidden ${F?"border-slate-200 bg-slate-50":"border-[#c08a2f] bg-white"}`,children:[!F&&r.jsx("div",{className:"absolute top-0 right-0 bg-[#c08a2f] text-white text-[10px] font-bold uppercase tracking-wider px-3 py-1 rounded-bl-xl",children:"Includes Lunch"}),r.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[r.jsx("div",{className:`text-xs font-bold uppercase tracking-widest ${F?"text-slate-400":"text-[#c08a2f]"}`,children:"Option 2"}),F&&r.jsx("span",{className:"inline-flex items-center rounded-full bg-slate-200 text-slate-500 text-[10px] font-bold uppercase tracking-wide px-2.5 py-1 shrink-0",children:"Booking Closed"})]}),r.jsx("div",{className:`text-lg font-bold mb-1 ${F?"text-slate-400":"text-[#1f0f3f]"}`,children:"Experience Abidjan + Networking Lunch"}),r.jsx("div",{className:"text-sm text-slate-500 mb-6",children:"Tour plus lunch"}),r.jsxs("div",{className:"mb-6",children:[r.jsxs("span",{className:`text-4xl font-extrabold ${F?"text-slate-400":"text-[#1f0f3f]"}`,children:["USD ",(((de=N.tour_lunch)==null?void 0:de.priceCents)||0)/100]}),r.jsx("span",{className:"text-sm text-slate-500 ml-2",children:"per delegate"})]}),r.jsx("button",{type:"button",disabled:F,onClick:()=>!F&&P("tour_lunch"),className:F?"mt-auto inline-flex items-center justify-center gap-2 rounded-full bg-slate-200 px-6 py-3 text-sm font-bold text-slate-400 cursor-not-allowed":"mt-auto inline-flex items-center justify-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a
72577324] px-6 py-3 text-sm font-bold text-white transition",children:F?"Booking Closed":"Reserve Your Place"})]})})()]}),r.jsxs(V.div,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"mt-10 rounded-2xl border-2 border-[#c08a2f]/40 bg-[#fdf6e3] p-6 md:p-8 flex items-start gap-4",children:[r.jsx("div",{className:"h-10 w-10 rounded-lg bg-[#c08a2f]/15 flex items-center justify-center shrink-0",children:r.jsx(Zl,{className:"h-5 w-5 text-[#c08a2f]"})}),r.jsxs("div",{children:[r.jsx("div",{className:"font-bold text-[#1f0f3f] mb-2",children:"Important Booking Information"}),r.jsxs("p",{className:"text-sm text-slate-700 leading-relaxed",children:["This excursion will only proceed if sufficient delegate registrations are received. To enable us to confirm transport and logistics with our local partner, we kindly ask delegates to reserve their place by ",r.jsx("strong",{className:"text-[#1f0f3f]",children:"Friday 7 August 2026"}),". Early registration helps us guarantee the experience and secure the necessary arrangements."]})]})]})]})}),r.jsxs("div",{className:"relative overflow-hidden py-20 md:py-28",children:[r.jsx("img",{src:"/experience-abidjan/plateau-towers.jpg",alt:"Le Plateau towers, Abidjan",className:"absolute inset-0 w-full h-full object-cover acgc-kenburns"}),r.jsx("div",{className:"absolute inset-0 bg-[#1f0f3f]/85"}),r.jsxs(V.div,{initial:{opacity:0,y:24},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.7},className:"relative max-w-3xl mx-auto px-4 md:px-6 text-center",children:[r.jsx("h3",{className:"text-3xl md:text-4xl font-extrabold text-white mb-5",children:"Complete Your ACGC Experience"}),r.jsx("p",{className:"text-white/80 leading-relaxed max-w-2xl mx-auto mb-8",children:"Whether you're extending your stay in Abidjan or flying home later that day, we'd love you to join us for one final opportunity to experience the city and continue conversations with fellow delegates."}),r.jsxs("button",{type:"button",onClick:()=>P(),className:"inline-flex items-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a77324] px-8 py-3.5 text-sm font-bold text-white transition shadow-lg",children:["Reserve Your Place ",r.jsx(nt,{className:"h-4 w-4"})]})]})]})]}),r.jsx("section",{id:"speakers",className:"py-20 bg-gradient-to-br from-[#f9f6ff] to-[#f0ebff] scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-3xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-10",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"Speakers"}),r.jsx("h2",{className:"text-3xl md:text-4xl font-extrabold text-[#1f0f3f]",children:"ACGC Conference Speaker FAQs"}),r.jsxs("p",{className:"mt-3 text-slate-600",children:["Everything you need to know about speaking at the ",B]})]}),r.jsx("div",{className:"space-y-3",children:C.map(F=>r.jsx(hH,{faq:F},F.q))}),r.jsxs("div",{className:"mt-8 text-center",children:[r.jsx("p",{className:"text-sm text-slate-600 mb-4",children:"Ready to propose a session?"}),r.jsxs("a",{href:"#more",onClick:F=>{F.preventDefault(),q("#more")},className:"inline-flex items-center gap-2 rounded-full bg-[#1f0f3f] hover:bg-[#2a1654] px-6 py-3 text-sm font-bold text-white transition",children:["Submit Speaker Interest Form ",r.jsx(nt,{className:"h-4 w-4"})]})]})]})}),r.jsx("section",{id:"more",className:"py-20 bg-gradient-to-br from-[#f9f6ff] to-[#f0ebff] scroll-mt-[236px]",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6",children:[r.jsxs("div",{className:"text-center mb-10",children:[r.jsx("div",{className:"text-xs font-semibold uppercase tracking-widest text-[#c08a2f] mb-2",children:"More"}),r.jsx("h2",{className:"text-3xl font-extrabold text-[#1f0f3f]",children:"Useful Resources"})]}),r.jsx("div",{className:"grid sm:grid-cols-3 gap-5",children:rH.map((F,Z)=>{const de=F.icon;return r.jsxs(V.a,{href:F.href,initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{delay:Z*.08,duration:.4},className:"group block rounded-2xl border border-slate-200 bg-white p-6 shadow-sm hover:shadow-md hover:border-[#c08a2f]/30 hover:-translate-y-1 transition-all",children:[r.jsx("div",{className:"h-10 w-10 rounded-lg bg-[#1f0f3f]/8 flex items-center justify-center mb-4 group-hover:bg-[#c08a2f]/10 transition-colors",children:r.jsx(de,{className:"h-5 w-5 text-[#1f0f3f] group-hover:text-[#c08a2f] transition-colors"})}),r.jsx("div",{className:"text-base font-bold text-[#1f0f3f] mb-2",children:F.title}),r.jsx("p",{className:"text-sm text-slate-500 leading-relaxed mb-4",children:F.desc}),r.jsxs("div",{className:"inline-flex items-center gap-1 text-xs font-semibold text-[#c08a2f] group-hover:gap-2 transition-all",children:[F.cta," ",r.jsx(nt,{className:"h-3.5 w-3.5"})]})]},F.title)})})]})}),r.jsx("section",{className:"bg-[#0d0620] py-14 text-center",children:r.jsxs("div",{className:"max-w-3xl mx-auto px-4",children:[r.jsx("div",{className:"text-[#e8c76c] text-xs font-bold uppercase tracking-widest mb-2",children:B}),r.jsx("h3",{className:"text-2xl font-extrabold text-white mb-1",children:fe||_.title}),X&&r.jsx("p",{className:"text-slate-400 text-sm italic mb-6",children:X}),r.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 text-sm text-slate-400 mb-8",children:[r.jsx("span",{children:J}),r.jsx("span",{className:"hidden sm:inline",children:"·"}),r.jsx("span",{children:ce})]}),r.jsxs(be,{ticketType:null,className:"inline-flex items-center gap-2 rounded-full bg-[#c08a2f] hover:bg-[#a
72577324] px-8 py-3.5 text-sm font-bold text-white transition shadow-lg",children:[r.jsx(Fn,{className:"h-4 w-4"}),"Register for ACGC ",_.year]}),r.jsxs("p",{className:"mt-6 text-xs text-slate-600",children:[r.jsx("a",{href:"mailto:[email protected]",className:"text-slate-400 hover:text-white transition underline",children:"[email protected]"})," · ",r.jsx("a",{href:"https://www.acgc.africa",className:"text-slate-400 hover:text-white transition underline",children:"acgc.africa"})]})]})}),r.jsx(gH,{}),r.jsx(mH,{}),r.jsx(ir,{children:d&&r.jsx(lH,{member:e,initialTicket:h,ticketOptions:w,conferenceId:_.id,editionTitle:B,onClose:()=>u(!1),onOpenExcursion:()=>{u(!1),setTimeout(()=>q("#excursion"),300)}})}),r.jsx(ir,{children:f&&r.jsx(cH,{member:e,initialOption:g,excursionOptions:N,conferenceId:_.id,onClose:()=>p(!1)})})]})}function uM(t){return t||null}function hM(t,e){if(!t)return"";const s=new Date(t),n=e?new Date(e):null,a={month:"long",day:"numeric",year:"numeric"};if(!n||s.toDateString()===n.toDateString())return s.toLocaleDateString("en-US",a);const i=s.getMonth()===n.getMonth()&&s.getFullYear()===n.getFullYear(),o=s.toLocaleDateString("en-US",i?{month:"long",day:"numeric"}:a),l=n.toLocaleDateString("en-US",a);return`${o} â ${l}`}function zk(t){return t==null?null:new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:0}).format(t/100)}function CH(t){return{start_at:t.start_date,end_at:t.end_date,title:t.title,summary:t.tagline||"",location:[t.venue_name,t.city,t.country].filter(Boolean).join(", ")}}function SH({conference:t}){const[e,s]=v.useState(!1),n=v.useRef(null),a=CH(t);return v.useEffect(()=>{const i=o=>{n.current&&!n.current.contains(o.target)&&s(!1)};return document.addEventListener("mousedown",i),()=>document.removeEventListener("mousedown",i)},[]),r.jsxs("div",{className:"relative",ref:n,children:[r.jsxs("button",{onClick:()=>s(!e),className:"inline-flex items-center justify-center gap-1.5 rounded-lg border border-white/20 bg-white/10 text-white/80 hover:bg-white/20 px-3 py-2 text-xs font-medium transition",title:"Add to calendar",children:[r.jsx(Xl,{className:"h-3.5 w-3.5"})," Add to Calendar"]}),e&&r.jsxs(V.div,{initial:{opacity:0,y:4},animate:{opacity:1,y:0},transition:{duration:.12},className:"absolute right-0 top-full mt-2 w-48 rounded-xl bg-white border border-slate-200 shadow-lg py-1.5 z-50",children:[r.jsx("a",{href:qw(a),target:"_blank",rel:"noreferrer",onClick:()=>s(!1),className:"block px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 transition",children:"Google Calendar"}),r.jsx("a",{href:Jw(a),target:"_blank",rel:"noreferrer",onClick:()=>s(!1),className:"block px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 transition",children:"Outlook"}),r.jsx("button",{onClick:()=>{Kw(a),s(!1)},className:"block w-full text-left px-3 py-2 text-sm text-slate-700 hover:bg-slate-50 transition",children:"Download .ics (Apple / Other)"})]})]})}function _H({conference:t}){const e=wx(t.start_date),s=uM(t.banner_url||t.thumbnail_url),n=[t.venue_name,t.city,t.country].filter(Boolean).join(", "),a=zk(t.member_price_cents),i=zk(t.non_member_price_cents);return r.jsxs("div",{className:"relative rounded-2xl overflow-hidden bg-[#1f0f3f] shadow-[0_8px_40px_-8px_rgba(0,0,0,0.3)] mb-8",children:[s&&r.jsx("div",{className:"absolute inset-0",children:r.jsx("img",{src:s,alt:"",className:"w-full h-full object-cover opacity-25",onError:o=>{o.currentTarget.style.display="none"}})}),r.jsxs("div",{className:"relative p-6 md:p-8 flex flex-col md:flex-row gap-6",children:[r.jsxs("div",{className:"flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-lg px-2.5 py-1 text-xs font-medium bg-[#1f0f3f] border border-white/20 text-white",children:[r.jsx(so,{className:"h-3.5 w-3.5"}),"Conference"]}),r.jsxs("span",{className:"inline-flex items-center gap-1 rounded-lg bg-[#c08a2f] text-white px-2.5 py-1 text-xs font-medium",children:[r.jsx(An,{className:"h-3 w-3"}),"Featured"]})]}),r.jsx(K,{to:`/conference/${t.slug}`,className:"hover:opacity-90 transition",children:r.jsxs("h2",{className:"mt-4 text-xl md:text-2xl font-bold text-white leading-tight",children:[t.edition_label?`${t.edition_label} `:"",t.title,t.tagline?`: ${t.tagline}`:""]})}),r.jsxs(K,{to:`/conference/${t.slug}`,className:"mt-2 inline-flex items-center gap-1 text-xs text-[#dcb26a] hover:text-[#c08a2f] font-medium transition",children:["View full details",r.jsx(ht,{className:"h-3 w-3 -rotate-90"})]}),r.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-x-5 gap-y-2 text-sm text-white/80",children:[r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(Ds,{className:"h-4 w-4 text-white/50"}),hM(t.start_date,t.end_date)]}),n&&r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(kt,{className:"h-4 w-4 text-white/50"}),n]})]}),(a||i)&&r.jsxs("div",{className:"mt-4 flex items-center gap-4 text-sm",children:[a&&r.jsxs("span",{className:"inline-flex items-center gap-1 text-[#dcb26a] font-medium",children:["Members: ",a]}),i&&r.jsxs("span",{className:"text-white/60",children:["Non-members: ",i]})]}),r.jsxs("div",{className:"mt-5 flex flex-wrap items-center gap-3",children:[r.jsx(K,{to:`/conference/${t.slug}#tickets`,className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-[#c08a2f] hover:bg-[#a
72577324] text-white font-medium text-sm transition shadow-lg",children:"Register"}),r.jsx(SH,{conference:t})]})]}),e&&r.jsxs("div",{className:"shrink-0 flex flex-col items-center justify-center",children:[r.jsx("div",{className:"text-xs uppercase tracking-widest text-white/50 mb-3",children:"Starts in"}),r.jsx("div",{className:"flex gap-2",children:[{val:e.days,label:"Days"},{val:e.hours,label:"Hrs"},{val:e.minutes,label:"Min"},{val:e.seconds,label:"Sec"}].map(o=>r.jsxs("div",{className:"flex flex-col items-center",children:[r.jsx("div",{className:"h-14 w-14 rounded-xl bg-white/10 backdrop-blur-sm flex items-center justify-center text-xl font-bold text-white",children:String(o.val).padStart(2,"0")}),r.jsx("div",{className:"mt-1 text-[10px] uppercase tracking-wider text-white/50",children:o.label})]},o.label))})]})]})]})}function TH({conference:t,isPast:e}){const s=uM(t.banner_url||t.thumbnail_url);return r.jsxs(V.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-40px"},transition:{duration:.4},className:`group rounded-2xl overflow-hidden border border-slate-200 bg-white shadow-sm hover:shadow-lg transition-shadow ${e?"opacity-90":""}`,children:[r.jsxs("div",{className:"relative h-44 bg-[#1f0f3f]",children:[s?r.jsx("img",{src:s,alt:t.title,className:"h-full w-full object-cover"}):r.jsx("div",{className:"h-full w-full flex items-center justify-center",children:r.jsx(so,{className:"h-10 w-10 text-white/30"})}),t.is_current&&!e&&r.jsx("span",{className:"absolute top-3 left-3 inline-flex items-center rounded-full bg-[#c08a2f] px-3 py-1 text-[11px] font-bold uppercase tracking-wider text-white",children:"Featured"}),e&&r.jsx("span",{className:"absolute top-3 left-3 inline-flex items-center rounded-full bg-slate-900/70 px-3 py-1 text-[11px] font-bold uppercase tracking-wider text-white",children:"Past"})]}),r.jsxs("div",{className:"p-5",children:[t.edition_label&&r.jsx("div",{className:"text-[11px] font-bold uppercase tracking-widest text-[#c08a2f] mb-1",children:t.edition_label}),r.jsx(K,{to:`/conference/${t.slug}`,className:"block",children:r.jsx("h3",{className:"text-lg font-bold text-[#1f0f3f] leading-snug group-hover:text-[#c08a2f] transition-colors",children:t.title})}),t.tagline&&r.jsx("p",{className:"mt-1 text-sm text-slate-500 line-clamp-2",children:t.tagline}),r.jsxs("div",{className:"mt-4 space-y-1.5 text-sm text-slate-600",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ds,{className:"h-4 w-4 text-slate-400 shrink-0"}),hM(t.start_date,t.end_date)]}),(t.venue_name||t.city)&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(kt,{className:"h-4 w-4 text-slate-400 shrink-0"}),[t.venue_name,t.city,t.country].filter(Boolean).join(", ")]})]}),r.jsxs(K,{to:`/conference/${t.slug}`,className:"mt-4 inline-flex items-center gap-1 text-sm font-semibold text-[#c08a2f] hover:text-[#8b6914] transition-colors",children:[e?"View recap":"View conference"," ",r.jsx(ll,{className:"h-4 w-4"})]})]})]})}function EH(){const[t,e]=v.useState([]),[s,n]=v.useState(!0),[a,i]=v.useState(""),[o,l]=v.useState("upcoming");v.useEffect(()=>{(async()=>{n(!0),i("");try{const g=await U("/api/conferences");e(g.conferences||[])}catch(g){i(g.message||"Failed to load conferences")}finally{n(!1)}})()},[]);const c=new Date,d=t.filter(p=>!p.end_date||new Date(p.end_date)>=c).sort((p,g)=>new Date(p.start_date)-new Date(g.start_date)),u=t.filter(p=>p.end_date&&new Date(p.end_date)<c).sort((p,g)=>new Date(g.start_date)-new Date(p.start_date)),h=o==="upcoming"?d:u,m=o==="upcoming"?d.filter(p=>p.is_current):[],f=o==="upcoming"?h.filter(p=>!p.is_current):h;return r.jsxs("div",{className:"bg-slate-50 min-h-screen",children:[r.jsx("div",{className:"bg-[#1f0f3f] text-white",children:r.jsxs(V.div,{initial:{opacity:0,y:16},animate:{opacity:1,y:0},transition:{duration:.5,ease:"easeOut"},className:"max-w-6xl mx-auto px-4 sm:px-6 py-14",children:[r.jsx("div",{className:"text-xs font-bold uppercase tracking-widest text-[#e8c76c] mb-2",children:"ACGC Conferences"}),r.jsx("h1",{className:"text-3xl sm:text-4xl font-extrabold",children:"Welcome To ACGC (African Corporate & Government counsel) Conference Page"}),r.jsx("p",{className:"mt-3 max-w-2xl text-white/70",children:"ACGC's flagship annual gathering for in-house and government counsel across Africa. Browse upcoming and past editions below."})]})}),r.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 py-10",children:[r.jsx("div",{className:"flex gap-2 mb-8",children:[{key:"upcoming",label:"Upcoming",count:d.length},{key:"past",label:"Past Conferences",count:u.length}].map(p=>r.jsxs("button",{onClick:()=>l(p.key),className:`px-4 py-2 rounded-lg text-sm font-medium transition ${o===p.key?"bg-[#1f0f3f] text-white":"bg-white text-slate-600 border border-slate-200 hover:border-[#c08a2f]/40"}`,children:[p.label,r.jsxs("span",{className:`ml-1.5 text-xs ${o===p.key?"text-[#c08a2f]":"text-slate-400"}`,children:["(",p.count,")"]})]},p.key))}),a&&r.jsx("div",{className:"rounded-lg bg-red-50 border border-red-200 px-4 py-3 text-sm text-red-700 mb-6",children:a}),s?r.jsx("div",{className:"py-24 text-center text-slate-400",children:"Loading conferencesâ¦"}):h.length===0?r.jsxs("div",{className:"py-24 text-center",children:[r.jsx(so,{className:"h-10 w-10 text-slate-300 mx-auto mb-3"}),r.jsx("div",{className:"text-slate-500 font-medium",children:o==="upcoming"?"No upcoming conferences":"No past conferences"}),r.jsx("div",{className:"text-sm text-slate-400 mt-1",children:o==="upcoming"?"New conferences will appear here as they are announced.":"Past conferences will appear here after they conclude."})]}):r.jsxs(r.Fragment,{children:[m.map(p=>r.jsx(_H,{conference:p}
725,p.id)),f.length>0&&r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-6",children:f.map(p=>r.jsx(TH,{conference:p,isPast:o==="past"},p.id))})]})]})]})}const MH=2e3,AH=30;function PH(){const[t]=eo(),e=Bn(),{setAuthToken:s,refresh:n}=Oe(),a=t.get("id"),[i,o]=v.useState(null),[l,c]=v.useState(!0),[d,u]=v.useState("idle"),h=v.useRef(0);return v.useEffect(()=>{if(!a){c(!1);return}let m=!1;const f=async()=>{var x;let p;try{p=await U(`/api/conference/registration/${a}`)}catch{if(m)return;c(!1);return}if(!(m||(o(p.registration),c(!1),!(((x=p.registration)==null?void 0:x.ticket_type)||"").startsWith("join_attend_")))){if(p.token){u("ready");try{s(p.token),await n({silent:!1,token:p.token})}catch{}return}if(u("polling"),h.current++,h.current>=AH){u("error");return}setTimeout(f,MH)}};return f(),()=>{m=!0}},[a,s,n]),r.jsx("div",{className:"min-h-screen bg-gradient-to-br from-[#f9f6ff] to-[#f0ebff] flex items-center justify-center px-4 py-16",children:r.jsx(V.div,{initial:{opacity:0,y:16,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.4,ease:"easeOut"},className:"w-full max-w-lg",children:r.jsxs("div",{className:"bg-white rounded-2xl shadow-xl overflow-hidden",children:[r.jsxs("div",{className:"bg-[#1f0f3f] px-8 py-8 text-center",children:[r.jsx(V.div,{initial:{scale:0,rotate:-30},animate:{scale:1,rotate:0},transition:{duration:.5,delay:.15,type:"spring",stiffness:200,damping:14},className:"mx-auto mb-4 h-16 w-16 rounded-full bg-green-500/20 flex items-center justify-center",children:r.jsx(Pr,{className:"h-9 w-9 text-green-400"})}),r.jsx("div",{className:"text-[#e8c76c] text-xs font-bold uppercase tracking-widest mb-1",children:"Registration Confirmed"}),r.jsx("h1",{className:"text-xl font-extrabold text-white",children:"Payment Received"}),r.jsx("p",{className:"mt-2 text-slate-300 text-sm",children:"Thank you for registering for the 8th Annual ACGC Conference."})]}),r.jsxs("div",{className:"px-8 py-8",children:[l?r.jsxs("div",{className:"flex items-center justify-center py-6 text-slate-400",children:[r.jsx($a,{className:"h-5 w-5 animate-spin mr-2"}),r.jsx("span",{className:"text-sm",children:"Loading registration detailsâ¦"})]}):i?r.jsxs("div",{className:"space-y-4",children:[r.jsxs(wr,{y:12,duration:.35,delay:.1,className:"rounded-xl bg-[#f9f6ff] border border-[#c08a2f]/20 p-5",children:[r.jsx("div",{className:"text-xs font-semibold text-[#c08a2f] uppercase tracking-wider mb-3",children:"Registration Summary"}),r.jsxs("div",{className:"space-y-2 text-sm text-slate-700",children:[r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-slate-500",children:"Name"}),r.jsx("span",{className:"font-semibold",children:i.full_name})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-slate-500",children:"Email"}),r.jsx("span",{className:"font-semibold",children:i.email})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-slate-500",children:"Ticket"}),r.jsx("span",{className:"font-semibold",children:i.ticket_name})]}),r.jsxs("div",{className:"flex justify-between",children:[r.jsx("span",{className:"text-slate-500",children:"Amount Paid"}),r.jsxs("span",{className:"font-semibold text-[#c08a2f]",children:["$",(i.ticket_price_cents/100).toFixed(2)," USD"]})]})]})]}),r.jsxs(wr,{y:12,duration:.35,delay:.2,className:"rounded-xl bg-slate-50 border border-slate-200 p-5 space-y-2",children:[r.jsx("div",{className:"text-xs font-semibold text-slate-500 uppercase tracking-wider mb-3",children:"Conference Details"}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-700",children:[r.jsx(aa,{className:"h-4 w-4 text-[#c08a2f] shrink-0"}),"30 September â 2 October 2026"]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-700",children:[r.jsx(kt,{className:"h-4 w-4 text-[#c08a2f] shrink-0"}),"Noom Hotel, Abidjan, Côte d'Ivoire"]}),r.jsxs("div",{className:"flex items-center gap-2 text-sm text-slate-700",children:[r.jsx(Fn,{className:"h-4 w-4 text-[#c08a2f] shrink-0"}),"A confirmation email has been sent to ",i.email]})]}),(i.ticket_type||"").startsWith("join_attend_")&&r.jsx("div",{className:"rounded-xl bg-[#f9f6ff] border border-[#c08a2f]/20 p-5 text-center",children:d==="ready"?r.jsxs(r.Fragment,{children:[r.jsx("p",{className:"text-sm font-semibold text-[#1f0f3f] mb-2",children:"Your ACGC member account is ready!"}),r.jsxs("button",{onClick:()=>e("/hub"),className:"inline-flex items-center gap-2 rounded-full bg-[#1f0f3f] hover:bg-[#2a1654] px-5 py-2.5 text-sm font-bold text-white transition",children:["Go to Member Portal ",r.jsx(nt,{className:"h-4 w-4"})]})]}):d==="error"?r.jsxs("p",{className:"text-sm text-slate-600",children:["Your membership is still being set up â check your email in a few minutes for a login link, or"," ",r.jsx("a",{href:"mailto:[email protected]",className:"text-[#c08a2f] underline",children:"contact ACGC"})," if it doesn't arrive."]}):r.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-slate-600",children:[r.jsx($a,{className:"h-4 w-4 animate-spin text-[#c08a2f]"}
725),"Setting up your ACGC member accountâ¦"]})})]}):r.jsxs("div",{className:"text-center py-4",children:[r.jsx("p",{className:"text-sm text-slate-600 mb-2",children:"Your registration is confirmed."}),r.jsx("p",{className:"text-sm text-slate-500",children:"A confirmation email will be sent to you shortly."})]}),r.jsxs("div",{className:"mt-6 space-y-3",children:[r.jsx("p",{className:"text-xs text-slate-500 text-center",children:"The ACGC team will be in touch with logistics, accommodation details, and the full programme as the conference approaches."}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[r.jsx(K,{to:"/conference/2026",className:"flex-1 inline-flex items-center justify-center gap-2 rounded-full bg-[#1f0f3f] hover:bg-[#2a1654] px-5 py-2.5 text-sm font-bold text-white transition",children:"Back to Conference Page"}),r.jsx("a",{href:"mailto:[email protected]",className:"flex-1 inline-flex items-center justify-center gap-2 rounded-full border border-[#1f0f3f] text-[#1f0f3f] hover:bg-[#1f0f3f] hover:text-white px-5 py-2.5 text-sm font-semibold transition",children:"Contact ACGC"})]})]})]})]})})})}function DH(t){return t?t.startsWith("data:")||t.startsWith("http://")||t.startsWith("https://")?t:tt(t):null}const RH=["full-time","part-time","contract","internship"],LH=["on-site","remote","hybrid"],OH=["Entry","Mid","Senior","Lead","Executive","C-Suite"],Yh={hidden:{opacity:0,y:14},visible:(t=0)=>({opacity:1,y:0,transition:{delay:t,duration:.5}})};function IH(){const{token:t,member:e}=Oe();(e==null?void 0:e.role)==="admin"||(e==null||e.role);const s=!!e,[n,a]=v.useState([]),[i,o]=v.useState(0),[l,c]=v.useState(!1),[d,u]=v.useState(""),[h,m]=v.useState(""),[f,p]=v.useState(""),[g,x]=v.useState(""),[b,y]=v.useState(""),[w,N]=v.useState(!1),[j,S]=v.useState(""),[k,C]=v.useState(!1),[T,A]=v.useState(!1),[E,L]=v.useState("");return v.useEffect(()=>{(async()=>{c(!0);try{if(s){const P=new URLSearchParams;d&&P.set("q",d),h&&P.set("industry",h),f&&P.set("type",f),g&&P.set("location_type",g),b&&P.set("seniority",b),P.set("limit","20");const R=await U(`/api/jobs/members?${P.toString()}`,{token:t});a(R.jobs||[]),o(R.total||0)}else{const P=await U("/api/jobs/teaser?limit=10");a(P.jobs||[]),o(P.total||0)}}catch{}finally{c(!1)}})()},[t,s,d,h,f,g,b]),r.jsxs("div",{className:"bg-[rgb(var(--bg))] text-[rgb(var(--fg))]",children:[r.jsxs("section",{className:"relative overflow-hidden bg-[#1f0f3f] text-white",children:[r.jsxs("div",{className:"absolute inset-0 pointer-events-none","aria-hidden":"true",children:[r.jsx("div",{className:"absolute top-[-20%] left-[-10%] h-72 w-72 bg-[#c08a2f]/15 blur-3xl"}),r.jsx("div",{className:"absolute bottom-[-10%] right-[-10%] h-60 w-60 bg-[#5ea3ff]/10 blur-3xl"})]}),r.jsxs("div",{className:"relative max-w-6xl mx-auto px-4 md:px-6 pt-14 pb-12",children:[r.jsxs(V.div,{initial:"hidden",animate:"visible",variants:Yh,custom:0,className:"flex items-center gap-3 text-sm uppercase tracking-[0.2em] text-[#e6c784]",children:[r.jsx("span",{className:"h-px w-8 bg-[#e6c784]"})," Careers"]}),r.jsx(V.h1,{initial:"hidden",animate:"visible",variants:Yh,custom:.05,className:"text-3xl md:text-5xl mt-3 leading-tight max-w-3xl",children:"Africa's top in-house & corporate roles"}),r.jsx(V.p,{initial:"hidden",animate:"visible",variants:Yh,custom:.12,className:"text-lg text-slate-200 mt-4 max-w-2xl",children:"Curated opportunities from the continent's most credible organisations â board seats, GC roles, compliance leads, and executive positions."}),r.jsxs(V.div,{initial:"hidden",animate:"visible",variants:Yh,custom:.18,className:"mt-4 flex items-center gap-4 text-sm text-slate-300",children:[r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(Wt,{className:"h-4 w-4 text-[#e6c784]"})," ",i," active roles"]}),r.jsxs("span",{className:"flex items-center gap-1.5",children:[r.jsx(pt,{className:"h-4 w-4 text-[#e6c784]"})," 40+ Countries"]})]})]})]}),r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-10",children:[s&&r.jsxs("div",{className:"mb-8 space-y-4",children:[r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[r.jsxs("div",{className:"relative flex-1",children:[r.jsx(Ua,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),r.jsx("input",{type:"text",placeholder:"Search job title, company, or location...",value:d,onChange:D=>u(D.target.value),className:"w-full h-11 pl-10 pr-4 rounded-xl border border-slate-200 bg-white text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),r.jsxs("button",{onClick:()=>
725N(!w),className:"h-11 px-4 rounded-xl border border-slate-200 bg-white text-sm text-slate-700 hover:bg-slate-50 flex items-center gap-2",children:["Filters ",r.jsx(ht,{className:`h-4 w-4 transition-transform ${w?"rotate-180":""}`})]})]}),w&&r.jsxs(V.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[r.jsxs("select",{value:h,onChange:D=>m(D.target.value),className:"h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-700 bg-white",children:[r.jsx("option",{value:"",children:"All Industries"}),Gi.map(D=>r.jsx("option",{value:D,children:D},D))]}),r.jsxs("select",{value:f,onChange:D=>p(D.target.value),className:"h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-700 bg-white",children:[r.jsx("option",{value:"",children:"All Types"}),RH.map(D=>r.jsx("option",{value:D,children:D.replace("-"," ")},D))]}),r.jsxs("select",{value:g,onChange:D=>x(D.target.value),className:"h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-700 bg-white",children:[r.jsx("option",{value:"",children:"All Locations"}),LH.map(D=>r.jsx("option",{value:D,children:D},D))]}),r.jsxs("select",{value:b,onChange:D=>y(D.target.value),className:"h-10 rounded-xl border border-slate-200 px-3 text-sm text-slate-700 bg-white",children:[r.jsx("option",{value:"",children:"All Seniority"}),OH.map(D=>r.jsx("option",{value:D,children:D},D))]})]})]}),!s&&r.jsx("div",{className:"mb-8 rounded-2xl border border-[#c08a2f]/20 bg-gradient-to-r from-[#c08a2f]/5 to-transparent p-6",children:r.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-xl bg-[#c08a2f]/10 grid place-items-center shrink-0",children:r.jsx(or,{className:"h-5 w-5 text-[#c08a2f]"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-900 font-semibold",children:"Unlock full job details & apply directly"}),r.jsx("div",{className:"mt-1 text-sm text-slate-600",children:"ACGC members get full access to all job listings, salary information, and one-click apply. Join 3,000+ in-house and government counsel."})]})]}),r.jsxs("div",{className:"flex gap-2 shrink-0",children:[r.jsx(W,{as:K,to:"/join",className:"bg-[#c08a2f] hover:bg-[#a77324] text-white border border-[#dcb26a]",children:"Join ACGC"}),r.jsx(W,{as:K,to:"/login",variant:"ghost",className:"border-slate-300",children:"Sign in"})]})]})}),l?r.jsx("div",{className:"text-center py-16 text-slate-500",children:"Loading opportunities..."}):n.length===0?r.jsxs("div",{className:"text-center py-16",children:[r.jsx(Wt,{className:"h-10 w-10 text-slate-300 mx-auto mb-3"}),r.jsx("div",{className:"text-slate-700 font-semibold",children:"No opportunities posted yet"}),r.jsx("div",{className:"text-sm text-slate-500 mt-1",children:"Check back soon â new roles are added regularly."})]}):r.jsx("div",{className:"space-y-4",children:n.map((D,P)=>r.jsx(FH,{job:D,idx:P,isMember:s},D.id))}),!s&&n.length>0&&r.jsxs("div",{className:"mt-10 rounded-2xl bg-[#1f0f3f] text-white p-8 text-center",children:[r.jsx(Ft,{className:"h-8 w-8 text-[#e6c784] mx-auto mb-3"}),r.jsx("h3",{className:"text-2xl",children:"Get Africa's top roles in your inbox"}),r.jsx("p",{className:"mt-2 text-slate-300 max-w-md mx-auto",children:"Subscribe to the ACGC careers newsletter â curated in-house and executive opportunities delivered weekly."}),k?r.jsx("div",{className:"mt-4 text-[#e6c784] font-medium",children:"You're subscribed! Check your inbox."}):r.jsxs(r.Fragment,{children:[E&&r.jsx("div",{className:"mt-4 text-red-400 text-sm",children:E}),r.jsxs("div",{className:"mt-5 flex flex-col sm:flex-row gap-2 max-w-md mx-auto",children:[r.jsx("input",{type:"email",placeholder:"[email protected]",value:j,onChange:D=>S(D.target.value),className:"flex-1 h-11 px-4 rounded-xl border border-white/20 bg-white/10 text-sm text-white placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"}),r.jsx(W,{onClick:async()=>{if(j.includes("@")){A(!0),L("");try{await U("/api/newsletter/subscribe",{method:"POST",body:{email:j,source:"careers_page"}}),C(!0)}catch(D){L(D.message||"Failed to subscribe")}finally{A(!1)}}},disabled:T||!j.includes("@"),className:"bg-[#c08a2f] hover:bg-[#a
72577324] text-white border border-[#dcb26a]",children:T?"Subscribing...":"Subscribe"})]})]})]})]})]})}function FH({job:t,idx:e,isMember:s}){var i;const[n,a]=v.useState(!1);return r.jsx(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:e*.03},children:r.jsx("div",{className:`rounded-2xl border ${t.featured?"border-[#c08a2f]/30 bg-[#c08a2f]/[0.03]":"border-slate-200 bg-white"} shadow-sm hover:shadow-md transition-shadow`,children:r.jsx("div",{className:"p-5",children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsxs("div",{className:"h-12 w-12 rounded-xl bg-slate-100 border border-slate-200 relative grid place-items-center shrink-0 overflow-hidden",children:[r.jsx(Gt,{className:"h-5 w-5 text-slate-400"}),t.company_logo_url&&r.jsx("img",{src:DH(t.company_logo_url),alt:t.company,className:"absolute inset-0 h-full w-full object-cover rounded-xl",onError:o=>{o.currentTarget.style.display="none"}})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-slate-900 font-semibold text-lg leading-snug",children:t.title}),r.jsx("div",{className:"text-sm text-slate-600 mt-0.5",children:t.company})]}),t.featured&&r.jsxs(Te,{className:"bg-[#c08a2f]/10 text-[#c08a2f] border-[#c08a2f]/20 shrink-0",children:[r.jsx(An,{className:"h-3 w-3 mr-1"})," Featured"]})]}),r.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1.5 text-sm text-slate-500",children:[r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(kt,{className:"h-3.5 w-3.5"})," ",t.location]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(pt,{className:"h-3.5 w-3.5"})," ",t.location_type]}),r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(cl,{className:"h-3.5 w-3.5"})," ",(i=t.type)==null?void 0:i.replace("-"," ")]}),t.industry&&r.jsxs("span",{className:"flex items-center gap-1",children:[r.jsx(Wt,{className:"h-3.5 w-3.5"})," ",t.industry]}),t.seniority&&r.jsx(Te,{tone:"default",className:"text-xs",children:t.seniority})]}),s&&r.jsxs(r.Fragment,{children:[(t.salary_min!=null||t.salary_max!=null)&&r.jsxs("div",{className:"mt-2 text-sm font-medium text-[#c08a2f]",children:[t.currency," ",t.salary_min!=null&&t.salary_max!=null?`${Number(t.salary_min).toLocaleString()} â ${Number(t.salary_max).toLocaleString()}`:t.salary_min!=null?`${Number(t.salary_min).toLocaleString()}+`:`Up to ${Number(t.salary_max).toLocaleString()}`]}),n&&t.description&&r.jsxs(V.div,{initial:{opacity:0}
725,animate:{opacity:1},className:"mt-3 text-sm text-slate-700 leading-relaxed whitespace-pre-line",children:[t.description,t.requirements&&r.jsxs("div",{className:"mt-3",children:[r.jsx("div",{className:"font-semibold text-slate-900 mb-1",children:"Requirements"}),r.jsx("div",{className:"whitespace-pre-line",children:t.requirements})]})]}),r.jsxs("div",{className:"mt-3 flex items-center gap-2",children:[r.jsx("button",{onClick:()=>a(!n),className:"text-sm text-[#2a1654] hover:text-[#1f0f3f] font-medium",children:n?"Show less":"View details"}),t.apply_url&&r.jsxs("a",{href:t.apply_url,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-sm font-medium text-white bg-[#c08a2f] hover:bg-[#a77324] px-3 py-1.5 rounded-lg transition",children:["Apply ",r.jsx(nt,{className:"h-3.5 w-3.5"})]})]})]}),!s&&r.jsx("div",{className:"mt-3 flex items-center gap-2",children:r.jsxs(K,{to:"/join",className:"inline-flex items-center gap-1 text-sm font-medium text-[#c08a2f] hover:text-[#a77324]",children:[r.jsx(or,{className:"h-3.5 w-3.5"})," Sign in to view details & apply"]})})]})]})})})})}const $H=[{name:"BCF",logo:"/PartnersLogo/BCF.jpg"},{name:"East Africa Law Society",logo:"/PartnersLogo/East Africa Law Society.jpg"},{name:"Economist Impact",logo:"/PartnersLogo/Economist Impact.jpg"},{name:"FICL",logo:"/PartnersLogo/FICL.jpg"},{name:"GAIL",logo:"/PartnersLogo/GAIL.jpg"},{name:"ITGC",logo:"/PartnersLogo/ITGC.jpg"},{name:"Law Association of Zambia",logo:"/PartnersLogo/Law Association of Zambia.jpg"},{name:"NBA Lagos Branch",logo:"/PartnersLogo/NBA Lagos Branch.jpg"},{name:"Parametric Global Consulting",logo:"/PartnersLogo/Parametric Global Consulting.jpg"},{name:"Reuters Events",logo:"/PartnersLogo/Reuters Events.jpg"},{name:"The Chancery Lane Project",logo:"/PartnersLogo/The Chancery Lane Project.jpg"}],zH=[{name:"ALP NG & Co",logo:"/SponsorsLogo/ALP NG & Co.jpg"},{name:"Baker McKenzie",logo:"/SponsorsLogo/Baker Mckenzie.jpg"},{name:"Bowmans",logo:"/SponsorsLogo/Bowmans.jpg"},{name:"Cavendrys",logo:"/SponsorsLogo/Cavendrys.jpg"},{name:"ENS Africa",logo:"/SponsorsLogo/ENS Africa.jpg"},{name:"Herbert Smith Freehills",logo:"/SponsorsLogo/Herbert Smith Freehills.jpg"},{name:"Tech Hive Advisory",logo:"/SponsorsLogo/Tech Hive Advisory.jpg"}],BH=[{name:"ALSF",logo:"/2026sponsors/ALSF.png"},{name:"Microsoft",logo:"/2026sponsors/Microsoft-Logo-PNG.png"},{name:"Baker McKenzie",logo:"/2026sponsors/Baker McKenzie.png"}];function n0({items:t,columns:e=4}){const s=e===3?"grid-cols-2 md:grid-cols-3":"grid-cols-2 sm:grid-cols-3 md:grid-cols-4";return r.jsx("div",{className:`grid ${s} gap-6 md:gap-8`,children:t.map(n=>r.jsx("div",{className:"flex items-center justify-center p-4 group",title:n.name,children:r.jsx("img",{src:n.logo,alt:n.name,className:"max-w-[280px] w-full h-auto max-h-[160px] object-contain transition-all duration-300 hover:scale-105",loading:"lazy",onError:a=>{a.target.style.display="none",a.target.parentElement.innerHTML=`<div class="h-[80px] w-full rounded-xl bg-slate-100 border-2 border-dashed border-slate-200 flex items-center justify-center text-sm font-semibold text-slate-400">${n.name}</div>`}})},n.name))})}function VH(){return r.jsx(r.Fragment,{children:r.jsxs("div",{className:"min-h-screen",children:[r.jsxs("section",{className:"relative bg-[#1f0f3f] text-white overflow-hidden",children:[r.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMiIgY3k9IjIiIHI9IjEuNSIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjAzKSIvPjwvc3ZnPg==')] opacity-60"}),r.jsx("div",{className:"max-w-5xl mx-auto px-4 md:px-6 py-20 md:py-28 relative z-10 text-center",children:r.jsxs(V.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:[r.jsx("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight",children:"Partners & Sponsors"}),r.jsx("p",{className:"mt-4 text-lg text-slate-300 max-w-2xl mx-auto",children:"ACGC collaborates with leading law firms, corporations, and institutions committed to empowering Africa's in-house and government counsel community."})]})})]}),r.jsx("section",{className:"max-w-5xl mx-auto px-4 md:px-6 py-16 md:py-20",children:r.jsx(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},children:r.jsxs("div",{className:"grid md:grid-cols-2 gap-10 items-center",children:[r.jsxs("div",{children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-slate-900",children:"Partnership Benefits"}),r.jsx("p",{className:"mt-4 text-slate-600 leading-relaxed",children:"As Africa's largest in-house legal community, ACGC partners with companies and institutions that have a genuine commitment to engaging meaningfully with our growing community of African corporate and government counsel."})]}),r.jsx("div",{className:"space-y-3",children:[{title:"3,000+ leading counsel",desc:"Direct access to in-house and public sector lawyers across Africa"},{title:"Networking & promotion",desc:"Ongoing opportunities with Africa's leading corporate and public sector counsel"},{title:"Evolving talent pool",desc:"Unrivalled connections with Africa's growing in-house legal community"},{title:"First-hand insights",desc:"Into the needs of those undertaking in-house legal roles across Africa"},{title:"One-of-a-kind access",desc:"Engagement with cross-sector intra-Africa networks"}].map(t=>r.jsxs("div",{className:"flex gap-3 items-start",children:[r.jsx("div",{className:"mt-1 h-5 w-5 rounded-full bg-[#c08a2f]/10 flex items-center justify-center shrink-0",children:r.jsx("div",{className:"h-2 w-2 rounded-full bg-[#c08a2f]"})}),r.jsxs("div",{children:[r.jsx("span",{className:"font-semibold text-slate-900",children:t.title}),r.jsxs("span",{className:"text-slate-500",children:[" â ",t.desc]})]})]},t.title))})]})})}),r.jsx("section",{className:"bg-slate-50/70 py-16 md:py-20",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[r.jsxs(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},className:"text-center mb-12",children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-slate-900",children:"Trusted Partners"}),r.jsx("p",{className:"mt-2 text-slate-500 max-w-xl mx-auto",children:"Organisations that work closely with ACGC to advance the in-house legal profession across the continent."})]}),r.jsx(n0,{items:$H,columns:4})]})}),r.jsx("section",{className:"py-16 md:py-20",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[r.jsxs(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},className:"text-center mb-12",children:[r.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-[#c08a2f]/10 text-sm font-medium text-[#c08a2f] mb-3",children:[r.jsx(Df,{className:"h-4 w-4"}),"ACGC 2025 Sponsors"]}),r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-slate-900",children:"ACGC 2025 Sponsors"}),r.jsx("p",{className:"mt-2 text-slate-500 max-w-xl mx-auto",children:"Leading firms that sponsored ACGC's 2025 Leadership Conference & In-House Legal Skills Institute."})]}),r.jsx(n0,{items:zH,columns:4})]})}),r.jsx("section",{className:"bg-slate-50/70 py-16 md:py-20",children:r.jsxs("div",{className:"max-w-6xl mx-auto px-4 md:px-6",children:[r.jsxs(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},className:"text-center mb-12",children:[r.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-[#c08a2f]/10 text-sm font-medium text-[#c08a2f] mb-3",children:[r.jsx(Df,{className:"h-4 w-4"}),"ACGC 2026 Sponsors"]}),r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-slate-900",children:"ACGC 2026 Sponsors"}),r.jsx("p",{className:"mt-2 text-slate-500 max-w-xl mx-auto",children:"Confirmed sponsors for ACGC's upcoming 2026 Leadership Conference."})]}),r.jsx(n0,{items:BH,columns:3})]})}),r.jsx("section",{className:"bg-[#1f0f3f] text-white py-16 md:py-20",children:r.jsx("div",{className:"max-w-3xl mx-auto px-4 md:px-6 text-center",children:r.jsxs(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-bold",children:"Become a Partner or Sponsor"}),r.jsx("p",{className:"mt-4 text-slate-300 max-w-xl mx-auto",children:"For more details about our current sponsorship opportunities and how your firm can be part of this transformative experience, please get in touch."}),r.jsxs("div",{className:"mt-8 flex flex-col sm:flex-row gap-4 justify-center",children:[r.jsxs(K,{to:"/partnering-with-us",className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-xl bg-[#c08a2f] hover:bg-[#a
72577324] text-white font-semibold transition text-sm",children:[r.jsx(Ft,{className:"h-4 w-4"}),"Partnering With Us"]}),r.jsxs(K,{to:"/about",className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-xl border border-white/20 hover:bg-white/5 text-white font-semibold transition text-sm",children:["Learn about ACGC",r.jsx(nt,{className:"h-4 w-4"})]})]})]})})})]})})}function mM(t){if(!t)return null;const e=t.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([^&?\s]+)/);return e?e[1]:null}function Bk({url:t,title:e}){const s=mM(t);if(!s)return null;const[n,a]=v.useState(!1),i=`https://img.youtube.com/vi/${s}/hqdefault.jpg`;return n?r.jsx("div",{className:"relative w-full aspect-video rounded-xl overflow-hidden bg-black",children:r.jsx("iframe",{src:`https://www.youtube.com/embed/${s}?autoplay=1&rel=0`,title:e||"YouTube video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"absolute inset-0 w-full h-full"})}):r.jsxs("button",{onClick:()=>a(!0),className:"relative w-full aspect-video rounded-xl overflow-hidden group cursor-pointer bg-black",children:[r.jsx("img",{src:i,alt:e||"Video thumbnail",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",onError:o=>{o.currentTarget.style.display="none"}}),r.jsx("div",{className:"absolute inset-0 bg-black/30 group-hover:bg-black/20 transition"}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("div",{className:"h-14 w-14 rounded-full bg-white/90 flex items-center justify-center shadow-lg group-hover:scale-110 transition-transform",children:r.jsx(wn,{className:"h-6 w-6 text-[#1f0f3f] ml-0.5",fill:"#1f0f3f"})})}),e&&r.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-3 bg-gradient-to-t from-black/70 to-transparent",children:r.jsx("span",{className:"text-sm font-medium text-white",children:e})})]})}function UH({isOpen:t,onClose:e}){const[s,n]=v.useState({fullName:"",organisation:"",workEmail:"",organisationType:"",areaOfInterest:""}),[a,i]=v.useState(!1),[o,l]=v.useState(!1),[c,d]=v.useState(""),u=async m=>{m.preventDefault(),d(""),i(!0);try{await U("/api/newsletter/partnership-enquiry",{method:"POST",body:s}),l(!0)}catch(f){d(f.message||"Something went wrong. Please try again.")}finally{i(!1)}},h="w-full h-11 rounded-xl border border-slate-200 bg-white px-4 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition";return t?r.jsx(ir,{children:r.jsx(V.div,{initial:{opacity:0}
725,animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",onClick:m=>{m.target===m.currentTarget&&e()},children:r.jsxs(V.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},className:"bg-white rounded-2xl shadow-2xl w-full max-w-lg max-h-[90vh] overflow-y-auto",children:[r.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-slate-100",children:[r.jsxs("div",{children:[r.jsx("h3",{className:"text-lg font-bold text-[#1f0f3f]",children:"Request the 2026 Partnership Prospectus"}),r.jsx("p",{className:"text-sm text-slate-500 mt-1",children:"Complete the short form below and our team will share the current prospectus with you."})]}),r.jsx("button",{onClick:e,className:"h-8 w-8 rounded-lg flex items-center justify-center hover:bg-slate-100 transition shrink-0",children:r.jsx(He,{className:"h-4 w-4 text-slate-400"})})]}),o?r.jsxs("div",{className:"p-8 text-center",children:[r.jsx("div",{className:"h-12 w-12 rounded-full bg-emerald-100 flex items-center justify-center mx-auto mb-4",children:r.jsx(ia,{className:"h-5 w-5 text-emerald-600"})}),r.jsx("div",{className:"text-lg font-semibold text-slate-900",children:"Request Sent"}),r.jsx("p",{className:"text-sm text-slate-500 mt-2",children:"Thank you for your interest. Our team will be in touch shortly with the 2026 Partnership Prospectus."}),r.jsx("button",{onClick:e,className:"mt-6 px-6 py-2.5 rounded-xl bg-[#1f0f3f] text-white text-sm font-medium hover:bg-[#1f0f3f]/90 transition",children:"Close"})]}):r.jsxs("form",{onSubmit:u,className:"p-6 space-y-4",children:[r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1.5",children:["Full Name ",r.jsx("span",{className:"text-red-400",children:"*"})]}),r.jsx("input",{type:"text",required:!0,placeholder:"Your full name",value:s.fullName,onChange:m=>n({...s,fullName:m.target.value}),className:h})]}),r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1.5",children:["Organisation ",r.jsx("span",{className:"text-red-400",children:"*"})]}),r.jsx("input",{type:"text",required:!0,placeholder:"Your organisation",value:s.organisation,onChange:m=>n({...s,organisation:m.target.value}),className:h})]}),r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1.5",children:["Work Email ",r.jsx("span",{className:"text-red-400",children:"*"})]}),r.jsx("input",{type:"email",required:!0,placeholder:"[email protected]",value:s.workEmail,onChange:m=>n({...s,workEmail:m.target.value}),className:h})]}),r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1.5",children:["Organisation Type ",r.jsx("span",{className:"text-red-400",children:"*"})]}),r.jsxs("select",{required:!0,value:s.organisationType,onChange:m=>n({...s,organisationType:m.target.value}),className:h,children:[r.jsx("option",{value:"",children:"Select type"}),r.jsx("option",{value:"Law Firm",children:"Law Firm"}),r.jsx("option",{value:"Corporate",children:"Corporate"}),r.jsx("option",{value:"Government / Public Institution",children:"Government / Public Institution"}),r.jsx("option",{value:"Professional Services",children:"Professional Services"}),r.jsx("option",{value:"Other",children:"Other"})]})]}),r.jsxs("div",{children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-700 mb-1.5",children:["Area of Interest ",r.jsx("span",{className:"text-slate-400 font-normal",children:"(optional)"})]}),r.jsxs("select",{value:s.areaOfInterest,onChange:m=>n({...s,areaOfInterest:m.target.value}),className:h,children:[r.jsx("option",{value:"",children:"Select area"}),r.jsx("option",{value:"Annual Conference",children:"Annual Conference"}),r.jsx("option",{value:"Year-Round Partnership",children:"Year-Round Partnership"}),r.jsx("option",{value:"Research / Thought Leadership",children:"Research / Thought Leadership"}),r.jsx("option",{value:"Multi-Programme Engagement",children:"Multi-Programme Engagement"}),r.jsx("option",{value:"Not Sure",children:"Not Sure"})]})]}),c&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-xl px-4 py-2",children:c}),r.jsx("div",{className:"pt-2",children:r.jsxs("button",{type:"submit",disabled:a,className:"w-full h-11 rounded-xl bg-[#c08a2f] hover:bg-[#a
72577324] text-white text-sm font-semibold transition shadow-sm disabled:opacity-60 flex items-center justify-center gap-2",children:[r.jsx(ia,{className:"h-4 w-4"})," ",a?"Sendingâ¦":"Submit Request"]})})]})]})})}):null}function HH(){var o,l;const[t,e]=v.useState(!1),[s,n]=v.useState([]),[a,i]=v.useState(0);return v.useEffect(()=>{U("/api/partner-videos").then(c=>n(c.videos||[])).catch(()=>{})},[]),r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"min-h-screen",children:[r.jsxs("section",{className:"relative bg-[#1f0f3f] text-white overflow-hidden",children:[r.jsx("div",{className:"absolute inset-0 bg-[url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMiIgY3k9IjIiIHI9IjEuNSIgZmlsbD0icmdiYSgyNTUsMjU1LDI1NSwwLjAzKSIvPjwvc3ZnPg==')] opacity-60"}),r.jsx("div",{className:"max-w-5xl mx-auto px-4 md:px-6 py-20 md:py-28 relative z-10 text-center",children:r.jsxs(V.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5},children:[r.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/10 border border-white/10 text-sm text-slate-300 mb-6",children:[r.jsx(bx,{className:"h-4 w-4"}),"Partnering with ACGC"]}),r.jsx("h1",{className:"text-4xl md:text-5xl font-bold tracking-tight",children:"Partnering With Us"}),r.jsx("p",{className:"mt-4 text-lg text-slate-300 max-w-2xl mx-auto",children:"Sponsorship and partnership opportunities across ACGC's conference, programmes and year-round initiatives."})]})})]}),r.jsx("section",{className:"py-16 md:py-20",children:r.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-6",children:r.jsxs(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-slate-900",children:"Conference Sponsorship Options"}),r.jsxs("div",{className:"mt-6 space-y-4 text-slate-600 leading-relaxed",children:[r.jsxs("p",{children:["Every year, ACGC hosts a dynamic 3-day ",r.jsx("strong",{className:"text-slate-900",children:"Leadership Conference & In-House Legal Skills Institute"}),", bringing together members and partners from across the continent and beyond. This flagship event is dedicated to empowering, championing, and elevating the African in-house legal community on the global stage."]}),r.jsx("p",{children:"The conference agenda is carefully curated to include leadership development sessions, engaging roundtable dialogues on key issues, and specialised technical skills training. While our primary focus is on the in-house legal community, we greatly value the participation of law firms and other key stakeholders. Law firms are invited to join us as event sponsors, contributing meaningfully to shaping the conversations and outcomes that define the event."})]})]})})}),s.length>1&&r.jsx("section",{className:"bg-[#1f0f3f] py-16 md:py-20",children:r.jsxs("div",{className:"max-w-5xl mx-auto px-4 md:px-6",children:[r.jsxs(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},className:"text-center mb-10",children:[r.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/10 text-sm font-medium text-[#e6c784] mb-3",children:[r.jsx(wn,{className:"h-4 w-4"}),"Conference Highlights"]}),r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-white",children:"See What Our Conferences Look Like"}),r.jsx("p",{className:"mt-2 text-slate-300 max-w-2xl mx-auto",children:"Get a visual sense of the energy, engagement, and quality of ACGC's flagship events."})]}),r.jsx(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4,delay:.1},className:"mb-6",children:r.jsx(Bk,{url:(o=s.slice(1)[a])==null?void 0:o.youtube_url,title:(l=s.slice(1)[a])==null?void 0:l.title})}),r.jsx("div",{className:"grid grid-cols-3 gap-3",children:s.slice(1).map((c,d)=>{const u=mM(c.youtube_url);return u?r.jsxs("button",{onClick:()=>i(d),className:`relative aspect-video rounded-lg overflow-hidden group cursor-pointer transition-all ${a===d?"ring-2 ring-[#c08a2f] opacity-100":"opacity-60 hover:opacity-90"}`,children:[r.jsx("img",{src:`https://img.youtube.com/vi/${u}/hqdefault.jpg`,alt:c.title||"",className:"w-full h-full object-cover",onError:h=>{h.currentTarget.style.display="none"}}),r.jsx("div",{className:`absolute inset-0 ${a===d?"bg-black/10":"bg-black/30"} transition`}),a===d&&r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("div",{className:"h-8 w-8 rounded-full bg-[#c08a2f] flex items-center justify-center",children:r.jsx(wn,{className:"h-3.5 w-3.5 text-white ml-0.5",fill:"white"})})}),c.title&&r.jsx("div",{className:"absolute bottom-0 left-0 right-0 p-2 bg-gradient-to-t from-black/70 to-transparent",children:r.jsx("span",{className:"text-xs font-medium text-white line-clamp-1",children:c.title})})]},c.id):null})})]})}),s.length>=1&&r.jsx("section",{className:"bg-[#1f0f3f] py-10 md:py-14",children:r.jsx("div",{className:"max-w-2xl mx-auto px-4 md:px-6",children:r.jsx(Bk,{url:s[0].youtube_url,title:""})})}),r.jsx("section",{className:"bg-slate-50/70 py-16 md:py-20",children:r.jsx("div",{className:"max-w-4xl mx-auto px-4 md:px-6",children:r.jsxs(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-slate-900",children:"Strategic Partnerships with ACGC"}),r.jsxs("div",{className:"mt-6 space-y-4 text-slate-600 leading-relaxed",children:[r.jsx("p",{children:"ACGC offers a curated range of partnership and sponsorship opportunities across our annual conference, roundtables, research initiatives and year-round programmes. Partnerships are structured, selective and aligned to long-term engagement within Africa's leading in-house legal community."}),r.jsx("p",{children:"Each year we release a detailed Partnership & Sponsorship Prospectus outlining conference opportunities, programme integration, research collaboration and brand visibility options across the ACGC platform."}),r.jsx("p",{children:"Because opportunities are limited and sector exclusivity may apply in certain categories, we invite prospective partners to request the current package directly."}),r.jsx("p",{className:"font-medium text-slate-800",children:"Contact us to receive the 2026 ACGC Partnership Prospectus."})]}),r.jsx("div",{className:"mt-8",children:r.jsxs("button",{onClick:()=>e(!0),className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-xl bg-[#c08a2f] hover:bg-[#a
72577324] text-white font-semibold transition text-sm shadow-sm",children:[r.jsx(Ft,{className:"h-4 w-4"}),"Request the 2026 Partnership Prospectus"]})})]})})}),r.jsx("section",{className:"bg-[#1f0f3f] text-white py-16 md:py-20",children:r.jsx("div",{className:"max-w-3xl mx-auto px-4 md:px-6 text-center",children:r.jsxs(V.div,{initial:{opacity:0,y:15},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.4},children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-bold",children:"Become a Partner or Sponsor"}),r.jsx("p",{className:"mt-4 text-slate-300 max-w-xl mx-auto",children:"For more details about our current sponsorship opportunities and how your firm can be part of this transformative experience, please get in touch."}),r.jsx("div",{className:"mt-8 flex justify-center",children:r.jsxs(K,{to:"/",className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-xl border border-white/20 hover:bg-white/5 text-white font-semibold transition text-sm",children:["Learn about ACGC",r.jsx(nt,{className:"h-4 w-4"})]})})]})})})]}),r.jsx(UH,{isOpen:t,onClose:()=>e(!1)})]})}function WH(t){return t?/youtu\.be|youtube\.com/.test(t):!1}function GH(t){const e=t.match(/youtu\.be\/([a-zA-Z0-9_-]{11})/)||t.match(/[?&]v=([a-zA-Z0-9_-]{11})/)||t.match(/youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/);return e?`https://www.youtube.com/embed/${e[1]}?autoplay=1`:null}function YH({resource:t,onClose:e}){if(!t)return null;v.useEffect(()=>(document.body.style.overflow="hidden",()=>{document.body.style.overflow="unset"}),[]);const{title:s,url:n,type:a}=t,i=()=>{if(!n)return r.jsx("div",{className:"flex flex-col items-center justify-center h-full text-slate-400",children:r.jsx("p",{children:"No media URL provided for this resource."})});if(a==="audio")return r.jsx("div",{className:"flex flex-col items-center justify-center h-full px-6",children:r.jsxs("div",{className:"w-full max-w-md bg-slate-800 p-8 rounded-3xl shadow-2xl flex flex-col items-center",children:[r.jsx("div",{className:"w-24 h-24 bg-[#c08a2f]/20 rounded-full flex items-center justify-center mb-6",children:r.jsx("div",{className:"w-16 h-16 bg-[#c08a2f] rounded-full animate-pulse"})}),r.jsx("h3",{className:"text-white text-xl font-bold mb-8 text-center",children:s}),r.jsx("audio",{controls:!0,autoPlay:!0,className:"w-full outline-none",src:n,children:r.jsx("track",{kind:"captions"})})]})});if(a==="video")return WH(n)?r.jsx("iframe",{title:s,src:GH(n),className:"w-full h-full border-0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0}):r.jsxs("video",{controls:!0,autoPlay:!0,className:"w-full h-full object-contain bg-black",children:[r.jsx("source",{src:n}),"Your browser does not support the video tag."]});if(a==="document"){if(/\.pdf(\?|$)/i.test(n))return r.jsx("object",{data:n,type:"application/pdf",className:"w-full h-full bg-slate-100",children:r.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[r.jsx("p",{className:"mb-4 text-slate-400",children:"Unable to display PDF directly."}),r.jsx("a",{href:n,target:"_blank",rel:"noreferrer",className:"px-4 py-2 bg-[#c08a2f] text-white rounded-lg hover:bg-[#a77324] transition-colors",children:"Download PDF"})]})});const l=`https://docs.google.com/gview?url=${encodeURIComponent(n)}&embedded=true`;return r.jsx("iframe",{title:s,src:l,className:"w-full h-full border-0 bg-white"})}return r.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-slate-400",children:[r.jsx("p",{children:"Preview not available for this file type."}),r.jsxs("a",{href:n,target:"_blank",rel:"noreferrer",className:"mt-4 px-4 py-2 bg-[#c08a2f] text-white rounded-lg hover:bg-[#a77324] transition-colors inline-flex items-center gap-2",children:[r.jsx(Ys,{className:"w-4 h-4"})," Download File"]})]})};return r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/90 backdrop-blur-sm p-4 md:p-8 animate-in fade-in duration-200",children:r.jsxs("div",{className:"w-full h-full max-w-6xl mx-auto flex flex-col bg-[#111] rounded-2xl overflow-hidden shadow-2xl ring-1 ring-white/10 relative",children:[r.jsxs("div",{className:"h-16 shrink-0 bg-slate-900 flex items-center justify-between px-6 border-b border-slate-800",children:[r.jsx("div",{className:"flex-1 min-w-0 pr-4",children:r.jsx("h2",{className:"text-white font-semibold truncate",children:s})}),r.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[r.jsx("a",{href:n,target:"_blank",rel:"noreferrer",className:"p-2 text-slate-400 hover:text-white hover:bg-slate-800 rounded-lg transition-colors",title:"Open in new tab / Download",children:r.jsx(ur,{className:"w-5 h-5"})}),r.jsx("button",{onClick:e,className:"p-2 text-slate-400 hover:text-white hover:bg-slate-800 rounded-lg transition-colors",title:"Close",children:r.jsx(He,{className:"w-5 h-5"})})]})]}),r.jsx("div",{className:"flex-1 min-h-0 relative",children:i()})]})})}const qH=[/youtu\.be\/([a-zA-Z0-9_-]{11})/,/[?&]v=([a-zA-Z0-9_-]{11})/,/youtube\.com\/embed\/([a-zA-Z0-9_-]{11})/];function KH(t){if(!t)return null;for(const e of qH){const s=e.exec(String(t));if(s)return s[1]}return null}function JH(t){const e=KH(t);return e?`https://img.youtube.com/vi/${e}/maxresdefault.jpg`:null}function Vk(t){return t.kind==="audio"?!0:/\.(mp3|m4a|wav)(\?|$)/i.test(t.url||"")}
725function jl({tag:t,title:e,subtitle:s}){return r.jsxs("div",{className:"mb-10",children:[r.jsx("span",{className:"inline-block text-[11px] font-black text-[#c08a2f] uppercase tracking-[0.22em] mb-2",children:t}),r.jsx("h2",{className:"text-3xl font-extrabold text-slate-900 tracking-tight leading-tight",children:e}),s&&r.jsx("p",{className:"text-slate-500 mt-2 text-base leading-relaxed max-w-2xl",children:s})]})}function QH({rec:t,onPlay:e}){const s=t.youtube_url||t.youtubeUrl||t.url,n=t.thumbnail?rw(t.thumbnail):JH(s);return r.jsxs("button",{onClick:e,className:"group relative rounded-2xl overflow-hidden bg-slate-900 shadow-md hover:shadow-2xl hover:-translate-y-1.5 transition-all duration-300 text-left w-full focus:outline-none focus:ring-2 focus:ring-[#c08a2f] focus:ring-offset-2",children:[r.jsxs("div",{className:"aspect-video relative overflow-hidden",children:[n?r.jsx("img",{src:n,alt:t.title,className:"absolute inset-0 w-full h-full object-cover transition-transform duration-500 group-hover:scale-105"}):r.jsx("div",{className:"absolute inset-0 bg-gradient-to-br from-[#1f0f3f] to-[#3a1d75]"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/70 via-black/10 to-transparent"}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("div",{className:"w-14 h-14 rounded-full bg-white/20 backdrop-blur-sm border border-white/40 flex items-center justify-center group-hover:bg-[#c08a2f] group-hover:border-[#c08a2f] transition-all duration-300 shadow-xl",children:r.jsx(wn,{className:"h-6 w-6 text-white ml-0.5",fill:"white"})})})]}),r.jsx("div",{className:"px-4 py-3 bg-white border-t border-slate-100",children:r.jsx("p",{className:"font-semibold text-slate-900 text-sm leading-snug group-hover:text-[#1f0f3f] transition-colors line-clamp-2",children:t.title})})]})}function XH({rec:t,onPlay:e}){return r.jsxs("button",{onClick:e,className:"group flex items-center gap-5 p-5 bg-white rounded-2xl border border-slate-200 shadow-sm hover:shadow-md hover:border-[#c08a2f]/50 transition-all text-left w-full focus:outline-none focus:ring-2 focus:ring-[#c08a2f]",children:[r.jsx("div",{className:"h-14 w-14 shrink-0 rounded-2xl bg-[#c08a2f]/10 flex items-center justify-center group-hover:bg-[#c08a2f] transition-colors",children:r.jsx(T7,{className:"h-6 w-6 text-[#c08a2f] group-hover:text-white transition-colors"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-slate-900 text-sm leading-snug",children:t.title}),r.jsx("p",{className:"text-xs text-slate-400 mt-1 font-medium",children:"Audio Recording"})]}),r.jsx("div",{className:"h-9 w-9 shrink-0 rounded-full bg-slate-100 flex items-center justify-center group-hover:bg-[#c08a2f] transition-colors",children:r.jsx(wn,{className:"h-4 w-4 text-slate-500 group-hover:text-white ml-0.5 transition-colors"})})]})}function ZH({doc:t,onOpen:e}){var a,i;const s=((i=(a=(t.url||"").match(/\.([a-z]+)(\?|$)/i))==null?void 0:a[1])==null?void 0:i.toUpperCase())||"FILE",n=s==="PDF";return r.jsxs("button",{onClick:e,className:"group flex items-start gap-4 p-5 bg-white rounded-2xl border border-slate-200 shadow-sm hover:shadow-lg hover:border-[#1f0f3f]/20 hover:-translate-y-0.5 transition-all text-left w-full focus:outline-none focus:ring-2 focus:ring-[#1f0f3f]",children:[r.jsx("div",{className:"h-11 w-11 shrink-0 rounded-xl bg-[#1f0f3f]/5 flex items-center justify-center mt-0.5 group-hover:bg-[#1f0f3f] transition-colors",children:n?r.jsx(es,{className:"h-5 w-5 text-[#1f0f3f] group-hover:text-white transition-colors"}):r.jsx(On,{className:"h-5 w-5 text-[#1f0f3f] group-hover:text-white transition-colors"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("p",{className:"font-semibold text-slate-800 text-sm leading-snug group-hover:text-[#1f0f3f] transition-colors line-clamp-3",children:t.title}),r.jsx("p",{className:"text-[11px] font-bold text-slate-400 mt-2 uppercase tracking-wider",children:s})]})]})}function e9({doc:t,number:e,onOpen:s}){const n=t.title.replace(/^Document\s*\d+[:\-â\s]*/i,"").trim();return r.jsxs("button",{onClick:s,className:"group flex flex-col p-5 bg-white rounded-2xl border border-slate-200 shadow-sm hover:shadow-lg hover:border-[#c08a2f]/40 transition-all text-left w-full focus:outline-none focus:ring-2 focus:ring-[#c08a2f]",children:[r.jsxs("span",{className:"text-[11px] font-black text-[#c08a2f] uppercase tracking-widest mb-3",children:["Doc ",String(e).padStart(2,"0")]}),r.jsx("p",{className:"font-semibold text-slate-800 text-sm leading-snug group-hover:text-[#1f0f3f] transition-colors flex-1 line-clamp-4",children:n}),r.jsxs("div",{className:"mt-4 flex items-center gap-2",children:[r.jsx("div",{className:"h-7 w-7 rounded-lg bg-slate-100 flex items-center justify-center group-hover:bg-[#c08a2f] transition-colors",children:r.jsx(es,{className:"h-3.5 w-3.5 text-slate-400 group-hover:text-white transition-colors"})}),r.jsx("span",{className:"text-xs text-slate-400 group-hover:text-[#c08a2f] transition-colors font-medium",children:"View PDF"})]})]})}function t9({url:t}){return r.jsxs("div",{className:"rounded-3xl overflow-hidden relative bg-[#1f0f3f]",children:[r.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[r.jsx("div",{className:"absolute -top-32 -right-32 w-[500px] h-[500px] bg-[#c08a2f]/15 rounded-full blur-[100px]"}),r.jsx("div",{className:"absolute -bottom-20 -left-20 w-[300px] h-[300px] bg-[#25D366]/10 rounded-full blur-[80px]"})]}),r.jsxs("div",{className:"relative z-10 px-8 py-14 md:px-16 md:py-16 flex flex-col md:flex-row items-center gap-10",children:[r.jsx("div",{className:"shrink-0 h-20 w-20 rounded-2xl bg-[#25D366]/20 border border-[#25D366]/30 flex items-center justify-center",children:r.jsx(my,{
725className:"h-10 w-10 text-[#25D366]",fill:"currentColor"})}),r.jsxs("div",{className:"flex-1 text-center md:text-left",children:[r.jsx("h2",{className:"text-2xl md:text-3xl font-extrabold text-white tracking-tight mb-3",children:"Continue the Conversation"}),r.jsx("p",{className:"text-slate-300 leading-relaxed max-w-xl",children:"Join your fellow delegates in our private WhatsApp group for reflections, informal peer learning, and key announcements. This group is for course participants only."})]}),r.jsxs("a",{href:t,target:"_blank",rel:"noreferrer",className:"shrink-0 inline-flex items-center gap-3 px-8 py-4 bg-[#25D366] hover:bg-[#1da851] text-white font-bold rounded-xl transition-colors shadow-lg text-sm whitespace-nowrap",children:[r.jsx(my,{className:"h-5 w-5"}),"Join WhatsApp Group"]})]})]})}function s9({doc:t,onOpen:e}){const s=t.title.match(/^Group\s*\d+/i),n=(s==null?void 0:s[0])||"",a=t.title.replace(/^Group\s*\d+[:\-â\s]*/i,"").trim();return r.jsxs("button",{onClick:e,className:"group flex flex-col p-6 bg-white rounded-2xl border border-slate-200 shadow-sm hover:shadow-lg hover:border-[#1f0f3f]/30 hover:-translate-y-0.5 transition-all text-left w-full focus:outline-none focus:ring-2 focus:ring-[#1f0f3f]",children:[r.jsx("div",{className:"h-11 w-11 rounded-xl bg-[#1f0f3f] flex items-center justify-center mb-4",children:r.jsx(at,{className:"h-5 w-5 text-white"})}),n&&r.jsx("span",{className:"text-[11px] font-black text-[#c08a2f] uppercase tracking-widest mb-2",children:n}),r.jsx("p",{className:"font-semibold text-slate-800 text-sm leading-snug group-hover:text-[#1f0f3f] transition-colors flex-1",children:a}),r.jsxs("div",{className:"mt-5 flex items-center gap-2 text-xs text-slate-400 group-hover:text-[#1f0f3f] transition-colors font-medium",children:[r.jsx(Ys,{className:"h-3.5 w-3.5"}),"View submission"]})]})}function n9({person:t}){const e=(t.title||"").indexOf(","),s=e>-1?t.title.slice(0,e).trim():t.title,n=e>-1?t.title.slice(e+1).trim():"";return r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 overflow-hidden shadow-sm hover:shadow-xl hover:-translate-y-1 transition-all duration-300",children:[r.jsxs("div",{className:"h-52 bg-gradient-to-br from-[#1f0f3f] to-[#2d1b54] relative overflow-hidden",children:[t.photo?r.jsx("img",{src:rw(t.photo),alt:t.name,className:"absolute inset-0 w-full h-full object-cover object-top"}):r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx(Ls,{className:"h-16 w-16 text-white/20"})}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#1f0f3f]/50 to-transparent"})]}),r.jsxs("div",{className:"p-5",children:[r.jsx("h3",{className:"font-bold text-slate-900 text-base leading-tight mb-1",children:t.name}),r.jsx("p",{className:"text-[11px] font-black text-[#c08a2f] uppercase tracking-wide leading-relaxed",children:s}),n&&r.jsx("p",{className:"text-xs text-slate-500 mt-1 leading-snug",children:n}),t.bio&&r.jsx("p",{className:"text-xs text-slate-500 mt-3 leading-relaxed",children:t.bio})]})]})}function r9(){const{token:t,loading:e}=Oe(),{slug:s}=al(),[n,a]=v.useState(null),[i,o]=v.useState(!0),[l,c]=v.useState(""),[d,u]=v.useState(null);if(v.useEffect(()=>{if(e)return;(async()=>{var C,T;try{const A=await U(`/api/resource-hub/programs/${encodeURIComponent(s)}`,t?{token:t}:{});a(A.program)}catch(A){console.error(A);const E=(C=A==null?void 0:A.data)==null?void 0:C.details,L=(T=A==null?void 0:A.data)==null?void 0:T.hint;let D=A.message||"Something went wrong";E==="database_initializing"?D="The database is still starting. Please wait a moment and refresh the page.":E==="database_initialization_failed"&&(D=L?`Database connection failed: ${L}. Set DATABASE_URL in server/.env to a valid PostgreSQL URL, then restart the API.`:"Could not reach the database. Ensure PostgreSQL is running and DATABASE_URL is set on the server."),c(D)}finally{o(!1)}})()},[s,t,e]),e)return r.jsx("div",{className:"min-h-screen bg-white"});if(i)return r.jsx("div",{className:"min-h-screen bg-white flex items-center justify-center",children:r.jsx("div",{className:"h-8 w-8 border-2 border-[#c08a2f] border-t-transparent roun
725ded-full animate-spin"})});if(l||!n)return r.jsx("div",{className:"min-h-screen bg-slate-50 pt-32 pb-20 text-center px-4",children:r.jsxs("div",{className:"max-w-md mx-auto bg-white p-10 rounded-3xl border border-slate-200 shadow-sm",children:[r.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-4",children:"Program Not Found"}),r.jsx("p",{className:"text-slate-500 leading-relaxed mb-8",children:l||"This resource hub does not exist or has been removed."}),r.jsxs(K,{to:"/resource-hub",className:"inline-flex items-center gap-2 px-6 py-3 bg-[#1f0f3f] text-white rounded-xl hover:bg-[#2d1b54] transition-colors font-semibold",children:[r.jsx(vn,{className:"h-4 w-4"})," Return to Hub"]})]})});const h=n.sessions||[],m=n.slides||[],f=n.supporting_documents||[],p=n.faculty||[],g=n.group_submissions||[],x=n.whatsapp_url,b=h.filter(k=>!Vk(k)),y=h.filter(k=>Vk(k)),w={};for(const k of m){const C=k.session||"General";w[C]||(w[C]=[]),w[C].push(k)}const N=Object.keys(w),j=(k,C,T)=>{C&&u({title:k,url:rw(C),type:T})},S=b.length===0&&y.length===0&&m.length===0&&f.length===0&&p.length===0;return r.jsxs("div",{className:"min-h-screen bg-white",children:[r.jsxs("div",{className:"bg-[#1f0f3f] pt-28 pb-24 px-6 relative overflow-hidden",children:[r.jsxs("div",{className:"absolute inset-0 pointer-events-none",children:[r.jsx("div",{className:"absolute top-0 right-0 w-[700px] h-[700px] bg-[#c08a2f]/10 rounded-full blur-[130px] translate-x-1/3 -translate-y-1/3"}),r.jsx("div",{className:"absolute bottom-0 left-0 w-[500px] h-[500px] bg-[#3a1d75]/50 rounded-full blur-[100px] -translate-x-1/3 translate-y-1/3"}),r.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[3px] bg-gradient-to-r from-transparent via-[#c08a2f] to-transparent opacity-60"})]}),r.jsxs(V.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,ease:"easeOut"},className:"max-w-5xl mx-auto relative z-10",children:[r.jsxs(K,{to:"/resource-hub",className:"inline-flex items-center gap-2 text-[#c08a2f] text-xs font-black uppercase tracking-[0.2em] mb-10 hover:opacity-75 transition group",children:[r.jsx(vn,{className:"h-3.5 w-3.5 group-hover:-translate-x-0.5 transition-transform"}),"Resource Hub"]}),r.jsxs("div",{className:"flex flex-wrap gap-2 mb-6",children:[(n.year||n.quarter)&&r.jsx("span",{className:"px-3 py-1 rounded-full bg-[#c08a2f]/20 border border-[#c08a2f]/40 text-[#c08a2f] text-xs font-bold uppercase tracking-wider",children:[n.year,n.quarter].filter(Boolean).join(" · ")}),r.jsx("span",{className:"px-3 py-1 rounded-full bg-white/10 border border-white/15 text-white/60 text-xs font-medium",children:"Member Programme"})]}),r.jsx("h1",{className:"text-4xl md:text-5xl lg:text-6xl font-extrabold text-white leading-tight mb-6 tracking-tight",children:n.title}),r.jsx("p",{className:"text-slate-300 text-lg max-w-3xl leading-relaxed mb-10",children:n.description}),r.jsxs("div",{className:"flex flex-wrap gap-x-8 gap-y-3 pt-2 border-t border-white/10",children:[b.length>0&&r.jsxs("span",{className:"flex items-center gap-2 text-white/65 text-sm font-medium",children:[r.jsx(wn,{className:"h-4 w-4 text-[#c08a2f]"}),b.length," Session",b.length!==1?"s":""]}),m.length>0&&r.jsxs("span",{className:"flex items-center gap-2 text-white/65 text-sm font-medium",children:[r.jsx(es,{className:"h-4 w-4 text-[#c08a2f]"}),m.length," Course Materials"]}),p.length>0&&r.jsxs("span",{className:"flex items-center gap-2 text-white/65 text-sm font-medium",children:[r.jsx(at,{className:"h-4 w-4 text-[#c08a2f]"}),p.length," Faculty"]}),f.length>0&&r.jsxs("span",{className:"flex items-center gap-2 text-white/65 text-sm font-medium",children:[r.jsx(Df,{className:"h-4 w-4 text-[#c08a2f]"}),"Virtual Lab Pack"]})]})]})]}),r.jsxs("div",{className:"max-w-6xl mx-auto px-6 py-20 space-y-24",children:[b.length>0&&r.jsxs(wr,{as:"section",id:"sessions",children:[r.jsx(jl,{tag:"Sessions",title:"Session Recordings",subtitle:"Watch the full module recordings. Click any card to play in-page â no redirects."}),r.jsx(by,{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:b.map(k=>r.jsx(QH,{rec:k,onPlay:()=>j(k.title,k.youtube_url||k.youtubeUrl||k.url,"video")},k.title))})]}),y.length>0&&r.jsxs(wr,{as:"section",id:"audio",children:[r.jsx(jl,{tag:"Audio",title:"Audio Resources",subtitle:"Curated audio sessions and podcast recordings."}),r.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:y.map(k=>r.jsx(XH,{rec:k,onPlay:()=>j(k.title,k.url,"audio")},k.title))})]}),m.length>0&&r.jsxs(wr,{as:"section",id:"materials",children:[r.jsx(jl,{tag:"Materials",title:"Course Materials",subtitle:"Presentation slides and session handouts. Click any card to view in-page."}),r.jsx("div",{className:"space-y-10",children:N.map(k=>r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center gap-4 mb-5",children:[r.jsx("span",{className:"px-4 py-1.5 rounded-lg bg-[#1f0f3f] text-white text-xs font-bold uppercase tracking-widest shrink-0",children:k}),r.jsx("span",{className:"flex-1 h-px bg-slate-100"})]}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:w[k].map(C=>r.jsx(ZH,{doc:C,onOpen:()=>j(C.title,C.url,"document")},C.title))})]},k))})]}),f.length>0&&r.jsxs(wr,{as:"section",id:"supporting",children:[r.jsx(jl,{tag:"Case Study Pack",title:"Supporting Documents",subtitle:"Virtual Lab reference materials â Whistleblower Allegation & Procurement Irregularities case pack."}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:f.map((k,C)=>r.jsx(e9,{doc:k,number:C+1,onOpen:()=>j(k.title,k.url,"document")},k.title))})]}),x&&r.jsx(wr,{as:"section",id:"community",children:r.jsx(t9,{url:x})}),g.length>0&&r.jsxs(wr,{as:"section",id:"groups",children:[r.jsx(jl,{tag:"Group Work",title:"Group Submissions",subtitle:"Virtual Lab outputs from programme cohort groups."}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-
7255",children:g.map(k=>r.jsx(s9,{doc:k,onOpen:()=>j(k.title,k.url,"document")},k.title))})]}),p.length>0&&r.jsxs(wr,{as:"section",id:"faculty",children:[r.jsx(jl,{tag:"Faculty",title:"Meet Our Faculty",subtitle:"Expert practitioners who designed and led this programme."}),r.jsx(by,{className:"grid sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:p.map(k=>r.jsx(n9,{person:k},k.name))})]}),S&&r.jsxs("div",{className:"py-28 text-center",children:[r.jsx("div",{className:"h-24 w-24 rounded-full bg-slate-50 border border-slate-100 flex items-center justify-center mx-auto mb-6",children:r.jsx(es,{className:"h-10 w-10 text-slate-300"})}),r.jsx("h2",{className:"text-2xl font-bold text-slate-900 mb-3",children:"Content Being Curated"}),r.jsx("p",{className:"text-slate-500 max-w-md mx-auto leading-relaxed",children:"We are preparing the recordings and materials for this programme. Please check back shortly."})]})]}),d&&r.jsx(YH,{resource:d,onClose:()=>u(null)})]})}const a9=new Set(["acep-2025"]),i9=[{id:"acep-2025",title:"ACEP 2025: Compliance Essentials",description:"This programme aims to equip in-house counsel with foundational and advanced compliance knowledge, distinguishing the role of compliance from legal advisory functions.",category:"Hub",image:"/images/programmes/acep.png",status:"ACTIVE",featured:!0,sections:5,members:"2025 Intake",link:"/hub/acep-2025",color:"border-[#c08a2f]"}];function o9({prog:t,index:e}){const s=t.status==="FREE";return r.jsxs(V.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:e*.1},className:"group relative bg-[#0f172a] rounded-[2.5rem] overflow-hidden border border-slate-800 hover:border-[#c08a2f]/50 transition-all duration-500 shadow-2xl flex flex-col",children:[r.jsxs("div",{className:"relative h-64 overflow-hidden",children:[r.jsx("img",{src:t.image,alt:t.title,className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-110"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#0f172a] via-transparent to-transparent opacity-60"}),r.jsx("div",{className:"absolute top-6 left-6 flex gap-2"}),t.featured&&r.jsx("div",{className:"absolute top-6 right-6",children:r.jsxs("span",{className:"px-3 py-1 rounded-full bg-[#c08a2f]/20 text-[#c08a2f] border border-[#c08a2f]/30 text-[10px] font-bold tracking-wider backdrop-blur-md flex items-center gap-1 shadow-lg",children:[r.jsx(An,{className:"h-3 w-3 fill-[#c08a2f]"})," FEATURED"]})}),r.jsx("div",{className:"absolute bottom-4 left-6",children:r.jsx("span",{className:"px-3 py-1 rounded-lg bg-[#c08a2f] text-[#1f0f3f] text-[10px] font-extrabold uppercase tracking-widest shadow-xl",children:t.category})})]}),r.jsxs("div",{className:"p-8 flex-1 flex flex-col",children:[r.jsx("h3",{className:"text-xl font-bold text-white group-hover:text-[#c08a2f] transition-colors duration-300 leading-tight",children:t.title}),r.jsx("p",{className:"mt-4 text-slate-400 text-sm leading-relaxed line-clamp-3",children:t.description}),r.jsxs("div",{className:"mt-6 pt-6 border-t border-slate-800 flex items-center gap-6",children:[r.jsxs("div",{className:"flex items-center gap-2 text-slate-500",children:[r.jsx(On,{className:"h-4 w-4"}),r.jsxs("span",{className:"text-xs font-medium",children:[t.sections," Sections"]})]}),r.jsxs("div",{className:"flex items-center gap-2 text-slate-500",children:[r.jsx(at,{className:"h-4 w-4"}),r.jsx("span",{className:"text-xs font-medium",children:t.members})]})]}),r.jsxs("div",{className:"mt-8 flex items-center justify-between",children:[r.jsx("span",{className:`text-lg font-bold ${s?"text-green-400":"text-white"}`,children:s?"Free":"Access Hub"}),r.jsx(K,{to:t.link,className:"h-10 w-10 rounded-full bg-slate-800 border border-slate-700 flex items-center justify-center text-white group-hover:bg-[#c08a2f] group-hover:border-[#c08a2f] group-hover:text-[#1f0f3f] transition-all duration-300 shadow-inner",children:r.jsx(nt,{className:"h-5 w-5"})})]})]})]})}function l9(){const[t,e]=v.useState([]),[s,n]=v.useState(!0);v.useEffect(()=>{U("/api/resource-hub/programs").then(i=>e(i.programs||[])).catch(console.error).finally(()=>n(!1))},[]);const a=[...i9,...t.filter(i=>!a9.has(i.slug)).map(i=>{var o,l;return{id:i.id,title:`${i.title} Resource Hub`,description:i.description||`Access session recordings, course materials, and engagement resources for ${i.title}.`,category:"Hub",image:"/images/programmes/acep.png",status:i.is_active?"ACTIVE":"DRAFT",featured:!0,sections:(((o=i.sessions)==null?void 0:o.length)||0)+(((l=i.slides)==null?void 0:l.length)||0),members:"N/A",link:`/hub/${i.slug}`,color:"border-[#1f0f3f]"}})];return r.jsxs("div",{className:"min-h-screen bg-white",children:[r.jsxs("div",{className:"relative pt-24 pb-20 px-4 overflow-hidden",children:[r.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-[#f8fafc] -z-10"}),r.jsx("div",{className:"absolute top-0 right-0 w-[600px] h-[600px] bg-[#c08a2f]/5 rounded-full blur-[120px] -z-10 translate-x-1/2 -translate-y-1/2"}),r.jsx("div",{className:"absolute bottom-0 left-0 w-[400px] h-[400px] bg-[#1f0f3f]/5 rounded-full blur-[100px] -z-10 -translate-x-1/2 translate-y-1/2"}),r.jsx(V.div,{initial:{opacity:0,y:16}
725,animate:{opacity:1,y:0},transition:{duration:.5,ease:"easeOut"},className:"max-w-6xl mx-auto",children:r.jsx(_r,{eyebrow:"ACGC PROGRAMMES",title:"Access Our Online Resource Hubs",subtitle:"Curated learning experiences and specialized engagement programmes designed for African corporate counsel.",align:"center"})})]}),r.jsxs("div",{className:"max-w-7xl mx-auto px-4 md:px-6 pb-32",children:[s?r.jsx("div",{className:"flex justify-center py-20",children:r.jsx("div",{className:"h-8 w-8 border-2 border-[#c08a2f] border-t-transparent rounded-full animate-spin"})}):r.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-2 xl:grid-cols-2 gap-8 lg:gap-12",children:a.map((i,o)=>r.jsx(o9,{prog:i,index:o},i.id))}),r.jsx("div",{className:"mt-16 text-center",children:r.jsx("p",{className:"text-slate-400 text-sm font-medium italic",children:"More programmes and learning paths coming soon."})})]})]})}function c9(){var j,S;const{token:t,member:e,refresh:s}=Oe(),n=v.useRef(null),[a,i]=v.useState(!1),[o,l]=v.useState(!1),[c,d]=v.useState(!1),[u,h]=v.useState(""),[m,f]=v.useState(""),[p,g]=v.useState({});if(v.useEffect(()=>{e&&g({first_name:e.first_name||"",last_name:e.last_name||"",job_title:e.job_title||"",country:e.country||"",sector_type:e.sector_type||"",industry:e.industry||"",linkedin_url:e.linkedin_url||"",twitter_url:e.twitter_url||"",instagram_url:e.instagram_url||"",bio:e.bio||"",phone:e.phone||"",privacy_show_email:!!e.privacy_show_email,privacy_show_phone:!!e.privacy_show_phone,privacy_show_linkedin:e.privacy_show_linkedin!==!1,privacy_allow_messages:e.privacy_allow_messages!==!1})},[e]),!e)return r.jsx(Mn,{to:"/login",replace:!0});const x=(k,C)=>g(T=>({...T,[k]:C})),b=e!=null&&e.avatar_url?tt(e.avatar_url):null,y=async k=>{var T;const C=(T=k.target.files)==null?void 0:T[0];if(C){i(!0),f("");try{const A=new FormData;A.append("avatar",C);const E=await fetch(tt("/api/me/avatar"),{method:"POST",headers:{Authorization:`Bearer ${t}`},body:A}),L=await E.json();if(!E.ok)throw new Error(L.error||"Upload failed");h("Photo updated!"),await s()}catch(A){f(A.message||"Upload failed")}finally{i(!1)}}},w=async()=>{d(!0),f(""),h("");try{await U("/api/me/profile",{token:t,method:"PUT",body:p}),h("Profile saved!"),l(!1),await s()}catch(k){f(k.message||"Save failed")}finally{d(!1)}},N=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor";return r.jsx("div",{className:"bg-slate-50 min-h-screen",children:r.jsxs("div",{className:"max-w-3xl mx-auto px-4 md:px-6 py-10 space-y-5",children:[u&&r.jsx("div",{className:"text-sm text-green-700 bg-green-50 border border-green-200 rounded-xl px-4 py-2",children:u}),m&&r.jsx("div",{className:"text-sm text-red-700 bg-red-50 border border-red-200 rounded-xl px-4 py-2",children:m}),r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm p-6",children:[r.jsxs("div",{className:"flex flex-col items-center text-center sm:flex-row sm:text-left sm:items-start gap-5",children:[r.jsxs("div",{className:"relative group shrink-0",children:[r.jsx("div",{className:"h-28 w-28 rounded-full border-4 border-slate-200 overflow-hidden bg-slate-100 grid place-items-center shadow-md",children:b?r.jsx("img",{src:b,alt:"Avatar",className:"h-full w-full object-cover",onError:k=>{k.currentTarget.style.display="none"}}):r.jsx(Ls,{className:"h-12 w-12 text-slate-400"})}),r.jsx("button",{onClick:()=>{var k;return(k=n.current)==null?void 0:k.click()},disabled:a,className:"absolute inset-0 rounded-full bg-black/40 opacity-0 group-hover:opacity-100 transition grid place-items-center cursor-pointer",children:r.jsx(xx,{className:"h-5 w-5 text-white"})}),r.jsx("input",{ref:n,type:"file",accept:"image/*",className:"hidden",onChange:y}),a&&r.jsx("div",{className:"absolute inset-0 rounded-full bg-black/50 grid place-items-center",children:r.jsx("div",{className:"h-5 w-5 border-2 border-white border-t-transparent rounded-full animate-spin"})})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("h1",{className:"text-brand-900 font-bold text-2xl",children:[e==null?void 0:e.first_name," ",e==null?void 0:e.last_name]}),r.jsxs("div",{className:"mt-2 space-y-1",children:[(e==null?void 0:e.job_title)&&r.jsxs("div",{className:"text-sm text-slate-600 flex items-center justify-center sm:justify-start gap-2",children:[r.jsx(Wt,{className:"h-4 w-4 text-slate-400 shrink-0"}),e.job_title]}),((j=e==null?void 0:e.organisation)==null?void 0:j.name)&&r.jsxs("div",{className:"text-sm text-slate-600 flex items-center justify-center sm:justify-start gap-2",children:[r.jsx(Gt,{className:"h-4 w-4 text-slate-400 shrink-0"}),e.organisation.name]}),(e==null?void 0:e.country)&&r.jsxs("div",{className:"text-sm text-slate-600 flex items-center justify-center sm:justify-start gap-2",children:[r.jsx(kt,{className:"h-4 w-4 text-slate-400 shrink-0"}),e.country]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap justify-center sm:justify-start gap-2",children:[!N&&r.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium px-2.5 py-1 rounded-full bg-brand-50 text-brand-700 border border-brand-200",children:[r.jsx(aa,{className:"h-3 w-3"})," Member since ",e==null?void 0:e.member_since_year]}
725),r.jsx("span",{className:`inline-flex items-center text-xs font-medium px-2.5 py-1 rounded-full border ${(e==null?void 0:e.payment_status)==="paid"||N?"bg-accent-50 text-accent-700 border-accent-200":"bg-slate-50 text-slate-600 border-slate-200"}`,children:N?e==null?void 0:e.role:e==null?void 0:e.payment_status}),!N&&r.jsx("span",{className:"inline-flex items-center text-xs font-medium px-2.5 py-1 rounded-full bg-slate-50 text-slate-600 border border-slate-200",children:e==null?void 0:e.membership_package})]})]}),r.jsx("div",{className:"shrink-0",children:o?r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("button",{onClick:()=>l(!1),className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-slate-200 text-slate-700 text-sm font-medium hover:bg-slate-300 transition",children:[r.jsx(He,{className:"h-4 w-4"})," Cancel"]}),r.jsxs("button",{onClick:w,disabled:c,className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-accent-500 text-white text-sm font-medium hover:bg-accent-600 transition disabled:opacity-50",children:[r.jsx(Gw,{className:"h-4 w-4"})," ",c?"Savingâ¦":"Save"]})]}):r.jsxs("button",{onClick:()=>l(!0),className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl bg-brand-900 text-white text-sm font-medium hover:bg-brand-800 transition",children:[r.jsx(Ui,{className:"h-4 w-4"})," Edit Profile"]})})]}),!o&&(e==null?void 0:e.bio)&&r.jsxs("div",{className:"mt-5 border-t border-slate-200 pt-4",children:[r.jsx("div",{className:"text-xs uppercase tracking-widest text-slate-400 mb-2",children:"About"}),r.jsx("div",{className:"text-sm text-slate-700 leading-relaxed whitespace-pre-wrap",children:e.bio})]})]}),o&&r.jsxs(V.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"space-y-5",children:[r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm p-6",children:[r.jsxs("div",{className:"text-brand-900 font-semibold mb-4 flex items-center gap-2",children:[r.jsx(Ui,{className:"h-4 w-4 text-slate-400"})," Edit Profile"]}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(uo,{label:"First Name",value:p.first_name,onChange:k=>x("first_name",k)}),r.jsx(uo,{label:"Last Name",value:p.last_name,onChange:k=>x("last_name",k)})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(uo,{label:"Job Title",value:p.job_title,onChange:k=>x("job_title",k)}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Country"}),r.jsxs("select",{value:p.country,onChange:k=>x("country",k.target.value),className:"w-full rounded-xl border border-slate-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-accent-500/40 focus:border-accent-500",children:[r.jsx("option",{value:"",children:"Select country"}),r.jsx("optgroup",{label:"Africa",children:Ou.map(k=>r.jsx("option",{value:k,children:k},k))}),r.jsx("optgroup",{label:"Rest of World",children:vy.slice(Ou.length).map(k=>r.jsx("option",{value:k,children:k},k))})]})]})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Sector"}),r.jsx("select",{value:p.sector_type,onChange:k=>x("sector_type",k.target.value),className:"w-full rounded-xl border border-slate-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-accent-500/40 focus:border-accent-500",children:ch.map(k=>r.jsx("option",{value:k.value,children:k.label},k.value))})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Industry"}),r.jsx("select",{value:p.industry,onChange:k=>x("industry",k.target.value),className:"w-full rounded-xl border border-slate-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-accent-500/40 focus:border-accent-500",children:Gi.map(k=>r.jsx("option",{value:k,children:k},k))})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Bio"}),r.jsx("textarea",{value:p.bio,onChange:k=>x("bio",k.target.value),rows:3,maxLength:500,className:"w-full rounded-xl border border-slate-300 px-4 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-accent-500/40 focu
725s:border-accent-500",placeholder:"A short professional bio\\u2026"}),r.jsxs("div",{className:"text-xs text-slate-400 mt-1",children:[(p.bio||"").length,"/500"]})]}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsx(uo,{label:"LinkedIn URL",value:p.linkedin_url,onChange:k=>x("linkedin_url",k),placeholder:"https://linkedin.com/in/..."}),r.jsx(uo,{label:"Twitter / X URL",value:p.twitter_url,onChange:k=>x("twitter_url",k),placeholder:"https://x.com/..."}),r.jsx(uo,{label:"Instagram URL",value:p.instagram_url,onChange:k=>x("instagram_url",k),placeholder:"https://instagram.com/..."})]}),r.jsx(uo,{label:"Phone",value:p.phone,onChange:k=>x("phone",k),placeholder:"+234..."})]})]}),r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm p-6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(Hi,{className:"h-5 w-5 text-slate-500"}),r.jsx("div",{className:"text-brand-900 font-semibold",children:"Privacy Settings"})]}),r.jsx("p",{className:"text-sm text-slate-500 mb-4",children:"Control what other members can see on your profile in the directory."}),r.jsxs("div",{className:"grid gap-3",children:[r.jsx(Kh,{icon:Ft,label:"Show email address",description:"Other members can see your email",checked:p.privacy_show_email,onChange:k=>x("privacy_show_email",k)}),r.jsx(Kh,{icon:Ai,label:"Show phone number",description:"Other members can see your phone",checked:p.privacy_show_phone,onChange:k=>x("privacy_show_phone",k)}),r.jsx(Kh,{icon:bn,label:"Show LinkedIn profile",description:"Display LinkedIn link on your directory card",checked:p.privacy_show_linkedin,onChange:k=>x("privacy_show_linkedin",k)}),r.jsx(Kh,{icon:In,label:"Allow in-portal messages",description:"Other members can send you private messages",checked:p.privacy_allow_messages,onChange:k=>x("privacy_allow_messages",k)})]})]})]}),!o&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm p-6",children:[r.jsxs("div",{className:"text-brand-900 font-semibold mb-4 flex items-center gap-2",children:[r.jsx(pt,{className:"h-4 w-4 text-slate-400"})," Contact & Social"]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[r.jsx(Or,{icon:Ft,label:"Email",value:e==null?void 0:e.email}),r.jsx(Or,{icon:Ai,label:"Phone",value:e==null?void 0:e.phone}),r.jsx(Or,{icon:bn,label:"LinkedIn",value:e==null?void 0:e.linkedin_url,link:!0}),r.jsx(Or,{icon:lh,label:"Twitter / X",value:e==null?void 0:e.twitter_url,link:!0}),r.jsx(Or,{icon:oh,label:"Instagram",value:e==null?void 0:e.instagram_url,link:!0}),r.jsx(Or,{icon:Gt,label:"Organisation",value:(S=e==null?void 0:e.organisation)==null?void 0:S.name})]})]}),r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm p-6",children:[r.jsxs("div",{className:"text-brand-900 font-semibold mb-4 flex items-center gap-2",children:[r.jsx(Wt,{className:"h-4 w-4 text-slate-400"})," Professional Details"]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[r.jsx(Or,{icon:Wt,label:"Job Title",value:e==null?void 0:e.job_title}),r.jsx(Or,{icon:kt,label:"Country",value:e==null?void 0:e.country}),r.jsx(Or,{icon:pt,label:"Sector",value:e==null?void 0:e.sector_type}),r.jsx(Or,{icon:pt,label:"Industry",value:e==null?void 0:e.industry})]})]}),r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm p-6",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(Hi,{className:"h-5 w-5 text-slate-500"}),r.jsx("div",{className:"text-brand-900 font-semibold",children:"Privacy Settings"})]}),r.jsx("p",{className:"text-sm text-slate-500 mb-4",children:'These control what other members see in the directory. Click "Edit Profile" to change.'}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(qh,{icon:Ft,label:"Email visible to members",active:!!(e!=null&&e.privacy_show_email)}),r.jsx(qh,{icon:Ai,label:"Phone visible to members",active:!!(e!=null&&e.privacy_show_phone)}),r.jsx(qh,{icon:bn,label:"LinkedIn shown on directory card",active:(e==null?void 0:e.privacy_show_linkedin)!==!1}),r.jsx(qh,{icon:In,label:"In-portal messages allowed",active:(e==null?void 0:e.privacy_allow_messages)!==!1}
725)]})]})]})]})})}function uo({label:t,value:e,onChange:s,placeholder:n}){return r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:t}),r.jsx("input",{type:"text",value:e||"",onChange:a=>s(a.target.value),placeholder:n,className:"w-full rounded-xl border border-slate-300 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-accent-500/40 focus:border-accent-500"})]})}function Or({icon:t,label:e,value:s,link:n}){const a=s||"â";return r.jsxs("div",{className:"rounded-xl border border-slate-200 bg-slate-50 p-4 flex items-start gap-3",children:[t&&r.jsx(t,{className:"h-4 w-4 text-slate-400 mt-0.5 shrink-0"}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-xs uppercase tracking-widest text-slate-400",children:e}),n&&s?r.jsx("a",{href:s,target:"_blank",rel:"noreferrer",className:"mt-1 text-sm text-accent-600 hover:text-accent-500 break-all block",children:a}):r.jsx("div",{className:"mt-1 text-sm text-slate-800 break-words",children:a})]})]})}function qh({icon:t,label:e,active:s}){return r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl border border-slate-200 bg-slate-50",children:[r.jsx(t,{className:"h-4 w-4 text-slate-400 shrink-0"}),r.jsx("div",{className:"flex-1 text-sm text-slate-700",children:e}),r.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-medium ${s?"text-green-600":"text-slate-400"}`,children:[s?r.jsx(is,{className:"h-3.5 w-3.5"}):r.jsx(He,{className:"h-3.5 w-3.5"}),s?"On":"Off"]})]})}function Kh({icon:t,label:e,description:s,checked:n,onChange:a}){return r.jsxs("label",{className:"flex items-start gap-3 p-3 rounded-xl border border-slate-200 bg-slate-50 cursor-pointer hover:bg-slate-100 transition",children:[r.jsx(t,{className:"h-4 w-4 text-slate-400 mt-1 shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm text-slate-800 font-medium",children:e}),r.jsx("div",{className:"text-xs text-slate-500",children:s})]}),r.jsx("div",{className:"shrink-0 mt-0.5",children:r.jsx("button",{type:"button",role:"switch","aria-checked":n,onClick:()=>a(!n),className:`relative inline-flex h-6 w-11 items-center rounded-full transition ${n?"bg-accent-500":"bg-slate-300"}`,children:r.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${n?"translate-x-6":"translate-x-1"}`})})})]})}const d9={USD:1,GBP:.79,EUR:.92,ZAR:18.5,KES:153},u9=["USD","GBP","EUR","ZAR","KES"],h9={ind_africa:14500,ind_gov:9500,ind_early:7500,ind_intl:23e3,corp_tier1:6e4,corp_tier2:15e4,corp_tier3:225e3,corp_tier4:3e5,corp_tier5:4e5,gov_micro:5e4,gov_small:125e3};function hd(t,e){const s=h9[t];if(!s)return null;const n=d9[e]||1;return Math.round(s*n)}function m9(t,e){return`${{USD:"$",GBP:"£",EUR:"â¬",ZAR:"R",KES:"KSh"}[e]||e+" "}${(t/100).toLocaleString()}`}function Uk(t){return t==="individual"?"Individual":t==="group_corporate"?"Group (Corporate)":t==="group_public_sector"?"Group (Public Sector)":t==="organisation"?"Organisation":t||"Membership"}function f9(t,e){const s=t==null?void 0:t.membership_tier;return s?hd(s,e):(t==null?void 0:t.membership_package)==="individual"?hd("ind_africa",e):(t==null?void 0:t.membership_package)==="group_corporate"?hd("corp_tier1",e):(t==null?void 0:t.membership_package)==="group_public_sector"?hd("gov_micro",e):hd("ind_africa",e)}function p9(){var g;const{token:t,member:e,refresh:s}=Oe(),n=jn(),[a,i]=v.useState(!1),[o,l]=v.useState(""),[c,d]=v.useState("USD"),[u,h]=v.useState("");if(v.useEffect(()=>{new URLSearchParams(n.search).get("status")==="success"&&(h("Payment successful! Your membership has been upgraded."),s())},[n.search,s]),!e)return r.jsx(Mn,{to:"/login",replace:!0});const f=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor"||(e==null?void 0:e.payment_status)==="paid",p=async()=>{i(!0),l("");try{const x=await U("/api/payments/stripe/create-checkout-session",{token:t,method:"POST",body:{membershipPackage:e==null?void 0:e.membership_package,membershipTier:e==null?void 0:e.membership_tier,currency:c}});if(x!=null&&x.url){window.location.href=x.url;return}l("No checkout URL returned. Please try again.")}catch(x){console.error("[billing] Stripe checkout error:",x),x.message==="Failed to fetch"?l("Unable to reach payment server. Please check your connection and try again."):l(
725x.message||"Failed to start payment")}finally{i(!1)}};return r.jsx("div",{className:"bg-slate-50 min-h-screen",children:r.jsxs("div",{className:"max-w-3xl mx-auto px-4 md:px-6 py-10 space-y-6",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-brand-900",children:"Membership & Billing"}),r.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Manage your ACGC membership plan and payment."})]}),u&&r.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-green-200 bg-green-50 px-4 py-3 text-sm text-green-700",children:[r.jsx(ls,{className:"h-5 w-5 shrink-0"}),u]}),o&&r.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:o}),r.jsx("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm p-6",children:r.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-brand-900 font-semibold",children:"Current Membership"}),r.jsxs("div",{className:"mt-1 text-sm text-slate-500",children:["Package: ",r.jsx("span",{className:"text-slate-800 font-medium",children:Uk(e==null?void 0:e.membership_package)})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[f?r.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium px-2.5 py-1 rounded-full bg-green-50 text-green-700 border border-green-200",children:[r.jsx(ls,{className:"h-3.5 w-3.5"})," Paid"]}):r.jsx("span",{className:"inline-flex items-center text-xs font-medium px-2.5 py-1 rounded-full bg-slate-100 text-slate-600 border border-slate-200",children:"Free"}),((g=e==null?void 0:e.organisation)==null?void 0:g.name)&&r.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-medium px-2.5 py-1 rounded-full bg-brand-50 text-brand-700 border border-brand-200",children:[r.jsx(Gt,{className:"h-3 w-3"})," ",e.organisation.name]})]})]})}),r.jsx("div",{className:"grid gap-4",children:r.jsx(x9,{title:`${Uk(e==null?void 0:e.membership_package)} Plan`,desc:"Your current membership package is billed annually through Stripe for paid users.",amount:f9(e,c),currency:c,active:!0})}),!f&&r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm p-6",children:[r.jsxs("div",{className:"text-brand-900 font-semibold mb-4 flex items-center gap-2",children:[r.jsx(gi,{className:"h-4 w-4 text-slate-400"})," Make Payment"]}),r.jsxs("div",{className:"grid sm:grid-cols-3 gap-4 items-end",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-700 mb-1",children:"Currency"}),r.jsx("select",{value:c,onChange:x=>d(x.target.value),className:"w-full h-11 rounded-xl border border-slate-300 px-3 text-sm focus:outline-none focus:ring-2 focus:ring-accent-500/40 focus:border-accent-500",children:u9.map(x=>r.jsx("option",{value:x,children:x},x))})]}),r.jsx("div",{className:"sm:col-span-2",children:r.jsxs(V.button,{whileHover:{y:-1},whileTap:{scale:.98},onClick:p,disabled:a,className:"w-full h-11 inline-flex items-center justify-center gap-2 rounded-xl bg-accent-500 text-white text-sm font-semibold hover:bg-accent-600 transition disabled:opacity-50",children:[r.jsx(gi,{className:"h-4 w-4"}),a?"Redirecting to Stripeâ¦":"Pay with Stripe"]})})]}),r.jsxs("div",{className:"mt-4 flex items-start gap-2 text-xs text-slate-400",children:[r.jsx(Hi,{className:"h-3.5 w-3.5 mt-0.5 shrink-0"}),"Payments are securely processed by Stripe. Your card details never touch our servers."]})]}),f&&r.jsxs("div",{className:"bg-white rounded-2xl border border-green-200 shadow-sm p-6 text-center",children:[r.jsx(ls,{className:"h-10 w-10 text-green-500 mx-auto mb-3"}),r.jsx("div",{className:"text-brand-900 font-semibold text-lg",children:"Membership Active"}),r.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Your membership is active. Annual renewals are handled through your Stripe subscription."})]})]})})}function x9({title:t,desc:e,amount:s,currency:n,active:a}){return r.jsxs("div",{className:`rounded-2xl border p-5 ${a?"border-accent-500/40 bg-accent-50 shadow-sm":"border-slate-200 bg-white"}`,children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"text-brand-900 font-semibold",children:t}),a?r.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-accent-100 text-accent-700 border border-accent-200",children:"Your Plan"}):r.jsx("span",{className:"text-xs font-medium px-2 py-0.5 rounded-full bg-slate-100 text-slate-500 border border-slate-200",children:"Option"})]}),r.jsx("p",{className:"mt-2 text-sm text-slate-600",children:e}),r.jsxs("div",{className:"mt-4 text-lg font-bold text-brand-900",children:[m9(s,n),r.jsx("span",{className:"text-sm font-normal text-slate-400",children:" / year"})]})]})}function g9(){const{token:t,member:e}=Oe(),[s,n]=v.useState("inbox"),[a,i]=v.useState([]),[o,l]=v.useState(!1),[c,d]=v.useState(""),[u,h]=v.useState(null),[m,f]=v.useState(0);if(!e)return r.jsx(Mn,{to:"/login",replace:!0});const g=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor"||(e==null?void 0:e.payment_status)==="paid",x=async()=>
725{l(!0),d("");try{const j=await U(s==="inbox"?"/api/messages/inbox":"/api/messages/sent",{token:t});if(i(j.messages||[]),s==="inbox"){const S=await U("/api/messages/unread-count",{token:t});f(S.count||0)}}catch(N){d(N.message||"Failed to load messages")}finally{l(!1)}};v.useEffect(()=>{g&&x()},[t,s]);const b=async N=>{try{await U(`/api/messages/${N}/read`,{token:t,method:"PUT"}),i(j=>j.map(S=>S.id===N?{...S,read:!0}:S)),f(j=>Math.max(0,j-1))}catch{}},y=async N=>{if(window.confirm("Delete this message?"))try{await U(`/api/messages/${N}`,{token:t,method:"DELETE"}),i(j=>j.filter(S=>S.id!==N))}catch(j){d(j.message||"Delete failed")}},w=N=>{if(u===N){h(null);return}h(N);const j=a.find(S=>S.id===N);s==="inbox"&&j&&!j.read&&b(N)};return g?r.jsx("div",{className:"bg-slate-50 min-h-screen",children:r.jsxs("div",{className:"max-w-3xl mx-auto px-4 md:px-6 py-10 space-y-5",children:[r.jsxs("div",{children:[r.jsx("h1",{className:"text-2xl font-bold text-brand-900",children:"Messages"}),r.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Private messages from other ACGC members."})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx("button",{onClick:()=>n("inbox"),className:`px-4 py-2 rounded-xl text-sm font-medium transition border ${s==="inbox"?"bg-brand-900 text-white border-brand-900":"text-slate-600 border-slate-200 bg-white hover:bg-slate-50"}`,children:r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(H3,{className:"h-4 w-4"}),"Inbox",m>0&&r.jsx("span",{className:"text-xs font-bold px-1.5 py-0.5 rounded-full bg-accent-500 text-white ml-1",children:m})]})}),r.jsx("button",{onClick:()=>n("sent"),className:`px-4 py-2 rounded-xl text-sm font-medium transition border ${s==="sent"?"bg-brand-900 text-white border-brand-900":"text-slate-600 border-slate-200 bg-white hover:bg-slate-50"}`,children:r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(ia,{className:"h-4 w-4"}),"Sent"]})})]}),c&&r.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-700",children:c}),o?r.jsx("div",{className:"text-slate-400 text-center py-12",children:"Loading\\u2026"}):a.length===0?r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm p-8 text-center",children:[r.jsx(Ft,{className:"h-10 w-10 text-slate-300 mx-auto mb-3"}),r.jsx("p",{className:"text-slate-500",children:s==="inbox"?"Your inbox is empty.":"No sent messages yet."})]}):r.jsx("div",{className:"space-y-2",children:a.map(N=>{const j=u===N.id,S=s==="inbox",k=S?`${N.from_first_name} ${N.from_last_name}`:`${N.to_first_name} ${N.to_last_name}`,C=S?N.from_job_title:N.to_job_title,T=S?N.from_avatar_url:N.to_avatar_url,A=T?tt(T):null;return r.jsx(V.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},children:r.jsxs("div",{className:"bg-white rounded-2xl border border-slate-200 shadow-sm overflow-hidden",children:[r.jsxs("button",{onClick:()=>w(N.id),className:"w-full text-left p-4 flex items-start gap-3 hover:bg-slate-50 transition",children:[r.jsx("div",{className:"h-10 w-10 rounded-full border border-slate-200 overflow-hidden bg-slate-100 grid place-items-center shrink-0",children:A?r.jsx("img",{src:A,alt:"",className:"h-full w-full object-cover",onError:E=>{E.currentTarget.style.display="none"}}):r.jsx(Ls,{className:"h-5 w-5 text-slate-400"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:`text-sm font-medium ${S&&!N.read?"text-brand-900 font-semibold":"text-slate-800"}`,children:k}
725),S&&!N.read&&r.jsx("span",{className:"h-2 w-2 rounded-full bg-accent-500 shrink-0"})]}),C&&r.jsx("div",{className:"text-xs text-slate-500",children:C}),N.subject&&r.jsx("div",{className:"text-sm text-slate-700 mt-0.5 truncate",children:N.subject}),r.jsx("div",{className:"text-xs text-slate-400 mt-1",children:new Date(N.created_at).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})})]}),r.jsx("div",{className:"shrink-0 text-slate-400",children:j?r.jsx(Vi,{className:"h-4 w-4"}):r.jsx(ht,{className:"h-4 w-4"})})]}),j&&r.jsxs("div",{className:"px-4 pb-4 border-t border-slate-100 pt-3",children:[r.jsx("div",{className:"text-sm text-slate-700 whitespace-pre-wrap leading-relaxed",children:N.body}),r.jsx("div",{className:"mt-3 flex justify-end",children:r.jsxs("button",{onClick:()=>y(N.id),className:"inline-flex items-center gap-1 text-xs text-red-500 hover:text-red-600 transition",children:[r.jsx(Lt,{className:"h-3.5 w-3.5"})," Delete"]})})]})]})},N.id)})})]})}):r.jsx("div",{className:"bg-slate-50 min-h-screen",children:r.jsxs("div",{className:"max-w-xl mx-auto px-4 md:px-6 py-16 text-center",children:[r.jsx("div",{className:"inline-flex items-center justify-center h-16 w-16 rounded-full bg-brand-50 mb-5",children:r.jsx(or,{className:"h-7 w-7 text-brand-700"})}),r.jsx("h2",{className:"text-2xl font-semibold text-slate-900",children:"Messages"}),r.jsx("p",{className:"mt-3 text-slate-600",children:"Messaging is available to paid ACGC members. Upgrade your membership to send and receive private messages from fellow ACGC members."}),r.jsx("div",{className:"mt-6",children:r.jsx(K,{to:"/billing",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-accent-500 text-white text-sm font-semibold hover:bg-accent-600 transition",children:"Upgrade membership"})})]})})}function b9(){var g;const{login:t,member:e}=Oe(),s=Bn(),n=jn(),{t:a}=en(),[i,o]=v.useState(""),[l,c]=v.useState(""),[d,u]=v.useState(!1),[h,m]=v.useState(""),f=((g=n.state)==null?void 0:g.from)||"/";if(e)return r.jsx(Mn,{to:"/",replace:!0});const p=async x=>{var b;x.preventDefault(),m(""),u(!0);try{await t(i,l),s(f)}catch(y){y.message==="account_banned"||((b=y.data)==null?void 0:b.error)==="account_banned"?m("Your account has been suspended. Please contact support."):m(y.message||a("auth.loginFailed"))}finally{u(!1)}};return r.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-12",children:r.jsxs("div",{className:"grid md:grid-cols-12 gap-6",children:[r.jsxs("div",{className:"md:col-span-6",children:[r.jsx(_r,{eyebrow:a("auth.login.eyebrow"),title:a("auth.login.title"),subtitle:a("auth.login.sub")}),r.jsx(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4},children:r.jsx(ne,{className:"mt-6",children:r.jsx(re,{children:r.jsxs("form",{className:"grid gap-4",onSubmit:p,children:[r.jsx(Y,{label:a("auth.email"),type:"email",value:i,onChange:x=>o(x.target.value),required:!0}),r.jsxs("div",{children:[r.jsx(Y,{label:a("auth.password"),type:"password",value:l,onChange:x=>c(x.target.value),required:!0,showPasswordToggle:!0}),r.jsx("div",{className:"mt-1.5 text-right",children:r.jsx(K,{to:"/forgot-password",className:"text-xs text-accent-700 hover:text-accent-800",children:a("auth.login.forgotPassword")})})]}),h?r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-xl px-4 py-2",children:h}):null,r.jsx(W,{type:"submit",variant:"primary",size:"lg",disabled:d,children:a(d?"auth.signingIn":"auth.signIn")}),r.jsxs("div",{className:"text-sm text-slate-500",children:[a("auth.noAccount")," ",r.jsx(K,{to:"/join",className:"text-accent-700 hover:text-accent-800",children:a("auth.join")})]})]})})})})]}),r.jsx("div",{className:"md:col-span-6",children:r.jsx(ne,{className:"h-full",children:r.jsxs(re,{children:[r.jsx("div",{className:"text-brand-900 font-semibold",children:a("auth.login.benefitsTitle")}),r.jsxs("div",{className:"mt-5 grid gap-3 text-sm text-slate-700",children:[r.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-4 shadow-soft",children:[r.jsxs("span",{className:"text-brand-900 font-semibold",children:[a("auth.login.benefits.network").split(":")[0],":"]}),a("auth.login.benefits.network").split(":").slice(1).join(":")]}),r.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-4 shadow-soft",children:[r.jsxs("span",{className:"text-brand-900 font-semibold",children:[a("auth.login.benefits.events").split(":")[0],":"]}),a("auth.login.benefits.events").split(":").slice(1).join(":")]}),r.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-4 shadow-soft",children:[r.jsxs("span",{className:"text-brand-900 font-semibold",children:[a("auth.login.benefits.resources").split(":")[0],":"]}),a("auth.login.benefits.resources").split(":").slice(1).join(":")]}),r.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-4 shadow-soft",children:[r.jsxs("span",{className:"text-brand-900 font-semibold",children:[a("auth.login.benefits.opportunities").split(":")[0],":"]}),a("auth.login.benefits.opportunities").split(":").slice(1).join(":")]})]})]})})})]})})}function Re({label:t,labelClassName:e="",error:s,className:n="",required:a,children:i,...o}){return r.jsxs("label",{className:"block",children:[t?r.jsxs("div",{className:`acgc-label mb-1 text-sm text-slate-700 ${e}`,children:[t,a&&r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}):null,r.jsx("select",{className:`acgc-input w-full h-11 rounded-2xl border px-4 text-slate-900 border-slate-200 focus:border-accent-600 focus:ring-2 focus:ring-accent-500/20 transition ${n}`,required:a,...o,children:i}),s?r.jsx("div",{className:"mt-1 text-sm text-red-600",children:s}):null]})}
725function y9({label:t,value:e,onChange:s,options:n=[],groupedOptions:a,placeholder:i="Selectâ¦",required:o=!1,className:l=""}){var y;const[c,d]=v.useState(!1),[u,h]=v.useState(""),m=v.useRef(null),f=v.useRef(null);v.useEffect(()=>{if(!c)return;const w=N=>{m.current&&!m.current.contains(N.target)&&d(!1)};return document.addEventListener("mousedown",w),()=>document.removeEventListener("mousedown",w)},[c]),v.useEffect(()=>{c&&f.current&&f.current.focus()},[c]);const p=v.useMemo(()=>a?a.flatMap(w=>w.items.map(N=>({...N,group:w.label}))):n.map(w=>typeof w=="string"?{value:w,label:w}:w),[n,a]),g=v.useMemo(()=>{const w=u.trim().toLowerCase();return w?p.filter(N=>N.label.toLowerCase().includes(w)):p},[p,u]),x=((y=p.find(w=>w.value===e))==null?void 0:y.label)||e||"",b=w=>{s({target:{value:w}}),d(!1),h("")};return r.jsxs("div",{ref:m,className:`relative block ${l}`,children:[t&&r.jsxs("div",{className:"acgc-label mb-1 text-sm text-slate-700",children:[t,o&&r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),r.jsxs("button",{type:"button",onClick:()=>d(!c),className:"acgc-input w-full h-11 rounded-2xl border px-4 text-left text-slate-900 border-slate-200 focus:border-accent-600 focus:ring-2 focus:ring-accent-500/20 transition flex items-center justify-between gap-2 bg-white",children:[r.jsx("span",{className:x?"truncate":"text-slate-400 truncate",children:x||i}),r.jsx(ht,{className:"h-4 w-4 text-slate-400 shrink-0"})]}),o&&r.jsx("input",{tabIndex:-1,value:e||"",onChange:()=>{},required:!0,className:"absolute inset-0 opacity-0 pointer-events-none"}),c&&r.jsxs("div",{className:"absolute z-50 left-0 right-0 mt-1 rounded-2xl border border-slate-200 bg-white shadow-lg overflow-hidden",children:[r.jsxs("div",{className:"p-2 border-b border-slate-100 flex items-center gap-2",children:[r.jsx(Ua,{className:"h-4 w-4 text-slate-400 shrink-0"}),r.jsx("input",{ref:f,value:u,onChange:w=>h(w.target.value),placeholder:"Searchâ¦",className:"w-full text-sm text-slate-800 outline-none bg-transparent"}),u&&r.jsx("button",{type:"button",onClick:()=>h(""),className:"text-slate-400 hover:text-slate-600",children:r.jsx(He,{className:"h-3.5 w-3.5"})})]}),r.jsx("div",{className:"max-h-60 overflow-auto",children:g.length===0?r.jsx("div",{className:"px-4 py-3 text-sm text-slate-400",children:"No results"}):(()=>{let w=null;return g.map(N=>{const j=a&&N.group!==w;return w=N.group,r.jsxs(v.Fragment,{children:[j&&r.jsx("div",{className:"px-4 pt-3 pb-1 text-[11px] font-semibold text-slate-400 uppercase tracking-wider",children:N.group}),r.jsx("button",{type:"button",onClick:()=>b(N.value),className:"w-full text-left px-4 py-2 text-sm transition "+(N.value===e?"bg-brand-50 text-brand-900 font-medium":"text-slate-700 hover:bg-slate-50"),children:N.label})]},N.value)})})()})]})]})}const v9={firstName:"",lastName:"",email:"",jobTitle:"",linkedin:"",twitter:"",instagram:""},r0=/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~`]/;function w9(t,e){return t==="individual"?sM.find(s=>s.id===e):t==="group_corporate"?nM.find(s=>s.id===e):t==="group_public_sector"?rM.find(s=>s.id===e):null}function j9(){const{member:t}=Oe();Bn();const{t:e}=en(),[s]=eo(),n=s.get("cancelled")==="true";if(t)return r.jsx(Mn,{to:"/",replace:!0});const[a,i]=v.useState(1),[o,l]=v.useState(""),[c,d]=v.useState(""),[u,h]=v.useState(""),[m,f]=v.useState("private"),[p,g]=v.useState(Gi[0]),[x,b]=v.useState(""),[y,w]=v.useState(""),[N,j]=v.useState({firstName:"",lastName:"",email:"",password:"",jobTitle:"",linkedin:"",twitter:"",instagram:""}),[S,k]=v.useState([]),[C,T]=v.useState(!1),[A,E]=v.useState(""),L=w9(o,c),D=o==="group_corporate"||o==="group_public_sector",P=(L==null?void 0:L.price)===null,R=(L==null?void 0:L.maxMembers)||1,$=v.useMemo(()=>[{label:"Africa",items:Ou.map(H=>({value:H,label:H}))},{label:"International",items:Zw.map(H=>({value:H,label:H}))}],[]),O=(H,he)=>j(oe=>({...oe,[H]:he})),_=H=>he=>O(H,he.target.value),B=N.password.length>=8&&/\d/.test(N.password)&&r0.test(N.password),J=N.firstName.trim()&&N.lastName.trim()&&N.email.trim()&&N.jobTitle.trim()&&N.linkedin.trim()&&B,Q=u.trim()&&m&&p&&x,ce=S.every(H=>H.firstName.trim()&&H.lastName.trim()&&H.email.trim()&&H.jobTitle.trim()&&H.linkedin.trim()),fe=D?J&&Q&&y.trim()&&ce:J&&Q,X=o&&c&&!P,pe=()=>{X&&(E(""),i(2),window.scrollTo({top:0,behavior:"smooth"}))},be=()=>{i(1),E(""),window.scrollTo({top:0,behavior:"smooth"})},q=()=>{1+S.length>=R||k(H=>[...H,{...v9}])},le=H=>{k(he=>he.filter((oe,F)=>F!==H))},De=(H,he,oe)=>{k(F=>F.map((Z,de)=>de===H?{...Z,[he]:oe}:Z))},$e=async H=>{var he,oe;H.preventDefault(),E(""),T(!0);try{const F=D?{firstName:N.firstName,lastName:N.lastName,email:N.email,password:N.password,jobTitle:N.jobTitle,linkedin:N.linkedin,twitter:N.twitter||null,instagram:N.instagram||null,organisation:u,sectorType:m,industry:p,c
725ountry:x,membershipPackage:o,membershipTier:c,groupName:y,additionalMembers:S.map(de=>({firstName:de.firstName,lastName:de.lastName,email:de.email,jobTitle:de.jobTitle,linkedin:de.linkedin,twitter:de.twitter||null,instagram:de.instagram||null}))}:{firstName:N.firstName,lastName:N.lastName,email:N.email,password:N.password,jobTitle:N.jobTitle,linkedin:N.linkedin,twitter:N.twitter||null,instagram:N.instagram||null,organisation:u,sectorType:m,industry:p,country:x,membershipPackage:o,membershipTier:c},Z=await U("/api/auth/create-checkout",{method:"POST",body:F});if(Z.url){window.location.href=Z.url;return}E("Unable to create payment session. Please try again.")}catch(F){const Z=(oe=(he=F.data)==null?void 0:he.details)==null?void 0:oe.fieldErrors;if(Z&&typeof Z=="object"){const de=Object.entries(Z).map(([Ve,Pe])=>`${Ve}: ${Array.isArray(Pe)?Pe.join(", "):Pe}`).join("; ");E(de||F.message||e("auth.registrationFailed"))}else E(F.message||e("auth.registrationFailed"))}finally{T(!1)}};return r.jsx("div",{className:"min-h-screen bg-gradient-to-b from-white via-stone-50/30 to-slate-50/50",children:r.jsx("div",{className:"max-w-6xl mx-auto px-4 md:px-6 py-12",children:r.jsxs("div",{className:"grid md:grid-cols-12 gap-6",children:[r.jsxs("div",{className:"md:col-span-7",children:[r.jsx(_r,{eyebrow:e("auth.register.eyebrow"),title:e("auth.register.title"),subtitle:e("auth.register.sub")}),r.jsxs("div",{className:"mt-6 flex items-center gap-3 text-sm",children:[r.jsxs("button",{type:"button",onClick:a===2?be:void 0,className:`flex items-center gap-2 px-3 py-1.5 rounded-full font-medium transition ${a===1?"bg-accent-600 text-white":"bg-slate-100 text-slate-600 hover:bg-slate-200 cursor-pointer"}`,children:[r.jsx("span",{className:"h-5 w-5 rounded-full bg-white/20 text-xs grid place-items-center font-bold",children:"1"}),"Choose Membership"]}),r.jsx("div",{className:"h-px w-6 bg-slate-300"}),r.jsxs("div",{className:`flex items-center gap-2 px-3 py-1.5 rounded-full font-medium ${a===2?"bg-accent-600 text-white":"bg-slate-100 text-slate-400"}`,children:[r.jsx("span",{className:"h-5 w-5 rounded-full bg-white/20 text-xs grid place-items-center font-bold",children:"2"}),"Complete Registration"]})]}),a===1&&r.jsx(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3},children:r.jsx("div",{className:"mt-6",children:r.jsxs("div",{className:"grid gap-6",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"text-sm text-slate-700 font-medium",children:e("auth.register.fields.language")}),r.jsx(Of,{})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm font-semibold text-[#1f0f3f] mb-3",children:"Choose your membership type"}),r.jsxs("div",{className:"grid gap-3",children:[r.jsx("button",{type:"button",onClick:()=>{l("individual"),d(""),k([])},className:`w-full text-left rounded-xl border-2 px-5 py-4 transition-all ${o==="individual"?"border-[#c08a2f] bg-white shadow-lg ring-1 ring-[#c08a2f]/20":"border-slate-200 bg-white hover:border-slate-300 hover:shadow-sm"}`,children:r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-xl bg-[#1f0f3f] flex items-center justify-center shrink-0",children:r.jsx(Y3,{className:"h-5 w-5 text-[#e6c784]"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-[15px] font-bold text-[#1f0f3f]",children:"Individual Membership"}),r.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:"For individual in-house and government lawyers"}),r.jsxs("div",{className:"text-sm font-bold text-[#1f0f3f] mt-1",children:["From $60 â $200 ",r.jsx("span",{className:"text-xs font-normal text-slate-400",children:"per year"})]})]}),o==="individual"&&r.jsx("div",{className:"h-6 w-6 rounded-full bg-[#c08a2f] flex items-center justify-center shrink-0",children:r.jsx(is,{className:"h-3.5 w-3.5 text-white"})})]})}),r.jsxs("button",{type:"button",onClick:()=>{l("group_corporate"),d(""),k([])},className:`w-full text-left rounded-xl border-2 px-5 py-4 transition-all border-l-4 ${o==="group_corporate"?"border-[#c08a2f] shadow-lg ring-1 ring-[#c08a2f]/20 border-l-[#c08a2f]":"border-stone-200 border-l-[#c9a96e] hover:border-stone-300 hover:shadow-sm"}`,style:{backgroundColor:o==="group_corporate"?"#faf5ed":"#faf6f0"},children:[r.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-[#c08a2f] mb-1",children:"For Legal Teams"}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-xl bg-[#1f0f3f]/90 flex items-center justify-center shrink-0",children:r.jsx(Gt,{className:"h-5 w-5 text-[#e6c784]"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-[15px] font-bold text-[#1f0f3f]",children:"Corporate Legal Department Membership"}),r.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:"For corporate legal teams (3â25+ members)"}),r.jsxs("div",{className:"text-sm font-bold text-[#1f0f3f] mt-1",children:["From $600 â $4,000+ ",r.jsx("span",{className:"text-xs font-normal text-slate-400",children:"per year"})]})]}),o==="group_corporate"&&r.jsx("div",{className:"h-6 w-6 rounded-full bg-[#c08a2f] flex items-center justify-center shrink-0",children:r.jsx(is,{className:"h-3.5 w-3.5 text-white"})})]})]}),r.jsxs("button",{type:"button",onClick:()=>{l("group_public_sector"),d(""),k([])},className:`w-full text-left rounded-xl border-2 px-5 py-4 transition-all border-l-4 ${o==="group_public_sector"?"border-[#c08a2f] shadow-lg ring-1 ring-[#c08a2f]/20 border-l-[#c08a2f]":"border-slate-200 border-l-slate-400 hover:border-slate-300 hover:shadow-sm"}`,style:{backgroundColor:o==="group_public_sector"?"#eef0f6":"#f0f2f7"},children:[r.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-[#c08a2f] mb-1",children:"For Public Institutions"}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-xl bg-[#1f0f3f]/80 flex items-center justify-center shrink-0",children:r.jsx(mk,{className:"h-5 w-5 text-[#e6c784]"})}),r.jsxs("div",{className:"flex-1",children:[r.jsx("div",{className:"text-[15px] font-bold text-[#1f0f3f]",children:"Government Legal Department Membership"}),r.jsx("div",{className:"text-xs text-slate-500 mt-0.5",children:"For government legal departments (3â10+ members)"}),r.jsxs("div",{className:"text-sm font-bold text-[#1f0f3f] mt-1",children:["From $500 ",r.jsx("span",{className:"text-xs font-normal text-slate-400",children:"per year"})," ",r.jsx("span",{className:"text-[11px] text-slate-400",children:"(Custom pricing for larger departments)"})]})]}),o==="group_public_sector"&&r.jsx("div",{className:"h-6 w-6 rounded-full bg-[#c08a2f] flex items-center justify-center shrink-0",children:r.jsx(is,{className:"h-3.5 w-3.5 text-white"})})]})]})]})]}),o==="individual"&&r.jsx(S9,{tiers:sM,selectedTier:c,onSelect:d}),o==="group_corporate"&&r.jsx(Hk,{tiers:nM,selectedTier:c,onSelect:d,title:"Corporate Legal Department Membership",icon:r.
725jsx(Gt,{}),variant:"corporate"}),o==="group_public_sector"&&r.jsx(Hk,{tiers:rM,selectedTier:c,onSelect:d,title:"Government Legal Department Membership",icon:r.jsx(mk,{}),variant:"government"}),L&&!P&&r.jsxs("div",{className:"rounded-xl bg-[#c08a2f]/5 border border-[#c08a2f]/20 p-4",children:[r.jsxs("div",{className:"flex items-center gap-2 text-[#1f0f3f] text-sm font-semibold",children:[r.jsx(is,{className:"h-4 w-4 text-[#c08a2f]"}),L.name,D&&L.maxMembers&&r.jsxs("span",{className:"text-xs font-normal text-slate-500 ml-1",children:["(up to ",L.maxMembers," members)"]})]}),r.jsx("div",{className:"mt-1 text-xs text-slate-600",children:L.eligibility})]}),r.jsx("div",{className:"mt-4 pt-6 border-t border-slate-200",children:r.jsxs("button",{type:"button",disabled:!X,onClick:pe,className:`w-full flex items-center justify-center gap-2 py-3.5 rounded-xl font-semibold text-base transition-all ${X?"bg-[#c08a2f] hover:bg-[#a77324] text-white shadow-lg hover:shadow-xl":"bg-slate-100 text-slate-400 cursor-not-allowed"}`,children:["Continue to Registration ",r.jsx(nt,{className:"h-4 w-4"})]})}),r.jsxs("div",{className:"text-sm text-slate-500 text-center",children:[e("auth.alreadyMember")," ",r.jsx(K,{to:"/login",className:"text-[#1f0f3f] hover:text-[#c08a2f] font-medium",children:e("auth.loginLink")})]})]})})}),a===2&&r.jsx(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.3},children:r.jsx(ne,{className:"mt-4",children:r.jsx(re,{children:r.jsxs("form",{onSubmit:$e,className:"grid gap-4",children:[n&&r.jsx("div",{className:"text-sm text-amber-700 bg-amber-50 border border-amber-200 rounded-xl px-4 py-2",children:"Payment was cancelled. You can fill in your details and try again."}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs("button",{type:"button",onClick:be,className:"inline-flex items-center gap-1 text-sm text-accent-600 hover:text-accent-700 font-medium",children:[r.jsx(vn,{className:"h-4 w-4"})," Change plan"]}),r.jsx("div",{className:"ml-auto text-xs text-slate-500 bg-slate-100 px-2.5 py-1 rounded-full",children:L==null?void 0:L.name})]}),D&&r.jsxs("div",{className:"rounded-2xl border border-accent-200 bg-accent-50/30 p-4",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(at,{className:"h-4 w-4 text-accent-600"}),r.jsx("div",{className:"text-sm font-semibold text-slate-800",children:"Group Details"})]}),r.jsx(Y,{label:"Group Name",hint:"This name will appear on all group members' profiles in the directory.",placeholder:"e.g. Acme Legal Team, Ministry of Justice â Kenya",value:y,onChange:H=>w(H.target.value),required:!0}),r.jsxs("div",{className:"mt-2 text-xs text-slate-500",children:["You can register up to ",r.jsx("strong",{children:R})," members under this group. You (the primary contact) count as member 1."]})]}),r.jsx("div",{className:"text-sm font-semibold text-slate-800 border-b border-slate-200 pb-2",children:D?"Primary Contact (Your Details)":"Your Details"}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:e("auth.register.fields.firstName"),value:N.firstName,onChange:_("firstName"),required:!0}),r.jsx(Y,{label:e("auth.register.fields.lastName"),value:N.lastName,onChange:_("lastName"),required:!0})]}),r.jsx(Y,{label:e("auth.register.fields.organisation"),value:u,onChange:H=>h(H.target.value),required:!0}),r.jsx(Y,{label:e("auth.register.fields.jobTitle"),value:N.jobTitle,onChange:_("jobTitle"),required:!0}),r.jsxs("div",{className:"rounded-2xl border border-slate-200 bg-white p-4 shadow-soft",children:[r.jsxs("div",{className:"text-sm text-slate-800",children:[e("auth.register.fields.sector"),r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),r.jsx("div",{className:"mt-3 flex flex-col sm:flex-row gap-3",children:ch.map(H=>r.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-800",children:[r.jsx("input",{type:"radio",name:"sectorType",value:H.value,checked:m===H.value,onChange:he=>f(he.target.value)}),H.label]},H.value))})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Re,{label:e("auth.register.fields.industry"),value:p,onChange:H=>g(H.target.value),required:!0,children:Gi.map(H=>r.jsx("option",{value:H,children:H},H))}),r.jsx(y9,{label:e("auth.register.fields.country"),value:x,onChange:H=>b(H.target.value),groupedOptions:$,placeholder:"Select your country",required:!0})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:e("auth.email"),type:"email",value:N.email,onChange:_("email"),required:!0}),r.jsxs("div",{children:[r.jsx(Y,{label:e("auth.password"),type:"password",value:N.password,onChange:_("password"),required:!0,showPasswordToggle:!0}),r.jsxs("div",{className:"mt-1.5 text-xs text-slate-500",children:[r.jsx("div",{className:"font-medium mb-0.5",children:"Password must contain:"}),r.jsxs("ul",{className:"space-y-0.5",children:[r.jsxs("li",{className:N.password.length>=8?"text-green-600":"",children:[N.password.length>=8?"â":"â¢"," At least 8 characters"]}),r.jsxs("li",{className:/\d/.test(N.password)?"text-green-600":"",children:[/\d/.test(N.password)?"â":"â¢"," One number"]}),r.jsxs("li",{className:r0.test(N.password)?"text-green-600":"",children:[r0.test(N.password)?"â":"â¢"," One special character"]})]})]})]})]}),r.jsx(Y,{label:e("auth.register.fields.linkedin"),placeholder:"https://www.linkedin.com/in/your-profile",value:N.linkedin,onChange:_("linkedin"),required:!0}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:e("auth.register.fields.twitter"),placeholder:"https://x.com/your-handle",value:N.twitter,onChange:_("twitter")}),r.jsx(Y,{label:e("auth.register.fields.instagram"),placeholder:"https://instagram.com/your-handle",value:N.instagram,onChange:_("instagram")})]}),D&&r.jsxs("div",{className:"mt-2",children:[r.jsx("div",{className:"text-sm font-semibold text-slate-800 border-b border-slate-200 pb-2 mb-4 flex items-center justify-between",children:r.jsxs("span",{children:["Additional Group Members (",S.length," of ",R-1," remaining slots)"]})}),S.map((H,he)=>r.jsx(C9,{index:he,member:H,onChange:De,onRemove:le,t:e},he)),1+S.length<R&&r.jsxs("button",{type:"button",onClick:q,className:"w-full rounded-xl border-2 border-dashed border-slate-300 hover:border-accent-400 py-3 text-sm text-slate-500 hover:text-accent-600 transition flex items-center justify-center gap-2",children:[r.jsx(qs,{className:"h-4 w-4"}),"Add Member (",1+S.length,"/",R,")"]}),S.length===0&&r.jsx("div",{className:"text-xs text-slate-400 mt-2",children:"You can add additional group members now or invite them later."})]}),A&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-xl px-4 py-2",children:A}),r.jsx(W,{type:"submit",variant:"primary",size:"lg",disabled:C||!fe,children:C?"Redirecting to paymentâ¦":D?`Proceed to Payment (${1+S.length} members)`:"Proceed to Payment"}),r.jsxs("div",{className:"text-sm text-slate-500",children:[e("auth.alreadyMember")," ",r.jsx(K,{to:"/login",className:"text-accent-700 hover:text-accent-800",children:e("auth.loginLink")})]})]})})})})]}),r.jsx("div",{className:"md:col-span-5",children:r.jsx(N9,{})})]})})})}function N9(){const[t,e]=v.useState(null),s=[{id:"events",icon:r.
725jsx(On,{}),title:"Events & Learning",items:["Access to ACGC webinars","Discounts for the Annual ACGC Conference","Reduced rates for learning programmes including Compliance Essentials"]},{id:"community",icon:r.jsx(at,{}),title:"Community",items:["Connections with in-house counsel across Africa and internationally","Collaboration across the ACGC network"]},{id:"visibility",icon:r.jsx(vx,{}),title:"Visibility & Speaking",items:["Opportunities to speak at ACGC and partner events","Editorial features and member spotlights","International visibility through global collaborations"]},{id:"career",icon:r.jsx(Wt,{}),title:"Career Opportunities",items:["Access to the ACGC Jobs & Opportunities Board","Early visibility of selected opportunities"]},{id:"research",icon:r.jsx(Vw,{}),title:"Research & Insights",items:["Participation in ACGC surveys and benchmarking","Access to sector research and discussions"]}];return r.jsxs("div",{className:"sticky top-28 rounded-2xl bg-gradient-to-br from-slate-50 to-stone-50/50 border border-slate-100 p-6",children:[r.jsx("div",{className:"text-[#1f0f3f] text-lg font-bold",children:"Why Join ACGC?"}),r.jsx("p",{className:"mt-2 text-sm text-slate-600 leading-relaxed",children:"ACGC brings together in-house and government counsel across Africa to connect with trusted peers, strengthen their expertise, and contribute to the evolution of the in-house profession."}),r.jsxs("div",{className:"mt-3 flex items-center gap-4 text-sm font-semibold text-[#1f0f3f]",children:[r.jsx("span",{children:"3,000+ members"}),r.jsx("span",{className:"text-slate-300",children:"|"}),r.jsx("span",{children:"40+ countries"})]}),r.jsx("div",{className:"mt-6",children:s.map(n=>r.jsx(k9,{icon:n.icon,title:n.title,items:n.items,isOpen:t===n.id,onToggle:()=>e(t===n.id?null:n.id)},n.id))})]})}function k9({icon:t,title:e,items:s,isOpen:n,onToggle:a}){return r.jsxs("div",{className:"border-b border-slate-100 last:border-b-0",children:[r.jsxs("button",{type:"button",onClick:a,className:"w-full flex items-center gap-3 py-3 text-left hover:bg-slate-50/50 transition rounded-lg px-2 -mx-2",children:[r.jsx("div",{className:"h-8 w-8 rounded-lg bg-[#1f0f3f] flex items-center justify-center shrink-0",children:v.cloneElement(t,{className:"h-4 w-4 text-[#e6c784]"})}),r.jsx("span",{className:"flex-1 text-sm font-medium text-[#1f0f3f]",children:e}),r.jsx(ht,{className:`h-4 w-4 text-slate-400 transition-transform ${n?"rotate-180":""}`})]}),n&&r.jsx(V.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2},className:"pb-3 pl-11",children:r.jsx("ul",{className:"text-slate-600 text-sm space-y-1.5",children:s.map((i,o)=>r.jsxs("li",{className:"flex items-start gap-2",children:[r.jsx(is,{className:"h-3.5 w-3.5 text-[#c08a2f] shrink-0 mt-0.5"}),r.jsx("span",{children:i})]},o))})})]})}function C9({index:t,member:e,onChange:s,onRemove:n,t:a}){return r.jsxs("div",{className:"mb-4 rounded-2xl border border-slate-200 bg-slate-50/50 p-4",children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsxs("div",{className:"text-sm font-semibold text-slate-700",children:["Member ",t+2]}),r.jsx("button",{type:"button",onClick:()=>n(t),className:"text-red-400 hover:text-red-600 transition",children:r.jsx(Lt,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"grid gap-3",children:[r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[r.jsx(Y,{label:"First Name",value:e.firstName,onChange:i=>s(t,"firstName",i.target.value),required:!0}),r.jsx(Y,{label:"Last Name",value:e.lastName,onChange:i=>s(t,"lastName",i.target.value),required:!0})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[r.jsx(Y,{label:"Email",type:"email",value:e.email,onChange:i=>s(t,"email",i.target.value),required:!0}),r.jsx(Y,{label:"Job Title",value:e.jobTitle,onChange:i=>s(t,"jobTitle",i.target.value),required:!0})]}),r.jsx(Y,{label:"LinkedIn",placeholder:"https://www.linkedin.com/in/...",value:e.linkedin,onChange:i=>s(t,"linkedin",i.target.value),required:!0}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[r.jsx(Y,{label:"Twitter (optional)",placeholder:"https://x.com/...",value:e.twitter,onChange:i=>s(t,"twitter",i.target.value)}),r.jsx(Y,{label:"Instagram (optional)",placeholder:"https://instagram.com/...",value:e.instagram,onChange:i=>s(t,"instagram",i.target.value)})]})]})]})}function S9({tiers:t,selectedTier:e,onSelect:s}){return r.jsxs("div",{className:"rounded-2xl border border-slate-100 bg-white p-5 shadow-sm",children:[r.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[r.jsx(Y3,{className:"h-5 w-5 text-[#c08a2f]"}),r.jsx("div",{className:"text-sm font-semibold text-[#1f0f3f]",children:"Select Your Membership Category"})]}),r.jsx("p",{className:"text-xs text-slate-500 mb-4 leading-relaxed",children:"All categories provide access to the same core membership benefits. A one-time application & admin fee applies upon joining."}),r.jsx("div",{className:"grid gap-3",children:t.map(n=>{const a=e===n.id;return r.jsx("button",{type:"button",onClick:()=>s(n.id),className:`w-full text-left rounded-xl border-2 p-4 transition-all ${a?"border-[#c08a2f] bg-white shadow-lg ring-1 ring-[#c08a2f]/20":"border-slate-200 bg-white hover:border-slate-300 hover:shadow-sm"}`,children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[a&&r.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-[#1f0f3f] bg-[#c08a2f]/10 px-2 py-0.5 rounded-full mb-1",children:[r.jsx(is,{className:"h-3 w-3 text-[#c08a2f]"})," Selected"]}),r.jsx("div",{className:"text-sm font-semibold text-[#1f0f3f]",children:n.name}),r.jsx("div",{className:"mt-1 text-xs text-slate-500 leading-relaxed",children:n.eligibility})]}),r.jsxs("div",{className:"text-right shrink-0",children:[r.jsx("div",{className:"text-xl font-bold text-[#1f0f3f]",children:n.priceLabel}),r.jsx("div",{className:"text-[11px] text-slate-400",children:"per annum"}),r.jsxs("div",{className:"mt-1 text-[11px] text-slate-400",children:["+ ",n.applicationFeeLabel," app fee"]})]})]})},n.id)})}),r.jsx("p",{className:"mt-4 text-[11px] text-slate-400 leading-relaxed",children:"* Individual membership is personal to the named member and cannot be transferred. In future years, application fees will be replaced by a modest annual digital infrastru
725cture fee."})]})}function Hk({tiers:t,selectedTier:e,onSelect:s,title:n,icon:a,variant:i="corporate"}){const[o,l]=v.useState(null),c=i==="corporate",d=c?"#faf6f0":"#f0f2f7",u=c?"border-stone-200":"border-slate-200",h=c?"For Legal Teams":"For Public Institutions",m=c?"Enquire About Corporate Membership":"Enquire About Government Membership";return r.jsxs("div",{className:`rounded-2xl border ${u} p-5`,style:{backgroundColor:d},children:[r.jsx("div",{className:"text-[10px] font-semibold uppercase tracking-wider text-slate-500 mb-1",children:h}),r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[v.cloneElement(a,{className:"h-5 w-5 text-[#1f0f3f]"}),r.jsx("div",{className:"text-sm font-semibold text-[#1f0f3f]",children:n})]}),r.jsx("div",{className:"grid gap-3",children:t.map(f=>{const p=e===f.id,g=o===f.id,x=f.price===null;return r.jsx("div",{children:r.jsxs("button",{type:"button",onClick:()=>{x||s(f.id),l(g?null:f.id)},className:`w-full text-left rounded-xl border-2 p-4 transition-all ${p?"border-[#c08a2f] bg-white shadow-lg ring-1 ring-[#c08a2f]/20":`${c?"border-stone-200":"border-slate-200"} bg-white hover:border-slate-300 hover:shadow-sm`}`,children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxs("span",{className:"text-xs font-bold text-[#1f0f3f] bg-[#1f0f3f]/10 px-2 py-0.5 rounded-full",children:["Tier ",f.tier]}),p&&r.jsxs("span",{className:"inline-flex items-center gap-1 text-xs font-semibold text-[#1f0f3f] bg-[#c08a2f]/10 px-2 py-0.5 rounded-full",children:[r.jsx(is,{className:"h-3 w-3 text-[#c08a2f]"})," Selected"]})]}),r.jsx("div",{className:"mt-1.5 text-sm font-semibold text-[#1f0f3f]",children:f.name}),r.jsx("div",{className:"mt-0.5 text-xs text-slate-500",children:f.eligibility}),f.maxMembers&&r.jsxs("div",{className:"mt-0.5 text-xs text-[#c08a2f] font-medium",children:["Up to ",f.maxMembers," members"]})]}),r.jsx("div",{className:"text-right shrink-0",children:x?r.jsx("div",{className:"text-sm font-bold text-slate-600",children:"Contact us"}):r.jsxs(r.Fragment,{children:[r.jsx("div",{className:"text-lg font-bold text-[#1f0f3f]",children:f.priceLabel}),r.jsx("div",{className:"text-[11px] text-slate-400",children:"per annum"})]})})]}),g&&r.jsxs("div",{className:"mt-3 pt-3 border-t border-slate-100",children:[r.jsx("div",{className:"text-xs font-semibold text-slate-700 mb-1.5",children:"Benefits:"}),r.jsx("ul",{className:"space-y-1",children:f.benefits.map((b,y)=>r.jsxs("li",{className:"flex items-start gap-1.5 text-xs text-slate-600",children:[r.jsx(is,{className:"h-3 w-3 text-[#c08a2f] shrink-0 mt-0.5"}),r.jsx("span",{children:b})]},y))}),x&&r.jsxs("a",{href:"mailto:[email protected]?subject=Custom%20Membership%20Inquiry",className:"mt-3 inline-flex items-center gap-1.5 text-xs font-medium text-[#1f0f3f] hover:text-[#c08a2f]",onClick:b=>b.stopPropagation(),children:[r.jsx(Ft,{className:"h-3.5 w-3.5"})," Contact us for pricing"]})]}),r.jsx("div",{className:"mt-2 text-[11px] text-[#1f0f3f]/60 font-medium",children:g?"Click to collapse":"Click to view benefits"})]})},f.id)})}),r.jsx("div",{className:"mt-4",children:r.jsx("a",{href:`mailto:[email protected]?subject=${encodeURIComponent(c?"Corporate Membership Enquiry":"Government Membership Enquiry")}`,className:"block w-full py-2.5 rounded-lg font-semibold text-sm text-center border-2 border-[#1f0f3f] text-[#1f0f3f] hover:bg-[#1f0f3f] hover:text-white transition",children:m})})]})}function _9(){const{t}=en(),[e,s]=v.useState(""),[n,a]=v.useState(!1),[i,o]=v.useState(!1),[l,c]=v.useState(""),d=async u=>{u.preventDefault(),c(""),a(!0);try{await U("/api/auth/forgot-password",{method:"POST",body:{email:e}}),o(!0)}catch(h){c(h.message||"Something went wrong. Please try again.")}finally{a(!1)}};return r.jsxs("div",{className:"max-w-lg mx-auto px-4 md:px-6 py-12",children:[r.jsx(_r,{eyebrow:"Account Recovery",title:"Forgot your password?",subtitle:"Enter your email address and we'll send you a link to reset your password."}),r.jsx(V.div,{initial:{opacity:0,y:10}
725,animate:{opacity:1,y:0},transition:{duration:.4},children:r.jsx(ne,{className:"mt-6",children:r.jsx(re,{children:i?r.jsxs("div",{className:"text-center py-4",children:[r.jsx(Pr,{className:"h-12 w-12 text-green-500 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Check your email"}),r.jsxs("p",{className:"mt-2 text-sm text-slate-600",children:["If an account exists for ",r.jsx("strong",{children:e}),", we've sent a password reset link. Please check your inbox and spam folder."]}),r.jsx("p",{className:"mt-1 text-xs text-slate-500",children:"The link expires in 1 hour."}),r.jsx("div",{className:"mt-6",children:r.jsxs(K,{to:"/login",className:"inline-flex items-center gap-2 text-sm text-accent-700 hover:text-accent-800",children:[r.jsx(vn,{className:"h-4 w-4"}),"Back to login"]})})]}):r.jsxs("form",{className:"grid gap-4",onSubmit:d,children:[r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-xl bg-slate-50 border border-slate-200",children:[r.jsx(Ft,{className:"h-5 w-5 text-slate-400 shrink-0"}),r.jsx("p",{className:"text-sm text-slate-600",children:"We'll send a secure reset link to your registered email address."})]}),r.jsx(Y,{label:"Email Address",type:"email",value:e,onChange:u=>s(u.target.value),placeholder:"[email protected]",required:!0}),l&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-xl px-4 py-2",children:l}),r.jsx(W,{type:"submit",variant:"primary",size:"lg",disabled:n,children:n?"Sendingâ¦":"Send reset link"}),r.jsx("div",{className:"text-sm text-slate-500 text-center",children:r.jsxs(K,{to:"/login",className:"inline-flex items-center gap-1 text-accent-700 hover:text-accent-800",children:[r.jsx(vn,{className:"h-3.5 w-3.5"}),"Back to login"]})})]})})})})]})}function T9(){const[t]=eo(),e=Bn(),s=t.get("token")||"",[n,a]=v.useState(""),[i,o]=v.useState(""),[l,c]=v.useState(!1),[d,u]=v.useState(!1),[h,m]=v.useState(""),f=n.length>=8,p=/\d/.test(n),g=/[!@#$%^&*()_+\-=\[\]{};':"\\|,.<>\/?~`]/.test(n),x=f&&p&&g,b=n===i&&n.length>0,y=async w=>{if(w.preventDefault(),m(""),!x){m("Password does not meet requirements.");return}if(!b){m("Passwords do not match.");return}c(!0);try{await U("/api/auth/reset-password",{method:"POST",body:{token:s,password:n}}),u(!0)}catch(N){const j=N.message||"Something went wrong.";j.includes("invalid_or_expired_token")?m("This reset link has expired or has already been used. Please request a new one."):m(j)}finally{c(!1)}};return s?r.jsxs("div",{className:"max-w-lg mx-auto px-4 md:px-6 py-12",children:[r.jsx(_r,{eyebrow:"Account Recovery",title:"Set a new password",subtitle:"Choose a strong password for your ACGC account."}),r.jsx(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4},children:r.jsx(ne,{className:"mt-6",children:r.jsx(re,{children:d?r.jsxs("div",{className:"text-center py-4",children:[r.jsx(Pr,{className:"h-12 w-12 text-green-500 mx-auto mb-4"}),r.jsx("h3",{className:"text-lg font-semibold text-slate-900",children:"Password reset successful"}),r.jsx("p",{className:"mt-2 text-sm text-slate-600",children:"Your password has been updated. You can now sign in with your new password."}),r.jsx("div",{className:"mt-6",children:r.jsx(W,{variant:"primary",size:"lg",onClick:()=>e("/login"),className:"w-full",children:"Go to login"})})]}):r.jsxs("form",{className:"grid gap-4",onSubmit:y,children:[r.jsxs("div",{children:[r.jsx(Y,{label:"New Password",type:"password",value:n,onChange:w=>a(w.target.value),required:!0}),r.jsxs("div",{className:"mt-1.5 text-xs text-slate-500",children:[r.jsx("div",{className:"font-medium mb-0.5",children:"Password must contain:"}),r.jsxs("ul",{className:"space-y-0.5",children:[r.jsxs("li",{className:f?"text-green-600":"",children:[f?"â":"â¢"," At least 8 characters"]}),r.jsxs("li",{className:p?"text-green-600":"",children:[p?"â":"â¢"," One number"]}),r.jsxs("li",{className:g?"text-green-600":"",children:[g?"â":"â¢"," One special character"]})]})]})]}),r.jsxs("div",{children:[r.jsx(Y,{label:"Confirm New Password",type:"password",value:i,onChange:w=>o(w.target.value),required:!0}),i.length>0&&r.jsx("div",{className:`mt-1 text-xs ${b?"text-green-600":"text-red-500"}`,children:b?"â Passwords match":"⢠Passwords do not match"})]}),h&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-xl px-4 py-2",children:h}),r.jsx(W,{type:"submit",variant:"primary",size:"lg",disabled:l||!x||!b,children:l?"Resettingâ¦":"Reset password"}),r.jsx("div",{className:"text-sm text-slate-500 text-center",children:r.jsxs(K,{to:"/login",className:"inline-flex items-center gap-1 text-accent-700 hover:text-accent-800",children:[r.jsx(vn,{className:"h-3.5 w-3.5"}),"Back to login"]})})]})})})})]}):r.jsxs("div",{className:"max-w-lg mx-auto px-4 md:px-6 py-12 text-center",children:[r.jsx(B3,{className:"h-12 w-12 text-red-400 mx-auto mb-4"}),r.jsx("h2",{className:"text-xl font-semibold text-slate-900",children:"Invalid reset link"}),r.jsx("p",{className:"mt-2 text-sm text-slate-600",children:"This password reset link is missing or invalid."}),r.jsx("div",{className:"mt-6",children:r.jsx(K,{to:"/forgot-password",className:"text-accent-700 hover:text-accent-800 text-sm font-medium",children:"Request a new reset link"})})]})}const Wk=2e3,Gk=30;function E9(){const[t]=eo(),e=Bn(),s=t.get("pending"),{member:n,refresh:a,setAuthToken:i}=Oe(),[o,l]=v.useState("polling"),[c,d]=v.useState(""),[u,h]=v.useState(!1),m=v.useRef(0);return v.useEffect(()=>{if(!s){l("error"),d("Missing registration reference. Please try registering again.");return}let f=!1,p=0;const g=5,x=async()=>{var b,y;try{const w=new AbortController,N=setTimeout(()=>w.abort(),1e4);let j;try{const S=await fetch(`https://acgc-production-7e76.up.railway.app/
725api/auth/registration-status/${s}`,{signal:w.signal});if(clearTimeout(N),j=await S.json().catch(()=>({})),!S.ok)throw new Error((j==null?void 0:j.error)||`request_failed_${S.status}`)}catch(S){if(clearTimeout(N),S.name==="AbortError"){if(console.warn("[registration] Poll timed out, retrying..."),m.current++,m.current<Gk){setTimeout(x,Wk);return}l("error"),d("Registration is taking longer than expected. Please try logging in or contact support.");return}throw S}if(f)return;if(p=0,j.status==="completed"&&j.token){l("completed"),h(!0),setTimeout(async()=>{try{i(j.token),await a({silent:!1,token:j.token})}catch{}e("/hub",{replace:!0})},5e3);return}if(m.current++,m.current>=Gk){l("error"),d("Payment is taking longer than expected. Please check your email or contact support.");return}setTimeout(x,Wk)}catch(w){if(f)return;if((w.message==="Failed to fetch"||((b=w.message)==null?void 0:b.includes("NetworkError")))&&p<g){p++,console.warn(`[registration] Network error, retrying (${p}/${g})...`),setTimeout(x,3e3);return}l("error"),d(((y=w.data)==null?void 0:y.message)||w.message||"Failed to check registration status.")}};return x(),()=>{f=!0}},[e,s,a,i]),n&&!u?r.jsx(Mn,{to:"/hub",replace:!0}):r.jsx("div",{className:"max-w-xl mx-auto px-4 md:px-6 py-20",children:r.jsx(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.4},children:r.jsx(ne,{children:r.jsxs(re,{children:[o==="polling"&&r.jsxs("div",{className:"text-center py-8",children:[r.jsx($a,{className:"h-12 w-12 text-accent-600 animate-spin mx-auto"}),r.jsx("h2",{className:"mt-4 text-xl font-semibold text-slate-900",children:"Completing your registrationâ¦"}),r.jsx("p",{className:"mt-2 text-sm text-slate-500",children:"Your payment was received. We're setting up your membership now. This usually takes a few seconds."})]}),o==="completed"&&r.jsxs("div",{className:"text-center py-8",children:[r.jsx(Pr,{className:"h-12 w-12 text-green-500 mx-auto"}),r.jsx("h2",{className:"mt-4 text-xl font-semibold text-slate-900",children:"Welcome to ACGC!"}),r.jsx("p",{className:"mt-2 text-sm text-slate-600",children:"Your membership is active. You now have full access to the Member Directory, events, resources, and more."}),r.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Redirecting you to the dashboardâ¦"})]}),o==="error"&&r.jsxs("div",{className:"text-center py-8",children:[r.jsx(B3,{className:"h-12 w-12 text-red-400 mx-auto"}),r.jsx("h2",{className:"mt-4 text-xl font-semibold text-slate-900",children:"Something went wrong"}),r.jsx("p",{className:"mt-2 text-sm text-slate-600",children:c}),r.jsxs("div",{className:"mt-6 flex flex-col sm:flex-row gap-3 justify-center",children:[r.jsx(W,{as:K,to:"/join",variant:"primary",children:"Try again"}),r.jsx(W,{as:"a",href:"mailto:[email protected]?subject=Registration%20Issue",variant:"ghost",children:"Contact support"})]})]})]})})})})}const M9=[{title:"Member Directory",desc:"Find peers by country, sector, and role.",icon:at,to:"/hub/directory"},{title:"Resources",desc:"Articles, toolkits, webinars, and more.",icon:Du,to:"/hub/resources"},{title:"Events",desc:"Webinars, conferences, and forums.",icon:Ds,to:"/hub/events"},{title:"Billing",desc:"Upgrade and manage your membership.",icon:gi,to:"/billing"}];function A9(){var s;const{member:t}=Oe(),e=(t==null?void 0:t.role)==="admin"||(t==null?void 0:t.role)==="editor";return r.jsxs("div",{className:"grid gap-6",children:[r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center justify-between gap-4 flex-wrap",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"text-slate-50 font-semibold text-xl",children:["Welcome back, ",t==null?void 0:t.first_name]}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Your dashboard will surface new content, event reminders, and community updates."})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[e?r.jsx(Te,{tone:"accent",children:"Admin"}):r.jsxs(Te,{tone:(t==null?void 0:t.payment_status)==="paid"?"accent":"default",children:["Status: ",(t==null?void 0:t.payment_status)==="paid"?"Paid":"Free"]}),r.jsx(Te,{tone:"brand",children:(t==null?void 0:t.membership_package)==="organisation"?"Organisation Plan":"Individual Plan"})]})]})}),r.jsx(re,{children:r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsx(a0,{title:"Notifications",icon:h7,desc:"Youâll see new uploads and event updates here.",badge:"Coming soon"}),r.jsx(a0,{title:"Organisation",icon:at,desc:((s=t==null?void 0:t.organisation)==null?void 0:s.name)||"â",badge:(t==null?void 0:t.sector_type)||"â"}),r.jsx(a0,{title:"Industry",icon:Du,desc:(t==null?void 0:t.industry)||"â",badge:(t==null?void 0:t.country)||"â"})]})})]}),r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-50 font-semibold",children:"Explore"}),r.jsx("div",{className:"mt-1 text-sm text-slate-400",children:"Qu
725ick access to your member tools and content."}),r.jsx("div",{className:"mt-4 grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:M9.concat(e?[{title:"Manage Events",desc:"Create and edit events.",icon:Ds,to:"/hub/events/manage"},{title:"Manage Resources",desc:"Upload and organise resources.",icon:Du,to:"/hub/resources/manage"},{title:"Manage Insights",desc:"Publish articles and newsletters.",icon:es,to:"/hub/insights/manage"},{title:"Manage Jobs",desc:"Post and manage job listings.",icon:Wt,to:"/hub/jobs/manage"},{title:"Resource Hub",desc:"Manage gated resource hub programs.",icon:Uw,to:"/hub/resource-hub"},{title:"LIFT",desc:"Manage LIFT programmes and sponsorships.",icon:k7,to:"/hub/lift/manage"},{title:"Conferences",desc:"Create and edit conference editions.",icon:so,to:"/hub/conferences/manage"},{title:"Conference Registrations",desc:"See who has registered and what they paid.",icon:Fn,to:"/hub/conference/manage"},{title:"Partner Videos",desc:"Manage conference highlight videos.",icon:Wi,to:"/hub/partner-videos"},{title:"Manage Leaderboard",desc:"Assign rankings to ACGC members.",icon:Yw,to:"/hub/leaderboard/manage"}]:[]).map((n,a)=>r.jsx(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:a*.05},whileHover:{y:-4},children:r.jsx(K,{to:n.to,className:"block",children:r.jsx(ne,{className:"h-full",children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-50 font-semibold",children:n.title}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:n.desc})]}),r.jsx("div",{className:"h-10 w-10 rounded-2xl bg-white/5 border border-white/10 grid place-items-center",children:r.jsx(n.icon,{className:"h-5 w-5 text-slate-200"})})]}),r.jsx("div",{className:"mt-4",children:r.jsx(W,{variant:"portal",className:"w-full",children:"Open"})})]})})})},n.title))})]})]})}function a0({title:t,desc:e,icon:s,badge:n}){return r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/20 p-4",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"text-slate-100 font-medium",children:t}),r.jsx("div",{className:"h-9 w-9 rounded-2xl bg-white/5 border border-white/10 grid place-items-center",children:r.jsx(s,{className:"h-4 w-4 text-slate-200"})})]}),r.jsx("div",{className:"mt-2 text-sm text-slate-300",children:e}),r.jsx("div",{className:"mt-3",children:r.jsx(Te,{tone:"default",children:n})})]})}function P9(t,e){const[s,n]=v.useState(t);return v.useEffect(()=>{const a=setTimeout(()=>n(t),e);return()=>clearTimeout(a)},[t,e]),s}function D9(){const{token:t,member:e}=Oe(),{t:s}=en();Bn();const[n,a]=v.useState(""),[i,o]=v.useState(""),[l,c]=v.useState(""),[d,u]=v.useState(""),[h,m]=v.useState(""),f=P9(n,250),[p,g]=v.useState([]),[x,b]=v.useState(!1),[y,w]=v.useState(""),[N,j]=v.useState(null),[S,k]=v.useState(""),[C,T]=v.useState(""),[A,E]=v.useState(!1),[L,D]=v.useState(""),[P,R]=v.useState(""),$=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",O=$||(e==null?void 0:e.payment_status)==="paid";v.useEffect(()=>{if(!O)return;(async()=>{b(!0),w("");try{const ce=new URLSearchParams;f&&ce.set("q",f),i&&ce.set("country",i),l&&ce.set("sector",l),d&&ce.set("industry",d),h&&ce.set("role",h);const fe=await U(`/api/directory/members?${ce.toString()}`,{token:t});g(fe.members)}catch(ce){w(ce.message||"Failed to load directory")}finally{b(!1)}})()},[t,f,i,l,d,h,O]);const _=Q=>{j(Q),k(""),T(""),D(""),R("")},B=async()=>{if(!C.trim()){R("Please enter a message");return}E(!0),R("");try{await U("/api/messages",{token:t,method:"POST",body:{to_member_id:N.id,subject:S.trim(),body:C.trim()}}),D("Message sent!"),setTimeout(()=>j(null),1500)}catch(Q){R(Q.message==="recipient_disabled_messages"?"This member has disabled messages.":Q.message||"Failed to send")}finally{E(!1)}},J=()=>{window.open(tt(`/api/directory/export/csv?token=${t}`),"_blank")};return O?r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-50 font-semibold text-xl",children:s("portalDirectory.title")}),r.jsx("div",{className:"mt-1 text-sm text-slate-400",children:"Find peers by name, jurisdiction, role, or industry."})]}),$&&r.jsxs(W,{variant:"portal",onClick:J,children:[r.jsx(Ys,{className:"h-4 w-4"})," Export CSV"]})]}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"grid md:grid-cols-5 ga
725p-4",children:[r.jsx(Y,{label:"Search",labelClassName:"text-slate-200",value:n,onChange:Q=>a(Q.target.value),placeholder:"Name, title, companyâ¦"}),r.jsx(Y,{label:"Country",labelClassName:"text-slate-200",value:i,onChange:Q=>o(Q.target.value),placeholder:"e.g. Nigeria"}),r.jsx(Y,{label:"Role / Title",labelClassName:"text-slate-200",value:h,onChange:Q=>m(Q.target.value),placeholder:"e.g. General Counsel"}),r.jsxs(Re,{label:"Sector",labelClassName:"text-slate-200",value:l,onChange:Q=>c(Q.target.value),children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:"All sectors"}),ch.map(Q=>r.jsx("option",{value:Q.value,className:"bg-white text-slate-900",children:Q.label},Q.value))]}),r.jsxs(Re,{label:"Industry",labelClassName:"text-slate-200",value:d,onChange:Q=>u(Q.target.value),children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:"All industries"}),Gi.map(Q=>r.jsx("option",{value:Q,className:"bg-white text-slate-900",children:Q},Q))]})]}),y?r.jsx("div",{className:"mt-3 text-sm text-red-300",children:y}):null,r.jsxs("div",{className:"mt-4 text-sm text-slate-400 flex items-center gap-2",children:[r.jsx(Ua,{className:"h-4 w-4"}),x?"Searchingâ¦":`${p.length} member${p.length!==1?"s":""} found`]})]})}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:p.map((Q,ce)=>r.jsx(V.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:Math.min(ce*.02,.4)},children:r.jsx(R9,{m:Q,onMessage:()=>_(Q),currentId:e==null?void 0:e.id})},Q.id))}),!x&&p.length===0&&r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-slate-200 text-center py-4",children:"No members match your filters."})})}),N&&r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:()=>j(null),"aria-label":"Close"}),r.jsx("div",{className:"relative max-w-lg mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-white/10 bg-brand-900 shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between",children:[r.jsxs("div",{className:"text-white font-semibold flex items-center gap-2",children:[r.jsx(In,{className:"h-4 w-4"}),"Message ",N.first_name," ",N.last_name]}),r.jsx("button",{onClick:()=>j(null),className:"text-slate-400 hover:text-white",children:r.jsx(He,{className:"h-5 w-5"})})]}),r.jsxs("div",{className:"p-4 grid gap-4",children:[L&&r.jsx("div",{className:"text-sm text-green-300",children:L}),P&&r.jsx("div",{className:"text-sm text-red-300",children:P}),r.jsx(Y,{label:"Subject (optional)",labelClassName:"text-slate-200",value:S,onChange:Q=>k(Q.target.value),placeholder:"Quick questionâ¦"}),r.jsxs("div",{children:[r.jsx("label",{className:"acgc-label text-sm text-slate-200 mb-1 block",children:"Message *"}),r.jsx("textarea",{value:C,onChange:Q=>T(Q.target.value),rows:4,className:"w-full rounded-2xl bg-white/10 border border-white/15 px-4 py-3 text-sm text-white placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500/50",placeholder:"Your messageâ¦"})]}),r.jsx("div",{className:"text-xs text-slate-500",children:"Your identity is shared with the recipient. No personal email or phone is exchanged."}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(W,{variant:"portal",onClick:()=>j(null),children:"Cancel"}),r.jsxs(W,{variant:"primary",onClick:B,disabled:A,children:[r.jsx(ia,{className:"h-4 w-4"})," ",A?"Sendingâ¦":"Send"]})]})]})]})})]})]}):r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-2xl bg-red-500/10 border border-red-500/20 grid place-items-center",children:r.jsx(Ru,{className:"h-5 w-5 text-red-200"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-50 font-semibold",children:s("portalDirectory.paidTitle")}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:s("portalDirectory.paidSub")}),r.jsx("div",{className:"mt-4",children:r.jsx(W,{as:K,to:"/billing",variant:"primary",children:s("portalDirectory.goToBilling")})})]})]})})})}function R9({m:t,onMessage:e,currentId:s}){const n=t.avatar_url?t.avatar_url.startsWith("data:")||t.avatar_url.startsWith("http")?t.avatar_url:tt(t.avatar_url):null,a=t.privacy_allow_messages&&t.id!==s;return r.jsx(ne,{className:"h-full",children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx(K,{to:`/hub/directory/${t.id}
725`,className:"h-14 w-14 rounded-2xl border border-white/15 overflow-hidden bg-white/5 grid place-items-center shrink-0 hover:border-accent-500/40 transition",children:n?r.jsx("img",{src:n,alt:"",className:"h-full w-full object-cover"}):r.jsx(Ls,{className:"h-6 w-6 text-slate-500"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs(K,{to:`/hub/directory/${t.id}`,className:"text-slate-50 font-semibold truncate block hover:text-accent-200 transition",children:[t.first_name," ",t.last_name]}),r.jsxs("div",{className:"text-sm text-slate-300 flex items-start gap-1.5 leading-snug break-words",children:[r.jsx(Wt,{className:"h-3.5 w-3.5 text-slate-400 shrink-0 mt-0.5"}),t.job_title]}),r.jsxs("div",{className:"text-sm text-slate-400 flex items-center gap-1.5 truncate",children:[r.jsx(Gt,{className:"h-3.5 w-3.5 text-slate-500 shrink-0"}),t.organisation_name]})]})]}),t.bio&&r.jsx("div",{className:"mt-3 text-xs text-slate-400 line-clamp-2",children:t.bio}),r.jsxs("div",{className:"mt-3 flex flex-wrap gap-1.5",children:[r.jsxs(Te,{tone:"brand",className:"text-xs",children:[r.jsx(kt,{className:"h-3 w-3 mr-0.5"})," ",t.country]}),r.jsx(Te,{tone:"default",className:"text-xs",children:t.sector_type}),r.jsx(Te,{tone:"default",className:"text-xs",children:t.industry}),t.group_name&&r.jsxs(Te,{tone:"accent",className:"text-xs",children:[r.jsx(Gt,{className:"h-3 w-3 mr-0.5"})," ",t.group_name]})]}),t.role!=="admin"&&r.jsx("div",{className:"mt-2",children:r.jsxs(Te,{tone:"default",className:"text-xs",children:[r.jsx(aa,{className:"h-3 w-3 mr-0.5"})," Member since ",t.member_since_year]}
725)}),r.jsxs("div",{className:"mt-4 flex items-center gap-2 border-t border-white/10 pt-3",children:[t.privacy_show_linkedin&&t.linkedin_url&&r.jsx("a",{href:t.linkedin_url,target:"_blank",rel:"noreferrer",className:"p-2 rounded-xl hover:bg-white/10 text-slate-300 hover:text-white transition",title:"LinkedIn",children:r.jsx(bn,{className:"h-4 w-4"})}),t.twitter_url&&r.jsx("a",{href:t.twitter_url,target:"_blank",rel:"noreferrer",className:"p-2 rounded-xl hover:bg-white/10 text-slate-300 hover:text-white transition",title:"Twitter / X",children:r.jsx(lh,{className:"h-4 w-4"})}),r.jsx("div",{className:"flex-1"}),a?r.jsxs(W,{variant:"ghost",size:"sm",onClick:e,className:"text-xs",children:[r.jsx(In,{className:"h-3.5 w-3.5"})," Message"]}):t.id!==s?r.jsx("span",{className:"text-xs text-slate-500",children:"Messages disabled"}):null]})]})})}function L9(){const{id:t}=al(),{token:e,member:s}=Oe(),n=Bn(),[a,i]=v.useState(null),[o,l]=v.useState(!0),[c,d]=v.useState(""),[u,h]=v.useState(!1),[m,f]=v.useState(""),[p,g]=v.useState(""),[x,b]=v.useState(!1),[y,w]=v.useState(""),[N,j]=v.useState("");v.useEffect(()=>{t&&(l(!0),d(""),U(`/api/directory/members/${t}`,{token:e}).then(D=>i(D.member)).catch(D=>d(D.message||"Failed to load profile")).finally(()=>l(!1)))},[t,e]);const S=()=>{h(!0),f(""),g(""),w(""),j("")},k=async()=>{if(!p.trim()){j("Please enter a message");return}b(!0),j("");try{await U("/api/messages",{token:e,method:"POST",body:{to_member_id:a.id,subject:m.trim(),body:p.trim()}}),w("Message sent!"),setTimeout(()=>h(!1),1500)}catch(D){j(D.message==="recipient_disabled_messages"?"This member has disabled messages.":D.message||"Failed to send")}finally{b(!1)}};if(o)return r.jsx("div",{className:"flex items-center justify-center py-20",children:r.jsx("div",{className:"h-8 w-8 border-2 border-accent-500 border-t-transparent rounded-full animate-spin"})});if(c||!a)return r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"text-center py-8",children:[r.jsx("div",{className:"text-red-300 mb-2",children:c||"Member not found"}),r.jsxs(W,{variant:"portal",onClick:()=>n("/hub/directory"),children:[r.jsx(vn,{className:"h-4 w-4"})," Back to Directory"]})]})})});const C=a.avatar_url?a.avatar_url.startsWith("data:")||a.avatar_url.startsWith("http")?a.avatar_url:tt(a.avatar_url):null,T=(s==null?void 0:s.id)===a.id,A=a.privacy_allow_messages&&!T,E=new Date().getFullYear()-(a.member_since_year||new Date().getFullYear()),L=E<1?"New member":E===1?"1 year":`${E} years`;return r.jsxs("div",{className:"grid gap-5 max-w-3xl mx-auto",children:[r.jsx("div",{children:r.jsxs(W,{variant:"ghost",size:"sm",onClick:()=>n("/hub/directory"),className:"text-slate-400 hover:text-white",children:[r.jsx(vn,{className:"h-4 w-4"})," Back to Directory"]})}),r.jsx(V.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},children:r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex flex-col sm:flex-row items-start gap-5",children:[r.jsx("div",{className:"h-28 w-28 rounded-2xl border-2 border-white/15 overflow-hidden bg-white/5 grid place-items-center shrink-0",children:C?r.jsx("img",{src:C,alt:`${a.first_name} ${a.last_name}`,className:"h-full w-full object-cover"}):r.jsx(Ls,{className:"h-12 w-12 text-slate-500"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("h1",{className:"text-white font-bold text-2xl",children:[a.first_name," ",a.last_name]}),r.jsxs("div",{className:"mt-2 space-y-1",children:[r.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-2",children:[r.jsx(Wt,{className:"h-4 w-4 text-slate-400 shrink-0"}),a.job_title]}),r.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-2",children:[r.jsx(Gt,{className:"h-4 w-4 text-slate-400 shrink-0"}),a.organisation_name]}),r.jsxs("div",{className:"text-sm text-slate-300 flex items-center gap-2",children:[r.jsx(kt,{className:"h-4 w-4 text-slate-400 shrink-0"}),a.country]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[a.role!=="admin"&&r.jsxs(Te,{tone:"brand",children:[r.jsx(aa,{className:"h-3 w-3 mr-1"})," Member since ",a.member_since_year]}
725),a.role!=="admin"&&E>=1&&r.jsxs(Te,{tone:"accent",children:[L," tenure"]}),r.jsx(Te,{tone:"default",children:a.sector_type}),r.jsx(Te,{tone:"default",children:a.industry}),a.group_name&&r.jsxs(Te,{tone:"accent",children:[r.jsx(Gt,{className:"h-3 w-3 mr-1"})," ",a.group_name]})]})]}),r.jsxs("div",{className:"shrink-0 flex flex-col gap-2",children:[T&&r.jsx(W,{variant:"portal",as:K,to:"/hub/profile",children:"Edit My Profile"}),A&&r.jsxs(W,{variant:"primary",onClick:S,children:[r.jsx(In,{className:"h-4 w-4"})," Send Message"]}),!A&&!T&&r.jsx("span",{className:"text-xs text-slate-500 text-center",children:"Messages disabled"})]})]}),a.bio&&r.jsxs("div",{className:"mt-5 border-t border-white/10 pt-4",children:[r.jsx("div",{className:"text-xs uppercase tracking-widest text-slate-500 mb-2",children:"About"}),r.jsx("div",{className:"text-sm text-slate-200 leading-relaxed whitespace-pre-wrap",children:a.bio})]})]})})}),r.jsx(V.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.05},children:r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"text-white font-semibold mb-4 flex items-center gap-2",children:[r.jsx(pt,{className:"h-4 w-4 text-slate-400"})," Contact & Social"]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[a.email&&r.jsx(gr,{icon:Ft,label:"Email",value:a.email,link:`mailto:${a.email}`}),a.phone&&r.jsx(gr,{icon:Ai,label:"Phone",value:a.phone,link:`tel:${a.phone}`}),a.linkedin_url&&r.jsx(gr,{icon:bn,label:"LinkedIn",value:"View Profile",link:a.linkedin_url,external:!0}),a.twitter_url&&r.jsx(gr,{icon:lh,label:"Twitter / X",value:"View Profile",link:a.twitter_url,external:!0}),a.instagram_url&&r.jsx(gr,{icon:oh,label:"Instagram",value:"View Profile",link:a.instagram_url,external:!0}),!a.email&&!a.phone&&!a.linkedin_url&&!a.twitter_url&&!a.instagram_url&&r.jsxs("div",{className:"text-sm text-slate-500 col-span-full flex items-center gap-2",children:[r.jsx(Hi,{className:"h-4 w-4"})," This member has not shared public contact information."]})]})]})})}),r.jsx(V.div,{initial:{opacity:0,y:12},animate:{opacity:1,y:0},transition:{delay:.1},children:r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"text-white font-semibold mb-4 flex items-center gap-2",children:[r.jsx(Wt,{className:"h-4 w-4 text-slate-400"})," Professional Details"]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[r.jsx(gr,{icon:Wt,label:"Job Title",value:a.job_title}),r.jsx(gr,{icon:Gt,label:"Organisation",value:a.organisation_name}),r.jsx(gr,{icon:kt,label:"Country",value:a.country}),r.jsx(gr,{icon:pt,label:"Sector",value:a.sector_type}),r.jsx(gr,{icon:pt,label:"Industry",value:a.industry}),a.role!=="admin"&&r.jsx(gr,{icon:aa,label:"Member Since",value:a.member_since_year})]})]})})}),u&&r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:()=>h(!1),"aria-label":"Close"}),r.jsx("div",{className:"relative max-w-lg mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-white/10 bg-brand-900 shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between",children:[r.jsxs("div",{className:"text-white font-semibold flex items-center gap-2",children:[r.jsx(In,{className:"h-4 w-4"}),"Message ",a.first_name," ",a.last_name]}),r.jsx("button",{onClick:()=>h(!1),className:"text-slate-400 hover:text-white",children:r.jsx(He,{className:"h-5 w-5"})})]}),r.jsxs("div",{className:"p-4 grid gap-4",children:[y&&r.jsx("div",{className:"text-sm text-green-300",children:y}),N&&r.jsx("div",{className:"text-sm text-red-300",children:N}),r.jsx(Y,{label:"Subject (optional)",labelClassName:"text-slate-200",value:m,onChange:D=>f(D.target.value),placeholder:"Quick questionâ¦"}),r.jsxs("div",{children:[r.jsx("label",{className:"acgc-label text-sm text-slate-200 mb-1 block",children:"Message *"}),r.jsx("textarea",{value:p,onChange:D=>g(D.target.value),rows:4,className:"w-full rounded-2xl bg-white/10 border border-white/15 px-4 py-3 text-sm text-white placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500/50",placeholder:"Your messageâ¦"})]}),r.jsx("div",{className:"text-xs text-slate-500",children:"Your identity is shared with the recipient. No personal email or phone is exchanged."}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(W,{variant:"portal",onClick:()=>h(!1),children:"Cancel"}),r.jsxs(W,{variant:"primary",onClick:k,disabled:x,children:[r.jsx(ia,{className:"h-4 w-4"})," ",x?"Sendingâ¦":"Send"]})]})]})]})})]})]})}function gr({icon:t,label:e,value:s,link:n,external:a}){return s?r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/20 p-4 flex items-start gap-3",children:[t&&r.jsx(t,{className:"h-4 w-4 text-slate-500 mt-0.5 shrink-0"}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-xs uppercase tracking-widest text-slate-500",children:e}),n?r.jsx("a",{href:n,target:a?"_blank":void 0,rel:a?"noreferrer":void 0,className:"mt-1 text-sm text-accent-200 hover:text-accent-100 break-all block",children:s}):r.jsx("div",{className:"mt-1 text-sm text-slate-100 break-words",children:s})]})]}):null}function O9(){var j,S;const{token:t,member:e,refresh:s}=Oe(),n=v.useRef(null),[a,i]=v.useState(!1),[o,l]=v.useState(!1),[c,d]=v.useState(!1),[u,h]=v.useState(""),[m,f]=v.useState(""),[p,g]=v.useState({});v.useEffect(()=>{e&&g({first_name:e.first_name||"",last_name:e.last_name||"",job_title:e.job_title||"",country:e.country||"",sector_type:e.sector_type||"",industry:e.industry||"",linkedin_url:e.linkedin_url||"",twitter_url:e.twitter_url||"",instagram_url:e.instagram_url||"",bio:e.bio||"",phone:e.phone||"",privacy_show_email:!!e.privacy_show_email,privacy_show_phone:!!e.privacy_show_phone,privacy_show_linkedin:e.privacy_show_linkedin!==!1,privacy_allow_messages:e.privacy_allow_messages!==!1})},[e]);const x=(k,C)=>g(T=>({...T,[k]:C})),b=e!=null&&e.avatar_url?e.avatar_url.startsWith("data:")||e.avatar_url.startsWith("http")?e.avatar_url:tt(e.avatar_url):null,y=async k=>{var T;const C=(T=k.target.files)==null?void 0:T[0];if(C){i(!0),f("");try{const A=new FormData;A.append("avatar",C);const E=await fetch(tt("/api/me/avatar"),{method:"POST",headers:{Authorization:`Bearer ${t}`},body:A}),L=await E.json();if(!E.ok)throw new Error(L.error||"Upload failed");h("Photo updated!"),await s()}catch(A){f(A.message||"Upload failed")}finally{i(!1)}}},w=async()=>{d(!0),f(""),h("");try{await U("/api/me/profile",{token:t,method:"PUT",body:p}),h("Profile saved!"),l(!1),await s()}catch(k){f(k.message||"Save failed")}finally{d(!1)}},N=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor";return r.jsxs("div",{className:"grid gap-5 max-w-3xl mx-auto",children:[u&&r.jsx("div",{className:"text-sm text-green-300 bg-green-500/10 border border-green-500/20 rounded-2xl px-4 py-2",children:u}),m&&r.jsx("div",{className:"text-sm text-red-300 bg-red-500/10 border border-red-500/20 rounded-2xl px-4 py-2",children:m}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex flex-col items-center text-center sm:flex-row sm:text-left sm:items-start gap-5",children:[r.jsxs("div",{className:"relative group shrink-0",children:[r.jsx("div",{className:"h-28 w-28 rounded-full border-4 border-white/15 overflow-hidden bg-white/5 grid place-items-center shadow-lg",children:b?r.jsx("img",{src:b,alt:"Avatar",className:"h-full w-full object-cover"}):r.jsx(Ls,{className:"h-12 w-12 text-slate-500"})}),r.jsx("button",{onClick:()=>{var k;return(k=n.current)==null?void 0:k.click()},disabled:a,className:"absolute inset-0 rounded-full bg-black/50 opacity-0 group-hover:opacity-100 transition grid place-items-center cursor-pointer",children:r.jsx(xx,{className:"h-5 w-5 text-white"})}),r.jsx("input",{ref:n,type:"file",accept:"image/*",className:"hidden",onChange:y}),a&&r.jsx("div",{className:"absolute inset-0 rounded-full bg-black/60 grid place-items-center",children:r.jsx("div",{className:"h-5 w-5 border-2 border-white border-t-transparent roun
725ded-full animate-spin"})})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("h1",{className:"text-white font-bold text-2xl",children:[e==null?void 0:e.first_name," ",e==null?void 0:e.last_name]}),r.jsxs("div",{className:"mt-2 space-y-1",children:[r.jsxs("div",{className:"text-sm text-slate-300 flex items-center justify-center sm:justify-start gap-2",children:[r.jsx(Wt,{className:"h-4 w-4 text-slate-400 shrink-0"}),e==null?void 0:e.job_title]}),r.jsxs("div",{className:"text-sm text-slate-300 flex items-center justify-center sm:justify-start gap-2",children:[r.jsx(Gt,{className:"h-4 w-4 text-slate-400 shrink-0"}),(j=e==null?void 0:e.organisation)==null?void 0:j.name]}),r.jsxs("div",{className:"text-sm text-slate-300 flex items-center justify-center sm:justify-start gap-2",children:[r.jsx(kt,{className:"h-4 w-4 text-slate-400 shrink-0"}),e==null?void 0:e.country]})]}),r.jsxs("div",{className:"mt-3 flex flex-wrap justify-center sm:justify-start gap-2",children:[!N&&r.jsxs(Te,{tone:"brand",children:[r.jsx(aa,{className:"h-3 w-3 mr-1"})," Member since ",e==null?void 0:e.member_since_year]}
725),r.jsx(Te,{tone:(e==null?void 0:e.payment_status)==="paid"||N?"accent":"default",children:N?e==null?void 0:e.role:e==null?void 0:e.payment_status}),!N&&r.jsx(Te,{tone:"default",children:e==null?void 0:e.membership_package})]})]}),r.jsx("div",{className:"shrink-0",children:o?r.jsxs("div",{className:"flex gap-2",children:[r.jsxs(W,{variant:"portal",onClick:()=>l(!1),children:[r.jsx(He,{className:"h-4 w-4"})," Cancel"]}),r.jsxs(W,{variant:"primary",onClick:w,disabled:c,children:[r.jsx(Gw,{className:"h-4 w-4"})," ",c?"Savingâ¦":"Save"]})]}):r.jsxs(W,{variant:"portal",onClick:()=>l(!0),children:[r.jsx(Ui,{className:"h-4 w-4"})," Edit Profile"]})})]}),!o&&(e==null?void 0:e.bio)&&r.jsxs("div",{className:"mt-5 border-t border-white/10 pt-4",children:[r.jsx("div",{className:"text-xs uppercase tracking-widest text-slate-500 mb-2",children:"About"}),r.jsx("div",{className:"text-sm text-slate-200 leading-relaxed whitespace-pre-wrap",children:e.bio})]})]})}),o&&r.jsxs(V.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"grid gap-4",children:[r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"text-white font-semibold mb-4 flex items-center gap-2",children:[r.jsx(Ui,{className:"h-4 w-4 text-slate-400"})," Edit Profile"]}),r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:"First Name",labelClassName:"text-slate-200",value:p.first_name,onChange:k=>x("first_name",k.target.value)}),r.jsx(Y,{label:"Last Name",labelClassName:"text-slate-200",value:p.last_name,onChange:k=>x("last_name",k.target.value)})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:"Job Title",labelClassName:"text-slate-200",value:p.job_title,onChange:k=>x("job_title",k.target.value)}),r.jsxs(Re,{label:"Country",labelClassName:"text-slate-200",value:p.country,onChange:k=>x("country",k.target.value),children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:"Select country"}),r.jsx("optgroup",{label:"Africa",className:"bg-white text-slate-900",children:vy.slice(0,54).map(k=>r.jsx("option",{value:k,className:"bg-white text-slate-900",children:k},k))}),r.jsx("optgroup",{label:"Rest of World",className:"bg-white text-slate-900",children:vy.slice(54).map(k=>r.jsx("option",{value:k,className:"bg-white text-slate-900",children:k},k))})]})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Re,{label:"Sector",labelClassName:"text-slate-200",value:p.sector_type,onChange:k=>x("sector_type",k.target.value),children:ch.map(k=>r.jsx("option",{value:k.value,className:"bg-white text-slate-900",children:k.label},k.value))}),r.jsx(Re,{label:"Industry",labelClassName:"text-slate-200",value:p.industry,onChange:k=>x("industry",k.target.value),children:Gi.map(k=>r.jsx("option",{value:k,className:"bg-white text-slate-900",children:k},k))})]}),r.jsxs("div",{children:[r.jsx("label",{className:"acgc-label text-sm text-slate-200 mb-1 block",children:"Bio"}),r.jsx("textarea",{value:p.bio,onChange:k=>x("bio",k.target.value),rows:3,maxLength:500,className:"w-full rounded-2xl bg-white/10 border border-white/15 px-4 py-3 text-sm text-white placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500/50",placeholder:"A short professional bio\\u2026"}),r.jsxs("div",{className:"text-xs text-slate-500 mt-1",children:[(p.bio||"").length,"/500"]})]}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsx(Y,{label:"LinkedIn URL",labelClassName:"text-slate-200",value:p.linkedin_url,onChange:k=>x("linkedin_url",k.target.value),placeholder:"https://linkedin.com/in/..."}),r.jsx(Y,{label:"Twitter / X URL",labelClassName:"text-slate-200",value:p.twitter_url,onChange:k=>x("twitter_url",k.target.value),placeholder:"https://x.com/..."}),r.jsx(Y,{label:"Instagram URL",labelClassName:"text-slate-200",value:p.instagram_url,onChange:k=>x("instagram_url",k.target.value),placeholder:"https://instagram.com/..."})]}),r.jsx(Y,{label:"Phone",labelClassName:"text-slate-200",value:p.phone,onChange:k=>x("phone",k.target.value),placeholder:"+234..."})]})]})}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(Hi,{className:"h-5 w-5 text-slate-300"}),r.jsx("div",{className:"text-white font-semibold",children:"Privacy Settings"})]}),r.jsx("div",{className:"text-sm text-slate-400 mb-4",children:"Control what other members can see on your profile in the directory."}),r.jsxs("div",{className:"grid gap-3",children:[r.jsx(Qh,{icon:Ft,label:"Show email address",description:"Other members can see your email",checked:p.privacy_show_email,onChange:k=>x("privacy_show_email",k)}),r.jsx(Qh,{icon:Ai,label:"Show phone number",description:"Other members can see your phone",checked:p.privacy_show_phone,onChange:k=>x("privacy_show_phone",k)}),r.jsx(Qh,{icon:bn,label:"Show LinkedIn profile",description:"Display LinkedIn link on your directory card",checked:p.privacy_show_linkedin,onChange:k=>x("privacy_show_linkedin",k)}),r.jsx(Qh,{icon:In,label:"Allow in-portal messages",description:"Other members can send you private messages",checked:p.privacy_allow_messages,onChange:k=>x("privacy_allow_messages",k)})]})]})})]}),!o&&r.jsxs(r.Fragment,{children:[r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"text-white font-semibold mb-4 flex items-center gap-2",children:[r.jsx(pt,{className:"h-4 w-4 text-slate-400"})," Contact & Social"]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[r.jsx(Ir,{icon:Ft,label:"Email",value:e==null?void 0:e.email}),r.jsx(Ir,{icon:Ai,label:"Phone",value:e==null?void 0:e.phone}),r.jsx(Ir,{icon:bn,label:"LinkedIn",value:e==null?void 0:e.linkedin_url,link:!0}),r.jsx(Ir,{icon:lh,label:"Twitter / X",value:e==null?void 0:e.twitter_url,link:!0}),r.jsx(Ir,{icon:oh,label:"Instagram",value:e==null?void 0:e.instagram_url,link:!0}),r.jsx(Ir,{icon:Gt,label:"Organisation",value:(S=e==null?void 0:e.organisation)==null?void 0:S.name})]})]})}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"text-white font-semibold mb-4 flex items-center gap-2",children:[r.jsx(Wt,{className:"h-4 w-4 text-slate-400"})," Professional Details"]}
725),r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[r.jsx(Ir,{icon:Wt,label:"Job Title",value:e==null?void 0:e.job_title}),r.jsx(Ir,{icon:kt,label:"Country",value:e==null?void 0:e.country}),r.jsx(Ir,{icon:pt,label:"Sector",value:e==null?void 0:e.sector_type}),r.jsx(Ir,{icon:pt,label:"Industry",value:e==null?void 0:e.industry})]})]})}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[r.jsx(Hi,{className:"h-5 w-5 text-slate-300"}),r.jsx("div",{className:"text-white font-semibold",children:"Privacy Settings"})]}),r.jsx("div",{className:"text-sm text-slate-400 mb-4",children:'These control what other members see in the directory. Click "Edit Profile" to change.'}),r.jsxs("div",{className:"grid gap-2",children:[r.jsx(Jh,{icon:Ft,label:"Email visible to members",active:!!(e!=null&&e.privacy_show_email)}),r.jsx(Jh,{icon:Ai,label:"Phone visible to members",active:!!(e!=null&&e.privacy_show_phone)}),r.jsx(Jh,{icon:bn,label:"LinkedIn shown on directory card",active:(e==null?void 0:e.privacy_show_linkedin)!==!1}),r.jsx(Jh,{icon:In,label:"In-portal messages allowed",active:(e==null?void 0:e.privacy_allow_messages)!==!1})]})]})})]})]})}function Ir({icon:t,label:e,value:s,link:n}){const a=s||"â";return r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-black/20 p-4 flex items-start gap-3",children:[t&&r.jsx(t,{className:"h-4 w-4 text-slate-500 mt-0.5 shrink-0"}),r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-xs uppercase tracking-widest text-slate-500",children:e}),n&&s?r.jsx("a",{href:s,target:"_blank",rel:"noreferrer",className:"mt-1 text-sm text-accent-200 hover:text-accent-100 break-all block",children:a}):r.jsx("div",{className:"mt-1 text-sm text-slate-100 break-words",children:a})]})]})}function Jh({icon:t,label:e,active:s}){return r.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-2xl border border-white/10 bg-black/10",children:[r.jsx(t,{className:"h-4 w-4 text-slate-400 shrink-0"}),r.jsx("div",{className:"flex-1 text-sm text-slate-200",children:e}),r.jsxs("div",{className:`flex items-center gap-1.5 text-xs font-medium ${s?"text-green-400":"text-slate-500"}`,children:[s?r.jsx(is,{className:"h-3.5 w-3.5"}):r.jsx(He,{className:"h-3.5 w-3.5"}),s?"On":"Off"]})]})}function Qh({icon:t,label:e,description:s,checked:n,onChange:a}){return r.jsxs("label",{className:"flex items-start gap-3 p-3 rounded-2xl border border-white/10 bg-black/10 cursor-pointer hover:bg-white/5 transition",children:[r.jsx(t,{className:"h-4 w-4 text-slate-400 mt-1 shrink-0"}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm text-slate-100 font-medium",children:e}),r.jsx("div",{className:"text-xs text-slate-400",children:s})]}),r.jsx("div",{className:"shrink-0 mt-0.5",children:r.jsx("button",{type:"button",role:"switch","aria-checked":n,onClick:()=>a(!n),className:`relative inline-flex h-6 w-11 items-center rounded-full transition ${n?"bg-accent-500":"bg-white/15"}`,children:r.jsx("span",{className:`inline-block h-4 w-4 rounded-full bg-white transition-transform ${n?"translate-x-6":"translate-x-1"}`})})})]})}function I9(){const{token:t,member:e}=Oe(),{i18n:s,t:n}=en(),[a,i]=v.useState(""),[o,l]=v.useState(""),[c,d]=v.useState([]),[u,h]=v.useState([]),[m,f]=v.useState(!1),[p,g]=v.useState("");v.useEffect(()=>{(async()=>{try{const N=await U("/api/resources/categories",{token:t});h(N.categories||[])}catch{}})(),(async()=>{f(!0),g("");try{const N=new URLSearchParams;a&&N.set("category",a),o&&N.set("q",o),s!=null&&s.language&&N.set("lang",s.language);const j=await U(`/api/resources/members?${N.toString()}`,{token:t});d(j.resources)}catch(N){g(N.message||"Failed to load resources")}finally{f(!1)}})()},[t,a,o,s==null?void 0:s.language]);const x=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",b=x||(e==null?void 0:e.payment_status)==="paid";return r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:n("portalRe
725sources.title")}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:n("portalResources.sub")})]}),x?r.jsx(W,{as:"a",href:"/hub/resources/manage",variant:"portal",children:n("portalResources.postCta")}):null]}),r.jsx(ne,{children:r.jsxs(re,{children:[b?null:r.jsx("div",{className:"mb-4 rounded-2xl border border-white/10 bg-black/20 p-4",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-2xl bg-red-500/10 border border-red-500/20 grid place-items-center",children:r.jsx(Ru,{className:"h-5 w-5 text-red-200"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-50 font-semibold",children:n("portalResources.paidTitle")}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:n("portalResources.paidSub")}),r.jsx("div",{className:"mt-3",children:r.jsx(W,{as:K,to:"/billing",variant:"primary",children:n("portalResources.goToBilling")})})]})]})}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:n("portalResources.searchLabel"),value:o,onChange:y=>
725l(y.target.value),placeholder:n("portalResources.searchPlaceholder")}),r.jsx("div",{children:r.jsxs(Re,{label:n("portalResources.categoryLabel"),value:a,onChange:y=>i(y.target.value),children:[r.jsx("option",{value:"",children:n("portalResources.categoryAll")}),u.map(y=>r.jsx("option",{value:y.id,children:y.name},y.id))]})})]}),p?r.jsx("div",{className:"mt-3 text-sm text-red-300",children:p}):null,r.jsx("div",{className:"mt-3 text-sm text-slate-300",children:m?n("common.loading"):n("common.itemCount",{count:c.length})})]})}),(()=>{const y={};c.forEach(S=>{const k=S.category_id||S.category||"Other";y[k]||(y[k]=[]),y[k].push(S)});const w=u.map(S=>({id:S.id,name:S.name,items:y[S.id]||y[S.name]||[]})).filter(S=>S.items.length>0),N=new Set(u.map(S=>String(S.id)).concat(u.map(S=>String(S.name)))),j=[];return Object.keys(y).forEach(S=>{N.has(String(S))||j.push(...y[S])}),j.length>0&&w.push({id:"other",name:"Other",items:j}),w.map(S=>r.jsx(F9,{title:S.name,resources:S.items},S.id))})()]})}function F9({title:t,resources:e}){return!e||e.length===0?null:r.jsxs("div",{className:"mt-8 first:mt-4",children:[r.jsx("h2",{className:"text-2xl font-bold text-white mb-5",children:t}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-5",children:e.map((s,n)=>r.jsx(V.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},transition:{delay:n*.02},className:"h-full",children:r.jsx($9,{r:s})},s.id))})]})}function $9({r:t}){var i;const{t:e}=en(),s=`/resources/${t.id}`,n=((i=Lu.find(o=>o.value===(t.content_format||"")))==null?void 0:i.label)||t.content_format||t.type||"Read",a=t.access_level==="public";return r.jsxs(ne,{className:"h-full flex flex-col overflow-hidden bg-brand-800 border-white/5 hover:border-white/20 transition-all group p-0",children:[r.jsxs("div",{className:"relative aspect-[16/9] w-full bg-black/40 overflow-hidden rounded-t-2xl",children:[t.thumbnail_url?r.jsx("img",{src:t.thumbnail_url,alt:t.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):r.jsx("div",{className:"w-full h-full flex items-center justify-center text-white/20 bg-brand-900",children:t.content_format==="watch"?r.jsxs("svg",{className:"w-12 h-12",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:[r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"}),r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})]}):r.jsx("svg",{className:"w-10 h-10",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:r.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1,d:"M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"})})}),r.jsxs("div",{className:"absolute top-3 left-3 right-3 flex justify-between items-start",children:[r.jsx("div",{className:`px-2 py-1 text-[10px] font-bold rounded-full ${a?"bg-green-500 text-white":"bg-brand-600 text-white"}`,children:a?"FREE":"PAID"}),t.is_featured&&r.jsx("div",{className:"px-2 py-1 text-[10px] font-bold rounded-full bg-[#c08a2f] text-white",children:"FEATURED"})]}),r.jsx("div",{className:"absolute bottom-3 left-3",children:r.jsx("div",{className:"px-2 py-1 text-[10px] uppercase font-bold tracking-wider rounded-lg bg-black/80 text-[#c08a2f]",children:n})})]}),r.jsxs(re,{className:"flex flex-col flex-grow pt-4",children:[r.jsx("div",{className:"text-white font-bold text-lg leading-snug line-clamp-2",children:t.title}),t.summary?r.jsx("div",{className:"mt-2 text-sm text-slate-300 line-clamp-3",children:t.summary}):null,r.jsx("div",{className:"mt-auto pt-5 flex items-center justify-between",children:t.content_format==="profile"?r.jsxs(K,{className:"text-[#c08a2f] hover:text-white text-sm font-semibold flex items-center gap-1 transition-colors",to:s,children:["View Profile ",r.jsx("span",{"aria-hidden":"true",children:"â"})]}):t.body?r.jsxs(K,{className:"text-[#c08a2f] hover:text-white text-sm font-semibold flex items-center gap-1 transition-colors",to:s,children:["View Details ",r.jsx("span",{"aria-hidden":"true",children:"â"})]}):t.youtube_url?r.jsxs("a",{className:"text-[#c08a2f] hover:text-white text-sm font-semibold flex items-center gap-1 transition-colors",href:t.youtube_url,target:"_blank",rel:"noreferrer",children:["Watch Video ",r.jsx("span",{"aria-hidden":"true",children:"â"})]}):t.file_url?r.jsxs("a",{className:"text-[#c08a2f] hover:text-white text-sm font-semibold flex items-center gap-1 transition-colors",href:t.file_url,target:"_blank",rel:"noreferrer",children:["Download ",r.jsx("span",{"aria-hidden":"true",children:"â"})]}):null})]})]})}var fM={exports:{}},pM={};/** 726 * @license React 727 * use-sync-external-store-shim.production.js 728 * 729 * Copyright (c) Meta Platforms, Inc. and affiliates. 730 * 731 * This source code is licensed under the MIT license found in the 732 * LICENSE file in the root directory of this source tree. 733 */var jc=M;function z9(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var B9=typeof Object.is=="function"?Object.is:z9,V9=jc.useState,U9=jc.useEffect,H9=jc.useLayoutEffect,W9=jc.useDebugValue;function G9(t,e){var s=e(),n=V9({inst:{value:s,getSnapshot:e}}),a=n[0].inst,i=n[1];return H9(function(){a.value=s,a.getSnapshot=e,i0(a)&&i({inst:a})},[t,s,e]),U9(function(){return i0(a)&&i({inst:a}),t(function(){i0(a)&&i({inst:a})})},[t]),W9(s),s}function i0(t){var e=t.getSnapshot;t=t.value;try{var s=e();return!B9(t,s)}catch{return!0}}function Y9(t,e){return e()}var q9=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Y9:G9;pM.useSyncExternalStore=jc.useSyncExternalStore!==void 0?jc.useSyncExternalStore:q9;fM.exports=pM;var e1=fM.exports;function xs(t){this.content=t}xs.prototype={constructor:xs,find:function(t){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===t)return e;return-1},get:function(t){var e=this.find(t);return e==-1?void 0:this.content[e+1]},update:function(t,e,s){var n=s&&s!=t?this.remove(s):this,a=n.find(t),i=n.content.slice();return a==-1?i.push(s||t,e):(i[a+1]=e,s&&(i[a]=s)),new xs(i)},remove:function(t){var e=this.find(t);if(e==-1)return this;var s=this.content.slice();return s.splice(e,2),new xs(s)},addToStart:function(t,e){return new xs([t,e].concat(this.remove(t).content))},addToEnd:function(t,e){var s=this.remove(t).content.slice();return s.push(t,e),new xs(s)},addBefore:function(t,e,s){var n=this.remove(e),a=n.content.slice(),i=n.find(t);return a.splice(i==-1?a.length:i,0,e,s),new xs(a)}
vendor: 9,261 bytes, line 733
733,forEach:function(t){for(var e=0;e<this.content.length;e+=2)t(this.content[e],this.content[e+1])},prepend:function(t){return t=xs.from(t),t.size?new xs(t.content.concat(this.subtract(t).content)):this},append:function(t){return t=xs.from(t),t.size?new xs(this.subtract(t).content.concat(t.content)):this},subtract:function(t){var e=this;t=xs.from(t);for(var s=0;s<t.content.length;s+=2)e=e.remove(t.content[s]);return e},toObject:function(){var t={};return this.forEach(function(e,s){t[e]=s}),t},get size(){return this.content.length>>1}};xs.from=function(t){if(t instanceof xs)return t;var e=[];if(t)for(var s in t)e.push(s,t[s]);return new xs(e)};function xM(t,e,s){for(let n=0;;n++){if(n==t.childCount||n==e.childCount)return t.childCount==e.childCount?null:s;let a=t.child(n),i=e.child(n);if(a==i){s+=a.nodeSize;continue}if(!a.sameMarkup(i))return s;if(a.isText&&a.text!=i.text){for(let o=0;a.text[o]==i.text[o];o++)s++;return s}if(a.content.size||i.content.size){let o=xM(a.content,i.content,s+1);if(o!=null)return o}s+=a.nodeSize}}function gM(t,e,s,n){for(let a=t.childCount,i=e.childCount;;){if(a==0||i==0)return a==i?null:{a:s,b:n};let o=t.child(--a),l=e.child(--i),c=o.nodeSize;if(o==l){s-=c,n-=c;continue}if(!o.sameMarkup(l))return{a:s,b:n};if(o.isText&&o.text!=l.text){let d=0,u=Math.min(o.text.length,l.text.length);for(;d<u&&o.text[o.text.length-d-1]==l.text[l.text.length-d-1];)d++,s--,n--;return{a:s,b:n}}if(o.content.size||l.content.size){let d=gM(o.content,l.content,s-1,n-1);if(d)return d}s-=c,n-=c}}class se{constructor(e,s){if(this.content=e,this.size=s||0,s==null)for(let n=0;n<e.length;n++)this.size+=e[n].nodeSize}nodesBetween(e,s,n,a=0,i){for(let o=0,l=0;l<s;o++){let c=this.content[o],d=l+c.nodeSize;if(d>e&&n(c,a+l,i||null,o)!==!1&&c.content.size){let u=l+1;c.nodesBetween(Math.max(0,e-u),Math.min(c.content.size,s-u),n,a+u)}l=d}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,s,n,a){let i="",o=!0;return this.nodesBetween(e,s,(l,c)=>{let d=l.isText?l.text.slice(Math.max(e,c)-c,s-c):l.isLeaf?a?typeof a=="function"?a(l):a:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&d||l.isTextblock)&&n&&(o?o=!1:i+=n),i+=d},0),i}append(e){if(!e.size)return this;if(!this.size)return e;let s=this.lastChild,n=e.firstChild,a=this.content.slice(),i=0;for(s.isText&&s.sameMarkup(n)&&(a[a.length-1]=s.withText(s.text+n.text),i=1);i<e.content.length;i++)a.push(e.content[i]);return new se(a,this.size+e.size)}cut(e,s=this.size){if(e==0&&s==this.size)return this;let n=[],a=0;if(s>e)for(let i=0,o=0;o<s;i++){let l=this.content[i],c=o+l.nodeSize;c>e&&((o<e||c>s)&&(l.isText?l=l.cut(Math.max(0,e-o),Math.min(l.text.length,s-o)):l=l.cut(Math.max(0,e-o-1),Math.min(l.content.size,s-o-1))),n.push(l),a+=l.nodeSize),o=c}return new se(n,a)}cutByIndex(e,s){return e==s?se.empty:e==0&&s==this.content.length?this:new se(this.content.slice(e,s))}replaceChild(e,s){let n=this.content[e];if(n==s)return this;let a=this.content.slice(),i=this.size+s.nodeSize-n.nodeSize;return a[e]=s,new se(a,i)}addToStart(e){return new se([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new se(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let s=0;s<this.content.length;s++)if(!this.content[s].eq(e.content[s]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let s=this.content[e];if(!s)throw new RangeError("Index "+e+" out of range for "+this);return s}maybeChild(e){return this.content[e]||null}forEach(e){for(let s=0,n=0;s<this.content.length;s++){let a=this.content[s];e(a,n,s),n+=a.nodeSize}}findDiffStart(e,s=0){return xM(this,e,s)}findDiffEnd(e,s=this.size,n=e.size){return gM(this,e,s,n)}findIndex(e){if(e==0)return Xh(0,e);if(e==this.size)return Xh(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let s=0,n=0;;s++){let a=this.child(s),i=n+a.nodeSize;if(i>=e)return i==e?Xh(s+1,i):Xh(s,n);n=i}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,s){if(!s)return se.empty;if(!Array.isArray(s))throw new RangeError("Invalid input for Fragment.fromJSON");return new se(s.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return se.empty;let s,n=0;for(let a=0;a<e.length;a++){let i=e[a];n+=i.nodeSize,a&&i.isText&&e[a-1].sameMarkup(i)?(s||(s=e.slice(0,a)),s[s.length-1]=i.withText(s[s.length-1].text+i.text)):s&&s.push(i)}return new se(s||e,n)}static from(e){if(!e)return se.empty;if(e instanceof se)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new se([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}se.empty=new se([],0);const o0={index:0,offset:0};function Xh(t,e){return o0.index=t,o0.offset=e,o0}function Ff(t,e){if(t===e)return!0;if(!(t&&typeof t=="object")||!(e&&typeof e=="object"))return!1;let s=Array.isArray(t);if(Array.isArray(e)!=s)return!1;if(s){if(t.length!=e.length)return!1;for(let n=0;n<t.length;n++)if(!Ff(t[n],e[n]))return!1}else{for(let n in t)if(!(n in e)||!Ff(t[n],e[n]))return!1;for(let n in e)if(!(n in t))return!1}return!0}let rt=class wy{constructor(e,s){this.type=e,this.attrs=s}addToSet(e){let s,n=!1;for(let a=0;a<e.length;a++){let i=e[a];if(this.eq(i))return e;if(this.type.excludes(i.type))s||(s=e.slice(0,a));else{if(i.type.excludes(this.type))return e;!n&&i.type.rank>this.type.rank&&(s||(s=e.slice(0,a)),s.push(this),n=!0),s&&s.push(i)}}return s||(s=e.slice()),n||s.push(this),s}removeFromSet(e){for(let s=0;s<e.length;s++)if(this.eq(e[s]))return e.slice(0,s).concat(e.slice(s+1));return e}isInSet(e){for(let s=0;s<e.length;s++)if(this.eq(e[s]))return!0;return!1}eq(e){return this==e||this.type==e.type&&Ff(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let s in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,s){if(!s)throw new RangeError("Invalid input for Mark.fromJSON");let n=e.marks[s.type];if(!n)throw new RangeError(`There is no mark type ${s.type} in this schema`);let a=n.create(s.attrs);return n.checkAttrs(a.attrs),a}static sameSet(e,s){if(e==s)return!0;if(e.length!=s.length)return!1;for(let n=0;n<e.length;n++)if(!e[n].eq(s[n]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return wy.none;if(e instanceof wy)return[e];let s=e.slice();return s.sort((n,a)=>n.type.rank-a.type.rank),s}};rt.none=[];class $f extends Error{}class me{constructor(e,s,n){this.content=e,this.openStart=s,this.openEnd=n}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,s){let n=yM(this.content,e+this.openStart,s);return n&&new me(n,this.openStart,this.openEnd)}removeBetween(e,s){return new me(bM(this.content,e+this.openStart,s+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,s){if(!s)return me.empty;let n=s.openStart||0,a=s.openEnd||0;if(typeof n!="number"||typeof a!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new me(se.fromJSON(e,s.content),n,a)}static maxOpen(e,s=!0){let n=0,a=0;for(let i=e.firstChild;i&&!i.isLeaf&&(s||!i.type.spec.isolating);i=i.firstChild)n++;for(let i=e.lastChild;i&&!i.isLeaf&&(s||!i.type.spec.isolating);i=i.lastChild)a++;return new me(e,n,a)}}me.empty=new me(se.empty,0,0);function bM(t,e,s){let{index:n,offset:a}=t.findIndex(e),i=t.maybeChild(n),{index:o,offset:l}=t.findIndex(s);if(a==e||i.isText){if(l!=s&&!t.child(o).isText)throw new RangeError("Removing non-flat range");return t.cut(0,e).append(t.cut(s))}if(n!=o)throw new RangeError("Removing non-flat range");return t.replaceChild(n,i.copy(bM(i.content,e-a-1,s-a-1)))}function yM(t,e,s,n){let{index:a,offset:i}=t.findIndex(e),o=t.maybeChild(a);if(i==e||o.isText)return n&&!n.canReplace(a,a,s)?null:t.cut(0,e).append(s).append(t.cut(e));let l=yM(o.content,e-i-1,s,o);return l&&t.replaceChild(a,o.copy(l))}function K9(t,e,s){if(s.openStart>t.depth)throw new $f("Inserted content deeper than insertion position");if(t.depth-s.openStart!=e.depth-s.openEnd)throw new $f("Inconsistent open depths");return vM(t,e,s,0)}function vM(t,e,s,n){let a=t.index(n),i=t.node(n);if(a==e.index(n)&&n<t.depth-s.openStart){let o=vM(t,e,s,n+1);return i.copy(i.content.replaceChild(a,o))}else if(s.content.size)if(!s.openStart&&!s.openEnd&&t.depth==n&&e.depth==n){let o=t.parent,l=o.content;return Fo(o,l.cut(0,t.parentOffset).append(s.content).append(l.cut(e.parentOffset)))}else{let{start:o,end:l}=J9(s,t);return Fo(i,jM(t,o,l,e,n))}else return Fo(i,zf(t,e,n))}function wM(t,e){if(!e.type.compatibleContent(t.type))throw new $f("Cannot join "+e.type.name+" onto "+t.type.name)}
vendor: 9,458 bytes, line 733
733function jy(t,e,s){let n=t.node(s);return wM(n,e.node(s)),n}function Io(t,e){let s=e.length-1;s>=0&&t.isText&&t.sameMarkup(e[s])?e[s]=t.withText(e[s].text+t.text):e.push(t)}function Xd(t,e,s,n){let a=(e||t).node(s),i=0,o=e?e.index(s):a.childCount;t&&(i=t.index(s),t.depth>s?i++:t.textOffset&&(Io(t.nodeAfter,n),i++));for(let l=i;l<o;l++)Io(a.child(l),n);e&&e.depth==s&&e.textOffset&&Io(e.nodeBefore,n)}function Fo(t,e){return t.type.checkContent(e),t.copy(e)}function jM(t,e,s,n,a){let i=t.depth>a&&jy(t,e,a+1),o=n.depth>a&&jy(s,n,a+1),l=[];return Xd(null,t,a,l),i&&o&&e.index(a)==s.index(a)?(wM(i,o),Io(Fo(i,jM(t,e,s,n,a+1)),l)):(i&&Io(Fo(i,zf(t,e,a+1)),l),Xd(e,s,a,l),o&&Io(Fo(o,zf(s,n,a+1)),l)),Xd(n,null,a,l),new se(l)}function zf(t,e,s){let n=[];if(Xd(null,t,s,n),t.depth>s){let a=jy(t,e,s+1);Io(Fo(a,zf(t,e,s+1)),n)}return Xd(e,null,s,n),new se(n)}function J9(t,e){let s=e.depth-t.openStart,a=e.node(s).copy(t.content);for(let i=s-1;i>=0;i--)a=e.node(i).copy(se.from(a));return{start:a.resolveNoCache(t.openStart+s),end:a.resolveNoCache(a.content.size-t.openEnd-s)}}class Iu{constructor(e,s,n){this.pos=e,this.path=s,this.parentOffset=n,this.depth=s.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,s=this.index(this.depth);if(s==e.childCount)return null;let n=this.pos-this.path[this.path.length-1],a=e.child(s);return n?e.child(s).cut(n):a}get nodeBefore(){let e=this.index(this.depth),s=this.pos-this.path[this.path.length-1];return s?this.parent.child(e).cut(0,s):e==0?null:this.parent.child(e-1)}posAtIndex(e,s){s=this.resolveDepth(s);let n=this.path[s*3],a=s==0?0:this.path[s*3-1]+1;for(let i=0;i<e;i++)a+=n.child(i).nodeSize;return a}marks(){let e=this.parent,s=this.index();if(e.content.size==0)return rt.none;if(this.textOffset)return e.child(s).marks;let n=e.maybeChild(s-1),a=e.maybeChild(s);if(!n){let l=n;n=a,a=l}let i=n.marks;for(var o=0;o<i.length;o++)i[o].type.spec.inclusive===!1&&(!a||!i[o].isInSet(a.marks))&&(i=i[o--].removeFromSet(i));return i}marksAcross(e){let s=this.parent.maybeChild(this.index());if(!s||!s.isInline)return null;let n=s.marks,a=e.parent.maybeChild(e.index());for(var i=0;i<n.length;i++)n[i].type.spec.inclusive===!1&&(!a||!n[i].isInSet(a.marks))&&(n=n[i--].removeFromSet(n));return n}sharedDepth(e){for(let s=this.depth;s>0;s--)if(this.start(s)<=e&&this.end(s)>=e)return s;return 0}blockRange(e=this,s){if(e.pos<this.pos)return e.blockRange(this);for(let n=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);n>=0;n--)if(e.pos<=this.end(n)&&(!s||s(this.node(n))))return new Bf(this,e,n);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let s=1;s<=this.depth;s++)e+=(e?"/":"")+this.node(s).type.name+"_"+this.index(s-1);return e+":"+this.parentOffset}static resolve(e,s){if(!(s>=0&&s<=e.content.size))throw new RangeError("Position "+s+" out of range");let n=[],a=0,i=s;for(let o=e;;){let{index:l,offset:c}=o.content.findIndex(i),d=i-c;if(n.push(o,l,a+c),!d||(o=o.child(l),o.isText))break;i=d-1,a+=c+1}return new Iu(s,n,i)}static resolveCached(e,s){let n=Yk.get(e);if(n)for(let i=0;i<n.elts.length;i++){let o=n.elts[i];if(o.pos==s)return o}else Yk.set(e,n=new Q9);let a=n.elts[n.i]=Iu.resolve(e,s);return n.i=(n.i+1)%X9,a}}class Q9{constructor(){this.elts=[],this.i=0}}const X9=12,Yk=new WeakMap;class Bf{constructor(e,s,n){this.$from=e,this.$to=s,this.depth=n}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Z9=Object.create(null);let Pi=class Ny{constructor(e,s,n,a=rt.none){this.type=e,this.attrs=s,this.marks=a,this.content=n||se.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,s,n,a=0){this.content.nodesBetween(e,s,n,a,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,s,n,a){return this.content.textBetween(e,s,n,a)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,s,n){return this.type==e&&Ff(this.attrs,s||e.defaultAttrs||Z9)&&rt.sameSet(this.marks,n||rt.none)}copy(e=null){return e==this.content?this:new Ny(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new Ny(this.type,this.attrs,this.content,e)}cut(e,s=this.content.size){return e==0&&s==this.content.size?this:this.copy(this.content.cut(e,s))}slice(e,s=this.content.size,n=!1){if(e==s)return me.empty;let a=this.resolve(e),i=this.resolve(s),o=n?0:a.sharedDepth(s),l=a.start(o),d=a.node(o).content.cut(a.pos-l,i.pos-l);return new me(d,a.depth-o,i.depth-o)}replace(e,s,n){return K9(this.resolve(e),this.resolve(s),n)}nodeAt(e){for(let s=this;;){let{index:n,offset:a}=s.content.findIndex(e);if(s=s.maybeChild(n),!s)return null;if(a==e||s.isText)return s;e-=a+1}}childAfter(e){let{index:s,offset:n}=this.content.findIndex(e);return{node:this.content.maybeChild(s),index:s,offset:n}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:s,offset:n}=this.content.findIndex(e);if(n<e)return{node:this.content.child(s),index:s,offset:n};let a=this.content.child(s-1);return{node:a,index:s-1,offset:n-a.nodeSize}}resolve(e){return Iu.resolveCached(this,e)}resolveNoCache(e){return Iu.resolve(this,e)}rangeHasMark(e,s,n){let a=!1;return s>e&&this.nodesBetween(e,s,i=>(n.isInSet(i.marks)&&(a=!0),!a)),a}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),NM(this.marks,e)}contentMatchAt(e){let s=this.type.contentMatch.matchFragment(this.content,0,e);if(!s)throw new Error("Called contentMatchAt on a node with invalid content");return s}canReplace(e,s,n=se.empty,a=0,i=n.childCount){let o=this.contentMatchAt(e).matchFragment(n,a,i),l=o&&o.matchFragment(this.content,s);if(!l||!l.validEnd)return!1;for(let c=a;c<i;c++)if(!this.type.allowsMarks(n.child(c).marks))return!1;return!0}canReplaceWith(e,s,n,a){if(a&&!this.type.allowsMarks(a))return!1;let i=this.contentMatchAt(e).matchType(n),o=i&&i.matchFragment(this.content,s);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),this.type.checkAttrs(this.attrs);let e=rt.none;for(let s=0;s<this.marks.length;s++){let n=this.marks[s];n.type.checkAttrs(n.attrs),e=n.addToSet(e)}if(!rt.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(s=>s.type.name)}`);this.content.forEach(s=>s.check())}toJSON(){let e={type:this.type.name};for(let s in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(s=>s.toJSON())),e}static fromJSON(e,s){if(!s)throw new RangeError("Invalid input for Node.fromJSON");let n;if(s.marks){if(!Array.isArray(s.marks))throw new RangeError("Invalid mark data for Node.fromJSON");n=s.marks.map(e.markFromJSON)}if(s.type=="text"){if(typeof s.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(s.text,n)}let a=se.fromJSON(e,s.content),i=e.nodeType(s.type).create(s.attrs,a,n);return i.type.checkAttrs(i.attrs),i}};Pi.prototype.text=void 0;class Vf extends Pi{constructor(e,s,n,a){if(super(e,s,null,a),!n)throw new RangeError("Empty text nodes are not allowed");this.text=n}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):NM(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,s){return this.text.slice(e,s)}get nodeSize(){return this.text.length}
vendor: 9,681 bytes, lines 733-734
733mark(e){return e==this.marks?this:new Vf(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new Vf(this.type,this.attrs,e,this.marks)}cut(e=0,s=this.text.length){return e==0&&s==this.text.length?this:this.withText(this.text.slice(e,s))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function NM(t,e){for(let s=t.length-1;s>=0;s--)e=t[s].type.name+"("+e+")";return e}class Jo{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,s){let n=new eW(e,s);if(n.next==null)return Jo.empty;let a=kM(n);n.next&&n.err("Unexpected trailing text");let i=oW(iW(a));return lW(i,n),i}matchType(e){for(let s=0;s<this.next.length;s++)if(this.next[s].type==e)return this.next[s].next;return null}matchFragment(e,s=0,n=e.childCount){let a=this;for(let i=s;a&&i<n;i++)a=a.matchType(e.child(i).type);return a}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:s}=this.next[e];if(!(s.isText||s.hasRequiredAttrs()))return s}return null}compatible(e){for(let s=0;s<this.next.length;s++)for(let n=0;n<e.next.length;n++)if(this.next[s].type==e.next[n].type)return!0;return!1}fillBefore(e,s=!1,n=0){let a=[this];function i(o,l){let c=o.matchFragment(e,n);if(c&&(!s||c.validEnd))return se.from(l.map(d=>d.createAndFill()));for(let d=0;d<o.next.length;d++){let{type:u,next:h}=o.next[d];if(!(u.isText||u.hasRequiredAttrs())&&a.indexOf(h)==-1){a.push(h);let m=i(h,l.concat(u));if(m)return m}}return null}return i(this,[])}findWrapping(e){for(let n=0;n<this.wrapCache.length;n+=2)if(this.wrapCache[n]==e)return this.wrapCache[n+1];let s=this.computeWrapping(e);return this.wrapCache.push(e,s),s}computeWrapping(e){let s=Object.create(null),n=[{match:this,type:null,via:null}];for(;n.length;){let a=n.shift(),i=a.match;if(i.matchType(e)){let o=[];for(let l=a;l.type;l=l.via)o.push(l.type);return o.reverse()}for(let o=0;o<i.next.length;o++){let{type:l,next:c}=i.next[o];!l.isLeaf&&!l.hasRequiredAttrs()&&!(l.name in s)&&(!a.type||c.validEnd)&&(n.push({match:l.contentMatch,type:l,via:a}),s[l.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function s(n){e.push(n);for(let a=0;a<n.next.length;a++)e.indexOf(n.next[a].next)==-1&&s(n.next[a].next)}return s(this),e.map((n,a)=>{let i=a+(n.validEnd?"*":" ")+" ";for(let o=0;o<n.next.length;o++)i+=(o?", ":"")+n.next[o].type.name+"->"+e.indexOf(n.next[o].next);return i}).join(` 734`)}}Jo.empty=new Jo(!0);class eW{constructor(e,s){this.string=e,this.nodeTypes=s,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function kM(t){let e=[];do e.push(tW(t));while(t.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function tW(t){let e=[];do e.push(sW(t));while(t.next&&t.next!=")"&&t.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function sW(t){let e=aW(t);for(;;)if(t.eat("+"))e={type:"plus",expr:e};else if(t.eat("*"))e={type:"star",expr:e};else if(t.eat("?"))e={type:"opt",expr:e};else if(t.eat("{"))e=nW(t,e);else break;return e}function qk(t){/\D/.test(t.next)&&t.err("Expected number, got '"+t.next+"'");let e=Number(t.next);return t.pos++,e}function nW(t,e){let s=qk(t),n=s;return t.eat(",")&&(t.next!="}"?n=qk(t):n=-1),t.eat("}")||t.err("Unclosed braced range"),{type:"range",min:s,max:n,expr:e}}function rW(t,e){let s=t.nodeTypes,n=s[e];if(n)return[n];let a=[];for(let i in s){let o=s[i];o.isInGroup(e)&&a.push(o)}return a.length==0&&t.err("No node type or group '"+e+"' found"),a}function aW(t){if(t.eat("(")){let e=kM(t);return t.eat(")")||t.err("Missing closing paren"),e}else if(/\W/.test(t.next))t.err("Unexpected token '"+t.next+"'");else{let e=rW(t,t.next).map(s=>(t.inline==null?t.inline=s.isInline:t.inline!=s.isInline&&t.err("Mixing inline and block content"),{type:"name",value:s}));return t.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function iW(t){let e=[[]];return a(i(t,0),s()),e;function s(){return e.push([])-1}function n(o,l,c){let d={term:c,to:l};return e[o].push(d),d}function a(o,l){o.forEach(c=>c.to=l)}function i(o,l){if(o.type=="choice")return o.exprs.reduce((c,d)=>c.concat(i(d,l)),[]);if(o.type=="seq")for(let c=0;;c++){let d=i(o.exprs[c],l);if(c==o.exprs.length-1)return d;a(d,l=s())}else if(o.type=="star"){let c=s();return n(l,c),a(i(o.expr,c),c),[n(c)]}else if(o.type=="plus"){let c=s();return a(i(o.expr,l),c),a(i(o.expr,c),c),[n(c)]}else{if(o.type=="opt")return[n(l)].concat(i(o.expr,l));if(o.type=="range"){let c=l;for(let d=0;d<o.min;d++){let u=s();a(i(o.expr,c),u),c=u}if(o.max==-1)a(i(o.expr,c),c);else for(let d=o.min;d<o.max;d++){let u=s();n(c,u),a(i(o.expr,c),u),c=u}return[n(c)]}else{if(o.type=="name")return[n(l,void 0,o.value)];throw new Error("Unknown expr type")}}}}function CM(t,e){return e-t}function Kk(t,e){let s=[];return n(e),s.sort(CM);function n(a){let i=t[a];if(i.length==1&&!i[0].term)return n(i[0].to);s.push(a);for(let o=0;o<i.length;o++){let{term:l,to:c}=i[o];!l&&s.indexOf(c)==-1&&n(c)}}}function oW(t){let e=Object.create(null);return s(Kk(t,0));function s(n){let a=[];n.forEach(o=>{t[o].forEach(({term:l,to:c})=>{if(!l)return;let d;for(let u=0;u<a.length;u++)a[u][0]==l&&(d=a[u][1]);Kk(t,c).forEach(u=>{d||a.push([l,d=[]]),d.indexOf(u)==-1&&d.push(u)})})});let i=e[n.join(",")]=new Jo(n.indexOf(t.length-1)>-1);for(let o=0;o<a.length;o++){let l=a[o][1].sort(CM);i.next.push({type:a[o][0],next:e[l.join(",")]||s(l)})}return i}}function lW(t,e){for(let s=0,n=[t];s<n.length;s++){let a=n[s],i=!a.validEnd,o=[];for(let l=0;l<a.next.length;l++){let{type:c,next:d}=a.next[l];o.push(c.name),i&&!(c.isText||c.hasRequiredAttrs())&&(i=!1),n.indexOf(d)==-1&&n.push(d)}i&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function SM(t){let e=Object.create(null);for(let s in t){let n=t[s];if(!n.hasDefault)return null;e[s]=n.default}return e}function _M(t,e){let s=Object.create(null);for(let n in t){let a=e&&e[n];if(a===void 0){let i=t[n];if(i.hasDefault)a=i.default;else throw new RangeError("No value supplied for attribute "+n)}s[n]=a}return s}function TM(t,e,s,n){for(let a in e)if(!(a in t))throw new RangeError(`Unsupported attribute ${a} for ${s} of type ${a}`);for(let a in t){let i=t[a];i.validate&&i.validate(e[a])}}function EM(t,e){let s=Object.create(null);if(e)for(let n in e)s[n]=new dW(t,n,e[n]);return s}let Jk=class MM{constructor(e,s,n){this.name=e,this.schema=s,this.spec=n,this.markSet=null,this.groups=n.group?n.group.split(" "):[],this.attrs=EM(e,n.attrs),this.defaultAttrs=SM(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(n.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==Jo.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:_M(this.attrs,e)}create(e=null,s,n){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Pi(this,this.computeAttrs(e),se.from(s),rt.setFrom(n))}createChecked(e=null,s,n){return s=se.from(s),this.checkContent(s),new Pi(this,this.computeAttrs(e),s,rt.setFrom(n))}createAndFill(e=null,s,n){if(e=this.computeAttrs(e),s=se.from(s),s.size){let o=this.contentMatch.fillBefore(s);if(!o)return null;s=o.append(s)}let a=this.contentMatch.matchFragment(s),i=a&&a.fillBefore(se.empty,!0);return i?new Pi(this,e,s.append(i),rt.setFrom(n)):null}validContent(e){let s=this.contentMatch.matchFragment(e);if(!s||!s.validEnd)return!1;for(let n=0;n<e.childCount;n++)if(!this.allowsMarks(e.child(n).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){TM(this.attrs,e,"node",this.name)}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let s=0;s<e.length;s++)if(!this.allowsMarkType(e[s].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let s;for(let n=0;n<e.length;n++)this.allowsMarkType(e[n].type)?s&&s.push(e[n]):s||(s=e.slice(0,n));return s?s.length?s:rt.none:e}static compile(e,s){let n=Object.create(null);e.forEach((i,o)=>n[i]=new MM(i,s,o));let a=s.spec.topNode||"doc";if(!n[a])throw new RangeError("Schema is missing its top node type ('"+a+"')");if(!n.text)throw new RangeError("Every schema needs a 'text' type");for(let i in n.text.attrs)throw new RangeError("The text node type should not have attributes");return n}};function cW(t,e,s){let n=s.split("|");return a=>{let i=a===null?"null":typeof a;if(n.indexOf(i)<0)throw new RangeError(`Expected value of type ${n} for attribute ${e} on type ${t}, got ${i}`)}}class dW{constructor(e,s,n){this.hasDefault=Object.prototype.hasOwnProperty.call(n,"default"),this.default=n.default,this.validate=typeof n.validate=="string"?cW(e,s,n.val
vendor: 8,933 bytes, lines 734-736
734idate):n.validate}get isRequired(){return!this.hasDefault}}class Nx{constructor(e,s,n,a){this.name=e,this.rank=s,this.schema=n,this.spec=a,this.attrs=EM(e,a.attrs),this.excluded=null;let i=SM(this.attrs);this.instance=i?new rt(this,i):null}create(e=null){return!e&&this.instance?this.instance:new rt(this,_M(this.attrs,e))}static compile(e,s){let n=Object.create(null),a=0;return e.forEach((i,o)=>n[i]=new Nx(i,a++,s,o)),n}removeFromSet(e){for(var s=0;s<e.length;s++)e[s].type==this&&(e=e.slice(0,s).concat(e.slice(s+1)),s--);return e}isInSet(e){for(let s=0;s<e.length;s++)if(e[s].type==this)return e[s]}checkAttrs(e){TM(this.attrs,e,"mark",this.name)}excludes(e){return this.excluded.indexOf(e)>-1}}class AM{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let s=this.spec={};for(let a in e)s[a]=e[a];s.nodes=xs.from(e.nodes),s.marks=xs.from(e.marks||{}),this.nodes=Jk.compile(this.spec.nodes,this),this.marks=Nx.compile(this.spec.marks,this);let n=Object.create(null);for(let a in this.nodes){if(a in this.marks)throw new RangeError(a+" can not be both a node and a mark");let i=this.nodes[a],o=i.spec.content||"",l=i.spec.marks;if(i.contentMatch=n[o]||(n[o]=Jo.parse(o,this.nodes)),i.inlineContent=i.contentMatch.inlineContent,i.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!i.isInline||!i.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=i}i.markSet=l=="_"?null:l?Qk(this,l.split(" ")):l==""||!i.inlineContent?[]:null}for(let a in this.marks){let i=this.marks[a],o=i.spec.excludes;i.excluded=o==null?[i]:o==""?[]:Qk(this,o.split(" "))}this.nodeFromJSON=a=>Pi.fromJSON(this,a),this.markFromJSON=a=>rt.fromJSON(this,a),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,s=null,n,a){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof Jk){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(s,n,a)}text(e,s){let n=this.nodes.text;return new Vf(n,n.defaultAttrs,e,rt.setFrom(s))}mark(e,s){return typeof e=="string"&&(e=this.marks[e]),e.create(s)}nodeType(e){let s=this.nodes[e];if(!s)throw new RangeError("Unknown node type: "+e);return s}}function Qk(t,e){let s=[];for(let n=0;n<e.length;n++){let a=e[n],i=t.marks[a],o=i;if(i)s.push(i);else for(let l in t.marks){let c=t.marks[l];(a=="_"||c.spec.group&&c.spec.group.split(" ").indexOf(a)>-1)&&s.push(o=c)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[n]+"'")}return s}function uW(t){return t.tag!=null}function hW(t){return t.style!=null}class Di{constructor(e,s){this.schema=e,this.rules=s,this.tags=[],this.styles=[];let n=this.matchedStyles=[];s.forEach(a=>{if(uW(a))this.tags.push(a);else if(hW(a)){let i=/[^=]*/.exec(a.style)[0];n.indexOf(i)<0&&n.push(i),this.styles.push(a)}}),this.normalizeLists=!this.tags.some(a=>{if(!/^(ul|ol)\b/.test(a.tag)||!a.node)return!1;let i=e.nodes[a.node];return i.contentMatch.matchType(i)})}parse(e,s={}){let n=new Zk(this,s,!1);return n.addAll(e,rt.none,s.from,s.to),n.finish()}parseSlice(e,s={}){let n=new Zk(this,s,!0);return n.addAll(e,rt.none,s.from,s.to),me.maxOpen(n.finish())}matchTag(e,s,n){for(let a=n?this.tags.indexOf(n)+1:0;a<this.tags.length;a++){let i=this.tags[a];if(pW(e,i.tag)&&(i.namespace===void 0||e.namespaceURI==i.namespace)&&(!i.context||s.matchesContext(i.context))){if(i.getAttrs){let o=i.getAttrs(e);if(o===!1)continue;i.attrs=o||void 0}return i}}}matchStyle(e,s,n,a){for(let i=a?this.styles.indexOf(a)+1:0;i<this.styles.length;i++){let o=this.styles[i],l=o.style;if(!(l.indexOf(e)!=0||o.context&&!n.matchesContext(o.context)||l.length>e.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=s))){if(o.getAttrs){let c=o.getAttrs(s);if(c===!1)continue;o.attrs=c||void 0}return o}}}static schemaRules(e){let s=[];function n(a){let i=a.priority==null?50:a.priority,o=0;for(;o<s.length;o++){let l=s[o];if((l.priority==null?50:l.priority)<i)break}s.splice(o,0,a)}for(let a in e.marks){let i=e.marks[a].spec.parseDOM;i&&i.forEach(o=>{n(o=eC(o)),o.mark||o.ignore||o.clearMark||(o.mark=a)})}for(let a in e.nodes){let i=e.nodes[a].spec.parseDOM;i&&i.forEach(o=>{n(o=eC(o)),o.node||o.ignore||o.mark||(o.node=a)})}return s}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new Di(e,Di.schemaRules(e)))}}const PM={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},mW={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},DM={ol:!0,ul:!0},Fu=1,ky=2,Zd=4;function Xk(t,e,s){return e!=null?(e?Fu:0)|(e==="full"?ky:0):t&&t.whitespace=="pre"?Fu|ky:s&~Zd}class Zh{constructor(e,s,n,a,i,o){this.type=e,this.attrs=s,this.marks=n,this.solid=a,this.options=o,this.content=[],this.activeMarks=rt.none,this.match=i||(o&Zd?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let s=this.type.contentMatch.fillBefore(se.from(e));if(s)this.match=this.type.contentMatch.matchFragment(s);else{let n=this.type.contentMatch,a;return(a=n.findWrapping(e.type))?(this.match=n,a):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&Fu)){let n=this.content[this.content.length-1],a;if(n&&n.isText&&(a=/[ \t\r\n\u000c]+$/.exec(n.text))){let i=n;n.text.length==a[0].length?this.content.pop():this.content[this.content.length-1]=i.withText(i.text.slice(0,i.text.length-a[0].length))}}let s=se.from(this.content);return!e&&this.match&&(s=s.append(this.match.fillBefore(se.empty,!0))),this.type?this.type.create(this.attrs,s,this.marks):s}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!PM.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class Zk{constructor(e,s,n){this.parser=e,this.options=s,this.isOpen=n,this.open=0,this.localPreserveWS=!1;let a=s.topNode,i,o=Xk(null,s.preserveWhitespace,0)|(n?Zd:0);a?i=new Zh(a.type,a.attrs,rt.none,!0,s.topMatch||a.type.contentMatch,o):n?i=new Zh(null,null,rt.none,!0,null,o):i=new Zh(e.schema.topNodeType,null,rt.none,!0,null,o),this.nodes=[i],this.find=s.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,s){e.nodeType==3?this.addTextNode(e,s):e.nodeType==1&&this.addElement(e,s)}addTextNode(e,s){let n=e.nodeValue,a=this.top,i=a.options&ky?"full":this.localPreserveWS||(a.options&Fu)>0,{schema:o}=this.parser;if(i==="full"||a.inlineContext(e)||/[^ \t\r\n\u000c]/.test(n)){if(i)if(i==="full")n=n.replace(/\r\n?/g,` 735`);else if(o.linebreakReplacement&&/[\r\n]/.test(n)&&this.top.findWrapping(o.linebreakReplacement.create())){let l=n.split(/\r?\n|\r/);for(let c=0;c<l.length;c++)c&&this.insertNode(o.linebreakReplacement.create(),s,!0),l[c]&&this.insertNode(o.text(l[c]),s,!/\S/.test(l[c]));n=""}else n=n.replace(/\r?\n|\r/g," ");else if(n=n.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(n)&&this.open==this.nodes.length-1){let l=a.content[a.content.length-1],c=e.previousSibling;(!l||c&&c.nodeName=="BR"||l.isText&&/[ \t\r\n\u000c]$/.test(l.text))&&(n=n.slice(1))}n&&this.insertNode(o.text(n),s,!/\S/.test(n)),this.findInText(e)}else this.findInside(e)}addElement(e,s,n){let a=this.localPreserveWS,i=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),l;DM.hasOwnProperty(o)&&this.parser.normalizeLists&&fW(e);let c=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,n));e:if(c?c.ignore:mW.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,s);else if(!c||c.skip||c.closeParent){c&&c.closeParent?this.open=Math.max(0,this.open-1):c&&c.skip.nodeType&&(e=c.skip);let d,u=this.needsBlock;if(PM.hasOwnProperty(o))i.content.length&&i.content[0].isInline&&this.open&&(this.open--,i=this.top),d=!0,i.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,s);break e}let h=c&&c.skip?s:this.readStyles(e,s);h&&this.addAll(e,h),d&&this.sync(i),this.needsBlock=u}else{let d=this.readStyles(e,s);d&&this.addElementByRule(e,c,d,c.consuming===!1?l:void 0)}this.localPreserveWS=a}leafFallback(e,s){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` 736`),s)}ignoreFallback(e,s){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),s,!0)}readStyles(e,s){let n=e.style;if(n&&n.length)for(let a=0;a<this.parser.matchedStyles.length;a++){let i=this.parser.matchedStyles[a],o=n.getPropertyValue(i);if(o)for(let l=void 0;;){let c=this.parser.matchStyle(i,o,this,l);if(!c)break;if(c.ignore)return null;if(c.clearMark?s=s.filter(d=>
vendor: 4,155 bytes, line 736
736!c.clearMark(d)):s=s.concat(this.parser.schema.marks[c.mark].create(c.attrs)),c.consuming===!1)l=c;else break}}return s}addElementByRule(e,s,n,a){let i,o;if(s.node)if(o=this.parser.schema.nodes[s.node],o.isLeaf)this.insertNode(o.create(s.attrs),n,e.nodeName=="BR")||this.leafFallback(e,n);else{let c=this.enter(o,s.attrs||null,n,s.preserveWhitespace);c&&(i=!0,n=c)}else{let c=this.parser.schema.marks[s.mark];n=n.concat(c.create(s.attrs))}let l=this.top;if(o&&o.isLeaf)this.findInside(e);else if(a)this.addElement(e,n,a);else if(s.getContent)this.findInside(e),s.getContent(e,this.parser.schema).forEach(c=>this.insertNode(c,n,!1));else{let c=e;typeof s.contentElement=="string"?c=e.querySelector(s.contentElement):typeof s.contentElement=="function"?c=s.contentElement(e):s.contentElement&&(c=s.contentElement),this.findAround(e,c,!0),this.addAll(c,n),this.findAround(e,c,!1)}i&&this.sync(l)&&this.open--}addAll(e,s,n,a){let i=n||0;for(let o=n?e.childNodes[n]:e.firstChild,l=a==null?null:e.childNodes[a];o!=l;o=o.nextSibling,++i)this.findAtPoint(e,i),this.addDOM(o,s);this.findAtPoint(e,i)}findPlace(e,s,n){let a,i;for(let o=this.open,l=0;o>=0;o--){let c=this.nodes[o],d=c.findWrapping(e);if(d&&(!a||a.length>d.length+l)&&(a=d,i=c,!d.length))break;if(c.solid){if(n)break;l+=2}}if(!a)return null;this.sync(i);for(let o=0;o<a.length;o++)s=this.enterInner(a[o],null,s,!1);return s}insertNode(e,s,n){if(e.isInline&&this.needsBlock&&!this.top.type){let i=this.textblockFromContext();i&&(s=this.enterInner(i,null,s))}let a=this.findPlace(e,s,n);if(a){this.closeExtra();let i=this.top;i.match&&(i.match=i.match.matchType(e.type));let o=rt.none;for(let l of a.concat(e.marks))(i.type?i.type.allowsMarkType(l.type):tC(l.type,e.type))&&(o=l.addToSet(o));return i.content.push(e.mark(o)),!0}return!1}enter(e,s,n,a){let i=this.findPlace(e.create(s),n,!1);return i&&(i=this.enterInner(e,s,n,!0,a)),i}enterInner(e,s,n,a=!1,i){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let l=Xk(e,i,o.options);o.options&Zd&&o.content.length==0&&(l|=Zd);let c=rt.none;return n=n.filter(d=>(o.type?o.type.allowsMarkType(d.type):tC(d.type,e))?(c=d.addToSet(c),!1):!0),this.nodes.push(new Zh(e,s,c,a,null,l)),this.open++,n}closeExtra(e=!1){let s=this.nodes.length-1;if(s>this.open){for(;s>this.open;s--)this.nodes[s-1].content.push(this.nodes[s].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let s=this.open;s>=0;s--){if(this.nodes[s]==e)return this.open=s,!0;this.localPreserveWS&&(this.nodes[s].options|=Fu)}return!1}get currentPos(){this.closeExtra();let e=0;for(let s=this.open;s>=0;s--){let n=this.nodes[s].content;for(let a=n.length-1;a>=0;a--)e+=n[a].nodeSize;s&&e++}return e}findAtPoint(e,s){if(this.find)for(let n=0;n<this.find.length;n++)this.find[n].node==e&&this.find[n].offset==s&&(this.find[n].pos=this.currentPos)}findInside(e){if(this.find)for(let s=0;s<this.find.length;s++)this.find[s].pos==null&&e.nodeType==1&&e.contains(this.find[s].node)&&(this.find[s].pos=this.currentPos)}findAround(e,s,n){if(e!=s&&this.find)for(let a=0;a<this.find.length;a++)this.find[a].pos==null&&e.nodeType==1&&e.contains(this.find[a].node)&&s.compareDocumentPosition(this.find[a].node)&(n?2:4)&&(this.find[a].pos=this.currentPos)}findInText(e){if(this.find)for(let s=0;s<this.find.length;s++)this.find[s].node==e&&(this.find[s].pos=this.currentPos-(e.nodeValue.length-this.find[s].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let s=e.split("/"),n=this.options.context,a=!this.isOpen&&(!n||n.parent.type==this.nodes[0].type),i=-(n?n.depth+1:0)+(a?0:1),o=(l,c)=>{for(;l>=0;l--){let d=s[l];if(d==""){if(l==s.length-1||l==0)continue;for(;c>=i;c--)if(o(l-1,c))return!0;return!1}else{let u=c>0||c==0&&a?this.nodes[c].type:n&&c>=i?n.node(c-i).type:null;if(!u||u.name!=d&&!u.isInGroup(d))return!1;c--}}return!0};return o(s.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let s=e.depth;s>=0;s--){let n=e.node(s).contentMatchAt(e.indexAfter(s)).defaultType;
vendor: 8,882 bytes, line 736
736if(n&&n.isTextblock&&n.defaultAttrs)return n}for(let s in this.parser.schema.nodes){let n=this.parser.schema.nodes[s];if(n.isTextblock&&n.defaultAttrs)return n}}}function fW(t){for(let e=t.firstChild,s=null;e;e=e.nextSibling){let n=e.nodeType==1?e.nodeName.toLowerCase():null;n&&DM.hasOwnProperty(n)&&s?(s.appendChild(e),e=s):n=="li"?s=e:n&&(s=null)}}function pW(t,e){return(t.matches||t.msMatchesSelector||t.webkitMatchesSelector||t.mozMatchesSelector).call(t,e)}function eC(t){let e={};for(let s in t)e[s]=t[s];return e}function tC(t,e){let s=e.schema.nodes;for(let n in s){let a=s[n];if(!a.allowsMarkType(t))continue;let i=[],o=l=>{i.push(l);for(let c=0;c<l.edgeCount;c++){let{type:d,next:u}=l.edge(c);if(d==e||i.indexOf(u)<0&&o(u))return!0}};if(o(a.contentMatch))return!0}}class dl{constructor(e,s){this.nodes=e,this.marks=s}serializeFragment(e,s={},n){n||(n=l0(s).createDocumentFragment());let a=n,i=[];return e.forEach(o=>{if(i.length||o.marks.length){let l=0,c=0;for(;l<i.length&&c<o.marks.length;){let d=o.marks[c];if(!this.marks[d.type.name]){c++;continue}if(!d.eq(i[l][0])||d.type.spec.spanning===!1)break;l++,c++}for(;l<i.length;)a=i.pop()[1];for(;c<o.marks.length;){let d=o.marks[c++],u=this.serializeMark(d,o.isInline,s);u&&(i.push([d,a]),a.appendChild(u.dom),a=u.contentDOM||u.dom)}}a.appendChild(this.serializeNodeInner(o,s))}),n}serializeNodeInner(e,s){let{dom:n,contentDOM:a}=$m(l0(s),this.nodes[e.type.name](e),null,e.attrs);if(a){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,s,a)}return n}serializeNode(e,s={}){let n=this.serializeNodeInner(e,s);for(let a=e.marks.length-1;a>=0;a--){let i=this.serializeMark(e.marks[a],e.isInline,s);i&&((i.contentDOM||i.dom).appendChild(n),n=i.dom)}return n}serializeMark(e,s,n={}){let a=this.marks[e.type.name];return a&&$m(l0(n),a(e,s),null,e.attrs)}static renderSpec(e,s,n=null,a){return $m(e,s,n,a)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new dl(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let s=sC(e.nodes);return s.text||(s.text=n=>n.text),s}static marksFromSchema(e){return sC(e.marks)}}function sC(t){let e={};for(let s in t){let n=t[s].spec.toDOM;n&&(e[s]=n)}return e}function l0(t){return t.document||window.document}const nC=new WeakMap;function xW(t){let e=nC.get(t);return e===void 0&&nC.set(t,e=gW(t)),e}function gW(t){let e=null;function s(n){if(n&&typeof n=="object")if(Array.isArray(n))if(typeof n[0]=="string")e||(e=[]),e.push(n);else for(let a=0;a<n.length;a++)s(n[a]);else for(let a in n)s(n[a])}return s(t),e}function $m(t,e,s,n){if(typeof e=="string")return{dom:t.createTextNode(e)};if(e.nodeType!=null)return{dom:e};if(e.dom&&e.dom.nodeType!=null)return e;let a=e[0],i;if(typeof a!="string")throw new RangeError("Invalid array passed to renderSpec");if(n&&(i=xW(n))&&i.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=a.indexOf(" ");o>0&&(s=a.slice(0,o),a=a.slice(o+1));let l,c=s?t.createElementNS(s,a):t.createElement(a),d=e[1],u=1;if(d&&typeof d=="object"&&d.nodeType==null&&!Array.isArray(d)){u=2;for(let h in d)if(d[h]!=null){let m=h.indexOf(" ");m>0?c.setAttributeNS(h.slice(0,m),h.slice(m+1),d[h]):h=="style"&&c.style?c.style.cssText=d[h]:c.setAttribute(h,d[h])}}for(let h=u;h<e.length;h++){let m=e[h];if(m===0){if(h<e.length-1||h>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:c,contentDOM:c}}else{let{dom:f,contentDOM:p}=$m(t,m,s,n);if(c.appendChild(f),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:c,contentDOM:l}}const RM=65535,LM=Math.pow(2,16);function bW(t,e){return t+e*LM}function rC(t){return t&RM}function yW(t){return(t-(t&RM))/LM}const OM=1,IM=2,zm=4,FM=8;class Cy{constructor(e,s,n){this.pos=e,this.delInfo=s,this.recover=n}get deleted(){return(this.delInfo&FM)>0}get deletedBefore(){return(this.delInfo&(OM|zm))>0}get deletedAfter(){return(this.delInfo&(IM|zm))>0}get deletedAcross(){return(this.delInfo&zm)>0}}class _n{constructor(e,s=!1){if(this.ranges=e,this.inverted=s,!e.length&&_n.empty)return _n.empty}recover(e){let s=0,n=rC(e);if(!this.inverted)for(let a=0;a<n;a++)s+=this.ranges[a*3+2]-this.ranges[a*3+1];return this.ranges[n*3]+s+yW(e)}mapResult(e,s=1){return this._map(e,s,!1)}map(e,s=1){return this._map(e,s,!0)}_map(e,s,n){let a=0,i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?a:0);if(c>e)break;let d=this.ranges[l+i],u=this.ranges[l+o],h=c+d;if(e<=h){let m=d?e==c?-1:e==h?1:s:s,f=c+a+(m<0?0:u);if(n)return f;let p=e==(s<0?c:h)?null:bW(l/3,e-c),g=e==c?IM:e==h?OM:zm;return(s<0?e!=c:e!=h)&&(g|=FM),new Cy(f,g,p)}a+=u-d}return n?e+a:new Cy(e+a,0,null)}touches(e,s){let n=0,a=rC(s),i=this.inverted?2:1,o=this.inverted?1:2;for(let l=0;l<this.ranges.length;l+=3){let c=this.ranges[l]-(this.inverted?n:0);if(c>e)break;let d=this.ranges[l+i],u=c+d;if(e<=u&&l==a*3)return!0;n+=this.ranges[l+o]-d}return!1}forEach(e){let s=this.inverted?2:1,n=this.inverted?1:2;for(let a=0,i=0;a<this.ranges.length;a+=3){let o=this.ranges[a],l=o-(this.inverted?i:0),c=o+(this.inverted?0:i),d=this.ranges[a+s],u=this.ranges[a+n];e(l,l+d,c,c+u),i+=u-d}}invert(){return new _n(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?_n.empty:new _n(e<0?[0,-e,0]:[0,0,e])}}_n.empty=new _n([]);class $u{constructor(e,s,n=0,a=e?e.length:0){this.mirror=s,this.from=n,this.to=a,this._maps=e||[],this.ownData=!(e||s)}get maps(){return this._maps}slice(e=0,s=this.maps.length){return new $u(this._maps,this.mirror,e,s)}appendMap(e,s){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),s!=null&&this.setMirror(this._maps.length-1,s)}appendMapping(e){for(let s=0,n=this._maps.length;s<e._maps.length;s++){let a=e.getMirror(s);this.appendMap(e._maps[s],a!=null&&a<s?n+a:void 0)}}getMirror(e){if(this.mirror){for(let s=0;s<this.mirror.length;s++)if(this.mirror[s]==e)return this.mirror[s+(s%2?-1:1)]}}setMirror(e,s){this.mirror||(this.mirror=[]),this.mirror.push(e,s)}appendMappingInverted(e){for(let s=e.maps.length-1,n=this._maps.length+e._maps.length;s>=0;s--){let a=e.getMirror(s);this.appendMap(e._maps[s].invert(),a!=null&&a>s?n-a-1:void 0)}}invert(){let e=new $u;return e.appendMappingInverted(this),e}map(e,s=1){if(this.mirror)return this._map(e,s,!0);for(let n=this.from;n<this.to;n++)e=this._maps[n].map(e,s);return e}mapResult(e,s=1){return this._map(e,s,!1)}_map(e,s,n){let a=0;for(let i=this.from;i<this.to;i++){let o=this._maps[i],l=o.mapResult(e,s);if(l.recover!=null){let c=this.getMirror(i);if(c!=null&&c>i&&c<this.to){i=c,e=this._maps[c].recover(l.recover);continue}}a|=l.delInfo,e=l.pos}return n?e:new Cy(e,a,null)}}const c0=Object.create(null);class Is{getMap(){return _n.empty}merge(e){return null}static fromJSON(e,s){if(!s||!s.stepType)throw new RangeError("Invalid input for Step.fromJSON");let n=c0[s.stepType];if(!n)throw new RangeError(`No step type ${s.stepType} defined`);return n.fromJSON(e,s)}static jsonID(e,s){if(e in c0)throw new RangeError("Duplicate use of step JSON ID "+e);return c0[e]=s,s.prototype.jsonID=e,s}}class Ht{constructor(e,s){this.doc=e,this.failed=s}static ok(e){return new Ht(e,null)}static fail(e){return new Ht(null,e)}static fromReplace(e,s,n,a){try{return Ht.ok(e.replace(s,n,a))}catch(i){if(i instanceof $f)return Ht.fail(i.message);throw i}}}function t1(t,e,s){let n=[];for(let a=0;a<t.childCount;a++){let i=t.child(a);i.content.size&&(i=i.copy(t1(i.content,e,i))),i.isInline&&(i=e(i,s,a)),n.push(i)}return se.fromArray(n)}class bi extends Is{constructor(e,s,n){super(),this.from=e,this.to=s,this.mark=n}apply(e){let s=e.slice(this.from,this.to),n=e.resolve(this.from),a=n.node(n.sharedDepth(this.to)),i=new me(t1(s.content,(o,l)=>!o.isAtom||!l.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),a),s.openStart,s.openEnd);return Ht.fromReplace(e,this.from,this.to,i)}invert(){return new kr(this.from,this.to,this.mark)}map(e){let s=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return s.deleted&&n.deleted||s.pos>=n.pos?null:new bi(s.pos,n.pos,this.mark)}merge(e){return e instanceof bi&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new bi(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,s){if(typeof s.from!="number"||typeof s.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new bi(s.from,s.to,e.markFromJSON(s.mark))}}Is.jsonID("addMark",bi);class kr extends Is{constructor(e,s,n){super(),this.from=e,this.to=s,this.mark=n}
vendor: 6,506 bytes, line 736
736apply(e){let s=e.slice(this.from,this.to),n=new me(t1(s.content,a=>a.mark(this.mark.removeFromSet(a.marks)),e),s.openStart,s.openEnd);return Ht.fromReplace(e,this.from,this.to,n)}invert(){return new bi(this.from,this.to,this.mark)}map(e){let s=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return s.deleted&&n.deleted||s.pos>=n.pos?null:new kr(s.pos,n.pos,this.mark)}merge(e){return e instanceof kr&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new kr(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,s){if(typeof s.from!="number"||typeof s.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new kr(s.from,s.to,e.markFromJSON(s.mark))}}Is.jsonID("removeMark",kr);class yi extends Is{constructor(e,s){super(),this.pos=e,this.mark=s}apply(e){let s=e.nodeAt(this.pos);if(!s)return Ht.fail("No node at mark step's position");let n=s.type.create(s.attrs,null,this.mark.addToSet(s.marks));return Ht.fromReplace(e,this.pos,this.pos+1,new me(se.from(n),0,s.isLeaf?0:1))}invert(e){let s=e.nodeAt(this.pos);if(s){let n=this.mark.addToSet(s.marks);if(n.length==s.marks.length){for(let a=0;a<s.marks.length;a++)if(!s.marks[a].isInSet(n))return new yi(this.pos,s.marks[a]);return new yi(this.pos,this.mark)}}return new Qo(this.pos,this.mark)}map(e){let s=e.mapResult(this.pos,1);return s.deletedAfter?null:new yi(s.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,s){if(typeof s.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new yi(s.pos,e.markFromJSON(s.mark))}}Is.jsonID("addNodeMark",yi);class Qo extends Is{constructor(e,s){super(),this.pos=e,this.mark=s}apply(e){let s=e.nodeAt(this.pos);if(!s)return Ht.fail("No node at mark step's position");let n=s.type.create(s.attrs,null,this.mark.removeFromSet(s.marks));return Ht.fromReplace(e,this.pos,this.pos+1,new me(se.from(n),0,s.isLeaf?0:1))}invert(e){let s=e.nodeAt(this.pos);return!s||!this.mark.isInSet(s.marks)?this:new yi(this.pos,this.mark)}map(e){let s=e.mapResult(this.pos,1);return s.deletedAfter?null:new Qo(s.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,s){if(typeof s.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new Qo(s.pos,e.markFromJSON(s.mark))}}Is.jsonID("removeNodeMark",Qo);class as extends Is{constructor(e,s,n,a=!1){super(),this.from=e,this.to=s,this.slice=n,this.structure=a}apply(e){return this.structure&&Sy(e,this.from,this.to)?Ht.fail("Structure replace would overwrite content"):Ht.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new _n([this.from,this.to-this.from,this.slice.size])}invert(e){return new as(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let s=e.mapResult(this.from,1),n=e.mapResult(this.to,-1);return s.deletedAcross&&n.deletedAcross?null:new as(s.pos,Math.max(s.pos,n.pos),this.slice,this.structure)}merge(e){if(!(e instanceof as)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let s=this.slice.size+e.slice.size==0?me.empty:new me(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new as(this.from,this.to+(e.to-e.from),s,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let s=this.slice.size+e.slice.size==0?me.empty:new me(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new as(e.from,this.to,s,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,s){if(typeof s.from!="number"||typeof s.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new as(s.from,s.to,me.fromJSON(e,s.slice),!!s.structure)}}Is.jsonID("replace",as);class ds extends Is{constructor(e,s,n,a,i,o,l=!1){super(),this.from=e,this.to=s,this.gapFrom=n,this.gapTo=a,this.slice=i,this.insert=o,this.structure=l}apply(e){if(this.structure&&(Sy(e,this.from,this.gapFrom)||Sy(e,this.gapTo,this.to)))return Ht.fail("Structure gap-replace would overwrite content");let s=e.slice(this.gapFrom,this.gapTo);if(s.openStart||s.openEnd)return Ht.fail("Gap is not a flat range");let n=this.slice.insertAt(this.insert,s.content);return n?Ht.fromReplace(e,this.from,this.to,n):Ht.fail("Content does not fit in gap")}getMap(){return new _n([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let s=this.gapTo-this.gapFrom;return new ds(this.from,this.from+this.slice.size+s,this.from+this.insert,this.from+this.insert+s,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let s=e.mapResult(this.from,1),n=e.mapResult(this.to,-1),a=this.from==this.gapFrom?s.pos:e.map(this.gapFrom,-1),i=this.to==this.gapTo?n.pos:e.map(this.gapTo,1);return s.deletedAcross&&n.deletedAcross||a<s.pos||i>n.pos?null:new ds(s.pos,n.pos,a,i,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,s){if(typeof s.from!="number"||typeof s.to!="number"||typeof s.gapFrom!="number"||typeof s.gapTo!="number"||typeof s.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new ds(s.from,s.to,s.gapFrom,s.gapTo,me.fromJSON(e,s.slice),s.insert,!!s.structure)}}Is.jsonID("replaceAround",ds);function Sy(t,e,s){let n=t.resolve(e),a=s-e,i=n.depth;for(;a>0&&i>0&&n.indexAfter(i)==n.node(i).childCount;)i--,a--;if(a>0){let o=n.node(i).maybeChild(n.indexAfter(i));for(;a>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,a--}}return!1}function vW(t,e,s,n){let a=[],i=[],o,l;t.doc.nodesBetween(e,s,(c,d,u)=>{if(!c.isInline)return;let h=c.marks;if(!n.isInSet(h)&&u.type.allowsMarkType(n.type)){let m=Math.max(d,e),f=Math.min(d+c.nodeSize,s),p=n.addToSet(h);for(let g=0;g<h.length;g++)h[g].isInSet(p)||(o&&o.to==m&&o.mark.eq(h[g])?o.to=f:a.push(o=new kr(m,f,h[g])));l&&l.to==m?l.to=f:i.push(l=new bi(m,f,n))}}),a.forEach(c=>
vendor: 4,926 bytes, lines 736-737
736t.step(c)),i.forEach(c=>t.step(c))}function wW(t,e,s,n){let a=[],i=0;t.doc.nodesBetween(e,s,(o,l)=>{if(!o.isInline)return;i++;let c=null;if(n instanceof Nx){let d=o.marks,u;for(;u=n.isInSet(d);)(c||(c=[])).push(u),d=u.removeFromSet(d)}else n?n.isInSet(o.marks)&&(c=[n]):c=o.marks;if(c&&c.length){let d=Math.min(l+o.nodeSize,s);for(let u=0;u<c.length;u++){let h=c[u],m;for(let f=0;f<a.length;f++){let p=a[f];p.step==i-1&&h.eq(a[f].style)&&(m=p)}m?(m.to=d,m.step=i):a.push({style:h,from:Math.max(l,e),to:d,step:i})}}}),a.forEach(o=>t.step(new kr(o.from,o.to,o.style)))}function s1(t,e,s,n=s.contentMatch,a=!0){let i=t.doc.nodeAt(e),o=[],l=e+1;for(let c=0;c<i.childCount;c++){let d=i.child(c),u=l+d.nodeSize,h=n.matchType(d.type);if(!h)o.push(new as(l,u,me.empty));else{n=h;for(let m=0;m<d.marks.length;m++)s.allowsMarkType(d.marks[m].type)||t.step(new kr(l,u,d.marks[m]));if(a&&d.isText&&s.whitespace!="pre"){let m,f=/\r?\n|\r/g,p;for(;m=f.exec(d.text);)p||(p=new me(se.from(s.schema.text(" ",s.allowedMarks(d.marks))),0,0)),o.push(new as(l+m.index,l+m.index+m[0].length,p))}}l=u}if(!n.validEnd){let c=n.fillBefore(se.empty,!0);t.replace(l,l,new me(c,0,0))}for(let c=o.length-1;c>=0;c--)t.step(o[c])}function jW(t,e,s){return(e==0||t.canReplace(e,t.childCount))&&(s==t.childCount||t.canReplace(0,s))}function Gc(t){let s=t.parent.content.cutByIndex(t.startIndex,t.endIndex);for(let n=t.depth,a=0,i=0;;--n){let o=t.$from.node(n),l=t.$from.index(n)+a,c=t.$to.indexAfter(n)-i;if(n<t.depth&&o.canReplace(l,c,s))return n;if(n==0||o.type.spec.isolating||!jW(o,l,c))break;l&&(a=1),c<o.childCount&&(i=1)}return null}function NW(t,e,s){let{$from:n,$to:a,depth:i}=e,o=n.before(i+1),l=a.after(i+1),c=o,d=l,u=se.empty,h=0;for(let p=i,g=!1;p>s;p--)g||n.index(p)>0?(g=!0,u=se.from(n.node(p).copy(u)),h++):c--;let m=se.empty,f=0;for(let p=i,g=!1;p>s;p--)g||a.after(p+1)<a.end(p)?(g=!0,m=se.from(a.node(p).copy(m)),f++):d++;t.step(new ds(c,d,o,l,new me(u.append(m),h,f),u.size-h,!0))}function n1(t,e,s=null,n=t){let a=kW(t,e),i=a&&CW(n,e);return i?a.map(aC).concat({type:e,attrs:s}).concat(i.map(aC)):null}function aC(t){return{type:t,attrs:null}}function kW(t,e){let{parent:s,startIndex:n,endIndex:a}=t,i=s.contentMatchAt(n).findWrapping(e);if(!i)return null;let o=i.length?i[0]:e;return s.canReplaceWith(n,a,o)?i:null}function CW(t,e){let{parent:s,startIndex:n,endIndex:a}=t,i=s.child(n),o=e.contentMatch.findWrapping(i.type);if(!o)return null;let c=(o.length?o[o.length-1]:e).contentMatch;for(let d=n;c&&d<a;d++)c=c.matchType(s.child(d).type);return!c||!c.validEnd?null:o}function SW(t,e,s){let n=se.empty;for(let o=s.length-1;o>=0;o--){if(n.size){let l=s[o].type.contentMatch.matchFragment(n);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}n=se.from(s[o].type.create(s[o].attrs,n))}let a=e.start,i=e.end;t.step(new ds(a,i,a,i,new me(n,0,0),s.length,!0))}function _W(t,e,s,n,a){if(!n.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let i=t.steps.length;t.doc.nodesBetween(e,s,(o,l)=>{let c=typeof a=="function"?a(o):a;if(o.isTextblock&&!o.hasMarkup(n,c)&&TW(t.doc,t.mapping.slice(i).map(l),n)){let d=null;if(n.schema.linebreakReplacement){let f=n.whitespace=="pre",p=!!n.contentMatch.matchType(n.schema.linebreakReplacement);f&&!p?d=!1:!f&&p&&(d=!0)}d===!1&&zM(t,o,l,i),s1(t,t.mapping.slice(i).map(l,1),n,void 0,d===null);let u=t.mapping.slice(i),h=u.map(l,1),m=u.map(l+o.nodeSize,1);return t.step(new ds(h,m,h+1,m-1,new me(se.from(n.create(c,null,o.marks)),0,0),1,!0)),d===!0&&$M(t,o,l,i),!1}})}function $M(t,e,s,n){e.forEach((a,i)=>{if(a.isText){let o,l=/\r?\n|\r/g;for(;o=l.exec(a.text);){let c=t.mapping.slice(n).map(s+1+i+o.index);t.replaceWith(c,c+1,e.type.schema.linebreakReplacement.create())}}})}function zM(t,e,s,n){e.forEach((a,i)=>{if(a.type==a.type.schema.linebreakReplacement){let o=t.mapping.slice(n).map(s+1+i);t.replaceWith(o,o+1,e.type.schema.text(` 737`))}})}function TW(t,e,s){let n=t.resolve(e),a=n.index();return n.parent.canReplaceWith(a,a+1,s)}function EW(t,e,s,n,a){let i=t.doc.nodeAt(e);if(!i)throw new RangeError("No node at given position");s||(s=i.type);let o=s.create(n,null,a||i.marks);if(i.isLeaf)return t.replaceWith(e,e+i.nodeSize,o);if(!s.validContent(i.content))throw new RangeError("Invalid content for node type "+s.name);t.step(new ds(e,e+i.nodeSize,e+1,e+i.nodeSize-1,new me(se.from(o),0,0),1,!0))}function Aa(t,e,s=1,n){let a=t.resolve(e),i=a.depth-s,o=n&&n[n.length-1]||a.parent;if(i<0||a.parent.type.spec.isolating||!a.parent.canReplace(a.index(),a.parent.childCount)||!o.type.validContent(a.parent.content.cutByIndex(a.index(),a.parent.childCount)))return!1;for(let d=a.depth-1,u=s-2;d>i;d--,u--){let h=a.node(d),m=a.index(d);if(h.type.spec.isolating)return!1;let f=h.content.cutByIndex(m,h.childCount),p=n&&n[u+1];p&&(f=f.replaceChild(0,p.type.create(p.attrs)));let g=n&&n[u]||h;
vendor: 8,436 bytes, line 737
737if(!h.canReplace(m+1,h.childCount)||!g.type.validContent(f))return!1}let l=a.indexAfter(i),c=n&&n[0];return a.node(i).canReplaceWith(l,l,c?c.type:a.node(i+1).type)}function MW(t,e,s=1,n){let a=t.doc.resolve(e),i=se.empty,o=se.empty;for(let l=a.depth,c=a.depth-s,d=s-1;l>c;l--,d--){i=se.from(a.node(l).copy(i));let u=n&&n[d];o=se.from(u?u.type.create(u.attrs,o):a.node(l).copy(o))}t.step(new as(e,e,new me(i.append(o),s,s),!0))}function no(t,e){let s=t.resolve(e),n=s.index();return BM(s.nodeBefore,s.nodeAfter)&&s.parent.canReplace(n,n+1)}function AW(t,e){e.content.size||t.type.compatibleContent(e.type);let s=t.contentMatchAt(t.childCount),{linebreakReplacement:n}=t.type.schema;for(let a=0;a<e.childCount;a++){let i=e.child(a),o=i.type==n?t.type.schema.nodes.text:i.type;if(s=s.matchType(o),!s||!t.type.allowsMarks(i.marks))return!1}return s.validEnd}function BM(t,e){return!!(t&&e&&!t.isLeaf&&AW(t,e))}function kx(t,e,s=-1){let n=t.resolve(e);for(let a=n.depth;;a--){let i,o,l=n.index(a);if(a==n.depth?(i=n.nodeBefore,o=n.nodeAfter):s>0?(i=n.node(a+1),l++,o=n.node(a).maybeChild(l)):(i=n.node(a).maybeChild(l-1),o=n.node(a+1)),i&&!i.isTextblock&&BM(i,o)&&n.node(a).canReplace(l,l+1))return e;if(a==0)break;e=s<0?n.before(a):n.after(a)}}function PW(t,e,s){let n=null,{linebreakReplacement:a}=t.doc.type.schema,i=t.doc.resolve(e-s),o=i.node().type;if(a&&o.inlineContent){let u=o.whitespace=="pre",h=!!o.contentMatch.matchType(a);u&&!h?n=!1:!u&&h&&(n=!0)}let l=t.steps.length;if(n===!1){let u=t.doc.resolve(e+s);zM(t,u.node(),u.before(),l)}o.inlineContent&&s1(t,e+s-1,o,i.node().contentMatchAt(i.index()),n==null);let c=t.mapping.slice(l),d=c.map(e-s);if(t.step(new as(d,c.map(e+s,-1),me.empty,!0)),n===!0){let u=t.doc.resolve(d);$M(t,u.node(),u.before(),t.steps.length)}return t}function DW(t,e,s){let n=t.resolve(e);if(n.parent.canReplaceWith(n.index(),n.index(),s))return e;if(n.parentOffset==0)for(let a=n.depth-1;a>=0;a--){let i=n.index(a);if(n.node(a).canReplaceWith(i,i,s))return n.before(a+1);if(i>0)return null}if(n.parentOffset==n.parent.content.size)for(let a=n.depth-1;a>=0;a--){let i=n.indexAfter(a);if(n.node(a).canReplaceWith(i,i,s))return n.after(a+1);if(i<n.node(a).childCount)return null}return null}function VM(t,e,s){let n=t.resolve(e);if(!s.content.size)return e;let a=s.content;for(let i=0;i<s.openStart;i++)a=a.firstChild.content;for(let i=1;i<=(s.openStart==0&&s.size?2:1);i++)for(let o=n.depth;o>=0;o--){let l=o==n.depth?0:n.pos<=(n.start(o+1)+n.end(o+1))/2?-1:1,c=n.index(o)+(l>0?1:0),d=n.node(o),u=!1;if(i==1)u=d.canReplace(c,c,a);else{let h=d.contentMatchAt(c).findWrapping(a.firstChild.type);u=h&&d.canReplaceWith(c,c,h[0])}if(u)return l==0?n.pos:l<0?n.before(o+1):n.after(o+1)}return null}function Cx(t,e,s=e,n=me.empty){if(e==s&&!n.size)return null;let a=t.resolve(e),i=t.resolve(s);return UM(a,i,n)?new as(e,s,n):new RW(a,i,n).fit()}function UM(t,e,s){return!s.openStart&&!s.openEnd&&t.start()==e.start()&&t.parent.canReplace(t.index(),e.index(),s.content)}class RW{constructor(e,s,n){this.$from=e,this.$to=s,this.unplaced=n,this.frontier=[],this.placed=se.empty;for(let a=0;a<=e.depth;a++){let i=e.node(a);this.frontier.push({type:i.type,match:i.contentMatchAt(e.indexAfter(a))})}for(let a=e.depth;a>0;a--)this.placed=se.from(e.node(a).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let d=this.findFittable();d?this.placeNodes(d):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),s=this.placed.size-this.depth-this.$from.depth,n=this.$from,a=this.close(e<0?this.$to:n.doc.resolve(e));if(!a)return null;let i=this.placed,o=n.depth,l=a.depth;for(;o&&l&&i.childCount==1;)i=i.firstChild.content,o--,l--;let c=new me(i,o,l);return e>-1?new ds(n.pos,e,this.$to.pos,this.$to.end(),c,s):c.size||n.pos!=this.$to.pos?new as(n.pos,a.pos,c):null}findFittable(){let e=this.unplaced.openStart;for(let s=this.unplaced.content,n=0,a=this.unplaced.openEnd;n<e;n++){let i=s.firstChild;if(s.childCount>1&&(a=0),i.type.spec.isolating&&a<=n){e=n;break}s=i.content}for(let s=1;s<=2;s++)for(let n=s==1?e:this.unplaced.openStart;n>=0;n--){let a,i=null;n?(i=d0(this.unplaced.content,n-1).firstChild,a=i.content):a=this.unplaced.content;let o=a.firstChild;for(let l=this.depth;l>=0;l--){let{type:c,match:d}=this.frontier[l],u,h=null;if(s==1&&(o?d.matchType(o.type)||(h=d.fillBefore(se.from(o),!1)):i&&c.compatibleContent(i.type)))return{sliceDepth:n,frontierDepth:l,parent:i,inject:h};if(s==2&&o&&(u=d.findWrapping(o.type)))return{sliceDepth:n,frontierDepth:l,parent:i,wrap:u};if(i&&d.matchType(i.type))break}}}openMore(){let{content:e,openStart:s,openEnd:n}=this.unplaced,a=d0(e,s);return!a.childCount||a.firstChild.isLeaf?!1:(this.unplaced=new me(e,s+1,Math.max(n,a.size+s>=e.size-n?s+1:0)),!0)}dropNode(){let{content:e,openStart:s,openEnd:n}=this.unplaced,a=d0(e,s);if(a.childCount<=1&&s>0){let i=e.size-s<=s+a.size;this.unplaced=new me(Ed(e,s-1,1),s-1,i?s-1:n)}else this.unplaced=new me(Ed(e,s,1),s,n)}placeNodes({sliceDepth:e,frontierDepth:s,parent:n,inject:a,wrap:i}){for(;this.depth>s;)this.closeFrontierNode();if(i)for(let g=0;g<i.length;g++)this.openFrontierNode(i[g]);let o=this.unplaced,l=n?n.content:o.content,c=o.openStart-e,d=0,u=[],{match:h,type:m}=this.frontier[s];if(a){for(let g=0;g<a.childCount;g++)u.push(a.child(g));h=h.matchFragment(a)}let f=l.size+e-(o.content.size-o.openEnd);for(;d<l.childCount;){let g=l.child(d),x=h.matchType(g.type);if(!x)break;d++,(d>1||c==0||g.content.size)&&(h=x,u.push(HM(g.mark(m.allowedMarks(g.marks)),d==1?c:0,d==l.childCount?f:-1)))}let p=d==l.childCount;p||(f=-1),this.placed=Md(this.placed,s,se.from(u)),this.frontier[s].match=h,p&&f<0&&n&&n.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let g=0,x=l;g<f;g++){let b=x.lastChild;this.frontier.push({type:b.type,match:b.contentMatchAt(b.childCount)}),x=b.content}this.unplaced=p?e==0?me.empty:new me(Ed(o.content,e-1,1),e-1,f<0?o.openEnd:e-1):new me(Ed(o.content,e,d),o.openStart,o.openEnd)}mustMoveInline(){if(!this.$to.parent.isTextblock)return-1;let e=this.frontier[this.depth],s;if(!e.type.isTextblock||!u0(this.$to,this.$to.depth,e.type,e.match,!1)||this.$to.depth==this.depth&&(s=this.findCloseLevel(this.$to))&&s.depth==this.depth)return-1;let{depth:n}=this.$to,a=this.$to.after(n);for(;n>1&&a==this.$to.end(--n);)++a;return a}findCloseLevel(e){e:for(let s=Math.min(this.depth,e.depth);s>=0;s--){let{match:n,type:a}=this.frontier[s],i=s<e.depth&&e.end(s+1)==e.pos+(e.depth-(s+1)),o=u0(e,s,a,n,i);if(o){for(let l=s-1;l>=0;l--){let{match:c,type:d}=this.frontier[l],u=u0(e,l,d,c,!0);if(!u||u.childCount)continue e}return{depth:s,fit:o,move:i?e.doc.resolve(e.after(s+1)):e}}}}close(e){let s=this.findCloseLevel(e);if(!s)return null;for(;this.depth>s.depth;)this.closeFrontierNode();s.fit.childCount&&(this.placed=Md(this.placed,s.depth,s.fit)),e=s.move;for(let n=s.depth+1;n<=e.depth;n++){let a=e.node(n),i=a.type.contentMatch.fillBefore(a.content,!0,e.index(n));this.openFrontierNode(a.type,a.attrs,i)}return e}openFrontierNode(e,s=null,n){let a=this.frontier[this.depth];a.match=a.match.matchType(e),this.placed=Md(this.placed,this.depth,se.from(e.create(s,n))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let s=this.frontier.pop().match.fillBefore(se.empty,!0);s.childCount&&(this.placed=Md(this.placed,this.frontier.length,s))}}function Ed(t,e,s){return e==0?t.cutByIndex(s,t.childCount):t.replaceChild(0,t.firstChild.copy(Ed(t.firstChild.content,e-1,s)))}function Md(t,e,s){return e==0?t.append(s):t.replaceChild(t.childCount-1,t.lastChild.copy(Md(t.lastChild.content,e-1,s)))}function d0(t,e){for(let s=0;s<e;s++)t=t.firstChild.content;return t}function HM(t,e,s){if(e<=0)return t;let n=t.content;return e>1&&(n=n.replaceChild(0,HM(n.firstChild,e-1,n.childCount==1?s-1:0))),e>0&&(n=t.type.contentMatch.fillBefore(n).append(n),s<=0&&(n=n.append(t.type.contentMatch.matchFragment(n).fillBefore(se.empty,!0)))),t.copy(n)}function u0(t,e,s,n,a){let i=t.node(e),o=a?t.indexAfter(e):t.index(e);if(o==i.childCount&&!s.compatibleContent(i.type))return null;let l=n.fillBefore(i.content,!0,o);return l&&!LW(s,i.content,o)?l:null}function LW(t,e,s){for(let n=s;n<e.childCount;n++)if(!t.allowsMarks(e.child(n).marks))return!0;return!1}function OW(t){return t.spec.defining||t.spec.definingForContent}function IW(t,e,s,n){if(!n.size)return t.deleteRange(e,s);let a=t.doc.resolve(e),i=t.doc.resolve(s);
vendor: 4,577 bytes, line 737
737if(UM(a,i,n))return t.step(new as(e,s,n));let o=GM(a,i);o[o.length-1]==0&&o.pop();let l=-(a.depth+1);o.unshift(l);for(let m=a.depth,f=a.pos-1;m>0;m--,f--){let p=a.node(m).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;o.indexOf(m)>-1?l=m:a.before(m)==f&&o.splice(1,0,-m)}let c=o.indexOf(l),d=[],u=n.openStart;for(let m=n.content,f=0;;f++){let p=m.firstChild;if(d.push(p),f==n.openStart)break;m=p.content}for(let m=u-1;m>=0;m--){let f=d[m],p=OW(f.type);if(p&&!f.sameMarkup(a.node(Math.abs(l)-1)))u=m;else if(p||!f.type.isTextblock)break}for(let m=n.openStart;m>=0;m--){let f=(m+u+1)%(n.openStart+1),p=d[f];if(p)for(let g=0;g<o.length;g++){let x=o[(g+c)%o.length],b=!0;x<0&&(b=!1,x=-x);let y=a.node(x-1),w=a.index(x-1);if(y.canReplaceWith(w,w,p.type,p.marks))return t.replace(a.before(x),b?i.after(x):s,new me(WM(n.content,0,n.openStart,f),f,n.openEnd))}}let h=t.steps.length;for(let m=o.length-1;m>=0&&(t.replace(e,s,n),!(t.steps.length>h));m--){let f=o[m];f<0||(e=a.before(f),s=i.after(f))}}function WM(t,e,s,n,a){if(e<s){let i=t.firstChild;t=t.replaceChild(0,i.copy(WM(i.content,e+1,s,n,i)))}if(e>n){let i=a.contentMatchAt(0),o=i.fillBefore(t).append(t);t=o.append(i.matchFragment(o).fillBefore(se.empty,!0))}return t}function FW(t,e,s,n){if(!n.isInline&&e==s&&t.doc.resolve(e).parent.content.size){let a=DW(t.doc,e,n.type);a!=null&&(e=s=a)}t.replaceRange(e,s,new me(se.from(n),0,0))}function $W(t,e,s){let n=t.doc.resolve(e),a=t.doc.resolve(s),i=GM(n,a);for(let o=0;o<i.length;o++){let l=i[o],c=o==i.length-1;if(c&&l==0||n.node(l).type.contentMatch.validEnd)return t.delete(n.start(l),a.end(l));if(l>0&&(c||n.node(l-1).canReplace(n.index(l-1),a.indexAfter(l-1))))return t.delete(n.before(l),a.after(l))}for(let o=1;o<=n.depth&&o<=a.depth;o++)if(e-n.start(o)==n.depth-o&&s>n.end(o)&&a.end(o)-s!=a.depth-o&&n.start(o-1)==a.start(o-1)&&n.node(o-1).canReplace(n.index(o-1),a.index(o-1)))return t.delete(n.before(o),s);t.delete(e,s)}function GM(t,e){let s=[],n=Math.min(t.depth,e.depth);for(let a=n;a>=0;a--){let i=t.start(a);if(i<t.pos-(t.depth-a)||e.end(a)>e.pos+(e.depth-a)||t.node(a).type.spec.isolating||e.node(a).type.spec.isolating)break;(i==e.start(a)||a==t.depth&&a==e.depth&&t.parent.inlineContent&&e.parent.inlineContent&&a&&e.start(a-1)==i-1)&&s.push(a)}return s}class lc extends Is{constructor(e,s,n){super(),this.pos=e,this.attr=s,this.value=n}apply(e){let s=e.nodeAt(this.pos);if(!s)return Ht.fail("No node at attribute step's position");let n=Object.create(null);for(let i in s.attrs)n[i]=s.attrs[i];n[this.attr]=this.value;let a=s.type.create(n,null,s.marks);return Ht.fromReplace(e,this.pos,this.pos+1,new me(se.from(a),0,s.isLeaf?0:1))}getMap(){return _n.empty}invert(e){return new lc(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let s=e.mapResult(this.pos,1);return s.deletedAfter?null:new lc(s.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,s){if(typeof s.pos!="number"||typeof s.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new lc(s.pos,s.attr,s.value)}}Is.jsonID("attr",lc);class zu extends Is{constructor(e,s){super(),this.attr=e,this.value=s}apply(e){let s=Object.create(null);for(let a in e.attrs)s[a]=e.attrs[a];s[this.attr]=this.value;let n=e.type.create(s,e.content,e.marks);return Ht.ok(n)}getMap(){return _n.empty}invert(e){return new zu(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,s){if(typeof s.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new zu(s.attr,s.value)}}Is.jsonID("docAttr",zu);let Nc=class extends Error{};Nc=function t(e){let s=Error.call(this,e);return s.__proto__=t.prototype,s};Nc.prototype=Object.create(Error.prototype);Nc.prototype.constructor=Nc;Nc.prototype.name="TransformError";class YM{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new $u}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let s=this.maybeStep(e);if(s.failed)throw new Nc(s.failed);return this}maybeStep(e){let s=e.apply(this.doc);return s.failed||this.addStep(e,s.doc),s}get docChanged(){return this.steps.length>0}changedRange(){let e=1e9,s=-1e9;for(let n=0;n<this.mapping.maps.length;n++){let a=this.mapping.maps[n];n&&(e=a.map(e,1),s=a.map(s,-1)),a.forEach((i,o,l,c)=>{e=Math.min(e,l),s=Math.max(s,c)})}return e==1e9?null:{from:e,to:s}}addStep(e,s){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=s}
vendor: 4,967 bytes, line 737
737replace(e,s=e,n=me.empty){let a=Cx(this.doc,e,s,n);return a&&this.step(a),this}replaceWith(e,s,n){return this.replace(e,s,new me(se.from(n),0,0))}delete(e,s){return this.replace(e,s,me.empty)}insert(e,s){return this.replaceWith(e,e,s)}replaceRange(e,s,n){return IW(this,e,s,n),this}replaceRangeWith(e,s,n){return FW(this,e,s,n),this}deleteRange(e,s){return $W(this,e,s),this}lift(e,s){return NW(this,e,s),this}join(e,s=1){return PW(this,e,s),this}wrap(e,s){return SW(this,e,s),this}setBlockType(e,s=e,n,a=null){return _W(this,e,s,n,a),this}setNodeMarkup(e,s,n=null,a){return EW(this,e,s,n,a),this}setNodeAttribute(e,s,n){return this.step(new lc(e,s,n)),this}setDocAttribute(e,s){return this.step(new zu(e,s)),this}addNodeMark(e,s){return this.step(new yi(e,s)),this}removeNodeMark(e,s){let n=this.doc.nodeAt(e);if(!n)throw new RangeError("No node at position "+e);if(s instanceof rt)s.isInSet(n.marks)&&this.step(new Qo(e,s));else{let a=n.marks,i,o=[];for(;i=s.isInSet(a);)o.push(new Qo(e,i)),a=i.removeFromSet(a);for(let l=o.length-1;l>=0;l--)this.step(o[l])}return this}split(e,s=1,n){return MW(this,e,s,n),this}addMark(e,s,n){return vW(this,e,s,n),this}removeMark(e,s,n){return wW(this,e,s,n),this}clearIncompatible(e,s,n){return s1(this,e,s,n),this}}const h0=Object.create(null);class Fe{constructor(e,s,n){this.$anchor=e,this.$head=s,this.ranges=n||[new zW(e.min(s),e.max(s))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let s=0;s<e.length;s++)if(e[s].$from.pos!=e[s].$to.pos)return!1;return!0}content(){return this.$from.doc.slice(this.from,this.to,!0)}replace(e,s=me.empty){let n=s.content.lastChild,a=null;for(let l=0;l<s.openEnd;l++)a=n,n=n.lastChild;let i=e.steps.length,o=this.ranges;for(let l=0;l<o.length;l++){let{$from:c,$to:d}=o[l],u=e.mapping.slice(i);e.replaceRange(u.map(c.pos),u.map(d.pos),l?me.empty:s),l==0&&lC(e,i,(n?n.isInline:a&&a.isTextblock)?-1:1)}}replaceWith(e,s){let n=e.steps.length,a=this.ranges;for(let i=0;i<a.length;i++){let{$from:o,$to:l}=a[i],c=e.mapping.slice(n),d=c.map(o.pos),u=c.map(l.pos);i?e.deleteRange(d,u):(e.replaceRangeWith(d,u,s),lC(e,n,s.isInline?-1:1))}}static findFrom(e,s,n=!1){let a=e.parent.inlineContent?new Me(e):Al(e.node(0),e.parent,e.pos,e.index(),s,n);if(a)return a;for(let i=e.depth-1;i>=0;i--){let o=s<0?Al(e.node(0),e.node(i),e.before(i+1),e.index(i),s,n):Al(e.node(0),e.node(i),e.after(i+1),e.index(i)+1,s,n);if(o)return o}return null}static near(e,s=1){return this.findFrom(e,s)||this.findFrom(e,-s)||new Pn(e.node(0))}static atStart(e){return Al(e,e,0,0,1)||new Pn(e)}static atEnd(e){return Al(e,e,e.content.size,e.childCount,-1)||new Pn(e)}static fromJSON(e,s){if(!s||!s.type)throw new RangeError("Invalid input for Selection.fromJSON");let n=h0[s.type];if(!n)throw new RangeError(`No selection type ${s.type} defined`);return n.fromJSON(e,s)}static jsonID(e,s){if(e in h0)throw new RangeError("Duplicate use of selection JSON ID "+e);return h0[e]=s,s.prototype.jsonID=e,s}getBookmark(){return Me.between(this.$anchor,this.$head).getBookmark()}}Fe.prototype.visible=!0;class zW{constructor(e,s){this.$from=e,this.$to=s}}let iC=!1;function oC(t){!iC&&!t.parent.inlineContent&&(iC=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+t.parent.type.name+")"))}class Me extends Fe{constructor(e,s=e){oC(e),oC(s),super(e,s)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,s){let n=e.resolve(s.map(this.head));if(!n.parent.inlineContent)return Fe.near(n);let a=e.resolve(s.map(this.anchor));return new Me(a.parent.inlineContent?a:n,n)}replace(e,s=me.empty){if(super.replace(e,s),s==me.empty){let n=this.$from.marksAcross(this.$to);n&&e.ensureMarks(n)}}eq(e){return e instanceof Me&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new Sx(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,s){if(typeof s.anchor!="number"||typeof s.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new Me(e.resolve(s.anchor),e.resolve(s.head))}static create(e,s,n=s){let a=e.resolve(s);return new this(a,n==s?a:e.resolve(n))}static between(e,s,n){let a=e.pos-s.pos;if((!n||a)&&(n=a>=0?1:-1),!s.parent.inlineContent){let i=Fe.findFrom(s,n,!0)||Fe.findFrom(s,-n,!0);if(i)s=i.$head;else return Fe.near(s,n)}return e.parent.inlineContent||(a==0?e=s:(e=(Fe.findFrom(e,-n,!0)||Fe.findFrom(e,n,!0)).$anchor,e.pos<s.pos!=a<0&&(e=s))),new Me(e,s)}}Fe.jsonID("text",Me);class Sx{constructor(e,s){this.anchor=e,this.head=s}map(e){return new Sx(e.map(this.anchor),e.map(this.head))}resolve(e){return Me.between(e.resolve(this.anchor),e.resolve(this.head))}}class Ce extends Fe{constructor(e){let s=e.nodeAfter,n=e.node(0).resolve(e.pos+s.nodeSize);super(e,n),this.node=s}
vendor: 4,806 bytes, line 737
737map(e,s){let{deleted:n,pos:a}=s.mapResult(this.anchor),i=e.resolve(a);return n?Fe.near(i):new Ce(i)}content(){return new me(se.from(this.node),0,0)}eq(e){return e instanceof Ce&&e.anchor==this.anchor}toJSON(){return{type:"node",anchor:this.anchor}}getBookmark(){return new r1(this.anchor)}static fromJSON(e,s){if(typeof s.anchor!="number")throw new RangeError("Invalid input for NodeSelection.fromJSON");return new Ce(e.resolve(s.anchor))}static create(e,s){return new Ce(e.resolve(s))}static isSelectable(e){return!e.isText&&e.type.spec.selectable!==!1}}Ce.prototype.visible=!1;Fe.jsonID("node",Ce);class r1{constructor(e){this.anchor=e}map(e){let{deleted:s,pos:n}=e.mapResult(this.anchor);return s?new Sx(n,n):new r1(n)}resolve(e){let s=e.resolve(this.anchor),n=s.nodeAfter;return n&&Ce.isSelectable(n)?new Ce(s):Fe.near(s)}}class Pn extends Fe{constructor(e){super(e.resolve(0),e.resolve(e.content.size))}replace(e,s=me.empty){if(s==me.empty){e.delete(0,e.doc.content.size);let n=Fe.atStart(e.doc);n.eq(e.selection)||e.setSelection(n)}else super.replace(e,s)}toJSON(){return{type:"all"}}static fromJSON(e){return new Pn(e)}map(e){return new Pn(e)}eq(e){return e instanceof Pn}getBookmark(){return BW}}Fe.jsonID("all",Pn);const BW={map(){return this},resolve(t){return new Pn(t)}};function Al(t,e,s,n,a,i=!1){if(e.inlineContent)return Me.create(t,s);for(let o=n-(a>0?0:1);a>0?o<e.childCount:o>=0;o+=a){let l=e.child(o);if(l.isAtom){if(!i&&Ce.isSelectable(l))return Ce.create(t,s-(a<0?l.nodeSize:0))}else{let c=Al(t,l,s+a,a<0?l.childCount:0,a,i);if(c)return c}s+=l.nodeSize*a}return null}function lC(t,e,s){let n=t.steps.length-1;if(n<e)return;let a=t.steps[n];if(!(a instanceof as||a instanceof ds))return;let i=t.mapping.maps[n],o;i.forEach((l,c,d,u)=>{o==null&&(o=u)}),t.setSelection(Fe.near(t.doc.resolve(o),s))}const cC=1,em=2,dC=4;class VW extends YM{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor<this.steps.length&&(this.curSelection=this.curSelection.map(this.doc,this.mapping.slice(this.curSelectionFor)),this.curSelectionFor=this.steps.length),this.curSelection}setSelection(e){if(e.$from.doc!=this.doc)throw new RangeError("Selection passed to setSelection must point at the current document");return this.curSelection=e,this.curSelectionFor=this.steps.length,this.updated=(this.updated|cC)&~em,this.storedMarks=null,this}get selectionSet(){return(this.updated&cC)>0}setStoredMarks(e){return this.storedMarks=e,this.updated|=em,this}ensureMarks(e){return rt.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&em)>0}addStep(e,s){super.addStep(e,s),this.updated=this.updated&~em,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,s=!0){let n=this.selection;return s&&(e=e.mark(this.storedMarks||(n.empty?n.$from.marks():n.$from.marksAcross(n.$to)||rt.none))),n.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,s,n){let a=this.doc.type.schema;if(s==null)return e?this.replaceSelectionWith(a.text(e),!0):this.deleteSelection();{if(n==null&&(n=s),!e)return this.deleteRange(s,n);let i=this.storedMarks;if(!i){let o=this.doc.resolve(s);i=n==s?o.marks():o.marksAcross(this.doc.resolve(n))}return this.replaceRangeWith(s,n,a.text(e,i)),!this.selection.empty&&this.selection.to==s+e.length&&this.setSelection(Fe.near(this.selection.$to)),this}}setMeta(e,s){return this.meta[typeof e=="string"?e:e.key]=s,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=dC,this}get scrolledIntoView(){return(this.updated&dC)>0}}function uC(t,e){return!e||!t?t:t.bind(e)}class Ad{constructor(e,s,n){this.name=e,this.init=uC(s.init,n),this.apply=uC(s.apply,n)}}const UW=[new Ad("doc",{init(t){return t.doc||t.schema.topNodeType.createAndFill()},apply(t){return t.doc}}),new Ad("selection",{init(t,e){return t.selection||Fe.atStart(e.doc)},apply(t){return t.selection}}),new Ad("storedMarks",{init(t){return t.storedMarks||null},apply(t,e,s,n){return n.selection.$cursor?t.storedMarks:null}}),new Ad("scrollToSelection",{init(){return 0},apply(t,e){return t.scrolledIntoView?e+1:e}})];class m0{constructor(e,s){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=UW.slice(),s&&s.forEac
vendor: 8,594 bytes, lines 737-738
737h(n=>{if(this.pluginsByKey[n.key])throw new RangeError("Adding different instances of a keyed plugin ("+n.key+")");this.plugins.push(n),this.pluginsByKey[n.key]=n,n.spec.state&&this.fields.push(new Ad(n.key,n.spec.state,n))})}}class ec{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,s=-1){for(let n=0;n<this.config.plugins.length;n++)if(n!=s){let a=this.config.plugins[n];if(a.spec.filterTransaction&&!a.spec.filterTransaction.call(a,e,this))return!1}return!0}applyTransaction(e){if(!this.filterTransaction(e))return{state:this,transactions:[]};let s=[e],n=this.applyInner(e),a=null;for(;;){let i=!1;for(let o=0;o<this.config.plugins.length;o++){let l=this.config.plugins[o];if(l.spec.appendTransaction){let c=a?a[o].n:0,d=a?a[o].state:this,u=c<s.length&&l.spec.appendTransaction.call(l,c?s.slice(c):s,d,n);if(u&&n.filterTransaction(u,o)){if(u.setMeta("appendedTransaction",e),!a){a=[];for(let h=0;h<this.config.plugins.length;h++)a.push(h<o?{state:n,n:s.length}:{state:this,n:0})}s.push(u),n=n.applyInner(u),i=!0}a&&(a[o]={state:n,n:s.length})}}if(!i)return{state:n,transactions:s}}}applyInner(e){if(!e.before.eq(this.doc))throw new RangeError("Applying a mismatched transaction");let s=new ec(this.config),n=this.config.fields;for(let a=0;a<n.length;a++){let i=n[a];s[i.name]=i.apply(e,this[i.name],this,s)}return s}get tr(){return new VW(this)}static create(e){let s=new m0(e.doc?e.doc.type.schema:e.schema,e.plugins),n=new ec(s);for(let a=0;a<s.fields.length;a++)n[s.fields[a].name]=s.fields[a].init(e,n);return n}reconfigure(e){let s=new m0(this.schema,e.plugins),n=s.fields,a=new ec(s);for(let i=0;i<n.length;i++){let o=n[i].name;a[o]=this.hasOwnProperty(o)?this[o]:n[i].init(e,a)}return a}toJSON(e){let s={doc:this.doc.toJSON(),selection:this.selection.toJSON()};if(this.storedMarks&&(s.storedMarks=this.storedMarks.map(n=>n.toJSON())),e&&typeof e=="object")for(let n in e){if(n=="doc"||n=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let a=e[n],i=a.spec.state;i&&i.toJSON&&(s[n]=i.toJSON.call(a,this[a.key]))}return s}static fromJSON(e,s,n){if(!s)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let a=new m0(e.schema,e.plugins),i=new ec(a);return a.fields.forEach(o=>{if(o.name=="doc")i.doc=Pi.fromJSON(e.schema,s.doc);else if(o.name=="selection")i.selection=Fe.fromJSON(i.doc,s.selection);else if(o.name=="storedMarks")s.storedMarks&&(i.storedMarks=s.storedMarks.map(e.schema.markFromJSON));else{if(n)for(let l in n){let c=n[l],d=c.spec.state;if(c.key==o.name&&d&&d.fromJSON&&Object.prototype.hasOwnProperty.call(s,l)){i[o.name]=d.fromJSON.call(c,e,s[l],i);return}}i[o.name]=o.init(e,i)}}),i}}function qM(t,e,s){for(let n in t){let a=t[n];a instanceof Function?a=a.bind(e):n=="handleDOMEvents"&&(a=qM(a,e,{})),s[n]=a}return s}class Ct{constructor(e){this.spec=e,this.props={},e.props&&qM(e.props,this,this.props),this.key=e.key?e.key.key:KM("plugin")}getState(e){return e[this.key]}}const f0=Object.create(null);function KM(t){return t in f0?t+"$"+ ++f0[t]:(f0[t]=0,t+"$")}class ts{constructor(e="key"){this.key=KM(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}}const a1=(t,e)=>t.selection.empty?!1:(e&&e(t.tr.deleteSelection().scrollIntoView()),!0);function JM(t,e){let{$cursor:s}=t.selection;return!s||(e?!e.endOfTextblock("backward",t):s.parentOffset>0)?null:s}const QM=(t,e,s)=>{let n=JM(t,s);if(!n)return!1;let a=i1(n);if(!a){let o=n.blockRange(),l=o&&Gc(o);return l==null?!1:(e&&e(t.tr.lift(o,l).scrollIntoView()),!0)}let i=a.nodeBefore;if(i5(t,a,e,-1))return!0;if(n.parent.content.size==0&&(kc(i,"end")||Ce.isSelectable(i)))for(let o=n.depth;;o--){let l=Cx(t.doc,n.before(o),n.after(o),me.empty);if(l&&l.slice.size<l.to-l.from){if(e){let c=t.tr.step(l);c.setSelection(kc(i,"end")?Fe.findFrom(c.doc.resolve(c.mapping.map(a.pos,-1)),-1):Ce.create(c.doc,a.pos-i.nodeSize)),e(c.scrollIntoView())}return!0}if(o==1||n.node(o-1).childCount>1)break}return i.isAtom&&a.depth==n.depth-1?(e&&e(t.tr.delete(a.pos-i.nodeSize,a.pos).scrollIntoView()),!0):!1},HW=(t,e,s)=>{let n=JM(t,s);if(!n)return!1;let a=i1(n);return a?XM(t,a,e):!1},WW=(t,e,s)=>{let n=e5(t,s);if(!n)return!1;let a=o1(n);return a?XM(t,a,e):!1};function XM(t,e,s){let n=e.nodeBefore,a=n,i=e.pos-1;for(;!a.isTextblock;i--){if(a.type.spec.isolating)return!1;let u=a.lastChild;if(!u)return!1;a=u}let o=e.nodeAfter,l=o,c=e.pos+1;for(;!l.isTextblock;c++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let d=Cx(t.doc,i,c,me.empty);if(!d||d.from!=i||d instanceof as&&d.slice.size>=c-i)return!1;if(s){let u=t.tr.step(d);u.setSelection(Me.create(u.doc,i)),s(u.scrollIntoView())}return!0}function kc(t,e,s=!1){for(let n=t;n;n=e=="start"?n.firstChild:n.lastChild){if(n.isTextblock)return!0;if(s&&n.childCount!=1)return!1}return!1}const ZM=(t,e,s)=>{let{$head:n,empty:a}=t.selection,i=n;if(!a)return!1;if(n.parent.isTextblock){if(s?!s.endOfTextblock("backward",t):n.parentOffset>0)return!1;i=i1(n)}let o=i&&i.nodeBefore;return!o||!Ce.isSelectable(o)?!1:(e&&e(t.tr.setSelection(Ce.create(t.doc,i.pos-o.nodeSize)).scrollIntoView()),!0)};function i1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){if(t.index(e)>0)return t.doc.resolve(t.before(e+1));if(t.node(e).type.spec.isolating)break}return null}function e5(t,e){let{$cursor:s}=t.selection;return!s||(e?!e.endOfTextblock("forward",t):s.parentOffset<s.parent.content.size)?null:s}const t5=(t,e,s)=>{let n=e5(t,s);if(!n)return!1;let a=o1(n);if(!a)return!1;let i=a.nodeAfter;if(i5(t,a,e,1))return!0;if(n.parent.content.size==0&&(kc(i,"start")||Ce.isSelectable(i))){let o=Cx(t.doc,n.before(),n.after(),me.empty);if(o&&o.slice.size<o.to-o.from){if(e){let l=t.tr.step(o);l.setSelection(kc(i,"start")?Fe.findFrom(l.doc.resolve(l.mapping.map(a.pos)),1):Ce.create(l.doc,l.mapping.map(a.pos))),e(l.scrollIntoView())}return!0}}return i.isAtom&&a.depth==n.depth-1?(e&&e(t.tr.delete(a.pos,a.pos+i.nodeSize).scrollIntoView()),!0):!1},s5=(t,e,s)=>{let{$head:n,empty:a}=t.selection,i=n;if(!a)return!1;if(n.parent.isTextblock){if(s?!s.endOfTextblock("forward",t):n.parentOffset<n.parent.content.size)return!1;i=o1(n)}let o=i&&i.nodeAfter;return!o||!Ce.isSelectable(o)?!1:(e&&e(t.tr.setSelection(Ce.create(t.doc,i.pos)).scrollIntoView()),!0)};function o1(t){if(!t.parent.type.spec.isolating)for(let e=t.depth-1;e>=0;e--){let s=t.node(e);if(t.index(e)+1<s.childCount)return t.doc.resolve(t.after(e+1));if(s.type.spec.isolating)break}return null}const GW=(t,e)=>{let s=t.selection,n=s instanceof Ce,a;if(n){if(s.node.isTextblock||!no(t.doc,s.from))return!1;a=s.from}else if(a=kx(t.doc,s.from,-1),a==null)return!1;if(e){let i=t.tr.join(a);n&&i.setSelection(Ce.create(i.doc,a-t.doc.resolve(a).nodeBefore.nodeSize)),e(i.scrollIntoView())}return!0},YW=(t,e)=>{let s=t.selection,n;if(s instanceof Ce){if(s.node.isTextblock||!no(t.doc,s.to))return!1;n=s.to}else if(n=kx(t.doc,s.to,1),n==null)return!1;return e&&e(t.tr.join(n).scrollIntoView()),!0},qW=(t,e)=>{let{$from:s,$to:n}=t.selection,a=s.blockRange(n),i=a&&Gc(a);return i==null?!1:(e&&e(t.tr.lift(a,i).scrollIntoView()),!0)},n5=(t,e)=>{let{$head:s,$anchor:n}=t.selection;return!s.parent.type.spec.code||!s.sameParent(n)?!1:(e&&e(t.tr.insertText(` 738`).scrollIntoView()),!0)};function l1(t){for(let e=0;e<t.edgeCount;e++){let{type:s}=t.edge(e);if(s.isTextblock&&!s.hasRequiredAttrs())return s}return null}const KW=(t,e)=>{let{$head:s,$anchor:n}=t.selection;if(!s.parent.type.spec.code||!s.sameParent(n))return!1;let a=s.node(-1),i=s.indexAfter(-1),o=l1(a.contentMatchAt(i));if(!o||!a.canReplaceWith(i,i,o))return!1;if(e){let l=s.after(),c=t.tr.replaceWith(l,l,o.createAndFill());c.setSelection(Fe.near(c.doc.resolve(l),1)),e(c.scrollIntoView())}return!0},r5=(t,e)=>{let s=t.selection,{$from:n,$to:a}=s;if(s instanceof Pn||n.parent.inlineContent||a.parent.inlineContent)return!1;let i=l1(a.parent.contentMatchAt(a.indexAfter()));if(!i||!i.isTextblock)return!1;if(e){let o=(!n.parentOffset&&a.index()<a.parent.childCount?n:a).pos,l=t.tr.insert(o,i.createAndFill());l.setSelection(Me.create(l.doc,o+1)),e(l.scrollIntoView())}return!0},a5=(t,e)=>{let{$cursor:s}=t.selection;if(!s||s.parent.content.size)return!1;if(s.depth>1&&s.after()!=s.end(-1)){let i=s.before();if(Aa(t.doc,i))return e&&e(t.tr.split(i).scrollIntoView()),!0}let n=s.blockRange(),a=n&&Gc(n);return a==null?!1:(e&&e(t.tr.lift(n,a).scrollIntoView()),!0)};
vendor: 6,960 bytes, line 738
738function JW(t){return(e,s)=>{let{$from:n,$to:a}=e.selection;if(e.selection instanceof Ce&&e.selection.node.isBlock)return!n.parentOffset||!Aa(e.doc,n.pos)?!1:(s&&s(e.tr.split(n.pos).scrollIntoView()),!0);if(!n.depth)return!1;let i=[],o,l,c=!1,d=!1;for(let f=n.depth;;f--)if(n.node(f).isBlock){c=n.end(f)==n.pos+(n.depth-f),d=n.start(f)==n.pos-(n.depth-f),l=l1(n.node(f-1).contentMatchAt(n.indexAfter(f-1))),i.unshift(c&&l?{type:l}:null),o=f;break}else{if(f==1)return!1;i.unshift(null)}let u=e.tr;(e.selection instanceof Me||e.selection instanceof Pn)&&u.deleteSelection();let h=u.mapping.map(n.pos),m=Aa(u.doc,h,i.length,i);if(m||(i[0]=l?{type:l}:null,m=Aa(u.doc,h,i.length,i)),!m)return!1;if(u.split(h,i.length,i),!c&&d&&n.node(o).type!=l){let f=u.mapping.map(n.before(o)),p=u.doc.resolve(f);l&&n.node(o-1).canReplaceWith(p.index(),p.index()+1,l)&&u.setNodeMarkup(u.mapping.map(n.before(o)),l)}return s&&s(u.scrollIntoView()),!0}}const QW=JW(),XW=(t,e)=>{let{$from:s,to:n}=t.selection,a,i=s.sharedDepth(n);return i==0?!1:(a=s.before(i),e&&e(t.tr.setSelection(Ce.create(t.doc,a))),!0)};function ZW(t,e,s){let n=e.nodeBefore,a=e.nodeAfter,i=e.index();return!n||!a||!n.type.compatibleContent(a.type)?!1:!n.content.size&&e.parent.canReplace(i-1,i)?(s&&s(t.tr.delete(e.pos-n.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(i,i+1)||!(a.isTextblock||no(t.doc,e.pos))?!1:(s&&s(t.tr.join(e.pos).scrollIntoView()),!0)}function i5(t,e,s,n){let a=e.nodeBefore,i=e.nodeAfter,o,l,c=a.type.spec.isolating||i.type.spec.isolating;if(!c&&ZW(t,e,s))return!0;let d=!c&&e.parent.canReplace(e.index(),e.index()+1);if(d&&(o=(l=a.contentMatchAt(a.childCount)).findWrapping(i.type))&&l.matchType(o[0]||i.type).validEnd){if(s){let f=e.pos+i.nodeSize,p=se.empty;for(let b=o.length-1;b>=0;b--)p=se.from(o[b].create(null,p));p=se.from(a.copy(p));let g=t.tr.step(new ds(e.pos-1,f,e.pos,f,new me(p,1,0),o.length,!0)),x=g.doc.resolve(f+2*o.length);x.nodeAfter&&x.nodeAfter.type==a.type&&no(g.doc,x.pos)&&g.join(x.pos),s(g.scrollIntoView())}return!0}let u=i.type.spec.isolating||n>0&&c?null:Fe.findFrom(e,1),h=u&&u.$from.blockRange(u.$to),m=h&&Gc(h);if(m!=null&&m>=e.depth)return s&&s(t.tr.lift(h,m).scrollIntoView()),!0;if(d&&kc(i,"start",!0)&&kc(a,"end")){let f=a,p=[];for(;p.push(f),!f.isTextblock;)f=f.lastChild;let g=i,x=1;for(;!g.isTextblock;g=g.firstChild)x++;if(f.canReplace(f.childCount,f.childCount,g.content)){if(s){let b=se.empty;for(let w=p.length-1;w>=0;w--)b=se.from(p[w].copy(b));let y=t.tr.step(new ds(e.pos-p.length,e.pos+i.nodeSize,e.pos+x,e.pos+i.nodeSize-x,new me(b,p.length,0),0,!0));s(y.scrollIntoView())}return!0}}return!1}function o5(t){return function(e,s){let n=e.selection,a=t<0?n.$from:n.$to,i=a.depth;for(;a.node(i).isInline;){if(!i)return!1;i--}return a.node(i).isTextblock?(s&&s(e.tr.setSelection(Me.create(e.doc,t<0?a.start(i):a.end(i)))),!0):!1}}const eG=o5(-1),tG=o5(1);function sG(t,e=null){return function(s,n){let{$from:a,$to:i}=s.selection,o=a.blockRange(i),l=o&&n1(o,t,e);return l?(n&&n(s.tr.wrap(o,l).scrollIntoView()),!0):!1}}function hC(t,e=null){return function(s,n){let a=!1;for(let i=0;i<s.selection.ranges.length&&!a;i++){let{$from:{pos:o},$to:{pos:l}}=s.selection.ranges[i];s.doc.nodesBetween(o,l,(c,d)=>{if(a)return!1;if(!(!c.isTextblock||c.hasMarkup(t,e)))if(c.type==t)a=!0;else{let u=s.doc.resolve(d),h=u.index();a=u.parent.canReplaceWith(h,h+1,t)}})}if(!a)return!1;if(n){let i=s.tr;for(let o=0;o<s.selection.ranges.length;o++){let{$from:{pos:l},$to:{pos:c}}=s.selection.ranges[o];i.setBlockType(l,c,t,e)}n(i.scrollIntoView())}return!0}}function c1(...t){return function(e,s,n){for(let a=0;a<t.length;a++)if(t[a](e,s,n))return!0;return!1}}c1(a1,QM,ZM);c1(a1,t5,s5);c1(n5,r5,a5,QW);typeof navigator<"u"?/Mac|iP(hone|[oa]d)/.test(navigator.platform):typeof os<"u"&&os.platform&&os.platform()=="darwin";function nG(t,e=null){return function(s,n){let{$from:a,$to:i}=s.selection,o=a.blockRange(i);if(!o)return!1;let l=n?s.tr:null;return rG(l,o,t,e)?(n&&n(l.scrollIntoView()),!0):!1}}function rG(t,e,s,n=null){let a=!1,i=e,o=e.$from.doc;if(e.depth>=2&&e.$from.node(e.depth-1).type.compatibleContent(s)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let c=o.resolve(e.start-2);i=new Bf(c,c,e.depth),e.endIndex<e.parent.childCount&&(e=new Bf(e.$from,o.resolve(e.$to.end(e.depth)),e.depth)),a=!0}let l=n1(i,s,n,e);return l?(t&&aG(t,e,l,a,s),!0):!1}function aG(t,e,s,n,a){let i=se.empty;for(let u=s.length-1;u>=0;u--)i=se.from(s[u].type.create(s[u].attrs,i));t.step(new ds(e.start-(n?2:0),e.end,e.start,e.end,new me(i,0,0),s.length,!0));let o=0;for(let u=0;u<s.length;u++)s[u].type==a&&(o=u+1);let l=s.length-o,c=e.start+s.length-(n?2:0),d=e.parent;for(let u=e.startIndex,h=e.endIndex,m=!0;u<h;u++,m=!1)!m&&Aa(t.doc,c,l)&&(t.split(c,l),c+=2*l),c+=d.child(u).nodeSize;return t}function iG(t){return function(e,s){let{$from:n,$to:a}=e.selection,i=n.blockRange(a,o=>o.childCount>0&&o.firstChild.type==t);return i?s?n.node(i.depth-1).type==t?oG(e,s,t,i):lG(e,s,i):!0:!1}}function oG(t,e,s,n){let a=t.tr,i=n.end,o=n.$to.end(n.depth);i<o&&(a.step(new ds(i-1,o,i,o,new me(se.from(s.create(null,n.parent.copy())),1,0),1,!0)),n=new Bf(a.doc.resolve(n.$from.pos),a.doc.resolve(o),n.depth));const l=Gc(n);if(l==null)return!1;a.lift(n,l);let c=a.doc.resolve(a.mapping.map(i,-1)-1);return no(a.doc,c.pos)&&c.nodeBefore.type==c.nodeAfter.type&&a.join(c.pos),e(a.scrollIntoView()),!0}function lG(t,e,s){let n=t.tr,a=s.parent;for(let f=s.end,p=s.endIndex-1,g=s.startIndex;p>g;p--)f-=a.child(p).nodeSize,n.delete(f-1,f+1);let i=n.doc.resolve(s.start),o=i.nodeAfter;if(n.mapping.map(s.end)!=s.start+i.nodeAfter.nodeSize)return!1;let l=s.startIndex==0,c=s.endIndex==a.childCount,d=i.node(-1),u=i.index(-1);if(!d.canReplace(u+(l?0:1),u+1,o.content.append(c?se.empty:se.from(a))))return!1;let h=i.pos,m=h+o.nodeSize;return n.step(new ds(h-(l?1:0),m+(c?1:0),h+1,m-1,new me((l?se.empty:se.from(a.copy(se.empty))).append(c?se.empty:se.from(a.copy(se.empty))),l?0:1,c?0:1),l?0:1)),e(n.scrollIntoView()),!0}function cG(t){return function(e,s){let{$from:n,$to:a}=e.selection,i=n.blockRange(a,d=>d.childCount>0&&d.firstChild.type==t);if(!i)return!1;let o=i.startIndex;if(o==0)return!1;let l=i.parent,c=l.child(o-1);if(c.type!=t)return!1;if(s){let d=c.lastChild&&c.lastChild.type==l.type,u=se.from(d?t.create():null),h=new me(se.from(t.create(null,se.from(l.type.create(null,u)))),d?3:1,0),m=i.start,f=i.end;s(e.tr.step(new ds(m-(d?3:1),f,m,f,h,1,!0)).scrollIntoView())}return!0}}const gs=function(t){for(var e=0;;e++)if(t=t.previousSibling,!t)return e},Cc=function(t){let e=t.assignedSlot||t.parentNode;return e&&e.nodeType==11?e.host:e};let _y=null;const ja=function(t,e,s){let n=_y||(_y=document.createRange());return n.setEnd(t,s??t.nodeValue.length),n.setStart(t,e||0),n},dG=function(){_y=null},Xo=function(t,e,s,n){return s&&(mC(t,e,s,n,-1)||mC(t,e,s,n,1))},uG=/^(img|br|input|textarea|hr)$/i;function mC(t,e,s,n,a){for(var i;;){if(t==s&&e==n)return!0;
vendor: 7,569 bytes, line 738
738if(e==(a<0?0:Xn(t))){let o=t.parentNode;if(!o||o.nodeType!=1||dh(t)||uG.test(t.nodeName)||t.contentEditable=="false")return!1;e=gs(t)+(a<0?0:1),t=o}else if(t.nodeType==1){let o=t.childNodes[e+(a<0?-1:0)];if(o.nodeType==1&&o.contentEditable=="false")if(!((i=o.pmViewDesc)===null||i===void 0)&&i.ignoreForSelection)e+=a;else return!1;else t=o,e=a<0?Xn(t):0}else return!1}}function Xn(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function hG(t,e){for(;;){if(t.nodeType==3&&e)return t;if(t.nodeType==1&&e>0){if(t.contentEditable=="false")return null;t=t.childNodes[e-1],e=Xn(t)}else if(t.parentNode&&!dh(t))e=gs(t),t=t.parentNode;else return null}}function mG(t,e){for(;;){if(t.nodeType==3&&e<t.nodeValue.length)return t;if(t.nodeType==1&&e<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[e],e=0}else if(t.parentNode&&!dh(t))e=gs(t)+1,t=t.parentNode;else return null}}function fG(t,e,s){for(let n=e==0,a=e==Xn(t);n||a;){if(t==s)return!0;let i=gs(t);if(t=t.parentNode,!t)return!1;n=n&&i==0,a=a&&i==Xn(t)}}function dh(t){let e;for(let s=t;s&&!(e=s.pmViewDesc);s=s.parentNode);return e&&e.node&&e.node.isBlock&&(e.dom==t||e.contentDOM==t)}const _x=function(t){return t.focusNode&&Xo(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)};function wo(t,e){let s=document.createEvent("Event");return s.initEvent("keydown",!0,!0),s.keyCode=t,s.key=s.code=e,s}function pG(t){let e=t.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function xG(t,e,s){if(t.caretPositionFromPoint)try{let n=t.caretPositionFromPoint(e,s);if(n)return{node:n.offsetNode,offset:Math.min(Xn(n.offsetNode),n.offset)}}catch{}if(t.caretRangeFromPoint){let n=t.caretRangeFromPoint(e,s);if(n)return{node:n.startContainer,offset:Math.min(Xn(n.startContainer),n.startOffset)}}}const la=typeof navigator<"u"?navigator:null,fC=typeof document<"u"?document:null,ro=la&&la.userAgent||"",Ty=/Edge\/(\d+)/.exec(ro),l5=/MSIE \d/.exec(ro),Ey=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ro),yn=!!(l5||Ey||Ty),Ri=l5?document.documentMode:Ey?+Ey[1]:Ty?+Ty[1]:0,sr=!yn&&/gecko\/(\d+)/i.test(ro);sr&&+(/Firefox\/(\d+)/.exec(ro)||[0,0])[1];const My=!yn&&/Chrome\/(\d+)/.exec(ro),ys=!!My,c5=My?+My[1]:0,Os=!yn&&!!la&&/Apple Computer/.test(la.vendor),Sc=Os&&(/Mobile\/\w+/.test(ro)||!!la&&la.maxTouchPoints>2),qn=Sc||(la?/Mac/.test(la.platform):!1),d5=la?/Win/.test(la.platform):!1,Sa=/Android \d/.test(ro),uh=!!fC&&"webkitFontSmoothing"in fC.documentElement.style,gG=uh?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function bG(t){let e=t.defaultView&&t.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:t.documentElement.clientWidth,top:0,bottom:t.documentElement.clientHeight}}function pa(t,e){return typeof t=="number"?t:t[e]}function yG(t){let e=t.getBoundingClientRect(),s=e.width/t.offsetWidth||1,n=e.height/t.offsetHeight||1;return{left:e.left,right:e.left+t.clientWidth*s,top:e.top,bottom:e.top+t.clientHeight*n}}function pC(t,e,s){let n=t.someProp("scrollThreshold")||0,a=t.someProp("scrollMargin")||5,i=t.dom.ownerDocument;for(let o=s||t.dom;o;){if(o.nodeType!=1){o=Cc(o);continue}let l=o,c=l==i.body,d=c?bG(i):yG(l),u=0,h=0;if(e.top<d.top+pa(n,"top")?h=-(d.top-e.top+pa(a,"top")):e.bottom>d.bottom-pa(n,"bottom")&&(h=e.bottom-e.top>d.bottom-d.top?e.top+pa(a,"top")-d.top:e.bottom-d.bottom+pa(a,"bottom")),e.left<d.left+pa(n,"left")?u=-(d.left-e.left+pa(a,"left")):e.right>d.right-pa(n,"right")&&(u=e.right-d.right+pa(a,"right")),u||h)if(c)i.defaultView.scrollBy(u,h);else{let f=l.scrollLeft,p=l.scrollTop;h&&(l.scrollTop+=h),u&&(l.scrollLeft+=u);let g=l.scrollLeft-f,x=l.scrollTop-p;e={left:e.left-g,top:e.top-x,right:e.right-g,bottom:e.bottom-x}}let m=c?"fixed":getComputedStyle(o).position;if(/^(fixed|sticky)$/.test(m))break;o=m=="absolute"?o.offsetParent:Cc(o)}}function vG(t){let e=t.dom.getBoundingClientRect(),s=Math.max(0,e.top),n,a;for(let i=(e.left+e.right)/2,o=s+1;o<Math.min(innerHeight,e.bottom);o+=5){let l=t.root.elementFromPoint(i,o);if(!l||l==t.dom||!t.dom.contains(l))continue;let c=l.getBoundingClientRect();if(c.top>=s-20){n=l,a=c.top;break}}return{refDOM:n,refTop:a,stack:u5(t.dom)}}function u5(t){let e=[],s=t.ownerDocument;for(let n=t;n&&(e.push({dom:n,top:n.scrollTop,left:n.scrollLeft}),t!=s);n=Cc(n));return e}function wG({refDOM:t,refTop:e,stack:s}){let n=t?t.getBoundingClientRect().top:0;h5(s,n==0?0:n-e)}function h5(t,e){for(let s=0;s<t.length;s++){let{dom:n,top:a,left:i}=t[s];n.scrollTop!=a+e&&(n.scrollTop=a+e),n.scrollLeft!=i&&(n.scrollLeft=i)}}let Nl=null;function jG(t){if(t.setActive)return t.setActive();if(Nl)return t.focus(Nl);let e=u5(t);t.focus(Nl==null?{get preventScroll(){return Nl={preventScroll:!0},!0}}:void 0),Nl||(Nl=!1,h5(e,0))}function m5(t,e){let s,n=2e8,a,i=0,o=e.top,l=e.top,c,d;for(let u=t.firstChild,h=0;u;u=u.nextSibling,h++){let m;if(u.nodeType==1)m=u.getClientRects();else if(u.nodeType==3)m=ja(u).getClientRects();else continue;for(let f=0;f<m.length;f++){let p=m[f];if(p.top<=o&&p.bottom>=l){o=Math.max(p.bottom,o),l=Math.min(p.top,l);let g=p.left>e.left?p.left-e.left:p.right<e.left?e.left-p.right:0;if(g<n){s=u,n=g,a=g&&s.nodeType==3?{left:p.right<e.left?p.right:p.left,top:e.top}:e,u.nodeType==1&&g&&(i=h+(e.left>=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!c&&p.left<=e.left&&p.right>=e.left&&(c=u,d={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!s&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(i=h+1)}}return!s&&c&&(s=c,a=d,n=0),s&&s.nodeType==3?NG(s,a):!s||n&&s.nodeType==1?{node:t,offset:i}:m5(s,a)}function NG(t,e){let s=t.nodeValue.length,n=document.createRange(),a;for(let i=0;i<s;i++){n.setEnd(t,i+1),n.setStart(t,i);let o=ni(n,1);if(o.top!=o.bottom&&d1(e,o)){a={node:t,offset:i+(e.left>=(o.left+o.right)/2?1:0)};break}}return n.detach(),a||{node:t,offset:0}}function d1(t,e){return t.left>=e.left-1&&t.left<=e.right+1&&t.top>=e.top-1&&t.top<=e.bottom+1}function kG(t,e){let s=t.parentNode;return s&&/^li$/i.test(s.nodeName)&&e.left<t.getBoundingClientRect().left?s:t}function CG(t,e,s){let{node:n,offset:a}=m5(e,s),i=-1;if(n.nodeType==1&&!n.firstChild){let o=n.getBoundingClientRect();i=o.left!=o.right&&s.left>(o.left+o.right)/2?1:-1}return t.docView.posFromDOM(n,a,i)}function SG(t,e,s,n){let a=-1;for(let i=e,o=!1;i!=t.dom;){let l=t.docView.nearestDesc(i,!0),c;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((c=l.dom.getBoundingClientRect()).width||c.height)&&(l.node.isBlock&&l.parent&&!/^T(R|BODY|HEAD|FOOT)$/.test(l.dom.nodeName)&&(!o&&c.left>n.left||c.top>n.top?a=l.posBefore:(!o&&c.right<n.left||c.bottom<n.top)&&(a=l.posAfter),o=!0),!l.contentDOM&&a<0&&!l.node.isText))return(l.node.isBlock?n.top<(c.top+c.bottom)/2:n.left<(c.left+c.right)/2)?l.posBefore:l.posAfter;i=l.dom.parentNode}return a>-1?a:t.docView.posFromDOM(e,s,-1)}function f5(t,e,s){let n=t.childNodes.length;if(n&&s.top<s.bottom)for(let a=Math.max(0,Math.min(n-1,Math.floor(n*(e.top-s.top)/(s.bottom-s.top))-2)),i=a;;){let o=t.childNodes[i];if(o.nodeType==1){let l=o.getClientRects();for(let c=0;c<l.length;c++){let d=l[c];if(d1(e,d))return f5(o,e,d)}}if((i=(i+1)%n)==a)break}return t}function _G(t,e){let s=t.dom.ownerDocument,n,a=0,i=xG(s,e.left,e.top);i&&({node:n,offset:a}=i);let o=(t.root.elementFromPoint?t.root:s).elementFromPoint(e.left,e.top),l;if(!o||!t.dom.contains(o.nodeType!=1?o.parentNode:o)){let d=t.dom.getBoundingClientRect();if(!d1(e,d)||(o=f5(t.dom,e,d),!o))return null}if(Os)for(let d=o;n&&d;d=Cc(d))d.draggable&&(n=void 0);
vendor: 9,373 bytes, lines 738-739
738if(o=kG(o,e),n){if(sr&&n.nodeType==1&&(a=Math.min(a,n.childNodes.length),a<n.childNodes.length)){let u=n.childNodes[a],h;u.nodeName=="IMG"&&(h=u.getBoundingClientRect()).right<=e.left&&h.bottom>e.top&&a++}let d;uh&&a&&n.nodeType==1&&(d=n.childNodes[a-1]).nodeType==1&&d.contentEditable=="false"&&d.getBoundingClientRect().top>=e.top&&a--,n==t.dom&&a==n.childNodes.length-1&&n.lastChild.nodeType==1&&e.top>n.lastChild.getBoundingClientRect().bottom?l=t.state.doc.content.size:(a==0||n.nodeType!=1||n.childNodes[a-1].nodeName!="BR")&&(l=SG(t,n,a,e))}l==null&&(l=CG(t,o,e));let c=t.docView.nearestDesc(o,!0);return{pos:l,inside:c?c.posAtStart-c.border:-1}}function xC(t){return t.top<t.bottom||t.left<t.right}function ni(t,e){let s=t.getClientRects();if(s.length){let n=s[e<0?0:s.length-1];if(xC(n))return n}return Array.prototype.find.call(s,xC)||t.getBoundingClientRect()}const TG=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;function p5(t,e,s){let{node:n,offset:a,atom:i}=t.docView.domFromPos(e,s<0?-1:1),o=uh||sr;if(n.nodeType==3)if(o&&(TG.test(n.nodeValue)||(s<0?!a:a==n.nodeValue.length))){let c=ni(ja(n,a,a),s);if(sr&&a&&/\s/.test(n.nodeValue[a-1])&&a<n.nodeValue.length){let d=ni(ja(n,a-1,a-1),-1);if(d.top==c.top){let u=ni(ja(n,a,a+1),-1);if(u.top!=c.top)return md(u,u.left<d.left)}}return c}else{let c=a,d=a,u=s<0?1:-1;return s<0&&!a?(d++,u=-1):s>=0&&a==n.nodeValue.length?(c--,u=1):s<0?c--:d++,md(ni(ja(n,c,d),u),u<0)}if(!t.state.doc.resolve(e-(i||0)).parent.inlineContent){if(i==null&&a&&(s<0||a==Xn(n))){let c=n.childNodes[a-1];if(c.nodeType==1)return p0(c.getBoundingClientRect(),!1)}if(i==null&&a<Xn(n)){let c=n.childNodes[a];if(c.nodeType==1)return p0(c.getBoundingClientRect(),!0)}return p0(n.getBoundingClientRect(),s>=0)}if(i==null&&a&&(s<0||a==Xn(n))){let c=n.childNodes[a-1],d=c.nodeType==3?ja(c,Xn(c)-(o?0:1)):c.nodeType==1&&(c.nodeName!="BR"||!c.nextSibling)?c:null;if(d)return md(ni(d,1),!1)}if(i==null&&a<Xn(n)){let c=n.childNodes[a];for(;c.pmViewDesc&&c.pmViewDesc.ignoreForCoords;)c=c.nextSibling;let d=c?c.nodeType==3?ja(c,0,o?0:1):c.nodeType==1?c:null:null;if(d)return md(ni(d,-1),!0)}return md(ni(n.nodeType==3?ja(n):n,-s),s>=0)}function md(t,e){if(t.width==0)return t;let s=e?t.left:t.right;return{top:t.top,bottom:t.bottom,left:s,right:s}}function p0(t,e){if(t.height==0)return t;let s=e?t.top:t.bottom;return{top:s,bottom:s,left:t.left,right:t.right}}function x5(t,e,s){let n=t.state,a=t.root.activeElement;n!=e&&t.updateState(e),a!=t.dom&&t.focus();try{return s()}finally{n!=e&&t.updateState(n),a!=t.dom&&a&&a.focus()}}function EG(t,e,s){let n=e.selection,a=s=="up"?n.$from:n.$to;return x5(t,e,()=>{let{node:i}=t.docView.domFromPos(a.pos,s=="up"?-1:1);for(;;){let l=t.docView.nearestDesc(i,!0);if(!l)break;if(l.node.isBlock){i=l.contentDOM||l.dom;break}i=l.dom.parentNode}let o=p5(t,a.pos,1);for(let l=i.firstChild;l;l=l.nextSibling){let c;if(l.nodeType==1)c=l.getClientRects();else if(l.nodeType==3)c=ja(l,0,l.nodeValue.length).getClientRects();else continue;for(let d=0;d<c.length;d++){let u=c[d];if(u.bottom>u.top+1&&(s=="up"?o.top-u.top>(u.bottom-o.top)*2:u.bottom-o.bottom>(o.bottom-u.top)*2))return!1}}return!0})}const MG=/[\u0590-\u08ac]/;function AG(t,e,s){let{$head:n}=e.selection;if(!n.parent.isTextblock)return!1;let a=n.parentOffset,i=!a,o=a==n.parent.content.size,l=t.domSelection();return l?!MG.test(n.parent.textContent)||!l.modify?s=="left"||s=="backward"?i:o:x5(t,e,()=>{let{focusNode:c,focusOffset:d,anchorNode:u,anchorOffset:h}=t.domSelectionRange(),m=l.caretBidiLevel;l.modify("move",s,"character");let f=n.depth?t.docView.domAfterPos(n.before()):t.dom,{focusNode:p,focusOffset:g}=t.domSelectionRange(),x=p&&!f.contains(p.nodeType==1?p:p.parentNode)||c==p&&d==g;try{l.collapse(u,h),c&&(c!=u||d!=h)&&l.extend&&l.extend(c,d)}catch{}return m!=null&&(l.caretBidiLevel=m),x}):n.pos==n.start()||n.pos==n.end()}let gC=null,bC=null,yC=!1;function PG(t,e,s){return gC==e&&bC==s?yC:(gC=e,bC=s,yC=s=="up"||s=="down"?EG(t,e,s):AG(t,e,s))}const nr=0,vC=1,So=2,ca=3;class hh{constructor(e,s,n,a){this.parent=e,this.children=s,this.dom=n,this.contentDOM=a,this.dirty=nr,n.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,s,n){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let s=0;s<this.children.length;s++)e+=this.children[s].size;return e}get border(){return 0}destroy(){this.parent=void 0,this.dom.pmViewDesc==this&&(this.dom.pmViewDesc=void 0);for(let e=0;e<this.children.length;e++)this.children[e].destroy()}posBeforeChild(e){for(let s=0,n=this.posAtStart;;s++){let a=this.children[s];if(a==e)return n;n+=a.size}}get posBefore(){return this.parent.posBeforeChild(this)}get posAtStart(){return this.parent?this.parent.posBeforeChild(this)+this.border:0}get posAfter(){return this.posBefore+this.size}get posAtEnd(){return this.posAtStart+this.size-2*this.border}localPosFromDOM(e,s,n){if(this.contentDOM&&this.contentDOM.contains(e.nodeType==1?e:e.parentNode))if(n<0){let i,o;if(e==this.contentDOM)i=e.childNodes[s-1];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.previousSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.previousSibling;return i?this.posBeforeChild(o)+o.size:this.posAtStart}else{let i,o;if(e==this.contentDOM)i=e.childNodes[s];else{for(;e.parentNode!=this.contentDOM;)e=e.parentNode;i=e.nextSibling}for(;i&&!((o=i.pmViewDesc)&&o.parent==this);)i=i.nextSibling;return i?this.posBeforeChild(o):this.posAtEnd}let a;if(e==this.dom&&this.contentDOM)a=s>gs(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))a=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(s==0)for(let i=e;;i=i.parentNode){if(i==this.dom){a=!1;break}if(i.previousSibling)break}if(a==null&&s==e.childNodes.length)for(let i=e;;i=i.parentNode){if(i==this.dom){a=!0;break}if(i.nextSibling)break}}return a??n>0?this.posAtEnd:this.posAtStart}nearestDesc(e,s=!1){for(let n=!0,a=e;a;a=a.parentNode){let i=this.getDesc(a),o;if(i&&(!s||i.node))if(n&&(o=i.nodeDOM)&&!(o.nodeType==1?o.contains(e.nodeType==1?e:e.parentNode):o==e))n=!1;else return i}}getDesc(e){let s=e.pmViewDesc;for(let n=s;n;n=n.parent)if(n==this)return s}posFromDOM(e,s,n){for(let a=e;a;a=a.parentNode){let i=this.getDesc(a);if(i)return i.localPosFromDOM(e,s,n)}return-1}descAt(e){for(let s=0,n=0;s<this.children.length;s++){let a=this.children[s],i=n+a.size;if(n==e&&i!=n){for(;!a.border&&a.children.length;)for(let o=0;o<a.children.length;o++){let l=a.children[o];if(l.size){a=l;break}}return a}if(e<i)return a.descAt(e-n-a.border);n=i}}domFromPos(e,s){if(!this.contentDOM)return{node:this.dom,offset:0,atom:e+1};let n=0,a=0;for(let i=0;n<this.children.length;n++){let o=this.children[n],l=i+o.size;if(l>e||o instanceof b5){a=e-i;break}i=l}if(a)return this.children[n].domFromPos(a-this.children[n].border,s);for(let i;n&&!(i=this.children[n-1]).size&&i instanceof g5&&i.side>=0;n--);if(s<=0){let i,o=!0;for(;i=n?this.children[n-1]:null,!(!i||i.dom.parentNode==this.contentDOM);n--,o=!1);return i&&s&&o&&!i.border&&!i.domAtom?i.domFromPos(i.size,s):{node:this.contentDOM,offset:i?gs(i.dom)+1:0}}else{let i,o=!0;for(;i=n<this.children.length?this.children[n]:null,!(!i||i.dom.parentNode==this.contentDOM);n++,o=!1);return i&&o&&!i.border&&!i.domAtom?i.domFromPos(0,s):{node:this.contentDOM,offset:i?gs(i.dom):this.contentDOM.childNodes.length}}}parseRange(e,s,n=0){if(this.children.length==0)return{node:this.contentDOM,from:e,to:s,fromOffset:0,toOffset:this.contentDOM.childNodes.length};let a=-1,i=-1;for(let o=n,l=0;;l++){let c=this.children[l],d=o+c.size;if(a==-1&&e<=d){let u=o+c.border;if(e>=u&&s<=d-c.border&&c.node&&c.contentDOM&&this.contentDOM.contains(c.contentDOM))return c.parseRange(e,s,u);e=o;for(let h=l;h>0;h--){let m=this.children[h-1];if(m.size&&m.dom.parentNode==this.contentDOM&&!m.emptyChildAt(1)){a=gs(m.dom)+1;break}e-=m.size}a==-1&&(a=0)}if(a>-1&&(d>s||l==this.children.length-1)){s=d;for(let u=l+1;u<this.children.length;u++){let h=this.children[u];if(h.size&&h.dom.parentNode==this.contentDOM&&!h.emptyChildAt(-1)){i=gs(h.dom);break}s+=h.size}i==-1&&(i=this.contentDOM.childNodes.length);break}o=d}return{node:this.contentDOM,from:e,to:s,fromOffset:a,toOffset:i}}emptyChildAt(e){if(this.border||!this.contentDOM||!this.children.length)return!1;let s=this.children[e<0?0:this.children.length-1];return s.size==0||s.emptyChildAt(e)}domAfterPos(e){let{node:s,offset:n}=this.domFromPos(e,0);if(s.nodeType!=1||n==s.childNodes.length)throw new RangeError("No node after pos "+e);return s.childNodes[n]}setSelection(e,s,n,a=!1){let i=Math.min(e,s),o=Math.max(e,s);for(let f=0,p=0;f<this.children.length;f++){let g=this.children[f],x=p+g.size;if(i>p&&o<x)return g.setSelection(e-p-g.border,s-p-g.border,n,a);p=x}let l=this.domFromPos(e,e?-1:1),c=s==e?l:this.domFromPos(s,s?-1:1),d=n.root.getSelection(),u=n.domSelectionRange(),h=!1;if((sr||Os)&&e==s){let{node:f,offset:p}=l;if(f.nodeType==3){if(h=!!(p&&f.nodeValue[p-1]==` 739`),h&&p==f.nodeValue.length)for(let g=f,x;g;g=g.parentNode){if(x=g.nextSibling){x.nodeName=="BR"&&(l=c={node:x.parentNode,offset:gs(x)+1});break}let b=g.pmViewDesc;if(b&&b.node&&b.node.isBlock)break}}else{let g=f.childNodes[p-1];h=g&&(g.nodeName=="BR"||g.contentEditable=="false")}}if(sr&&u.focusNode&&u.focusNode!=c.node&&u.focusNode.nodeType==1){let f=u.focu
vendor: 4,255 bytes, line 739
739sNode.childNodes[u.focusOffset];f&&f.contentEditable=="false"&&(a=!0)}if(!(a||h&&Os)&&Xo(l.node,l.offset,u.anchorNode,u.anchorOffset)&&Xo(c.node,c.offset,u.focusNode,u.focusOffset))return;let m=!1;if((d.extend||e==s)&&!(h&&sr)){d.collapse(l.node,l.offset);try{e!=s&&d.extend(c.node,c.offset),m=!0}catch{}}if(!m){if(e>s){let p=l;l=c,c=p}let f=document.createRange();f.setEnd(c.node,c.offset),f.setStart(l.node,l.offset),d.removeAllRanges(),d.addRange(f)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,s){for(let n=0,a=0;a<this.children.length;a++){let i=this.children[a],o=n+i.size;if(n==o?e<=o&&s>=n:e<o&&s>n){let l=n+i.border,c=o-i.border;if(e>=l&&s<=c){this.dirty=e==n||s==o?So:vC,e==l&&s==c&&(i.contentLost||i.dom.parentNode!=this.contentDOM)?i.dirty=ca:i.markDirty(e-l,s-l);return}else i.dirty=i.dom==i.contentDOM&&i.dom.parentNode==this.contentDOM&&!i.children.length?So:ca}n=o}this.dirty=So}markParentsDirty(){let e=1;for(let s=this.parent;s;s=s.parent,e++){let n=e==1?So:vC;s.dirty<n&&(s.dirty=n)}}get domAtom(){return!1}get ignoreForCoords(){return!1}get ignoreForSelection(){return!1}isText(e){return!1}}class g5 extends hh{constructor(e,s,n,a){let i,o=s.type.toDOM;if(typeof o=="function"&&(o=o(n,()=>{if(!i)return a;if(i.parent)return i.parent.posBeforeChild(i)})),!s.type.spec.raw){if(o.nodeType!=1){let l=document.createElement("span");l.appendChild(o),o=l}o.contentEditable="false",o.classList.add("ProseMirror-widget")}super(e,[],o,null),this.widget=s,this.widget=s,i=this}matchesWidget(e){return this.dirty==nr&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let s=this.widget.spec.stopEvent;return s?s(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get ignoreForSelection(){return!!this.widget.type.spec.relaxedSide}get side(){return this.widget.type.side}}class DG extends hh{constructor(e,s,n,a){super(e,[],s,null),this.textDOM=n,this.text=a}get size(){return this.text.length}localPosFromDOM(e,s){return e!=this.textDOM?this.posAtStart+(s?this.size:0):this.posAtStart+s}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}}class Zo extends hh{constructor(e,s,n,a,i){super(e,[],n,a),this.mark=s,this.spec=i}static create(e,s,n,a){let i=a.nodeViews[s.type.name],o=i&&i(s,a,n);return(!o||!o.dom)&&(o=dl.renderSpec(document,s.type.spec.toDOM(s,n),null,s.attrs)),new Zo(e,s,o.dom,o.contentDOM||o.dom,o)}parseRule(){return this.dirty&ca||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=ca&&this.mark.eq(e)}markDirty(e,s){if(super.markDirty(e,s),this.dirty!=nr){let n=this.parent;for(;!n.node;)n=n.parent;n.dirty<this.dirty&&(n.dirty=this.dirty),this.dirty=nr}}slice(e,s,n){let a=Zo.create(this.parent,this.mark,!0,n),i=this.children,o=this.size;s<o&&(i=Py(i,s,o,n)),e>0&&(i=Py(i,0,e,n));for(let l=0;l<i.length;l++)i[l].parent=a;return a.children=i,a}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}}class Li extends hh{constructor(e,s,n,a,i,o,l,c,d){super(e,[],i,o),this.node=s,this.outerDeco=n,this.innerDeco=a,this.nodeDOM=l}static create(e,s,n,a,i,o){let l=i.nodeViews[s.type.name],c,d=l&&l(s,i,()=>{if(!c)return o;if(c.parent)return c.parent.posBeforeChild(c)},n,a),u=d&&d.dom,h=d&&d.contentDOM;if(s.isText){if(!u)u=document.createTextNode(s.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:h}=dl.renderSpec(document,s.type.spec.toDOM(s),null,s.attrs));!h&&!s.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),s.type.spec.draggable&&(u.draggable=!0));let m=u;return u=w5(u,n,s),d?c=new RG(e,s,n,a,u,h||null,m,d,i,o+1):s.isText?new Tx(e,s,n,a,u,m,i):new Li(e,s,n,a,u,h||null,m,i,o+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;
vendor: 6,801 bytes, line 739
739let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let s=this.children.length-1;s>=0;s--){let n=this.children[s];if(this.dom.contains(n.dom.parentNode)){e.contentElement=n.dom.parentNode;break}}e.contentElement||(e.getContent=()=>se.empty)}return e}matchesNode(e,s,n){return this.dirty==nr&&e.eq(this.node)&&Uf(s,this.outerDeco)&&n.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,s){let n=this.node.inlineContent,a=s,i=e.composing?this.localCompositionInfo(e,s):null,o=i&&i.pos>-1?i:null,l=i&&i.pos<0,c=new OG(this,o&&o.node,e);$G(this.node,this.innerDeco,(d,u,h)=>{d.spec.marks?c.syncToMarks(d.spec.marks,n,e,u):d.type.side>=0&&!h&&c.syncToMarks(u==this.node.childCount?rt.none:this.node.child(u).marks,n,e,u),c.placeWidget(d,e,a)},(d,u,h,m)=>{c.syncToMarks(d.marks,n,e,m);let f;c.findNodeMatch(d,u,h,m)||l&&e.state.selection.from>a&&e.state.selection.to<a+d.nodeSize&&(f=c.findIndexWithChild(i.node))>-1&&c.updateNodeAt(d,u,h,f,e)||c.updateNextNode(d,u,h,e,m,a)||c.addNode(d,u,h,e,a),a+=d.nodeSize}),c.syncToMarks([],n,e,0),this.node.isTextblock&&c.addTextblockHacks(),c.destroyRest(),(c.changed||this.dirty==So)&&(o&&this.protectLocalComposition(e,o),y5(this.contentDOM,this.children,e),Sc&&zG(this.dom))}localCompositionInfo(e,s){let{from:n,to:a}=e.state.selection;if(!(e.state.selection instanceof Me)||n<s||a>s+this.node.content.size)return null;let i=e.input.compositionNode;if(!i||!this.dom.contains(i.parentNode))return null;if(this.node.inlineContent){let o=i.nodeValue,l=BG(this.node.content,o,n-s,a-s);return l<0?null:{node:i,pos:l,text:o}}else return{node:i,pos:-1,text:""}}protectLocalComposition(e,{node:s,pos:n,text:a}){if(this.getDesc(s))return;let i=s;for(;i.parentNode!=this.contentDOM;i=i.parentNode){for(;i.previousSibling;)i.parentNode.removeChild(i.previousSibling);for(;i.nextSibling;)i.parentNode.removeChild(i.nextSibling);i.pmViewDesc&&(i.pmViewDesc=void 0)}let o=new DG(this,i,s,a);e.input.compositionNodes.push(o),this.children=Py(this.children,n,n+a.length,e,o)}update(e,s,n,a){return this.dirty==ca||!e.sameMarkup(this.node)?!1:(this.updateInner(e,s,n,a),!0)}updateInner(e,s,n,a){this.updateOuterDeco(s),this.node=e,this.innerDeco=n,this.contentDOM&&this.updateChildren(a,this.posAtStart),this.dirty=nr}updateOuterDeco(e){if(Uf(e,this.outerDeco))return;let s=this.nodeDOM.nodeType!=1,n=this.dom;this.dom=v5(this.dom,this.nodeDOM,Ay(this.outerDeco,this.node,s),Ay(e,this.node,s)),this.dom!=n&&(n.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.nodeDOM.draggable=!0))}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.nodeDOM.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}}function wC(t,e,s,n,a){w5(n,e,t);let i=new Li(void 0,t,e,s,n,n,n,a,0);return i.contentDOM&&i.updateChildren(a,0),i}class Tx extends Li{constructor(e,s,n,a,i,o,l){super(e,s,n,a,i,null,o,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,s,n,a){return this.dirty==ca||this.dirty!=nr&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(s),(this.dirty!=nr||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,a.trackWrites==this.nodeDOM&&(a.trackWrites=null)),this.node=e,this.dirty=nr,!0)}inParent(){let e=this.parent.contentDOM;for(let s=this.nodeDOM;s;s=s.parentNode)if(s==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,s,n){return e==this.nodeDOM?this.posAtStart+Math.min(s,this.node.text.length):super.localPosFromDOM(e,s,n)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,s,n){let a=this.node.cut(e,s),i=document.createTextNode(a.text);return new Tx(this.parent,a,this.outerDeco,this.innerDeco,i,i,n)}markDirty(e,s){super.markDirty(e,s),this.dom!=this.nodeDOM&&(e==0||s==this.nodeDOM.nodeValue.length)&&(this.dirty=ca)}get domAtom(){return!1}isText(e){return this.node.text==e}}class b5 extends hh{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==nr&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}}class RG extends Li{constructor(e,s,n,a,i,o,l,c,d,u){super(e,s,n,a,i,o,l,d,u),this.spec=c}update(e,s,n,a){if(this.dirty==ca)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let i=this.spec.update(e,s,n);return i&&this.updateInner(e,s,n,a),i}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,s,n,a)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,s,n,a){this.spec.setSelection?this.spec.setSelection(e,s,n.root):super.setSelection(e,s,n,a)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}}function y5(t,e,s){let n=t.firstChild,a=!1;for(let i=0;i<e.length;i++){let o=e[i],l=o.dom;if(l.parentNode==t){for(;l!=n;)n=jC(n),a=!0;n=n.nextSibling}else a=!0,t.insertBefore(l,n);if(o instanceof Zo){let c=n?n.previousSibling:t.lastChild;y5(o.contentDOM,o.children,s),n=c?c.nextSibling:t.firstChild}}for(;n;)n=jC(n),a=!0;a&&s.trackWrites==t&&(s.trackWrites=null)}const eu=function(t){t&&(this.nodeName=t)};eu.prototype=Object.create(null);const _o=[new eu];function Ay(t,e,s){if(t.length==0)return _o;let n=s?_o[0]:new eu,a=[n];for(let i=0;i<t.length;i++){let o=t[i].type.attrs;if(o){o.nodeName&&a.push(n=new eu(o.nodeName));for(let l in o){let c=o[l];c!=null&&(s&&a.length==1&&a.push(n=new eu(e.isInline?"span":"div")),l=="class"?n.class=(n.class?n.class+" ":"")+c:l=="style"?n.style=(n.style?n.style+";":"")+c:l!="nodeName"&&(n[l]=c))}}}return a}function v5(t,e,s,n){if(s==_o&&n==_o)return e;let a=e;for(let i=0;i<n.length;i++){let o=n[i],l=s[i];if(i){let c;l&&l.nodeName==o.nodeName&&a!=t&&(c=a.parentNode)&&c.nodeName.toLowerCase()==o.nodeName||(c=document.createElement(o.nodeName),c.pmIsDeco=!0,c.appendChild(a),l=_o[0]),a=c}LG(a,l||_o[0],o)}return a}function LG(t,e,s){for(let n in e)n!="class"&&n!="style"&&n!="nodeName"&&!(n in s)&&t.removeAttribute(n);for(let n in s)n!="class"&&n!="style"&&n!="nodeName"&&s[n]!=e[n]&&t.setAttribute(n,s[n]);
vendor: 6,189 bytes, line 739
739if(e.class!=s.class){let n=e.class?e.class.split(" ").filter(Boolean):[],a=s.class?s.class.split(" ").filter(Boolean):[];for(let i=0;i<n.length;i++)a.indexOf(n[i])==-1&&t.classList.remove(n[i]);for(let i=0;i<a.length;i++)n.indexOf(a[i])==-1&&t.classList.add(a[i]);t.classList.length==0&&t.removeAttribute("class")}if(e.style!=s.style){if(e.style){let n=/\s*([\w\-\xa1-\uffff]+)\s*:(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|\(.*?\)|[^;])*/g,a;for(;a=n.exec(e.style);)t.style.removeProperty(a[1])}s.style&&(t.style.cssText+=s.style)}}function w5(t,e,s){return v5(t,t,_o,Ay(e,s,t.nodeType!=1))}function Uf(t,e){if(t.length!=e.length)return!1;for(let s=0;s<t.length;s++)if(!t[s].type.eq(e[s].type))return!1;return!0}function jC(t){let e=t.nextSibling;return t.parentNode.removeChild(t),e}class OG{constructor(e,s,n){this.lock=s,this.view=n,this.index=0,this.stack=[],this.changed=!1,this.top=e,this.preMatch=IG(e.node.content,e)}destroyBetween(e,s){if(e!=s){for(let n=e;n<s;n++)this.top.children[n].destroy();this.top.children.splice(e,s-e),this.changed=!0}}destroyRest(){this.destroyBetween(this.index,this.top.children.length)}syncToMarks(e,s,n,a){let i=0,o=this.stack.length>>1,l=Math.min(o,e.length);for(;i<l&&(i==o-1?this.top:this.stack[i+1<<1]).matchesMark(e[i])&&e[i].type.spec.spanning!==!1;)i++;for(;i<o;)this.destroyRest(),this.top.dirty=nr,this.index=this.stack.pop(),this.top=this.stack.pop(),o--;for(;o<e.length;){this.stack.push(this.top,this.index+1);let c=-1,d=this.top.children.length;a<this.preMatch.index&&(d=Math.min(this.index+3,d));for(let u=this.index;u<d;u++){let h=this.top.children[u];if(h.matchesMark(e[o])&&!this.isLocked(h.dom)){c=u;break}}if(c>-1)c>this.index&&(this.changed=!0,this.destroyBetween(this.index,c)),this.top=this.top.children[this.index];else{let u=Zo.create(this.top,e[o],s,n);this.top.children.splice(this.index,0,u),this.top=u,this.changed=!0}this.index=0,o++}}findNodeMatch(e,s,n,a){let i=-1,o;if(a>=this.preMatch.index&&(o=this.preMatch.matches[a-this.preMatch.index]).parent==this.top&&o.matchesNode(e,s,n))i=this.top.children.indexOf(o,this.index);else for(let l=this.index,c=Math.min(this.top.children.length,l+5);l<c;l++){let d=this.top.children[l];if(d.matchesNode(e,s,n)&&!this.preMatch.matched.has(d)){i=l;break}}return i<0?!1:(this.destroyBetween(this.index,i),this.index++,!0)}updateNodeAt(e,s,n,a,i){let o=this.top.children[a];return o.dirty==ca&&o.dom==o.contentDOM&&(o.dirty=So),o.update(e,s,n,i)?(this.destroyBetween(this.index,a),this.index++,!0):!1}findIndexWithChild(e){for(;;){let s=e.parentNode;if(!s)return-1;if(s==this.top.contentDOM){let n=e.pmViewDesc;if(n){for(let a=this.index;a<this.top.children.length;a++)if(this.top.children[a]==n)return a}return-1}e=s}}updateNextNode(e,s,n,a,i,o){for(let l=this.index;l<this.top.children.length;l++){let c=this.top.children[l];if(c instanceof Li){let d=this.preMatch.matched.get(c);if(d!=null&&d!=i)return!1;let u=c.dom,h,m=this.isLocked(u)&&!(e.isText&&c.node&&c.node.isText&&c.nodeDOM.nodeValue==e.text&&c.dirty!=ca&&Uf(s,c.outerDeco));if(!m&&c.update(e,s,n,a))return this.destroyBetween(this.index,l),c.dom!=u&&(this.changed=!0),this.index++,!0;if(!m&&(h=this.recreateWrapper(c,e,s,n,a,o)))return this.destroyBetween(this.index,l),this.top.children[this.index]=h,h.contentDOM&&(h.dirty=So,h.updateChildren(a,o+1),h.dirty=nr),this.changed=!0,this.index++,!0;break}}return!1}recreateWrapper(e,s,n,a,i,o){if(e.dirty||s.isAtom||!e.children.length||!e.node.content.eq(s.content)||!Uf(n,e.outerDeco)||!a.eq(e.innerDeco))return null;let l=Li.create(this.top,s,n,a,i,o);if(l.contentDOM){l.children=e.children,e.children=[];for(let c of l.children)c.parent=l}return e.destroy(),l}addNode(e,s,n,a,i){let o=Li.create(this.top,e,s,n,a,i);o.contentDOM&&o.updateChildren(a,i+1),this.top.children.splice(this.index++,0,o),this.changed=!0}placeWidget(e,s,n){let a=this.index<this.top.children.length?this.top.children[this.index]:null;if(a&&a.matchesWidget(e)&&(e==a.widget||!a.widget.type.toDOM.parentNode))this.index++;else{let i=new g5(this.top,e,s,n);this.top.children.splice(this.index++,0,i),this.changed=!0}}addTextblockHacks(){let e=this.top.children[this.index-1],s=this.top;for(;e instanceof Zo;)s=e,e=s.children[s.children.length-1];(!e||!(e instanceof Tx)||/\n$/.test(e.node.text)||this.view.requiresGeckoHackNode&&/\s$/.test(e.node.text))&&((Os||ys)&&e&&e.dom.contentEditable=="false"&&this.addHackNode("IMG",s),this.addHackNode("BR",this.top))}addHackNode(e,s){if(s==this.top&&this.index<s.children.length&&s.children[this.index].matchesHack(e))this.index++;else{let n=document.createElement(e);e=="IMG"&&(n.className="ProseMirror-separator",n.alt=""),e=="BR"&&(n.className="ProseMirror-trailingBreak");let a=new b5(this.top,[],n,null);s!=this.top?s.children.push(a):s.children.splice(this.index++,0,a),this.changed=!0}}isLocked(e){return this.lock&&(e==this.lock||e.nodeType==1&&e.contains(this.lock.parentNode))}}function IG(t,e){let s=e,n=s.children.length,a=t.childCount,i=new Map,o=[];e:for(;a>0;){let l;for(;;)if(n){let d=s.children[n-1];if(d instanceof Zo)s=d,n=d.children.length;else{l=d,n--;break}}else{if(s==e)break e;n=s.parent.children.indexOf(s),s=s.parent}let c=l.node;if(c){if(c!=t.child(a-1))break;--a,i.set(l,a),o.push(l)}}return{index:a,matched:i,matches:o.reverse()}}function FG(t,e){return t.type.side-e.type.side}function $G(t,e,s,n){let a=e.locals(t),i=0;if(a.length==0){for(let d=0;d<t.childCount;d++){let u=t.child(d);n(u,a,e.forChild(i,u),d),i+=u.nodeSize}return}let o=0,l=[],c=null;for(let d=0;;){let u,h;for(;o<a.length&&a[o].to==i;){let x=a[o++];x.widget&&(u?(h||(h=[u])).push(x):u=x)}if(u)if(h){h.sort(FG);for(let x=0;x<h.length;x++)s(h[x],d,!!c)}else s(u,d,!!c);let m,f;if(c)f=-1,m=c,c=null;else if(d<t.childCount)f=d,m=t.child(d++);else break;for(let x=0;x<l.length;x++)l[x].to<=i&&l.splice(x--,1);for(;o<a.length&&a[o].from<=i&&a[o].to>i;)l.push(a[o++]);let p=i+m.nodeSize;if(m.isText){let x=p;o<a.length&&a[o].from<x&&(x=a[o].from);for(let b=0;b<l.length;b++)l[b].to<x&&(x=l[b].to);x<p&&(c=m.cut(x-i),m=m.cut(0,x-i),p=x,f=-1)}else for(;o<a.length&&a[o].to<p;)o++;let g=m.isInline&&!m.isLeaf?l.filter(x=>!x.inline):l.slice();n(m,g,e.forChild(i,m),f),i=p}}
vendor: 3,540 bytes, line 739
739function zG(t){if(t.nodeName=="UL"||t.nodeName=="OL"){let e=t.style.cssText;t.style.cssText=e+"; list-style: square !important",window.getComputedStyle(t).listStyle,t.style.cssText=e}}function BG(t,e,s,n){for(let a=0,i=0;a<t.childCount&&i<=n;){let o=t.child(a++),l=i;if(i+=o.nodeSize,!o.isText)continue;let c=o.text;for(;a<t.childCount;){let d=t.child(a++);if(i+=d.nodeSize,!d.isText)break;c+=d.text}if(i>=s){if(i>=n&&c.slice(n-e.length-l,n-l)==e)return n-e.length;let d=l<n?c.lastIndexOf(e,n-l-1):-1;if(d>=0&&d+e.length+l>=s)return l+d;if(s==n&&c.length>=n+e.length-l&&c.slice(n-l,n-l+e.length)==e)return n}}return-1}function Py(t,e,s,n,a){let i=[];for(let o=0,l=0;o<t.length;o++){let c=t[o],d=l,u=l+=c.size;d>=s||u<=e?i.push(c):(d<e&&i.push(c.slice(0,e-d,n)),a&&(i.push(a),a=void 0),u>s&&i.push(c.slice(s-d,c.size,n)))}return i}function u1(t,e=null){let s=t.domSelectionRange(),n=t.state.doc;if(!s.focusNode)return null;let a=t.docView.nearestDesc(s.focusNode),i=a&&a.size==0,o=t.docView.posFromDOM(s.focusNode,s.focusOffset,1);if(o<0)return null;let l=n.resolve(o),c,d;if(_x(s)){for(c=o;a&&!a.node;)a=a.parent;let h=a.node;if(a&&h.isAtom&&Ce.isSelectable(h)&&a.parent&&!(h.isInline&&fG(s.focusNode,s.focusOffset,a.dom))){let m=a.posBefore;d=new Ce(o==m?l:n.resolve(m))}}else{if(s instanceof t.dom.ownerDocument.defaultView.Selection&&s.rangeCount>1){let h=o,m=o;for(let f=0;f<s.rangeCount;f++){let p=s.getRangeAt(f);h=Math.min(h,t.docView.posFromDOM(p.startContainer,p.startOffset,1)),m=Math.max(m,t.docView.posFromDOM(p.endContainer,p.endOffset,-1))}if(h<0)return null;[c,o]=m==t.state.selection.anchor?[m,h]:[h,m],l=n.resolve(o)}else c=t.docView.posFromDOM(s.anchorNode,s.anchorOffset,1);if(c<0)return null}let u=n.resolve(c);if(!d){let h=e=="pointer"||t.state.selection.head<l.pos&&!i?1:-1;d=h1(t,u,l,h)}return d}function j5(t){return t.editable?t.hasFocus():k5(t)&&document.activeElement&&document.activeElement.contains(t.dom)}function Pa(t,e=!1){let s=t.state.selection;if(N5(t,s),!!j5(t)){if(!e&&t.input.mouseDown&&t.input.mouseDown.allowDefault&&ys){let n=t.domSelectionRange(),a=t.domObserver.currentSelection;if(n.anchorNode&&a.anchorNode&&Xo(n.anchorNode,n.anchorOffset,a.anchorNode,a.anchorOffset)){t.input.mouseDown.delayedSelectionSync=!0,t.domObserver.setCurSelection();return}}if(t.domObserver.disconnectSelection(),t.cursorWrapper)UG(t);else{let{anchor:n,head:a}=s,i,o;NC&&!(s instanceof Me)&&(s.$from.parent.inlineContent||(i=kC(t,s.from)),!s.empty&&!s.$from.parent.inlineContent&&(o=kC(t,s.to))),t.docView.setSelection(n,a,t,e),NC&&(i&&CC(i),o&&CC(o)),s.visible?t.dom.classList.remove("ProseMirror-hideselection"):(t.dom.classList.add("ProseMirror-hideselection"),"onselectionchange"in document&&VG(t))}t.domObserver.setCurSelection(),t.domObserver.connectSelection()}}const NC=Os||ys&&c5<63;function kC(t,e){let{node:s,offset:n}=t.docView.domFromPos(e,0),a=n<s.childNodes.length?s.childNodes[n]:null,i=n?s.childNodes[n-1]:null;if(Os&&a&&a.contentEditable=="false")return x0(a);if((!a||a.contentEditable=="false")&&(!i||i.contentEditable=="false")){if(a)return x0(a);if(i)return x0(i)}}function x0(t){return t.contentEditable="true",Os&&t.draggable&&(t.draggable=!1,t.wasDraggable=!0),t}function CC(t){t.contentEditable="false",t.wasDraggable&&(t.draggable=!0,t.wasDraggable=null)}function VG(t){let e=t.dom.ownerDocument;e.removeEventListener("selectionchange",t.input.hideSelectionGuard);let s=t.domSelectionRange(),n=s.anchorNode,a=s.anchorOffset;e.addEventListener("selectionchange",t.input.hideSelectionGuard=()=>
vendor: 8,194 bytes, lines 739-742
739{(s.anchorNode!=n||s.anchorOffset!=a)&&(e.removeEventListener("selectionchange",t.input.hideSelectionGuard),setTimeout(()=>{(!j5(t)||t.state.selection.visible)&&t.dom.classList.remove("ProseMirror-hideselection")},20))})}function UG(t){let e=t.domSelection();if(!e)return;let s=t.cursorWrapper.dom,n=s.nodeName=="IMG";n?e.collapse(s.parentNode,gs(s)+1):e.collapse(s,0),!n&&!t.state.selection.visible&&yn&&Ri<=11&&(s.disabled=!0,s.disabled=!1)}function N5(t,e){if(e instanceof Ce){let s=t.docView.descAt(e.from);s!=t.lastSelectedViewDesc&&(SC(t),s&&s.selectNode(),t.lastSelectedViewDesc=s)}else SC(t)}function SC(t){t.lastSelectedViewDesc&&(t.lastSelectedViewDesc.parent&&t.lastSelectedViewDesc.deselectNode(),t.lastSelectedViewDesc=void 0)}function h1(t,e,s,n){return t.someProp("createSelectionBetween",a=>a(t,e,s))||Me.between(e,s,n)}function _C(t){return t.editable&&!t.hasFocus()?!1:k5(t)}function k5(t){let e=t.domSelectionRange();if(!e.anchorNode)return!1;try{return t.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(t.editable||t.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function HG(t){let e=t.docView.domFromPos(t.state.selection.anchor,0),s=t.domSelectionRange();return Xo(e.node,e.offset,s.anchorNode,s.anchorOffset)}function Dy(t,e){let{$anchor:s,$head:n}=t.selection,a=e>0?s.max(n):s.min(n),i=a.parent.inlineContent?a.depth?t.doc.resolve(e>0?a.after():a.before()):null:a;return i&&Fe.findFrom(i,e)}function ii(t,e){return t.dispatch(t.state.tr.setSelection(e).scrollIntoView()),!0}function TC(t,e,s){let n=t.state.selection;if(n instanceof Me)if(s.indexOf("s")>-1){let{$head:a}=n,i=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter;if(!i||i.isText||!i.isLeaf)return!1;let o=t.state.doc.resolve(a.pos+i.nodeSize*(e<0?-1:1));return ii(t,new Me(n.$anchor,o))}else if(n.empty){if(t.endOfTextblock(e>0?"forward":"backward")){let a=Dy(t.state,e);return a&&a instanceof Ce?ii(t,a):!1}else if(!(qn&&s.indexOf("m")>-1)){let a=n.$head,i=a.textOffset?null:e<0?a.nodeBefore:a.nodeAfter,o;if(!i||i.isText)return!1;let l=e<0?a.pos-i.nodeSize:a.pos;return i.isAtom||(o=t.docView.descAt(l))&&!o.contentDOM?Ce.isSelectable(i)?ii(t,new Ce(e<0?t.state.doc.resolve(a.pos-i.nodeSize):a)):uh?ii(t,new Me(t.state.doc.resolve(e<0?l:l+i.nodeSize))):!1:!1}}else return!1;else{if(n instanceof Ce&&n.node.isInline)return ii(t,new Me(e>0?n.$to:n.$from));{let a=Dy(t.state,e);return a?ii(t,a):!1}}}function Hf(t){return t.nodeType==3?t.nodeValue.length:t.childNodes.length}function tu(t,e){let s=t.pmViewDesc;return s&&s.size==0&&(e<0||t.nextSibling||t.nodeName!="BR")}function kl(t,e){return e<0?WG(t):GG(t)}function WG(t){let e=t.domSelectionRange(),s=e.focusNode,n=e.focusOffset;if(!s)return;let a,i,o=!1;for(sr&&s.nodeType==1&&n<Hf(s)&&tu(s.childNodes[n],-1)&&(o=!0);;)if(n>0){if(s.nodeType!=1)break;{let l=s.childNodes[n-1];if(tu(l,-1))a=s,i=--n;else if(l.nodeType==3)s=l,n=s.nodeValue.length;else break}}else{if(C5(s))break;{let l=s.previousSibling;for(;l&&tu(l,-1);)a=s.parentNode,i=gs(l),l=l.previousSibling;if(l)s=l,n=Hf(s);else{if(s=s.parentNode,s==t.dom)break;n=0}}}o?Ry(t,s,n):a&&Ry(t,a,i)}function GG(t){let e=t.domSelectionRange(),s=e.focusNode,n=e.focusOffset;if(!s)return;let a=Hf(s),i,o;for(;;)if(n<a){if(s.nodeType!=1)break;let l=s.childNodes[n];if(tu(l,1))i=s,o=++n;else break}else{if(C5(s))break;{let l=s.nextSibling;for(;l&&tu(l,1);)i=l.parentNode,o=gs(l)+1,l=l.nextSibling;if(l)s=l,n=0,a=Hf(s);else{if(s=s.parentNode,s==t.dom)break;n=a=0}}}i&&Ry(t,i,o)}function C5(t){let e=t.pmViewDesc;return e&&e.node&&e.node.isBlock}function YG(t,e){for(;t&&e==t.childNodes.length&&!dh(t);)e=gs(t)+1,t=t.parentNode;for(;t&&e<t.childNodes.length;){let s=t.childNodes[e];if(s.nodeType==3)return s;if(s.nodeType==1&&s.contentEditable=="false")break;t=s,e=0}}function qG(t,e){for(;t&&!e&&!dh(t);)e=gs(t),t=t.parentNode;for(;t&&e;){let s=t.childNodes[e-1];if(s.nodeType==3)return s;if(s.nodeType==1&&s.contentEditable=="false")break;t=s,e=t.childNodes.length}}function Ry(t,e,s){if(e.nodeType!=3){let i,o;(o=YG(e,s))?(e=o,s=0):(i=qG(e,s))&&(e=i,s=i.nodeValue.length)}let n=t.domSelection();if(!n)return;if(_x(n)){let i=document.createRange();i.setEnd(e,s),i.setStart(e,s),n.removeAllRanges(),n.addRange(i)}else n.extend&&n.extend(e,s);t.domObserver.setCurSelection();let{state:a}=t;setTimeout(()=>{t.state==a&&Pa(t)},50)}function EC(t,e){let s=t.state.doc.resolve(e);if(!(ys||d5)&&s.parent.inlineContent){let a=t.coordsAtPos(e);if(e>s.start()){let i=t.coordsAtPos(e-1),o=(i.top+i.bottom)/2;if(o>a.top&&o<a.bottom&&Math.abs(i.left-a.left)>1)return i.left<a.left?"ltr":"rtl"}if(e<s.end()){let i=t.coordsAtPos(e+1),o=(i.top+i.bottom)/2;if(o>a.top&&o<a.bottom&&Math.abs(i.left-a.left)>1)return i.left>a.left?"ltr":"rtl"}}return getComputedStyle(t.dom).direction=="rtl"?"rtl":"ltr"}function MC(t,e,s){let n=t.state.selection;if(n instanceof Me&&!n.empty||s.indexOf("s")>-1||qn&&s.indexOf("m")>-1)return!1;let{$from:a,$to:i}=n;if(!a.parent.inlineContent||t.endOfTextblock(e<0?"up":"down")){let o=Dy(t.state,e);if(o&&o instanceof Ce)return ii(t,o)}if(!a.parent.inlineContent){let o=e<0?a:i,l=n instanceof Pn?Fe.near(o,e):Fe.findFrom(o,e);return l?ii(t,l):!1}return!1}function AC(t,e){if(!(t.state.selection instanceof Me))return!0;let{$head:s,$anchor:n,empty:a}=t.state.selection;if(!s.sameParent(n))return!0;if(!a)return!1;if(t.endOfTextblock(e>0?"forward":"backward"))return!0;let i=!s.textOffset&&(e<0?s.nodeBefore:s.nodeAfter);if(i&&!i.isText){let o=t.state.tr;return e<0?o.delete(s.pos-i.nodeSize,s.pos):o.delete(s.pos,s.pos+i.nodeSize),t.dispatch(o),!0}return!1}function PC(t,e,s){t.domObserver.stop(),e.contentEditable=s,t.domObserver.start()}function KG(t){if(!Os||t.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:s}=t.domSelectionRange();if(e&&e.nodeType==1&&s==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let n=e.firstChild;PC(t,n,"true"),setTimeout(()=>PC(t,n,"false"),20)}return!1}function JG(t){let e="";return t.ctrlKey&&(e+="c"),t.metaKey&&(e+="m"),t.altKey&&(e+="a"),t.shiftKey&&(e+="s"),e}function QG(t,e){let s=e.keyCode,n=JG(e);if(s==8||qn&&s==72&&n=="c")return AC(t,-1)||kl(t,-1);if(s==46&&!e.shiftKey||qn&&s==68&&n=="c")return AC(t,1)||kl(t,1);if(s==13||s==27)return!0;if(s==37||qn&&s==66&&n=="c"){let a=s==37?EC(t,t.state.selection.from)=="ltr"?-1:1:-1;return TC(t,a,n)||kl(t,a)}else if(s==39||qn&&s==70&&n=="c"){let a=s==39?EC(t,t.state.selection.from)=="ltr"?1:-1:1;return TC(t,a,n)||kl(t,a)}else{if(s==38||qn&&s==80&&n=="c")return MC(t,-1,n)||kl(t,-1);if(s==40||qn&&s==78&&n=="c")return KG(t)||MC(t,1,n)||kl(t,1);if(n==(qn?"m":"c")&&(s==66||s==73||s==89||s==90))return!0}return!1}function m1(t,e){t.someProp("transformCopied",f=>{e=f(e,t)});let s=[],{content:n,openStart:a,openEnd:i}=e;for(;a>1&&i>1&&n.childCount==1&&n.firstChild.childCount==1;){a--,i--;let f=n.firstChild;s.push(f.type.name,f.attrs!=f.type.defaultAttrs?f.attrs:null),n=f.content}let o=t.someProp("clipboardSerializer")||dl.fromSchema(t.state.schema),l=A5(),c=l.createElement("div");c.appendChild(o.serializeFragment(n,{document:l}));let d=c.firstChild,u,h=0;for(;d&&d.nodeType==1&&(u=M5[d.nodeName.toLowerCase()]);){for(let f=u.length-1;f>=0;f--){let p=l.createElement(u[f]);for(;c.firstChild;)p.appendChild(c.firstChild);c.appendChild(p),h++}d=c.firstChild}d&&d.nodeType==1&&d.setAttribute("data-pm-slice",`${a} ${i}${h?` -${h}`:""} ${JSON.stringify(s)}`);let m=t.someProp("clipboardTextSerializer",f=>f(e,t))||e.content.textBetween(0,e.content.size,` 740 741`);return{dom:c,text:m,slice:e}}function S5(t,e,s,n,a){let i=a.parent.type.spec.code,o,l;if(!s&&!e)return null;let c=!!e&&(n||i||!s);if(c){if(t.someProp("transformPastedText",m=>{e=m(e,i||n,t)}),i)return l=new me(se.from(t.state.schema.text(e.replace(/\r\n?/g,` 742`))),0,0),t.someProp("transformPasted",m=>{l=m(l,t,!0)}),l;let h=t.someProp("clipboardTextParser",m=>m(e,a,n,t));if(h)l=h;else{let m=a.marks(),{schema:f}=t.state,p=dl.fromSchema(f);o=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(g=>{let x=o.appendChild(document.createElement("p"));g&&x.appendChild(p.serializeNode(f.text(g,m)))})}}else t.someProp("transformPastedHTML",h=>
vendor: 8,734 bytes, line 742
742{s=h(s,t)}),o=tY(s),uh&&sY(o);let d=o&&o.querySelector("[data-pm-slice]"),u=d&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(d.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let h=+u[3];h>0;h--){let m=o.firstChild;for(;m&&m.nodeType!=1;)m=m.nextSibling;if(!m)break;o=m}if(l||(l=(t.someProp("clipboardParser")||t.someProp("domParser")||Di.fromSchema(t.state.schema)).parseSlice(o,{preserveWhitespace:!!(c||u),context:a,ruleFromNode(m){return m.nodeName=="BR"&&!m.nextSibling&&m.parentNode&&!XG.test(m.parentNode.nodeName)?{ignore:!0}:null}})),u)l=nY(DC(l,+u[1],+u[2]),u[4]);else if(l=me.maxOpen(ZG(l.content,a),!0),l.openStart||l.openEnd){let h=0,m=0;for(let f=l.content.firstChild;h<l.openStart&&!f.type.spec.isolating;h++,f=f.firstChild);for(let f=l.content.lastChild;m<l.openEnd&&!f.type.spec.isolating;m++,f=f.lastChild);l=DC(l,h,m)}return t.someProp("transformPasted",h=>{l=h(l,t,c)}),l}const XG=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function ZG(t,e){if(t.childCount<2)return t;for(let s=e.depth;s>=0;s--){let a=e.node(s).contentMatchAt(e.index(s)),i,o=[];if(t.forEach(l=>{if(!o)return;let c=a.findWrapping(l.type),d;if(!c)return o=null;if(d=o.length&&i.length&&T5(c,i,l,o[o.length-1],0))o[o.length-1]=d;else{o.length&&(o[o.length-1]=E5(o[o.length-1],i.length));let u=_5(l,c);o.push(u),a=a.matchType(u.type),i=c}}),o)return se.from(o)}return t}function _5(t,e,s=0){for(let n=e.length-1;n>=s;n--)t=e[n].create(null,se.from(t));return t}function T5(t,e,s,n,a){if(a<t.length&&a<e.length&&t[a]==e[a]){let i=T5(t,e,s,n.lastChild,a+1);if(i)return n.copy(n.content.replaceChild(n.childCount-1,i));if(n.contentMatchAt(n.childCount).matchType(a==t.length-1?s.type:t[a+1]))return n.copy(n.content.append(se.from(_5(s,t,a+1))))}}function E5(t,e){if(e==0)return t;let s=t.content.replaceChild(t.childCount-1,E5(t.lastChild,e-1)),n=t.contentMatchAt(t.childCount).fillBefore(se.empty,!0);return t.copy(s.append(n))}function Ly(t,e,s,n,a,i){let o=e<0?t.firstChild:t.lastChild,l=o.content;return t.childCount>1&&(i=0),a<n-1&&(l=Ly(l,e,s,n,a+1,i)),a>=s&&(l=e<0?o.contentMatchAt(0).fillBefore(l,i<=a).append(l):l.append(o.contentMatchAt(o.childCount).fillBefore(se.empty,!0))),t.replaceChild(e<0?0:t.childCount-1,o.copy(l))}function DC(t,e,s){return e<t.openStart&&(t=new me(Ly(t.content,-1,e,t.openStart,0,t.openEnd),e,t.openEnd)),s<t.openEnd&&(t=new me(Ly(t.content,1,s,t.openEnd,0,0),t.openStart,s)),t}const M5={thead:["table"],tbody:["table"],tfoot:["table"],caption:["table"],colgroup:["table"],col:["table","colgroup"],tr:["table","tbody"],td:["table","tbody","tr"],th:["table","tbody","tr"]};let RC=null;function A5(){return RC||(RC=document.implementation.createHTMLDocument("title"))}let g0=null;function eY(t){let e=window.trustedTypes;return e?(g0||(g0=e.defaultPolicy||e.createPolicy("ProseMirrorClipboard",{createHTML:s=>s})),g0.createHTML(t)):t}function tY(t){let e=/^(\s*<meta [^>]*>)*/.exec(t);e&&(t=t.slice(e[0].length));let s=A5().createElement("div"),n=/<([a-z][^>\s]+)/i.exec(t),a;if((a=n&&M5[n[1].toLowerCase()])&&(t=a.map(i=>"<"+i+">").join("")+t+a.map(i=>"</"+i+">").reverse().join("")),s.innerHTML=eY(t),a)for(let i=0;i<a.length;i++)s=s.querySelector(a[i])||s;return s}function sY(t){let e=t.querySelectorAll(ys?"span:not([class]):not([style])":"span.Apple-converted-space");for(let s=0;s<e.length;s++){let n=e[s];n.childNodes.length==1&&n.textContent=="Â "&&n.parentNode&&n.parentNode.replaceChild(t.ownerDocument.createTextNode(" "),n)}}function nY(t,e){if(!t.size)return t;let s=t.content.firstChild.type.schema,n;try{n=JSON.parse(e)}catch{return t}let{content:a,openStart:i,openEnd:o}=t;for(let l=n.length-2;l>=0;l-=2){let c=s.nodes[n[l]];if(!c||c.hasRequiredAttrs())break;a=se.from(c.create(n[l+1],a)),i++,o++}return new me(a,i,o)}const Js={},Qs={},rY={touchstart:!0,touchmove:!0};class aY{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.badSafariComposition=!1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}}function iY(t){for(let e in Js){let s=Js[e];t.dom.addEventListener(e,t.input.eventHandlers[e]=n=>{lY(t,n)&&!f1(t,n)&&(t.editable||!(n.type in Qs))&&s(t,n)},rY[e]?{passive:!0}:void 0)}Os&&t.dom.addEventListener("input",()=>null),Oy(t)}function vi(t,e){t.input.lastSelectionOrigin=e,t.input.lastSelectionTime=Date.now()}function oY(t){t.domObserver.stop();for(let e in t.input.eventHandlers)t.dom.removeEventListener(e,t.input.eventHandlers[e]);clearTimeout(t.input.composingTimeout),clearTimeout(t.input.lastIOSEnterFallbackTimeout)}function Oy(t){t.someProp("handleDOMEvents",e=>{for(let s in e)t.input.eventHandlers[s]||t.dom.addEventListener(s,t.input.eventHandlers[s]=n=>f1(t,n))})}function f1(t,e){return t.someProp("handleDOMEvents",s=>{let n=s[e.type];return n?n(t,e)||e.defaultPrevented:!1})}function lY(t,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let s=e.target;s!=t.dom;s=s.parentNode)if(!s||s.nodeType==11||s.pmViewDesc&&s.pmViewDesc.stopEvent(e))return!1;return!0}function cY(t,e){!f1(t,e)&&Js[e.type]&&(t.editable||!(e.type in Qs))&&Js[e.type](t,e)}Qs.keydown=(t,e)=>{let s=e;if(t.input.shiftKey=s.keyCode==16||s.shiftKey,!D5(t,s)&&(t.input.lastKeyCode=s.keyCode,t.input.lastKeyCodeTime=Date.now(),!(Sa&&ys&&s.keyCode==13)))if(s.keyCode!=229&&t.domObserver.forceFlush(),Sc&&s.keyCode==13&&!s.ctrlKey&&!s.altKey&&!s.metaKey){let n=Date.now();t.input.lastIOSEnter=n,t.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{t.input.lastIOSEnter==n&&(t.someProp("handleKeyDown",a=>a(t,wo(13,"Enter"))),t.input.lastIOSEnter=0)},200)}else t.someProp("handleKeyDown",n=>n(t,s))||QG(t,s)?s.preventDefault():vi(t,"key")};Qs.keyup=(t,e)=>{e.keyCode==16&&(t.input.shiftKey=!1)};Qs.keypress=(t,e)=>{let s=e;if(D5(t,s)||!s.charCode||s.ctrlKey&&!s.altKey||qn&&s.metaKey)return;if(t.someProp("handleKeyPress",a=>a(t,s))){s.preventDefault();return}let n=t.state.selection;if(!(n instanceof Me)||!n.$from.sameParent(n.$to)){let a=String.fromCharCode(s.charCode),i=()=>t.state.tr.insertText(a).scrollIntoView();!/[\r\n]/.test(a)&&!t.someProp("handleTextInput",o=>o(t,n.$from.pos,n.$to.pos,a,i))&&t.dispatch(i()),s.preventDefault()}};function Ex(t){return{left:t.clientX,top:t.clientY}}function dY(t,e){let s=e.x-t.clientX,n=e.y-t.clientY;return s*s+n*n<100}function p1(t,e,s,n,a){if(n==-1)return!1;let i=t.state.doc.resolve(n);for(let o=i.depth+1;o>0;o--)if(t.someProp(e,l=>o>i.depth?l(t,s,i.nodeAfter,i.before(o),a,!0):l(t,s,i.node(o),i.before(o),a,!1)))return!0;return!1}function cc(t,e,s){if(t.focused||t.focus(),t.state.selection.eq(e))return;let n=t.state.tr.setSelection(e);n.setMeta("pointer",!0),t.dispatch(n)}function uY(t,e){if(e==-1)return!1;let s=t.state.doc.resolve(e),n=s.nodeAfter;return n&&n.isAtom&&Ce.isSelectable(n)?(cc(t,new Ce(s)),!0):!1}function hY(t,e){if(e==-1)return!1;let s=t.state.selection,n,a;s instanceof Ce&&(n=s.node);let i=t.state.doc.resolve(e);for(let o=i.depth+1;o>0;o--){let l=o>i.depth?i.nodeAfter:i.node(o);if(Ce.isSelectable(l)){n&&s.$from.depth>0&&o>=s.$from.depth&&i.before(s.$from.depth+1)==s.$from.pos?a=i.before(s.$from.depth):a=i.before(o);break}}return a!=null?(cc(t,Ce.create(t.state.doc,a)),!0):!1}function mY(t,e,s,n,a){return p1(t,"handleClickOn",e,s,n)||t.someProp("handleClick",i=>i(t,e,n))||(a?hY(t,s):uY(t,s))}function fY(t,e,s,n){return p1(t,"handleDoubleClickOn",e,s,n)||t.someProp("handleDoubleClick",a=>a(t,e,n))}function pY(t,e,s,n){return p1(t,"handleTripleClickOn",e,s,n)||t.someProp("handleTripleClick",a=>a(t,e,n))||xY(t,s,n)}function xY(t,e,s){if(s.button!=0)return!1;let n=t.state.doc;if(e==-1)return n.inlineContent?(cc(t,Me.create(n,0,n.content.size)),!0):!1;let a=n.resolve(e);for(let i=a.depth+1;i>0;i--){let o=i>a.depth?a.nodeAfter:a.node(i),l=a.before(i);if(o.inlineContent)cc(t,Me.create(n,l+1,l+1+o.content.size));else if(Ce.isSelectable(o))cc(t,Ce.create(n,l));else continue;return!0}}function x1(t){return Wf(t)}const P5=qn?"metaKey":"ctrlKey";Js.mousedown=(t,e)=>{let s=e;t.input.shiftKey=s.shiftKey;let n=x1(t),a=Date.now(),i="singleClick";a-t.input.lastClick.time<500&&dY(s,t.input.lastClick)&&!s[P5]&&t.input.lastClick.button==s.button&&(t.input.lastClick.type=="singleClick"?i="doubleClick":t.input.lastClick.type=="doubleClick"&&(i="tripleClick")),t.input.last
vendor: 18,832 bytes, line 742
742Click={time:a,x:s.clientX,y:s.clientY,type:i,button:s.button};let o=t.posAtCoords(Ex(s));o&&(i=="singleClick"?(t.input.mouseDown&&t.input.mouseDown.done(),t.input.mouseDown=new gY(t,o,s,!!n)):(i=="doubleClick"?fY:pY)(t,o.pos,o.inside,s)?s.preventDefault():vi(t,"pointer"))};class gY{constructor(e,s,n,a){this.view=e,this.pos=s,this.event=n,this.flushed=a,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!n[P5],this.allowDefault=n.shiftKey;let i,o;if(s.inside>-1)i=e.state.doc.nodeAt(s.inside),o=s.inside;else{let u=e.state.doc.resolve(s.pos);i=u.parent,o=u.depth?u.before():0}const l=a?null:n.target,c=l?e.docView.nearestDesc(l,!0):null;this.target=c&&c.nodeDOM.nodeType==1?c.nodeDOM:null;let{selection:d}=e.state;(n.button==0&&i.type.spec.draggable&&i.type.spec.selectable!==!1||d instanceof Ce&&d.from<=o&&d.to>o)&&(this.mightDrag={node:i,pos:o,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&sr&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),vi(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Pa(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let s=this.pos;this.view.state.doc!=this.startDoc&&(s=this.view.posAtCoords(Ex(e))),this.updateAllowDefault(e),this.allowDefault||!s?vi(this.view,"pointer"):mY(this.view,s.pos,s.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||Os&&this.mightDrag&&!this.mightDrag.node.isAtom||ys&&!this.view.state.selection.visible&&Math.min(Math.abs(s.pos-this.view.state.selection.from),Math.abs(s.pos-this.view.state.selection.to))<=2)?(cc(this.view,Fe.near(this.view.state.doc.resolve(s.pos))),e.preventDefault()):vi(this.view,"pointer")}move(e){this.updateAllowDefault(e),vi(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}}Js.touchstart=t=>{t.input.lastTouch=Date.now(),x1(t),vi(t,"pointer")};Js.touchmove=t=>{t.input.lastTouch=Date.now(),vi(t,"pointer")};Js.contextmenu=t=>x1(t);function D5(t,e){return t.composing?!0:Os&&Math.abs(e.timeStamp-t.input.compositionEndedAt)<500?(t.input.compositionEndedAt=-2e8,!0):!1}const bY=Sa?5e3:-1;Qs.compositionstart=Qs.compositionupdate=t=>{if(!t.composing){t.domObserver.flush();let{state:e}=t,s=e.selection.$to;if(e.selection instanceof Me&&(e.storedMarks||!s.textOffset&&s.parentOffset&&s.nodeBefore.marks.some(n=>n.type.spec.inclusive===!1)||ys&&d5&&yY(t)))t.markCursor=t.state.storedMarks||s.marks(),Wf(t,!0),t.markCursor=null;else if(Wf(t,!e.selection.empty),sr&&e.selection.empty&&s.parentOffset&&!s.textOffset&&s.nodeBefore.marks.length){let n=t.domSelectionRange();for(let a=n.focusNode,i=n.focusOffset;a&&a.nodeType==1&&i!=0;){let o=i<0?a.lastChild:a.childNodes[i-1];if(!o)break;if(o.nodeType==3){let l=t.domSelection();l&&l.collapse(o,o.nodeValue.length);break}else a=o,i=-1}}t.input.composing=!0}R5(t,bY)};function yY(t){let{focusNode:e,focusOffset:s}=t.domSelectionRange();if(!e||e.nodeType!=1||s>=e.childNodes.length)return!1;let n=e.childNodes[s];return n.nodeType==1&&n.contentEditable=="false"}Qs.compositionend=(t,e)=>{t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=e.timeStamp,t.input.compositionPendingChanges=t.domObserver.pendingRecords().length?t.input.compositionID:0,t.input.compositionNode=null,t.input.badSafariComposition?t.domObserver.forceFlush():t.input.compositionPendingChanges&&Promise.resolve().then(()=>t.domObserver.flush()),t.input.compositionID++,R5(t,20))};function R5(t,e){clearTimeout(t.input.composingTimeout),e>-1&&(t.input.composingTimeout=setTimeout(()=>Wf(t),e))}function L5(t){for(t.composing&&(t.input.composing=!1,t.input.compositionEndedAt=wY());t.input.compositionNodes.length>0;)t.input.compositionNodes.pop().markParentsDirty()}function vY(t){let e=t.domSelectionRange();if(!e.focusNode)return null;let s=hG(e.focusNode,e.focusOffset),n=mG(e.focusNode,e.focusOffset);if(s&&n&&s!=n){let a=n.pmViewDesc,i=t.domObserver.lastChangedTextNode;if(s==i||n==i)return i;if(!a||!a.isText(n.nodeValue))return n;if(t.input.compositionNode==n){let o=s.pmViewDesc;if(!(!o||!o.isText(s.nodeValue)))return n}}return s||n}function wY(){let t=document.createEvent("Event");return t.initEvent("event",!0,!0),t.timeStamp}function Wf(t,e=!1){if(!(Sa&&t.domObserver.flushingSoon>=0)){if(t.domObserver.forceFlush(),L5(t),e||t.docView&&t.docView.dirty){let s=u1(t),n=t.state.selection;return s&&!s.eq(n)?t.dispatch(t.state.tr.setSelection(s)):(t.markCursor||e)&&!n.$from.node(n.$from.sharedDepth(n.to)).inlineContent?t.dispatch(t.state.tr.deleteSelection()):t.updateState(t.state),!0}return!1}}function jY(t,e){if(!t.dom.parentNode)return;let s=t.dom.parentNode.appendChild(document.createElement("div"));s.appendChild(e),s.style.cssText="position: fixed; left: -10000px; top: 10px";let n=getSelection(),a=document.createRange();a.selectNodeContents(e),t.dom.blur(),n.removeAllRanges(),n.addRange(a),setTimeout(()=>{s.parentNode&&s.parentNode.removeChild(s),t.focus()},50)}const Bu=yn&&Ri<15||Sc&&gG<604;Js.copy=Qs.cut=(t,e)=>{let s=e,n=t.state.selection,a=s.type=="cut";if(n.empty)return;let i=Bu?null:s.clipboardData,o=n.content(),{dom:l,text:c}=m1(t,o);i?(s.preventDefault(),i.clearData(),i.setData("text/html",l.innerHTML),i.setData("text/plain",c)):jY(t,l),a&&t.dispatch(t.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function NY(t){return t.openStart==0&&t.openEnd==0&&t.content.childCount==1?t.content.firstChild:null}function kY(t,e){if(!t.dom.parentNode)return;let s=t.input.shiftKey||t.state.selection.$from.parent.type.spec.code,n=t.dom.parentNode.appendChild(document.createElement(s?"textarea":"div"));s||(n.contentEditable="true"),n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus();let a=t.input.shiftKey&&t.input.lastKeyCode!=45;setTimeout(()=>{t.focus(),n.parentNode&&n.parentNode.removeChild(n),s?Vu(t,n.value,null,a,e):Vu(t,n.textContent,n.innerHTML,a,e)},50)}function Vu(t,e,s,n,a){let i=S5(t,e,s,n,t.state.selection.$from);if(t.someProp("handlePaste",c=>c(t,a,i||me.empty)))return!0;if(!i)return!1;let o=NY(i),l=o?t.state.tr.replaceSelectionWith(o,n):t.state.tr.replaceSelection(i);return t.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function O5(t){let e=t.getData("text/plain")||t.getData("Text");if(e)return e;let s=t.getData("text/uri-list");return s?s.replace(/\r?\n/g," "):""}Qs.paste=(t,e)=>{let s=e;if(t.composing&&!Sa)return;let n=Bu?null:s.clipboardData,a=t.input.shiftKey&&t.input.lastKeyCode!=45;n&&Vu(t,O5(n),n.getData("text/html"),a,s)?s.preventDefault():kY(t,s)};class I5{constructor(e,s,n){this.slice=e,this.move=s,this.node=n}}const CY=qn?"altKey":"ctrlKey";function F5(t,e){let s=t.someProp("dragCopies",n=>!n(e));return s??!e[CY]}Js.dragstart=(t,e)=>{let s=e,n=t.input.mouseDown;if(n&&n.done(),!s.dataTransfer)return;let a=t.state.selection,i=a.empty?null:t.posAtCoords(Ex(s)),o;if(!(i&&i.pos>=a.from&&i.pos<=(a instanceof Ce?a.to-1:a.to))){if(n&&n.mightDrag)o=Ce.create(t.state.doc,n.mightDrag.pos);else if(s.target&&s.target.nodeType==1){let h=t.docView.nearestDesc(s.target,!0);h&&h.node.type.spec.draggable&&h!=t.docView&&(o=Ce.create(t.state.doc,h.posBefore))}}let l=(o||t.state.selection).content(),{dom:c,text:d,slice:u}=m1(t,l);(!s.dataTransfer.files.length||!ys||c5>120)&&s.dataTransfer.clearData(),s.dataTransfer.setData(Bu?"Text":"text/html",c.innerHTML),s.dataTransfer.effectAllowed="copyMove",Bu||s.dataTransfer.setData("text/plain",d),t.dragging=new I5(u,F5(t,s),o)};Js.dragend=t=>{let e=t.dragging;window.setTimeout(()=>{t.dragging==e&&(t.dragging=null)},50)};Qs.dragover=Qs.dragenter=(t,e)=>e.preventDefault();Qs.drop=(t,e)=>{try{SY(t,e,t.dragging)}finally{t.dragging=null}};function SY(t,e,s){if(!e.dataTransfer)return;let n=t.posAtCoords(Ex(e));if(!n)return;let a=t.state.doc.resolve(n.pos),i=s&&s.slice;i?t.someProp("transformPasted",f=>{i=f(i,t,!1)}):i=S5(t,O5(e.dataTransfer),Bu?null:e.dataTransfer.getData("text/html"),!1,a);let o=!!(s&&F5(t,e));if(t.someProp("handleDrop",f=>f(t,e,i||me.empty,o))){e.preventDefault();return}if(!i)return;e.preventDefault();let l=i?VM(t.state.doc,a.pos,i):a.pos;l==null&&(l=a.pos);let c=t.state.tr;if(o){let{node:f}=s;f?f.replace(c):c.deleteSelection()}let d=c.mapping.map(l),u=i.openStart==0&&i.openEnd==0&&i.content.childCount==1,h=c.doc;if(u?c.replaceRangeWith(d,d,i.content.firstChild):c.replaceRange(d,d,i),c.doc.eq(h))return;let m=c.doc.resolve(d);if(u&&Ce.isSelectable(i.content.firstChild)&&m.nodeAfter&&m.nodeAfter.sameMarkup(i.content.firstChild))c.setSelection(new Ce(m));else{let f=c.mapping.map(l);c.mapping.maps[c.mapping.maps.length-1].forEach((p,g,x,b)=>f=b),c.setSelection(h1(t,m,c.doc.resolve(f)))}t.focus(),t.dispatch(c.setMeta("uiEvent","drop"))}Js.focus=t=>{t.input.lastFocus=Date.now(),t.focused||(t.domObserver.stop(),t.dom.classList.add("ProseMirror-focused"),t.domObserver.start(),t.focused=!0,setTimeout(()=>{t.docView&&t.hasFocus()&&!t.domObserver.currentSelection.eq(t.domSelectionRange())&&Pa(t)},20))};Js.blur=(t,e)=>{let s=e;t.focused&&(t.domObserver.stop(),t.dom.classList.remove("ProseMirror-focused"),t.domObserver.start(),s.relatedTarget&&t.dom.contains(s.relatedTarget)&&t.domObserver.currentSelection.clear(),t.focused=!1)};Js.beforeinput=(t,e)=>{if(ys&&Sa&&e.inputType=="deleteContentBackward"){t.domObserver.flushSoon();let{domChangeCount:n}=t.input;setTimeout(()=>{if(t.input.domChangeCount!=n||(t.dom.blur(),t.focus(),t.someProp("handleKeyDown",i=>i(t,wo(8,"Backspace")))))return;let{$cursor:a}=t.state.selection;a&&a.pos>0&&t.dispatch(t.state.tr.delete(a.pos-1,a.pos).scrollIntoView())},50)}};for(let t in Qs)Js[t]=Qs[t];function Uu(t,e){if(t==e)return!0;for(let s in t)if(t[s]!==e[s])return!1;for(let s in e)if(!(s in t))return!1;return!0}class Gf{constructor(e,s){this.toDOM=e,this.spec=s||$o,this.side=this.spec.side||0}map(e,s,n,a){let{pos:i,deleted:o}=e.mapResult(s.from+a,this.side<0?-1:1);return o?null:new Us(i-n,i-n,this)}valid(){return!0}eq(e){return this==e||e instanceof Gf&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&Uu(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}}class Oi{constructor(e,s){this.attrs=e,this.spec=s||$o}map(e,s,n,a){let i=e.map(s.from+a,this.spec.inclusiveStart?-1:1)-n,o=e.map(s.to+a,this.spec.inclusiveEnd?1:-1)-n;return i>=o?null:new Us(i,o,this)}valid(e,s){return s.from<s.to}eq(e){return this==e||e instanceof Oi&&Uu(this.attrs,e.attrs)&&Uu(this.spec,e.spec)}static is(e){return e.type instanceof Oi}destroy(){}}class g1{constructor(e,s){this.attrs=e,this.spec=s||$o}map(e,s,n,a){let i=e.mapResult(s.from+a,1);if(i.deleted)return null;let o=e.mapResult(s.to+a,-1);return o.deleted||o.pos<=i.pos?null:new Us(i.pos-n,o.pos-n,this)}valid(e,s){let{index:n,offset:a}=e.content.findIndex(s.from),i;return a==s.from&&!(i=e.child(n)).isText&&a+i.nodeSize==s.to}eq(e){return this==e||e instanceof g1&&Uu(this.attrs,e.attrs)&&Uu(this.spec,e.spec)}destroy(){}}class Us{constructor(e,s,n){this.from=e,this.to=s,this.type=n}copy(e,s){return new Us(e,s,this.type)}eq(e,s=0){return this.type.eq(e.type)&&this.from+s==e.from&&this.to+s==e.to}map(e,s,n){return this.type.map(e,this,s,n)}static widget(e,s,n){return new Us(e,e,new Gf(s,n))}static inline(e,s,n,a){return new Us(e,s,new Oi(n,a))}static node(e,s,n,a){return new Us(e,s,new g1(n,a))}get spec(){return this.type.spec}get inline(){return this.type instanceof Oi}get widget(){return this.type instanceof Gf}}const Pl=[],$o={};class bt{constructor(e,s){this.local=e.length?e:Pl,this.children=s.length?s:Pl}static create(e,s){return s.length?Yf(s,e,0,$o):Ts}find(e,s,n){let a=[];return this.findInner(e??0,s??1e9,a,0,n),a}findInner(e,s,n,a,i){for(let o=0;o<this.local.length;o++){let l=this.local[o];l.from<=s&&l.to>=e&&(!i||i(l.spec))&&n.push(l.copy(l.from+a,l.to+a))}for(let o=0;o<this.children.length;o+=3)if(this.children[o]<s&&this.children[o+1]>e){let l=this.children[o]+1;this.children[o+2].findInner(e-l,s-l,n,a+l,i)}}map(e,s,n){return this==Ts||e.maps.length==0?this:this.mapInner(e,s,0,0,n||$o)}mapInner(e,s,n,a,i){let o;for(let l=0;l<this.local.length;l++){let c=this.local[l].map(e,n,a);c&&c.type.valid(s,c)?(o||(o=[])).push(c):i.onRemove&&i.onRemove(this.local[l].spec)}return this.children.length?_Y(this.children,o||[],e,s,n,a,i):o?new bt(o.sort(zo),Pl):Ts}add(e,s){return s.length?this==Ts?bt.create(e,s):this.addInner(e,s,0):this}addInner(e,s,n){let a,i=0;e.forEach((l,c)=>{let d=c+n,u;if(u=z5(s,l,d)){for(a||(a=this.children.slice());i<a.length&&a[i]<c;)i+=3;a[i]==c?a[i+2]=a[i+2].addInner(l,u,d+1):a.splice(i,0,c,c+l.nodeSize,Yf(u,l,d+1,$o)),i+=3}});let o=$5(i?B5(s):s,-n);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||o.splice(l--,1);return new bt(o.length?this.local.concat(o).sort(zo):this.local,a||this.children)}remove(e){return e.length==0||this==Ts?this:this.removeInner(e,0)}removeInner(e,s){let n=this.children,a=this.local;for(let i=0;i<n.length;i+=3){let o,l=n[i]+s,c=n[i+1]+s;for(let u=0,h;u<e.length;u++)(h=e[u])&&h.from>l&&h.to<c&&(e[u]=null,(o||(o=[])).push(h));if(!o)continue;n==this.children&&(n=this.children.slice());let d=n[i+2].removeInner(o,l+1);d!=Ts?n[i+2]=d:(n.splice(i,3),i-=3)}if(a.length){for(let i=0,o;i<e.length;i++)if(o=e[i])for(let l=0;l<a.length;l++)a[l].eq(o,s)&&(a==this.local&&(a=this.local.slice()),a.splice(l--,1))}return n==this.children&&a==this.local?this:a.length||n.length?new bt(a,n):Ts}forChild(e,s){if(this==Ts)return this;if(s.isLeaf)return bt.empty;let n,a;for(let l=0;l<this.children.length;l+=3)if(this.children[l]>=e){this.children[l]==e&&(n=this.children[l+2]);break}let i=e+1,o=i+s.content.size;for(let l=0;l<this.local.length;l++){let c=this.local[l];if(c.from<o&&c.to>i&&c.type instanceof Oi){let d=Math.max(i,c.from)-i,u=Math.min(o,c.to)-i;d<u&&(a||(a=[])).push(c.copy(d,u))}}if(a){let l=new bt(a.sort(zo),Pl);return n?new hi([l,n]):l}return n||Ts}eq(e){if(this==e)return!0;if(!(e instanceof bt)||this.local.length!=e.local.length||this.children.length!=e.children.length)return!1;for(let s=0;s<this.local.length;s++)if(!this.local[s].eq(e.local[s]))return!1;for(let s=0;s<this.children.length;s+=3)if(this.children[s]!=e.children[s]||this.children[s+1]!=e.children[s+1]||!this.children[s+2].eq(e.children[s+2]))return!1;return!0}locals(e){return b1(this.localsInner(e))}localsInner(e){if(this==Ts)return Pl;if(e.inlineContent||!this.local.some(Oi.is))return this.local;let s=[];for(let n=0;n<this.local.length;n++)this.local[n].type instanceof Oi||s.push(this.local[n]);return s}forEachSet(e){e(this)}}bt.empty=new bt([],[]);bt.removeOverlap=b1;const Ts=bt.empty;class hi{constructor(e){this.members=e}map(e,s){const n=this.members.map(a=>a.map(e,s,$o));return hi.from(n)}forChild(e,s){if(s.isLeaf)return bt.empty;let n=[];for(let a=0;a<this.members.length;a++){let i=this.members[a].forChild(e,s);i!=Ts&&(i instanceof hi?n=n.concat(i.members):n.push(i))}return hi.from(n)}eq(e){if(!(e instanceof hi)||e.members.length!=this.members.length)return!1;for(let s=0;s<this.members.length;s++)if(!this.members[s].eq(e.members[s]))return!1;return!0}locals(e){let s,n=!0;for(let a=0;a<this.members.length;a++){let i=this.members[a].localsInner(e);if(i.length)if(!s)s=i;else{n&&(s=s.slice(),n=!1);for(let o=0;o<i.length;o++)s.push(i[o])}}return s?b1(n?s:s.sort(zo)):Pl}static from(e){switch(e.length){case 0:return Ts;case 1:return e[0];default:return new hi(e.every(s=>s instanceof bt)?e:e.reduce((s,n)=>s.concat(n instanceof bt?n:n.members),[]))}}forEachSet(e){for(let s=0;s<this.members.length;s++)this.members[s].forEachSet(e)}}function _Y(t,e,s,n,a,i,o){let l=t.slice();for(let d=0,u=i;d<s.maps.length;d++){let h=0;s.maps[d].forEach((m,f,p,g)=>{let x=g-p-(f-m);for(let b=0;b<l.length;b+=3){let y=l[b+1];if(y<0||m>y+u-h)continue;let w=l[b]+u-h;f>=w?l[b+1]=m<=w?-2:-1:m>=u&&x&&(l[b]+=x,l[b+1]+=x)}h+=x}),u=s.maps[d].map(u,-1)}let c=!1;for(let d=0;d<l.length;d+=3)if(l[d+1]<0){if(l[d+1]==-2){c=!0,l[d+1]=-1;continue}let u=s.map(t[d]+i),h=u-a;if(h<0||h>=n.content.size){c=!0;continue}let m=s.map(t[d+1]+i,-1),f=m-a,{index:p,offset:g}=n.content.findIndex(h),x=n.maybeChild(p);if(x&&g==h&&g+x.nodeSize==f){let b=l[d+2].mapInner(s,x,u+1,t[d]+i+1,o);b!=Ts?(l[d]=h,l[d+1]=f,l[d+2]=b):(l[d+1]=-2,c=!0)}else c=!0}if(c){let d=TY(l,t,e,s,a,i,o),u=Yf(d,n,0,o);e=u.local;for(let h=0;h<l.length;h+=3)l[h+1]<0&&(l.splice(h,3),h-=3);for(let h=0,m=0;h<u.children.length;h+=3){let f=u.children[h];for(;m<l.length&&l[m]<f;)m+=3;l.splice(m,0,u.children[h],u.children[h+1],u.children[h+2])}}return new bt(e.sort(zo),l)}function $5(t,e){if(!e||!t.length)return t;let s=[];for(let n=0;n<t.length;n++){let a=t[n];s.push(new Us(a.from+e,a.to+e,a.type))}return s}function TY(t,e,s,n,a,i,o){function l(c,d){for(let u=0;u<c.local.length;u++){let h=c.local[u].map(n,a,d);h?s.push(h):o.onRemove&&o.onRemove(c.local[u].spec)}for(let u=0;u<c.children.length;u+=3)l(c.children[u+2],c.children[u]+d+1)}for(let c=0;c<t.length;c+=3)t[c+1]==-1&&l(t[c+2],e[c]+i+1);return s}function z5(t,e,s){if(e.isLeaf)return null;let n=s+e.nodeSize,a=null;for(let i=0,o;i<t.length;i++)(o=t[i])&&o.from>s&&o.to<n&&((a||(a=[])).push(o),t[i]=null);return a}function B5(t){let e=[];for(let s=0;s<t.length;s++)t[s]!=null&&e.push(t[s]);return e}function Yf(t,e,s,n){let a=[],i=!1;e.forEach((l,c)=>{let d=z5(t,l,c+s);if(d){i=!0;let u=Yf(d,l,s+c+1,n);u!=Ts&&a.push(c,c+l.nodeSize,u)}});let o=$5(i?B5(t):t,-s).sort(zo);for(let l=0;l<o.length;l++)o[l].type.valid(e,o[l])||(n.onRemove&&n.onRemove(o[l].spec),o.splice(l--,1));return o.length||a.length?new bt(o,a):Ts}function zo(t,e){return t.from-e.from||t.to-e.to}function b1(t){let e=t;for(let s=0;s<e.length-1;s++){let n=e[s];if(n.from!=n.to)for(let a=s+1;a<e.length;a++){let i=e[a];if(i.from==n.from){i.to!=n.to&&(e==t&&(e=t.slice()),e[a]=i.copy(i.from,n.to),LC(e,a+1,i.copy(n.to,i.to)));continue}else{i.from<n.to&&(e==t&&(e=t.slice()),e[s]=n.copy(n.from,i.from),LC(e,a,n.copy(i.from,n.to))
vendor: 8,683 bytes, line 742
742);break}}}return e}function LC(t,e,s){for(;e<t.length&&zo(s,t[e])>0;)e++;t.splice(e,0,s)}function b0(t){let e=[];return t.someProp("decorations",s=>{let n=s(t.state);n&&n!=Ts&&e.push(n)}),t.cursorWrapper&&e.push(bt.create(t.state.doc,[t.cursorWrapper.deco])),hi.from(e)}const EY={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},MY=yn&&Ri<=11;class AY{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}}class PY{constructor(e,s){this.view=e,this.handleDOMChange=s,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new AY,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(n=>{for(let a=0;a<n.length;a++)this.queue.push(n[a]);yn&&Ri<=11&&n.some(a=>a.type=="childList"&&a.removedNodes.length||a.type=="characterData"&&a.oldValue.length>a.target.nodeValue.length)?this.flushSoon():Os&&e.composing&&n.some(a=>a.type=="childList"&&a.target.nodeName=="TR")?(e.input.badSafariComposition=!0,this.flushSoon()):this.flush()}),MY&&(this.onCharData=n=>{this.queue.push({target:n.target,type:"characterData",oldValue:n.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,EY)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let s=0;s<e.length;s++)this.queue.push(e[s]);window.setTimeout(()=>this.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(_C(this.view)){if(this.suppressingSelectionUpdates)return Pa(this.view);if(yn&&Ri<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Xo(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let s=new Set,n;for(let i=e.focusNode;i;i=Cc(i))s.add(i);for(let i=e.anchorNode;i;i=Cc(i))if(s.has(i)){n=i;break}let a=n&&this.view.docView.nearestDesc(n);if(a&&a.ignoreMutation({type:"selection",target:n.nodeType==3?n.parentNode:n}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let s=this.pendingRecords();s.length&&(this.queue=[]);let n=e.domSelectionRange(),a=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(n)&&_C(e)&&!this.ignoreSelectionChange(n),i=-1,o=-1,l=!1,c=[];if(e.editable)for(let u=0;u<s.length;u++){let h=this.registerMutation(s[u],c);h&&(i=i<0?h.from:Math.min(h.from,i),o=o<0?h.to:Math.max(h.to,o),h.typeOver&&(l=!0))}if(c.some(u=>u.nodeName=="BR")&&(e.input.lastKeyCode==8||e.input.lastKeyCode==46)){for(let u of c)if(u.nodeName=="BR"&&u.parentNode){let h=u.nextSibling;h&&h.nodeType==1&&h.contentEditable=="false"&&u.parentNode.removeChild(u)}}else if(sr&&c.length){let u=c.filter(h=>h.nodeName=="BR");if(u.length==2){let[h,m]=u;h.parentNode&&h.parentNode.parentNode==m.parentNode?m.remove():h.remove()}else{let{focusNode:h}=this.currentSelection;for(let m of u){let f=m.parentNode;f&&f.nodeName=="LI"&&(!h||LY(e,h)!=f)&&m.remove()}}}let d=null;i<0&&a&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)<Date.now()-300&&_x(n)&&(d=u1(e))&&d.eq(Fe.near(e.state.doc.resolve(0),1))?(e.input.lastFocus=0,Pa(e),this.currentSelection.set(n),e.scrollToSelection()):(i>-1||a)&&(i>-1&&(e.docView.markDirty(i,o),DY(e)),e.input.badSafariComposition&&(e.input.badSafariComposition=!1,OY(e,c)),this.handleDOMChange(i,o,l,c),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(n)||Pa(e),this.currentSelection.set(n))}registerMutation(e,s){if(s.indexOf(e.target)>-1)return null;let n=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(n==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!n||n.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;u<e.addedNodes.length;u++){let h=e.addedNodes[u];s.push(h),h.nodeType==3&&(this.lastChangedTextNode=h)}if(n.contentDOM&&n.contentDOM!=n.dom&&!n.contentDOM.contains(e.target))return{from:n.posBefore,to:n.posAfter};let a=e.previousSibling,i=e.nextSibling;if(yn&&Ri<=11&&e.addedNodes.length)for(let u=0;u<e.addedNodes.length;u++){let{previousSibling:h,nextSibling:m}=e.addedNodes[u];(!h||Array.prototype.indexOf.call(e.addedNodes,h)<0)&&(a=h),(!m||Array.prototype.indexOf.call(e.addedNodes,m)<0)&&(i=m)}let o=a&&a.parentNode==e.target?gs(a)+1:0,l=n.localPosFromDOM(e.target,o,-1),c=i&&i.parentNode==e.target?gs(i):e.target.childNodes.length,d=n.localPosFromDOM(e.target,c,1);return{from:l,to:d}}else return e.type=="attributes"?{from:n.posAtStart-n.border,to:n.posAtEnd+n.border}:(this.lastChangedTextNode=e.target,{from:n.posAtStart,to:n.posAtEnd,typeOver:e.target.nodeValue==e.oldValue})}}let OC=new WeakMap,IC=!1;function DY(t){if(!OC.has(t)&&(OC.set(t,null),["normal","nowrap","pre-line"].indexOf(getComputedStyle(t.dom).whiteSpace)!==-1)){if(t.requiresGeckoHackNode=sr,IC)return;console.warn("ProseMirror expects the CSS white-space property to be set, preferably to 'pre-wrap'. It is recommended to load style/prosemirror.css from the prosemirror-view package."),IC=!0}}function FC(t,e){let s=e.startContainer,n=e.startOffset,a=e.endContainer,i=e.endOffset,o=t.domAtPos(t.state.selection.anchor);return Xo(o.node,o.offset,a,i)&&([s,n,a,i]=[a,i,s,n]),{anchorNode:s,anchorOffset:n,focusNode:a,focusOffset:i}}function RY(t,e){if(e.getComposedRanges){let a=e.getComposedRanges(t.root)[0];if(a)return FC(t,a)}let s;function n(a){a.preventDefault(),a.stopImmediatePropagation(),s=a.getTargetRanges()[0]}return t.dom.addEventListener("beforeinput",n,!0),document.execCommand("indent"),t.dom.removeEventListener("beforeinput",n,!0),s?FC(t,s):null}function LY(t,e){for(let s=e.parentNode;s&&s!=t.dom;s=s.parentNode){let n=t.docView.nearestDesc(s,!0);if(n&&n.node.isBlock)return s}return null}function OY(t,e){var s;let{focusNode:n,focusOffset:a}=t.domSelectionRange();for(let i of e)if(((s=i.parentNode)===null||s===void 0?void 0:s.nodeName)=="TR"){let o=i.nextSibling;for(;o&&o.nodeName!="TD"&&o.nodeName!="TH";)o=o.nextSibling;if(o){let l=o;for(;;){let c=l.firstChild;if(!c||c.nodeType!=1||c.contentEditable=="false"||/^(BR|IMG)$/.test(c.nodeName))break;l=c}l.insertBefore(i,l.firstChild),n==i&&t.domSelection().collapse(i,a)}else i.parentNode.removeChild(i)}}function IY(t,e,s){let{node:n,fromOffset:a,toOffset:i,from:o,to:l}=t.docView.parseRange(e,s),c=t.domSelectionRange(),d,u=c.anchorNode;if(u&&t.dom.contains(u.nodeType==1?u:u.parentNode)&&(d=[{node:u,offset:c.anchorOffset}],_x(c)||d.push({node:c.focusNode,offset:c.focusOffset})),ys&&t.input.lastKeyCode===8)for(let x=i;x>a;x--){let b=n.childNodes[x-1],y=b.pmViewDesc;if(b.nodeName=="BR"&&!y){i=x;break}if(!y||y.size)break}let h=t.state.doc,m=t.someProp("domParser")||Di.fromSchema(t.state.schema),f=h.resolve(o),p=null,g=m.parse(n,{topNode:f.parent,topMatch:f.parent.contentMatchAt(f.index()),topOpen:!0,from:a,to:i,preserveWhitespace:f.parent.type.whitespace=="pre"?"full":!0,findPositions:d,ruleFromNode:FY,context:f});if(d&&d[0].pos!=null){let x=d[0].pos,b=d[1]&&d[1].pos;b==null&&(b=x),p={anchor:x+o,head:b+o}}return{doc:g,sel:p,from:o,to:l}}function FY(t){let e=t.pmViewDesc;if(e)return e.parseRule();
vendor: 4,380 bytes, line 742
742if(t.nodeName=="BR"&&t.parentNode){if(Os&&/^(ul|ol)$/i.test(t.parentNode.nodeName)){let s=document.createElement("div");return s.appendChild(document.createElement("li")),{skip:s}}else if(t.parentNode.lastChild==t||Os&&/^(tr|table)$/i.test(t.parentNode.nodeName))return{ignore:!0}}else if(t.nodeName=="IMG"&&t.getAttribute("mark-placeholder"))return{ignore:!0};return null}const $Y=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|img|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function zY(t,e,s,n,a){let i=t.input.compositionPendingChanges||(t.composing?t.input.compositionID:0);if(t.input.compositionPendingChanges=0,e<0){let k=t.input.lastSelectionTime>Date.now()-50?t.input.lastSelectionOrigin:null,C=u1(t,k);if(C&&!t.state.selection.eq(C)){if(ys&&Sa&&t.input.lastKeyCode===13&&Date.now()-100<t.input.lastKeyCodeTime&&t.someProp("handleKeyDown",A=>A(t,wo(13,"Enter"))))return;let T=t.state.tr.setSelection(C);k=="pointer"?T.setMeta("pointer",!0):k=="key"&&T.scrollIntoView(),i&&T.setMeta("composition",i),t.dispatch(T)}return}let o=t.state.doc.resolve(e),l=o.sharedDepth(s);e=o.before(l+1),s=t.state.doc.resolve(s).after(l+1);let c=t.state.selection,d=IY(t,e,s),u=t.state.doc,h=u.slice(d.from,d.to),m,f;t.input.lastKeyCode===8&&Date.now()-100<t.input.lastKeyCodeTime?(m=t.state.selection.to,f="end"):(m=t.state.selection.from,f="start"),t.input.lastKeyCode=null;let p=UY(h.content,d.doc.content,d.from,m,f);if(p&&t.input.domChangeCount++,(Sc&&t.input.lastIOSEnter>Date.now()-225||Sa)&&a.some(k=>k.nodeType==1&&!$Y.test(k.nodeName))&&(!p||p.endA>=p.endB)&&t.someProp("handleKeyDown",k=>k(t,wo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(!p)if(n&&c instanceof Me&&!c.empty&&c.$head.sameParent(c.$anchor)&&!t.composing&&!(d.sel&&d.sel.anchor!=d.sel.head))p={start:c.from,endA:c.to,endB:c.to};else{if(d.sel){let k=$C(t,t.state.doc,d.sel);if(k&&!k.eq(t.state.selection)){let C=t.state.tr.setSelection(k);i&&C.setMeta("composition",i),t.dispatch(C)}}return}t.state.selection.from<t.state.selection.to&&p.start==p.endB&&t.state.selection instanceof Me&&(p.start>t.state.selection.from&&p.start<=t.state.selection.from+2&&t.state.selection.from>=d.from?p.start=t.state.selection.from:p.endA<t.state.selection.to&&p.endA>=t.state.selection.to-2&&t.state.selection.to<=d.to&&(p.endB+=t.state.selection.to-p.endA,p.endA=t.state.selection.to)),yn&&Ri<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>d.from&&d.doc.textBetween(p.start-d.from-1,p.start-d.from+1)==" Â "&&(p.start--,p.endA--,p.endB--);let g=d.doc.resolveNoCache(p.start-d.from),x=d.doc.resolveNoCache(p.endB-d.from),b=u.resolve(p.start),y=g.sameParent(x)&&g.parent.inlineContent&&b.end()>=p.endA;if((Sc&&t.input.lastIOSEnter>Date.now()-225&&(!y||a.some(k=>k.nodeName=="DIV"||k.nodeName=="P"))||!y&&g.pos<d.doc.content.size&&(!g.sameParent(x)||!g.parent.inlineContent)&&g.pos<x.pos&&!/\S/.test(d.doc.textBetween(g.pos,x.pos,"","")))&&t.someProp("handleKeyDown",k=>k(t,wo(13,"Enter")))){t.input.lastIOSEnter=0;return}if(t.state.selection.anchor>p.start&&VY(u,p.start,p.endA,g,x)&&t.someProp("handleKeyDown",k=>k(t,wo(8,"Backspace")))){Sa&&ys&&t.domObserver.suppressSelectionUpdates();return}ys&&p.endB==p.start&&(t.input.lastChromeDelete=Date.now()),Sa&&!y&&g.start()!=x.start()&&x.parentOffset==0&&g.depth==x.depth&&d.sel&&d.sel.anchor==d.sel.head&&d.sel.head==p.endA&&(p.endB-=2,x=d.doc.resolveNoCache(p.endB-d.from),setTimeout(()=>{t.someProp("handleKeyDown",function(k){return k(t,wo(13,"Enter"))})},20));let w=p.start,N=p.endA,j=k=>{let C=k||t.state.tr.replace(w,N,d.doc.slice(p.start-d.from,p.endB-d.from));if(d.sel){let T=$C(t,C.doc,d.sel);T&&!(ys&&t.composing&&T.empty&&(p.start!=p.endB||t.input.lastChromeDelete<Date.now()-100)&&(T.head==w||T.head==C.mapping.map(N)-1)||yn&&T.empty&&T.head==w)&&C.setSelection(T)}return i&&C.setMeta("composition",i),C.scrollIntoView()},S;if(y)if(g.pos==x.pos){yn&&Ri<=11&&g.parentOffset==0&&(t.domObserver.suppressSelectionUpdates(),setTimeout(()=>Pa(t),20));let k=j(t.state.tr.delete(w,N)),C=u.resolve(p.start).marksAcross(u.resolve(p.endA));C&&k.ensureMarks(C),t.dispatch(k)}else if(p.endA==p.endB&&(S=BY(g.parent.content.cut(g.parentOffset,x.parentOffset),b.parent.content.cut(b.parentOffset,p.endA-b.start())))){let k=j(t.state.tr);S.type=="add"?k.addMark(w,N,S.mark):k.removeMark(w,N,S.mark),t.dis
vendor: 11,639 bytes, line 742
742patch(k)}else if(g.parent.child(g.index()).isText&&g.index()==x.index()-(x.textOffset?0:1)){let k=g.parent.textBetween(g.parentOffset,x.parentOffset),C=()=>j(t.state.tr.insertText(k,w,N));t.someProp("handleTextInput",T=>T(t,w,N,k,C))||t.dispatch(C())}else t.dispatch(j());else t.dispatch(j())}function $C(t,e,s){return Math.max(s.anchor,s.head)>e.content.size?null:h1(t,e.resolve(s.anchor),e.resolve(s.head))}function BY(t,e){let s=t.firstChild.marks,n=e.firstChild.marks,a=s,i=n,o,l,c;for(let u=0;u<n.length;u++)a=n[u].removeFromSet(a);for(let u=0;u<s.length;u++)i=s[u].removeFromSet(i);if(a.length==1&&i.length==0)l=a[0],o="add",c=u=>u.mark(l.addToSet(u.marks));else if(a.length==0&&i.length==1)l=i[0],o="remove",c=u=>u.mark(l.removeFromSet(u.marks));else return null;let d=[];for(let u=0;u<e.childCount;u++)d.push(c(e.child(u)));if(se.from(d).eq(t))return{mark:l,type:o}}function VY(t,e,s,n,a){if(s-e<=a.pos-n.pos||y0(n,!0,!1)<a.pos)return!1;let i=t.resolve(e);if(!n.parent.isTextblock){let l=i.nodeAfter;return l!=null&&s==e+l.nodeSize}if(i.parentOffset<i.parent.content.size||!i.parent.isTextblock)return!1;let o=t.resolve(y0(i,!0,!0));return!o.parent.isTextblock||o.pos>s||y0(o,!0,!1)<s?!1:n.parent.content.cut(n.parentOffset).eq(o.parent.content)}function y0(t,e,s){let n=t.depth,a=e?t.end():t.pos;for(;n>0&&(e||t.indexAfter(n)==t.node(n).childCount);)n--,a++,e=!1;if(s){let i=t.node(n).maybeChild(t.indexAfter(n));for(;i&&!i.isLeaf;)i=i.firstChild,a++}return a}function UY(t,e,s,n,a){let i=t.findDiffStart(e,s);if(i==null)return null;let{a:o,b:l}=t.findDiffEnd(e,s+t.size,s+e.size);if(a=="end"){let c=Math.max(0,i-Math.min(o,l));n-=o+c-i}if(o<i&&t.size<e.size){let c=n<=i&&n>=o?i-n:0;i-=c,i&&i<e.size&&zC(e.textBetween(i-1,i+1))&&(i+=c?1:-1),l=i+(l-o),o=i}else if(l<i){let c=n<=i&&n>=l?i-n:0;i-=c,i&&i<t.size&&zC(t.textBetween(i-1,i+1))&&(i+=c?1:-1),o=i+(o-l),l=i}return{start:i,endA:o,endB:l}}function zC(t){if(t.length!=2)return!1;let e=t.charCodeAt(0),s=t.charCodeAt(1);return e>=56320&&e<=57343&&s>=55296&&s<=56319}class V5{constructor(e,s){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new aY,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=s,this.state=s.state,this.directPlugins=s.plugins||[],this.directPlugins.forEach(WC),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=UC(this),VC(this),this.nodeViews=HC(this),this.docView=wC(this.state.doc,BC(this),b0(this),this.dom,this),this.domObserver=new PY(this,(n,a,i,o)=>zY(this,n,a,i,o)),this.domObserver.start(),iY(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let s in e)this._props[s]=e[s];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&Oy(this);let s=this._props;this._props=e,e.plugins&&(e.plugins.forEach(WC),this.directPlugins=e.plugins),this.updateStateInner(e.state,s)}setProps(e){let s={};for(let n in this._props)s[n]=this._props[n];s.state=this.state;for(let n in e)s[n]=e[n];this.update(s)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,s){var n;let a=this.state,i=!1,o=!1;e.storedMarks&&this.composing&&(L5(this),o=!0),this.state=e;let l=a.plugins!=e.plugins||this._props.plugins!=s.plugins;if(l||this._props.plugins!=s.plugins||this._props.nodeViews!=s.nodeViews){let f=HC(this);WY(f,this.nodeViews)&&(this.nodeViews=f,i=!0)}(l||s.handleDOMEvents!=this._props.handleDOMEvents)&&Oy(this),this.editable=UC(this),VC(this);let c=b0(this),d=BC(this),u=a.plugins!=e.plugins&&!a.doc.eq(e.doc)?"reset":e.scrollToSelection>a.scrollToSelection?"to selection":"preserve",h=i||!this.docView.matchesNode(e.doc,d,c);(h||!e.selection.eq(a.selection))&&(o=!0);let m=u=="preserve"&&o&&this.dom.style.overflowAnchor==null&&vG(this);if(o){this.domObserver.stop();let f=h&&(yn||ys)&&!this.composing&&!a.selection.empty&&!e.selection.empty&&HY(a.selection,e.selection);if(h){let p=ys?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=vY(this)),(i||!this.docView.update(e.doc,d,c,this))&&(this.docView.updateOuterDeco(d),this.docView.destroy(),this.docView=wC(e.doc,d,c,this.dom,this)),p&&(!this.trackWrites||!this.dom.contains(this.trackWrites))&&(f=!0)}f||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&HG(this))?Pa(this,f):(N5(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(a),!((n=this.dragging)===null||n===void 0)&&n.node&&!a.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,a),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():m&&wG(m)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",s=>s(this)))if(this.state.selection instanceof Ce){let s=this.docView.domAfterPos(this.state.selection.from);s.nodeType==1&&pC(this,s.getBoundingClientRect(),e)}else pC(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let s=0;s<this.directPlugins.length;s++){let n=this.directPlugins[s];n.spec.view&&this.pluginViews.push(n.spec.view(this))}for(let s=0;s<this.state.plugins.length;s++){let n=this.state.plugins[s];n.spec.view&&this.pluginViews.push(n.spec.view(this))}}else for(let s=0;s<this.pluginViews.length;s++){let n=this.pluginViews[s];n.update&&n.update(this,e)}}updateDraggedNode(e,s){let n=e.node,a=-1;if(this.state.doc.nodeAt(n.from)==n.node)a=n.from;else{let i=n.from+(this.state.doc.content.size-s.doc.content.size);(i>0&&this.state.doc.nodeAt(i))==n.node&&(a=i)}this.dragging=new I5(e.slice,e.move,a<0?void 0:Ce.create(this.state.doc,a))}someProp(e,s){let n=this._props&&this._props[e],a;if(n!=null&&(a=s?s(n):n))return a;for(let o=0;o<this.directPlugins.length;o++){let l=this.directPlugins[o].props[e];if(l!=null&&(a=s?s(l):l))return a}let i=this.state.plugins;if(i)for(let o=0;o<i.length;o++){let l=i[o].props[e];if(l!=null&&(a=s?s(l):l))return a}}hasFocus(){if(yn){let e=this.root.activeElement;if(e==this.dom)return!0;if(!e||!this.dom.contains(e))return!1;for(;e&&this.dom!=e&&this.dom.contains(e);){if(e.contentEditable=="false")return!1;e=e.parentElement}return!0}return this.root.activeElement==this.dom}focus(){this.domObserver.stop(),this.editable&&jG(this.dom),Pa(this),this.domObserver.start()}get root(){let e=this._root;if(e==null){for(let s=this.dom.parentNode;s;s=s.parentNode)if(s.nodeType==9||s.nodeType==11&&s.host)return s.getSelection||(Object.getPrototypeOf(s).getSelection=()=>s.ownerDocument.getSelection()),this._root=s}return e||document}updateRoot(){this._root=null}posAtCoords(e){return _G(this,e)}coordsAtPos(e,s=1){return p5(this,e,s)}domAtPos(e,s=0){return this.docView.domFromPos(e,s)}nodeDOM(e){let s=this.docView.descAt(e);return s?s.nodeDOM:null}posAtDOM(e,s,n=-1){let a=this.docView.posFromDOM(e,s,n);if(a==null)throw new RangeError("DOM position not inside the editor");return a}endOfTextblock(e,s){return PG(this,s||this.state,e)}pasteHTML(e,s){return Vu(this,"",e,!1,s||new ClipboardEvent("paste"))}pasteText(e,s){return Vu(this,e,null,!0,s||new ClipboardEvent("paste"))}serializeForClipboard(e){return m1(this,e)}destroy(){this.docView&&(oY(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],b0(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,dG())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return cY(this,e)}domSelectionRange(){let e=this.domSelection();return e?Os&&this.root.nodeType===11&&pG(this.dom.ownerDocument)==this.dom&&RY(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}}V5.prototype.dispatch=function(t){let e=this._props.dispatchTransaction;e?e.call(this,t):this.updateState(this.state.apply(t))};function BC(t){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(t.editable),t.someProp("attributes",s=>{if(typeof s=="function"&&(s=s(t.state)),s)for(let n in s)n=="class"?e.class+=" "+s[n]:n=="style"?e.style=(e.style?e.style+";":"")+s[n]:!e[n]&&n!="contenteditable"&&n!="nodeName"&&(e[n]=String(s[n]))}),e.translate||(e.translate="no"),[Us.node(0,t.state.doc.content.size,e)]}function VC(t){if(t.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),t.cursorWrapper={dom:e,deco:Us.widget(t.state.selection.from,e,{raw:!0,marks:t.markCursor})}}else t.cursorWrapper=null}function UC(t){return!t.someProp("editable",e=>e(t.state)===!1)}function HY(t,e){let s=Math.min(t.$anchor.sharedDepth(t.head),e.$anchor.sharedDepth(e.head));return t.$anchor.start(s)!=e.$anchor.start(s)}function HC(t){let e=Object.create(null);function s(n){for(let a in n)Object.prototype.hasOwnProperty.call(e,a)||(e[a]=n[a])}return t.someProp("nodeViews",s),t.someProp("markViews",s),e}function WY(t,e){let s=0,n=0;for(let a in t){if(t[a]!=e[a])return!0;s++}for(let a in e)n++;return s!=n}function WC(t){if(t.spec.state||t.spec.filterTransaction||t.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var Yi={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},qf={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},GY=typeof navigator<"u"&&/Mac/.test(navigator.platform),YY=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var bs=0;bs<10;bs++)Yi[48+bs]=Yi[96+bs]=String(bs);for(var bs=1;bs<=24;bs++)Yi[bs+111]="F"+bs;for(var bs=65;bs<=90;bs++)Yi[bs]=String.fromCharCode(bs+32),qf[bs]=String.fromCharCode(bs);for(var v0 in Yi)qf.hasOwnProperty(v0)||(qf[v0]=Yi[v0]);function qY(t){var e=GY&&t.metaKey&&t.shiftKey&&!t.ctrlKey&&!t.altKey||YY&&t.shiftKey&&t.key&&t.key.length==1||t.key=="Unidentified",s=!e&&t.key||(t.shiftKey?qf:Yi)[t.keyCode]||t.key||"Unidentified";return s=="Esc"&&(s="Escape"),s=="Del"&&(s="Delete"),s=="Left"&&(s="ArrowLeft"),s=="Up"&&(s="ArrowUp"),s=="Right"&&(s="ArrowRight"),s=="Down"&&(s="ArrowDown"),s}const KY=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),JY=typeof navigator<"u"&&/Win/.test(navigator.platform);function QY(t){let e=t.split(/-(?!$)/),s=e[e.length-1];s=="Space"&&(s=" ");let n,a,i,o;for(let l=0;l<e.length-1;l++){let c=e[l];
vendor: 56,892 bytes, lines 742-785
742if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))n=!0;else if(/^(c|ctrl|control)$/i.test(c))a=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))KY?o=!0:a=!0;else throw new Error("Unrecognized modifier name: "+c)}return n&&(s="Alt-"+s),a&&(s="Ctrl-"+s),o&&(s="Meta-"+s),i&&(s="Shift-"+s),s}function XY(t){let e=Object.create(null);for(let s in t)e[QY(s)]=t[s];return e}function w0(t,e,s=!0){return e.altKey&&(t="Alt-"+t),e.ctrlKey&&(t="Ctrl-"+t),e.metaKey&&(t="Meta-"+t),s&&e.shiftKey&&(t="Shift-"+t),t}function ZY(t){return new Ct({props:{handleKeyDown:U5(t)}})}function U5(t){let e=XY(t);return function(s,n){let a=qY(n),i,o=e[w0(a,n)];if(o&&o(s.state,s.dispatch,s))return!0;if(a.length==1&&a!=" "){if(n.shiftKey){let l=e[w0(a,n,!1)];if(l&&l(s.state,s.dispatch,s))return!0}if((n.altKey||n.metaKey||n.ctrlKey)&&!(JY&&n.ctrlKey&&n.altKey)&&(i=Yi[n.keyCode])&&i!=a){let l=e[w0(i,n)];if(l&&l(s.state,s.dispatch,s))return!0}}return!1}}var eq=Object.defineProperty,y1=(t,e)=>{for(var s in e)eq(t,s,{get:e[s],enumerable:!0})};function Mx(t){const{state:e,transaction:s}=t;let{selection:n}=s,{doc:a}=s,{storedMarks:i}=s;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return i},get selection(){return n},get doc(){return a},get tr(){return n=s.selection,a=s.doc,i=s.storedMarks,s}}}var Ax=class{constructor(t){this.editor=t.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=t.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){const{rawCommands:t,editor:e,state:s}=this,{view:n}=e,{tr:a}=s,i=this.buildProps(a);return Object.fromEntries(Object.entries(t).map(([o,l])=>[o,(...d)=>{const u=l(...d)(i);return!a.getMeta("preventDispatch")&&!this.hasCustomState&&n.dispatch(a),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(t,e=!0){const{rawCommands:s,editor:n,state:a}=this,{view:i}=n,o=[],l=!!t,c=t||a.tr,d=()=>(!l&&e&&!c.getMeta("preventDispatch")&&!this.hasCustomState&&i.dispatch(c),o.every(h=>h===!0)),u={...Object.fromEntries(Object.entries(s).map(([h,m])=>[h,(...p)=>{const g=this.buildProps(c,e),x=m(...p)(g);return o.push(x),u}])),run:d};return u}createCan(t){const{rawCommands:e,state:s}=this,n=!1,a=t||s.tr,i=this.buildProps(a,n);return{...Object.fromEntries(Object.entries(e).map(([l,c])=>[l,(...d)=>c(...d)({...i,dispatch:void 0})])),chain:()=>this.createChain(a,n)}}buildProps(t,e=!0){const{rawCommands:s,editor:n,state:a}=this,{view:i}=n,o={tr:t,editor:n,view:i,state:Mx({state:a,transaction:t}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(t,e),can:()=>this.createCan(t),get commands(){return Object.fromEntries(Object.entries(s).map(([l,c])=>[l,(...d)=>c(...d)(o)]))}};return o}},H5={};y1(H5,{blur:()=>tq,clearContent:()=>sq,clearNodes:()=>nq,command:()=>rq,createParagraphNear:()=>aq,cut:()=>iq,deleteCurrentNode:()=>oq,deleteNode:()=>lq,deleteRange:()=>cq,deleteSelection:()=>dq,enter:()=>uq,exitCode:()=>hq,extendMarkRange:()=>mq,first:()=>fq,focus:()=>xq,forEach:()=>gq,insertContent:()=>bq,insertContentAt:()=>wq,joinBackward:()=>kq,joinDown:()=>Nq,joinForward:()=>Cq,joinItemBackward:()=>Sq,joinItemForward:()=>_q,joinTextblockBackward:()=>Tq,joinTextblockForward:()=>Eq,joinUp:()=>jq,keyboardShortcut:()=>Aq,lift:()=>Pq,liftEmptyBlock:()=>Dq,liftListItem:()=>Rq,newlineInCode:()=>Lq,resetAttributes:()=>Oq,scrollIntoView:()=>Iq,selectAll:()=>Fq,selectNodeBackward:()=>$q,selectNodeForward:()=>zq,selectParentNode:()=>Bq,selectTextblockEnd:()=>Vq,selectTextblockStart:()=>Uq,setContent:()=>Hq,setMark:()=>uK,setMeta:()=>hK,setNode:()=>mK,setNodeSelection:()=>fK,setTextDirection:()=>pK,setTextSelection:()=>xK,sinkListItem:()=>gK,splitBlock:()=>bK,splitListItem:()=>yK,toggleList:()=>vK,toggleMark:()=>wK,toggleNode:()=>jK,toggleWrap:()=>NK,undoInputRule:()=>kK,unsetAllMarks:()=>CK,unsetMark:()=>SK,unsetTextDirection:()=>_K,updateAttributes:()=>TK,wrapIn:()=>EK,wrapInList:()=>MK});var tq=()=>({editor:t,view:e})=>(requestAnimationFrame(()=>{var s;t.isDestroyed||(e.dom.blur(),(s=window==null?void 0:window.getSelection())==null||s.removeAllRanges())}),!0),sq=(t=!0)=>({commands:e})=>e.setContent("",{emitUpdate:t}),nq=()=>({state:t,tr:e,dispatch:s})=>{const{selection:n}=e,{ranges:a}=n;return s&&a.forEach(({$from:i,$to:o})=>{t.doc.nodesBetween(i.pos,o.pos,(l,c)=>{if(l.type.isText)return;const{doc:d,mapping:u}=e,h=d.resolve(u.map(c)),m=d.resolve(u.map(c+l.nodeSize)),f=h.blockRange(m);if(!f)return;const p=Gc(f);if(l.type.isTextblock){const{defaultType:g}=h.parent.contentMatchAt(h.index());e.setNodeMarkup(f.start,g)}(p||p===0)&&e.lift(f,p)})}),!0},rq=t=>e=>t(e),aq=()=>({state:t,dispatch:e})=>r5(t,e),iq=(t,e)=>({editor:s,tr:n})=>{const{state:a}=s,i=a.doc.slice(t.from,t.to);n.deleteRange(t.from,t.to);const o=n.mapping.map(e);return n.insert(o,i.content),n.setSelection(new Me(n.doc.resolve(Math.max(o-1,0)))),!0},oq=()=>({tr:t,dispatch:e})=>{const{selection:s}=t,n=s.$anchor.node();if(n.content.size>0)return!1;const a=t.selection.$anchor;for(let i=a.depth;i>0;i-=1)if(a.node(i).type===n.type){if(e){const l=a.before(i),c=a.after(i);t.delete(l,c).scrollIntoView()}return!0}return!1};function qt(t,e){if(typeof t=="string"){if(!e.nodes[t])throw Error(`There is no node type named '${t}'. Maybe you forgot to add the extension?`);return e.nodes[t]}return t}var lq=t=>({tr:e,state:s,dispatch:n})=>{const a=qt(t,s.schema),i=e.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===a){if(n){const c=i.before(o),d=i.after(o);e.delete(c,d).scrollIntoView()}return!0}return!1},cq=t=>({tr:e,dispatch:s})=>{const{from:n,to:a}=t;return s&&e.delete(n,a),!0},dq=()=>({state:t,dispatch:e})=>a1(t,e),uq=()=>({commands:t})=>t.keyboardShortcut("Enter"),hq=()=>({state:t,dispatch:e})=>KW(t,e);function v1(t){return Object.prototype.toString.call(t)==="[object RegExp]"}function Kf(t,e,s={strict:!0}){const n=Object.keys(e);return n.length?n.every(a=>s.strict?e[a]===t[a]:v1(e[a])?e[a].test(t[a]):e[a]===t[a]):!0}function W5(t,e,s={}){return t.find(n=>n.type===e&&Kf(Object.fromEntries(Object.keys(s).map(a=>[a,n.attrs[a]])),s))}function GC(t,e,s={}){return!!W5(t,e,s)}function w1(t,e,s){var n;if(!t||!e)return;let a=t.parent.childAfter(t.parentOffset);if((!a.node||!a.node.marks.some(u=>u.type===e))&&(a=t.parent.childBefore(t.parentOffset)),!a.node||!a.node.marks.some(u=>u.type===e)||(s=s||((n=a.node.marks[0])==null?void 0:n.attrs),!W5([...a.node.marks],e,s)))return;let o=a.index,l=t.start()+a.offset,c=o+1,d=l+a.node.nodeSize;for(;o>0&&GC([...t.parent.child(o-1).marks],e,s);)o-=1,l-=t.parent.child(o).nodeSize;for(;c<t.parent.childCount&&GC([...t.parent.child(c).marks],e,s);)d+=t.parent.child(c).nodeSize,c+=1;return{from:l,to:d}}function Ha(t,e){if(typeof t=="string"){if(!e.marks[t])throw Error(`There is no mark type named '${t}'. Maybe you forgot to add the extension?`);return e.marks[t]}return t}var mq=(t,e={})=>({tr:s,state:n,dispatch:a})=>{const i=Ha(t,n.schema),{doc:o,selection:l}=s,{$from:c,from:d,to:u}=l;if(a){const h=w1(c,i,e);if(h&&h.from<=d&&h.to>=u){const m=Me.create(o,h.from,h.to);s.setSelection(m)}}return!0},fq=t=>e=>{const s=typeof t=="function"?t(e):t;for(let n=0;n<s.length;n+=1)if(s[n](e))return!0;return!1};function G5(t){return t instanceof Me}function To(t=0,e=0,s=0){return Math.min(Math.max(t,e),s)}function Y5(t,e=null){if(!e)return null;const s=Fe.atStart(t),n=Fe.atEnd(t);if(e==="start"||e===!0)return s;if(e==="end")return n;const a=s.from,i=n.to;return e==="all"?Me.create(t,To(0,a,i),To(t.content.size,a,i)):Me.create(t,To(e,a,i),To(e,a,i))}function Iy(){return navigator.platform==="Android"||/android/i.test(navigator.userAgent)}function Hu(){return["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&"ontouchend"in document}function pq(){return typeof navigator<"u"?/^((?!chrome|android).)*safari/i.test(navigator.userAgent):!1}var xq=(t=null,e={})=>({editor:s,view:n,tr:a,dispatch:i})=>{e={scrollIntoView:!0,...e};const o=()=>{(Hu()||Iy())&&n.dom.focus(),pq()&&!Hu()&&!Iy()&&n.dom.focus({preventScroll:!0}),requestAnimationFrame(()=>{s.isDestroyed||(n.focus(),e!=null&&e.scrollIntoView&&s.commands.scrollIntoView())})};try{if(n.hasFocus()&&t===null||t===!1)return!0}catch{return!1}if(i&&t===null&&!G5(s.state.selection))return o(),!0;const l=Y5(a.doc,t)||s.state.selection,c=s.state.selection.eq(l);return i&&(c||a.setSelection(l),c&&a.storedMarks&&a.setStoredMarks(a.storedMarks),o()),!0},gq=(t,e)=>s=>t.every((n,a)=>e(n,{...s,index:a})),bq=(t,e)=>({tr:s,commands:n})=>n.insertContentAt({from:s.selection.from,to:s.selection.to},t,e),q5=t=>{const e=t.childNodes;for(let s=e.length-1;s>=0;s-=1){const n=e[s];n.nodeType===3&&n.nodeValue&&/^(\n\s\s|\n)$/.test(n.nodeValue)?t.removeChild(n):n.nodeType===1&&q5(n)}return t};function tm(t){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");const e=`<body>${t}</body>`,s=new window.DOMParser().parseFromString(e,"text/html").body;return q5(s)}function Wu(t,e,s){if(t instanceof Pi||t instanceof se)return t;s={slice:!0,parseOptions:{},...s};const n=typeof t=="object"&&t!==null,a=typeof t=="string";if(n)try{if(Array.isArray(t)&&t.length>0)return se.fromArray(t.map(l=>e.nodeFromJSON(l)));const o=e.nodeFromJSON(t);return s.errorOnInvalidContent&&o.check(),o}catch(i){if(s.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:i});return console.warn("[tiptap warn]: Invalid content.","Passed value:",t,"Error:",i),Wu("",e,s)}if(a){if(s.errorOnInvalidContent){let o=!1,l="";const c=new AM({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:d=>(o=!0,l=typeof d=="string"?d:d.outerHTML,null)}]}})});if(s.slice?Di.fromSchema(c).parseSlice(tm(t),s.parseOptions):Di.fromSchema(c).parse(tm(t),s.parseOptions),s.errorOnInvalidContent&&o)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}const i=Di.fromSchema(e);return s.slice?i.parseSlice(tm(t),s.parseOptions).content:i.parse(tm(t),s.parseOptions)}return Wu("",e,s)}function yq(t,e,s){const n=t.steps.length-1;if(n<e)return;const a=t.steps[n];if(!(a instanceof as||a instanceof ds))return;const i=t.mapping.maps[n];let o=0;i.forEach((l,c,d,u)=>{o===0&&(o=u)}),t.setSelection(Fe.near(t.doc.resolve(o),s))}var vq=t=>!("type"in t),wq=(t,e,s)=>({tr:n,dispatch:a,editor:i})=>{var o;if(a){s={parseOptions:i.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...s};let l;const c=x=>{i.emit("contentError",{editor:i,error:x,disableCollaboration:()=>{"collaboration"in i.storage&&typeof i.storage.collaboration=="object"&&i.storage.collaboration&&(i.storage.collaboration.isDisabled=!0)}})},d={preserveWhitespace:"full",...s.parseOptions};if(!s.errorOnInvalidContent&&!i.options.enableContentCheck&&i.options.emitContentError)try{Wu(e,i.schema,{parseOptions:d,errorOnInvalidContent:!0})}catch(x){c(x)}try{l=Wu(e,i.schema,{parseOptions:d,errorOnInvalidContent:(o=s.errorOnInvalidContent)!=null?o:i.options.enableContentCheck})}catch(x){return c(x),!1}let{from:u,to:h}=typeof t=="number"?{from:t,to:t}:{from:t.from,to:t.to},m=!0,f=!0;if((vq(l)?l:[l]).forEach(x=>{x.check(),m=m?x.isText&&x.marks.length===0:!1,f=f?x.isBlock:!1}),u===h&&f){const{parent:x}=n.doc.resolve(u);x.isTextblock&&!x.type.spec.code&&!x.childCount&&(u-=1,h+=1)}let g;if(m){if(Array.isArray(e))g=e.map(x=>x.text||"").join("");else if(e instanceof se){let x="";e.forEach(b=>{b.text&&(x+=b.text)}),g=x}else typeof e=="object"&&e&&e.text?g=e.text:g=e;n.insertText(g,u,h)}else{g=l;const x=n.doc.resolve(u),b=x.node(),y=x.parentOffset===0,w=b.isText||b.isTextblock,N=b.content.size>0;y&&w&&N&&(u=Math.max(0,u-1)),n.replaceWith(u,h,g)}s.updateSelection&&yq(n,n.steps.length-1,-1),s.applyInputRules&&n.setMeta("applyInputRules",{from:u,text:g}),s.applyPasteRules&&n.setMeta("applyPasteRules",{from:u,text:g})}return!0},jq=()=>({state:t,dispatch:e})=>GW(t,e),Nq=()=>({state:t,dispatch:e})=>YW(t,e),kq=()=>({state:t,dispatch:e})=>QM(t,e),Cq=()=>({state:t,dispatch:e})=>t5(t,e),Sq=()=>({state:t,dispatch:e,tr:s})=>{try{const n=kx(t.doc,t.selection.$from.pos,-1);return n==null?!1:(s.join(n,2),e&&e(s),!0)}catch{return!1}},_q=()=>({state:t,dispatch:e,tr:s})=>{try{const n=kx(t.doc,t.selection.$from.pos,1);return n==null?!1:(s.join(n,2),e&&e(s),!0)}catch{return!1}},Tq=()=>({state:t,dispatch:e})=>HW(t,e),Eq=()=>({state:t,dispatch:e})=>WW(t,e);function K5(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function Mq(t){const e=t.split(/-(?!$)/);let s=e[e.length-1];s==="Space"&&(s=" ");let n,a,i,o;for(let l=0;l<e.length-1;l+=1){const c=e[l];if(/^(cmd|meta|m)$/i.test(c))o=!0;else if(/^a(lt)?$/i.test(c))n=!0;else if(/^(c|ctrl|control)$/i.test(c))a=!0;else if(/^s(hift)?$/i.test(c))i=!0;else if(/^mod$/i.test(c))Hu()||K5()?o=!0:a=!0;else throw new Error(`Unrecognized modifier name: ${c}`)}return n&&(s=`Alt-${s}`),a&&(s=`Ctrl-${s}`),o&&(s=`Meta-${s}`),i&&(s=`Shift-${s}`),s}var Aq=t=>({editor:e,view:s,tr:n,dispatch:a})=>{const i=Mq(t).split(/-(?!$)/),o=i.find(d=>!["Alt","Ctrl","Meta","Shift"].includes(d)),l=new KeyboardEvent("keydown",{key:o==="Space"?" ":o,altKey:i.includes("Alt"),ctrlKey:i.includes("Ctrl"),metaKey:i.includes("Meta"),shiftKey:i.includes("Shift"),bubbles:!0,cancelable:!0}),c=e.captureTransaction(()=>{s.someProp("handleKeyDown",d=>d(s,l))});return c==null||c.steps.forEach(d=>{const u=d.map(n.mapping);u&&a&&n.maybeStep(u)}),!0};function qi(t,e,s={}){const{from:n,to:a,empty:i}=t.selection,o=e?qt(e,t.schema):null,l=[];t.doc.nodesBetween(n,a,(h,m)=>{if(h.isText)return;const f=Math.max(n,m),p=Math.min(a,m+h.nodeSize);l.push({node:h,from:f,to:p})});const c=a-n,d=l.filter(h=>o?o.name===h.node.type.name:!0).filter(h=>Kf(h.node.attrs,s,{strict:!1}));return i?!!d.length:d.reduce((h,m)=>h+m.to-m.from,0)>=c}var Pq=(t,e={})=>({state:s,dispatch:n})=>{const a=qt(t,s.schema);return qi(s,a,e)?qW(s,n):!1},Dq=()=>({state:t,dispatch:e})=>a5(t,e),Rq=t=>({state:e,dispatch:s})=>{const n=qt(t,e.schema);return iG(n)(e,s)},Lq=()=>({state:t,dispatch:e})=>n5(t,e);function Px(t,e){return e.nodes[t]?"node":e.marks[t]?"mark":null}function YC(t,e){const s=typeof e=="string"?[e]:e;return Object.keys(t).reduce((n,a)=>(s.includes(a)||(n[a]=t[a]),n),{})}var Oq=(t,e)=>({tr:s,state:n,dispatch:a})=>{let i=null,o=null;const l=Px(typeof t=="string"?t:t.name,n.schema);if(!l)return!1;l==="node"&&(i=qt(t,n.schema)),l==="mark"&&(o=Ha(t,n.schema));let c=!1;return s.selection.ranges.forEach(d=>{n.doc.nodesBetween(d.$from.pos,d.$to.pos,(u,h)=>{i&&i===u.type&&(c=!0,a&&s.setNodeMarkup(h,void 0,YC(u.attrs,e))),o&&u.marks.length&&u.marks.forEach(m=>{o===m.type&&(c=!0,a&&s.addMark(h,h+u.nodeSize,o.create(YC(m.attrs,e))))})})}),c},Iq=()=>({tr:t,dispatch:e})=>(e&&t.scrollIntoView(),!0),Fq=()=>({tr:t,dispatch:e})=>{if(e){const s=new Pn(t.doc);t.setSelection(s)}return!0},$q=()=>({state:t,dispatch:e})=>ZM(t,e),zq=()=>({state:t,dispatch:e})=>s5(t,e),Bq=()=>({state:t,dispatch:e})=>XW(t,e),Vq=()=>({state:t,dispatch:e})=>tG(t,e),Uq=()=>({state:t,dispatch:e})=>eG(t,e);function Fy(t,e,s={},n={}){return Wu(t,e,{slice:!1,parseOptions:s,errorOnInvalidContent:n.errorOnInvalidContent})}var Hq=(t,{errorOnInvalidContent:e,emitUpdate:s=!0,parseOptions:n={}}={})=>({editor:a,tr:i,dispatch:o,commands:l})=>{const{doc:c}=i;if(n.preserveWhitespace!=="full"){const d=Fy(t,a.schema,n,{errorOnInvalidContent:e??a.options.enableContentCheck});return o&&i.replaceWith(0,c.content.size,d).setMeta("preventUpdate",!s),!0}return o&&i.setMeta("preventUpdate",!s),l.insertContentAt({from:0,to:c.content.size},t,{parseOptions:n,errorOnInvalidContent:e??a.options.enableContentCheck})};function J5(t,e){const s=Ha(e,t.schema),{from:n,to:a,empty:i}=t.selection,o=[];i?(t.storedMarks&&o.push(...t.storedMarks),o.push(...t.selection.$head.marks())):t.doc.nodesBetween(n,a,c=>{o.push(...c.marks)});const l=o.find(c=>c.type.name===s.name);return l?{...l.attrs}:{}}function Q5(t,e){const s=new YM(t);return e.forEach(n=>{n.steps.forEach(a=>{s.step(a)})}),s}function Wq(t){for(let e=0;e<t.edgeCount;e+=1){const{type:s}=t.edge(e);if(s.isTextblock&&!s.hasRequiredAttrs())return s}return null}function Gq(t,e,s){const n=[];return t.nodesBetween(e.from,e.to,(a,i)=>{s(a)&&n.push({node:a,pos:i})}),n}function Yq(t,e){for(let s=t.depth;s>0;s-=1){const n=t.node(s);if(e(n))return{pos:s>0?t.before(s):0,start:t.start(s),depth:s,node:n}}}function Dx(t){return e=>Yq(e.$from,t)}function ke(t,e,s){return t.config[e]===void 0&&t.parent?ke(t.parent,e,s):typeof t.config[e]=="function"?t.config[e].bind({...s,parent:t.parent?ke(t.parent,e,s):null}):t.config[e]}function j1(t){return t.map(e=>{const s={name:e.name,options:e.options,storage:e.storage},n=ke(e,"addExtensions",s);return n?[e,...j1(n())]:e}).flat(10)}function N1(t,e){const s=dl.fromSchema(e).serializeFragment(t),a=document.implementation.createHTMLDocument().createElement("div");return a.appendChild(s),a.innerHTML}function X5(t){return typeof t=="function"}function Xe(t,e=void 0,...s){return X5(t)?e?t.bind(e)(...s):t(...s):t}function qq(t={}){return Object.keys(t).length===0&&t.constructor===Object}function _c(t){const e=t.filter(a=>a.type==="extension"),s=t.filter(a=>a.type==="node"),n=t.filter(a=>a.type==="mark");return{baseExtensions:e,nodeExtensions:s,markExtensions:n}}function Z5(t){const e=[],{nodeExtensions:s,markExtensions:n}=_c(t),a=[...s,...n],i={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1},o=s.filter(d=>d.name!=="text").map(d=>d.name),l=n.map(d=>d.name),c=[...o,...l];return t.forEach(d=>{const u={name:d.name,options:d.options,storage:d.storage,extensions:a},h=ke(d,"addGlobalAttributes",u);if(!h)return;h().forEach(f=>{let p;Array.isArray(f.types)?p=f.types:f.types==="*"?p=c:f.types==="nodes"?p=o:f.types==="marks"?p=l:p=[],p.forEach(g=>{Object.entries(f.attributes).forEach(([x,b])=>{e.push({type:g,name:x,attribute:{...i,...b}})})})})}),a.forEach(d=>{const u={name:d.name,options:d.options,storage:d.storage},h=ke(d,"addAttributes",u);if(!h)return;const m=h();Object.entries(m).forEach(([f,p])=>{const g={...i,...p};typeof(g==null?void 0:g.default)=="function"&&(g.default=g.default()),g!=null&&g.isRequired&&(g==null?void 0:g.default)===void 0&&delete g.default,e.push({type:d.name,name:f,attribute:g})})}),e}function Kq(t){const e=[];let s="",n=!1,a=!1,i=0;const o=t.length;for(let l=0;l<o;l+=1){const c=t[l];if(c==="'"&&!a){n=!n,s+=c;continue}if(c==='"'&&!n){a=!a,s+=c;continue}if(!n&&!a){if(c==="("){i+=1,s+=c;continue}if(c===")"&&i>0){i-=1,s+=c;continue}if(c===";"&&i===0){e.push(s),s="";continue}}s+=c}return s&&e.push(s),e}function qC(t){const e=[],s=Kq(t||""),n=s.length;for(let a=0;a<n;a+=1){const i=s[a],o=i.indexOf(":");if(o===-1)continue;const l=i.slice(0,o).trim(),c=i.slice(o+1).trim();l&&c&&e.push([l,c])}return e}function At(...t){return t.filter(e=>!!e).reduce((e,s)=>{const n={...e};return Object.entries(s).forEach(([a,i])=>{if(!n[a]){n[a]=i;return}if(a==="class"){const l=i?String(i).split(" "):[],c=n[a]?n[a].split(" "):[],d=l.filter(u=>!c.includes(u));n[a]=[...c,...d].join(" ")}else if(a==="style"){const l=new Map([...qC(n[a]),...qC(i)]);n[a]=Array.from(l.entries()).map(([c,d])=>`${c}: ${d}`).join("; ")}else n[a]=i}),n},{})}function Tc(t,e){return e.filter(s=>s.type===t.type.name).filter(s=>s.attribute.rendered).map(s=>s.attribute.renderHTML?s.attribute.renderHTML(t.attrs)||{}:{[s.name]:t.attrs[s.name]}).reduce((s,n)=>At(s,n),{})}function Jq(t){return typeof t!="string"?t:t.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(t):t==="true"?!0:t==="false"?!1:t}function KC(t,e){return"style"in t?t:{...t,getAttrs:s=>{const n=t.getAttrs?t.getAttrs(s):t.attrs;if(n===!1)return!1;const a=e.reduce((i,o)=>{const l=o.attribute.parseHTML?o.attribute.parseHTML(s):Jq(s.getAttribute(o.name));return l==null?i:{...i,[o.name]:l}},{});return{...n,...a}}}}function JC(t){return Object.fromEntries(Object.entries(t).filter(([e,s])=>e==="attrs"&&qq(s)?!1:s!=null))}function QC(t){var e,s;const n={};return!((e=t==null?void 0:t.attribute)!=null&&e.isRequired)&&"default"in((t==null?void 0:t.attribute)||{})&&(n.default=t.attribute.default),((s=t==null?void 0:t.attribute)==null?void 0:s.validate)!==void 0&&(n.validate=t.attribute.validate),[t.name,n]}function Qq(t,e){var s;const n=Z5(t),{nodeExtensions:a,markExtensions:i}=_c(t),o=(s=a.find(d=>ke(d,"topNode")))==null?void 0:s.name,l=Object.fromEntries(a.map(d=>{const u=n.filter(b=>b.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((b,y)=>{const w=ke(y,"extendNodeSchema",h);return{...b,...w?w(d):{}}},{}),f=JC({...m,content:Xe(ke(d,"content",h)),marks:Xe(ke(d,"marks",h)),group:Xe(ke(d,"group",h)),inline:Xe(ke(d,"inline",h)),atom:Xe(ke(d,"atom",h)),selectable:Xe(ke(d,"selectable",h)),draggable:Xe(ke(d,"draggable",h)),code:Xe(ke(d,"code",h)),whitespace:Xe(ke(d,"whitespace",h)),linebreakReplacement:Xe(ke(d,"linebreakReplacement",h)),defining:Xe(ke(d,"defining",h)),isolating:Xe(ke(d,"isolating",h)),attrs:Object.fromEntries(u.map(QC))}),p=Xe(ke(d,"parseHTML",h));p&&(f.parseDOM=p.map(b=>KC(b,u)));const g=ke(d,"renderHTML",h);g&&(f.toDOM=b=>g({node:b,HTMLAttributes:Tc(b,u)}));const x=ke(d,"renderText",h);return x&&(f.toText=x),[d.name,f]})),c=Object.fromEntries(i.map(d=>{const u=n.filter(x=>x.type===d.name),h={name:d.name,options:d.options,storage:d.storage,editor:e},m=t.reduce((x,b)=>{const y=ke(b,"extendMarkSchema",h);return{...x,...y?y(d):{}}},{}),f=JC({...m,inclusive:Xe(ke(d,"inclusive",h)),excludes:Xe(ke(d,"excludes",h)),group:Xe(ke(d,"group",h)),spanning:Xe(ke(d,"spanning",h)),code:Xe(ke(d,"code",h)),attrs:Object.fromEntries(u.map(QC))}),p=Xe(ke(d,"parseHTML",h));p&&(f.parseDOM=p.map(x=>KC(x,u)));const g=ke(d,"renderHTML",h);return g&&(f.toDOM=x=>g({mark:x,HTMLAttributes:Tc(x,u)})),[d.name,f]}));return new AM({topNode:o,nodes:l,marks:c})}function Xq(t){const e=t.filter((s,n)=>t.indexOf(s)!==n);return Array.from(new Set(e))}function su(t){return t.sort((s,n)=>{const a=ke(s,"priority")||100,i=ke(n,"priority")||100;return a>i?-1:a<i?1:0})}function eA(t){const e=su(j1(t)),s=Xq(e.map(n=>n.name));return s.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${s.map(n=>`'${n}'`).join(", ")}]. This can lead to issues.`),e}function tA(t,e,s){const{from:n,to:a}=e,{blockSeparator:i=` 743 744`,textSerializers:o={}}=s||{};let l="";return t.nodesBetween(n,a,(c,d,u,h)=>{var m;c.isBlock&&d>n&&(l+=i);const f=o==null?void 0:o[c.type.name];if(f)return u&&(l+=f({node:c,pos:d,parent:u,index:h,range:e})),!1;c.isText&&(l+=(m=c==null?void 0:c.text)==null?void 0:m.slice(Math.max(n,d)-d,a-d))}),l}function Zq(t,e){const s={from:0,to:t.content.size};return tA(t,s,e)}function sA(t){return Object.fromEntries(Object.entries(t.nodes).filter(([,e])=>e.spec.toText).map(([e,s])=>[e,s.spec.toText]))}function eK(t,e){const s=qt(e,t.schema),{from:n,to:a}=t.selection,i=[];t.doc.nodesBetween(n,a,l=>{i.push(l)});const o=i.reverse().find(l=>l.type.name===s.name);return o?{...o.attrs}:{}}function nA(t,e){const s=Px(typeof e=="string"?e:e.name,t.schema);return s==="node"?eK(t,e):s==="mark"?J5(t,e):{}}function tK(t,e=JSON.stringify){const s={};return t.filter(n=>{const a=e(n);return Object.prototype.hasOwnProperty.call(s,a)?!1:s[a]=!0})}function sK(t){const e=tK(t);return e.length===1?e:e.filter((s,n)=>!e.filter((i,o)=>o!==n).some(i=>s.oldRange.from>=i.oldRange.from&&s.oldRange.to<=i.oldRange.to&&s.newRange.from>=i.newRange.from&&s.newRange.to<=i.newRange.to))}function rA(t){const{mapping:e,steps:s}=t,n=[];return e.maps.forEach((a,i)=>{const o=[];if(a.ranges.length)a.forEach((l,c)=>{o.push({from:l,to:c})});else{const{from:l,to:c}=s[i];if(l===void 0||c===void 0)return;o.push({from:l,to:c})}o.forEach(({from:l,to:c})=>{const d=e.slice(i).map(l,-1),u=e.slice(i).map(c),h=e.invert().map(d,-1),m=e.invert().map(u);n.push({oldRange:{from:h,to:m},newRange:{from:d,to:u}})})}),sK(n)}function k1(t,e,s){const n=[];return t===e?s.resolve(t).marks().forEach(a=>{const i=s.resolve(t),o=w1(i,a.type);o&&n.push({mark:a,...o})}):s.nodesBetween(t,e,(a,i)=>{!a||(a==null?void 0:a.nodeSize)===void 0||n.push(...a.marks.map(o=>({from:i,to:i+a.nodeSize,mark:o})))}),n}var nK=(t,e,s,n=20)=>{const a=t.doc.resolve(s);let i=n,o=null;for(;i>0&&o===null;){const l=a.node(i);(l==null?void 0:l.type.name)===e?o=l:i-=1}return[o,i]};function fd(t,e){return e.nodes[t]||e.marks[t]||null}function Bm(t,e,s){return Object.fromEntries(Object.entries(s).filter(([n])=>{const a=t.find(i=>i.type===e&&i.name===n);return a?a.attribute.keepOnSplit:!1}))}var rK=(t,e=500)=>{let s="";const n=t.parentOffset;return t.parent.nodesBetween(Math.max(0,n-e),n,(a,i,o,l)=>{var c,d;const u=((d=(c=a.type.spec).toText)==null?void 0:d.call(c,{node:a,pos:i,parent:o,index:l}))||a.textContent||"%leaf%";s+=a.isAtom&&!a.isText?u:u.slice(0,Math.max(0,n-i))}),s};function $y(t,e,s={}){const{empty:n,ranges:a}=t.selection,i=e?Ha(e,t.schema):null;if(n)return!!(t.storedMarks||t.selection.$from.marks()).filter(h=>i?i.name===h.type.name:!0).find(h=>Kf(h.attrs,s,{strict:!1}));let o=0;const l=[];if(a.forEach(({$from:h,$to:m})=>{const f=h.pos,p=m.pos;t.doc.nodesBetween(f,p,(g,x)=>{if(i&&g.inlineContent&&!g.type.allowsMarkType(i))return!1;if(!g.isText&&!g.marks.length)return;const b=Math.max(f,x),y=Math.min(p,x+g.nodeSize),w=y-b;o+=w,l.push(...g.marks.map(N=>({mark:N,from:b,to:y})))})}),o===0)return!1;const c=l.filter(h=>i?i.name===h.mark.type.name:!0).filter(h=>Kf(h.mark.attrs,s,{strict:!1})).reduce((h,m)=>h+m.to-m.from,0),d=l.filter(h=>i?h.mark.type!==i&&h.mark.type.excludes(i):!0).reduce((h,m)=>h+m.to-m.from,0);return(c>0?c+d:c)>=o}function aK(t,e,s={}){if(!e)return qi(t,null,s)||$y(t,null,s);const n=Px(e,t.schema);return n==="node"?qi(t,e,s):n==="mark"?$y(t,e,s):!1}var iK=(t,e)=>{const{$from:s,$to:n,$anchor:a}=t.selection;if(e){const i=Dx(l=>l.type.name===e)(t.selection);if(!i)return!1;const o=t.doc.resolve(i.pos+1);return a.pos+1===o.end()}return!(n.parentOffset<n.parent.nodeSize-2||s.pos!==n.pos)},oK=t=>{const{$from:e,$to:s}=t.selection;return!(e.parentOffset>0||e.pos!==s.pos)};function XC(t,e){return Array.isArray(e)?e.some(s=>(typeof s=="string"?s:s.name)===t.name):e}function ZC(t,e){const{nodeExtensions:s}=_c(e),n=s.find(o=>o.name===t);if(!n)return!1;const a={name:n.name,options:n.options,storage:n.storage},i=Xe(ke(n,"group",a));return typeof i!="string"?!1:i.split(" ").includes("list")}function Rx(t,{checkChildren:e=!0,ignoreWhitespace:s=!1}={}){var n;if(s){if(t.type.name==="hardBreak")return!0;if(t.isText)return/^\s*$/m.test((n=t.text)!=null?n:"")}if(t.isText)return!t.text;if(t.isAtom||t.isLeaf)return!1;if(t.content.childCount===0)return!0;if(e){let a=!0;return t.content.forEach(i=>{a!==!1&&(Rx(i,{ignoreWhitespace:s,checkChildren:e})||(a=!1))}),a}return!1}function aA(t){return t instanceof Ce}var iA=class oA{constructor(e){this.position=e}static fromJSON(e){return new oA(e.position)}toJSON(){return{position:this.position}}};function lK(t,e){const s=e.mapping.mapResult(t.position);return{position:new iA(s.pos),mapResult:s}}function cK(t){return new iA(t)}function dK(t,e,s){var n;const{selection:a}=e;let i=null;if(G5(a)&&(i=a.$cursor),i){const l=(n=t.storedMarks)!=null?n:i.marks();return i.parent.type.allowsMarkType(s)&&(!!s.isInSet(l)||!l.some(d=>d.type.excludes(s)))}const{ranges:o}=a;return o.some(({$from:l,$to:c})=>{let d=l.depth===0?t.doc.inlineContent&&t.doc.type.allowsMarkType(s):!1;return t.doc.nodesBetween(l.pos,c.pos,(u,h,m)=>{if(d)return!1;if(u.isInline){const f=!m||m.type.allowsMarkType(s),p=!!s.isInSet(u.marks)||!u.marks.some(g=>g.type.excludes(s));d=f&&p}return!d}),d})}var uK=(t,e={})=>({tr:s,state:n,dispatch:a})=>{const{selection:i}=s,{empty:o,ranges:l}=i,c=Ha(t,n.schema);if(a)if(o){const d=J5(n,c);s.addStoredMark(c.create({...d,...e}))}else l.forEach(d=>{const u=d.$from.pos,h=d.$to.pos;n.doc.nodesBetween(u,h,(m,f)=>{const p=Math.max(f,u),g=Math.min(f+m.nodeSize,h);m.marks.find(b=>b.type===c)?m.marks.forEach(b=>{c===b.type&&s.addMark(p,g,c.create({...b.attrs,...e}))}):s.addMark(p,g,c.create(e))})});return dK(n,s,c)},hK=(t,e)=>({tr:s})=>(s.setMeta(t,e),!0),mK=(t,e={})=>({state:s,dispatch:n,chain:a})=>{const i=qt(t,s.schema);let o;return s.selection.$anchor.sameParent(s.selection.$head)&&(o=s.selection.$anchor.parent.attrs),i.isTextblock?a().command(({commands:l})=>hC(i,{...o,...e})(s)?!0:l.clearNodes()).command(({state:l})=>hC(i,{...o,...e})(l,n)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},fK=t=>({tr:e,dispatch:s})=>{if(s){const{doc:n}=e,a=To(t,0,n.content.size),i=Ce.create(n,a);e.setSelection(i)}return!0},pK=(t,e)=>({tr:s,state:n,dispatch:a})=>{const{selection:i}=n;let o,l;return typeof e=="number"?(o=e,l=e):e&&"from"in e&&"to"in e?(o=e.from,l=e.to):(o=i.from,l=i.to),a&&s.doc.nodesBetween(o,l,(c,d)=>{c.isText||s.setNodeMarkup(d,void 0,{...c.attrs,dir:t})}),!0},xK=t=>({tr:e,dispatch:s})=>{if(s){const{doc:n}=e,{from:a,to:i}=typeof t=="number"?{from:t,to:t}:t,o=Me.atStart(n).from,l=Me.atEnd(n).to,c=To(a,o,l),d=To(i,o,l),u=Me.create(n,c,d);e.setSelection(u)}return!0},gK=t=>({state:e,dispatch:s})=>{const n=qt(t,e.schema);return cG(n)(e,s)};function eS(t,e){const s=t.storedMarks||t.selection.$to.parentOffset&&t.selection.$from.marks();if(s){const n=s.filter(a=>e==null?void 0:e.includes(a.type.name));t.tr.ensureMarks(n)}}var bK=({keepMarks:t=!0}={})=>({tr:e,state:s,dispatch:n,editor:a})=>{const{selection:i,doc:o}=e,{$from:l,$to:c}=i,d=a.extensionManager.attributes,u=Bm(d,l.node().type.name,l.node().attrs);if(i instanceof Ce&&i.node.isBlock)return!l.parentOffset||!Aa(o,l.pos)?!1:(n&&(t&&eS(s,a.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;const h=c.parentOffset===c.parent.content.size,m=l.depth===0?void 0:Wq(l.node(-1).contentMatchAt(l.indexAfter(-1)));let f=h&&m?[{type:m,attrs:u}]:void 0,p=Aa(e.doc,e.mapping.map(l.pos),1,f);if(!f&&!p&&Aa(e.doc,e.mapping.map(l.pos),1,m?[{type:m}]:void 0)&&(p=!0,f=m?[{type:m,attrs:u}]:void 0),n){if(p&&(i instanceof Me&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,f),m&&!h&&!l.parentOffset&&l.parent.type!==m)){const g=e.mapping.map(l.before()),x=e.doc.resolve(g);l.node(-1).canReplaceWith(x.index(),x.index()+1,m)&&e.setNodeMarkup(e.mapping.map(l.before()),m)}t&&eS(s,a.extensionManager.splittableMarks),e.scrollIntoView()}return p},yK=(t,e={})=>({tr:s,state:n,dispatch:a,editor:i})=>{var o;const l=qt(t,n.schema),{$from:c,$to:d}=n.selection,u=n.selection.node;if(u&&u.isBlock||c.depth<2||!c.sameParent(d))return!1;const h=c.node(-1);if(h.type!==l)return!1;const m=i.extensionManager.attributes;if(c.parent.content.size===0&&c.node(-1).childCount===c.indexAfter(-1)){if(c.depth===2||c.node(-3).type!==l||c.index(-2)!==c.node(-2).childCount-1)return!1;if(a){let b=se.empty;const y=c.index(-1)?1:c.index(-2)?2:3;for(let C=c.depth-y;C>=c.depth-3;C-=1)b=se.from(c.node(C).copy(b));const w=c.indexAfter(-1)<c.node(-2).childCount?1:c.indexAfter(-2)<c.node(-3).childCount?2:3,N={...Bm(m,c.node().type.name,c.node().attrs),...e},j=((o=l.contentMatch.defaultType)==null?void 0:o.createAndFill(N))||void 0;b=b.append(se.from(l.createAndFill(null,j)||void 0));const S=c.before(c.depth-(y-1));s.replace(S,c.after(-w),new me(b,4-y,0));let k=-1;s.doc.nodesBetween(S,s.doc.content.size,(C,T)=>{if(k>-1)return!1;C.isTextblock&&C.content.size===0&&(k=T+1)}),k>-1&&s.setSelection(Me.near(s.doc.resolve(k))),s.scrollIntoView()}return!0}const f=d.pos===c.end()?h.contentMatchAt(0).defaultType:null,p={...Bm(m,h.type.name,h.attrs),...e},g={...Bm(m,c.node().type.name,c.node().attrs),...e};s.delete(c.pos,d.pos);const x=f?[{type:l,attrs:p},{type:f,attrs:g}]:[{type:l,attrs:p}];if(!Aa(s.doc,c.pos,2))return!1;if(a){const{selection:b,storedMarks:y}=n,{splittableMarks:w}=i.extensionManager,N=y||b.$to.parentOffset&&b.$from.marks();if(s.split(c.pos,2,x).scrollIntoView(),!N||!a)return!0;const j=N.filter(S=>w.includes(S.type.name));s.ensureMarks(j)}return!0},j0=(t,e)=>{const s=Dx(o=>o.type===e)(t.selection);if(!s)return!0;const n=t.doc.resolve(Math.max(0,s.pos-1)).before(s.depth);if(n===void 0)return!0;const a=t.doc.nodeAt(n);return s.node.type===(a==null?void 0:a.type)&&no(t.doc,s.pos)&&t.join(s.pos),!0},N0=(t,e)=>{const s=Dx(o=>o.type===e)(t.selection);if(!s)return!0;const n=t.doc.resolve(s.start).after(s.depth);if(n===void 0)return!0;const a=t.doc.nodeAt(n);return s.node.type===(a==null?void 0:a.type)&&no(t.doc,n)&&t.join(n),!0},vK=(t,e,s,n={})=>({editor:a,tr:i,state:o,dispatch:l,chain:c,commands:d,can:u})=>{const{extensions:h,splittableMarks:m}=a.extensionManager,f=qt(t,o.schema),p=qt(e,o.schema),{selection:g,storedMarks:x}=o,{$from:b,$to:y}=g,w=b.blockRange(y),N=x||g.$to.parentOffset&&g.$from.marks();if(!w)return!1;const j=Dx(S=>ZC(S.type.name,h))(g);if(w.depth>=1&&j&&w.depth-j.depth<=1){if(j.node.type===f)return d.liftListItem(p);if(ZC(j.node.type.name,h)&&f.validContent(j.node.content)&&l)return c().command(()=>(i.setNodeMarkup(j.pos,f),!0)).command(()=>j0(i,f)).command(()=>N0(i,f)).run()}return!s||!N||!l?c().command(()=>u().wrapInList(f,n)?!0:d.clearNodes()).wrapInList(f,n).command(()=>j0(i,f)).command(()=>N0(i,f)).run():c().command(()=>{const S=u().wrapInList(f,n),k=N.filter(C=>m.includes(C.type.name));return i.ensureMarks(k),S?!0:d.clearNodes()}).wrapInList(f,n).command(()=>j0(i,f)).command(()=>N0(i,f)).run()},wK=(t,e={},s={})=>({state:n,commands:a})=>{const{extendEmptyMarkRange:i=!1}=s,o=Ha(t,n.schema);return $y(n,o,e)?a.unsetMark(o,{extendEmptyMarkRange:i}):a.setMark(o,e)},jK=(t,e,s={})=>({state:n,commands:a})=>{const i=qt(t,n.schema),o=qt(e,n.schema),l=qi(n,i,s);let c;return n.selection.$anchor.sameParent(n.selection.$head)&&(c=n.selection.$anchor.parent.attrs),l?a.setNode(o,c):a.setNode(i,{...c,...s})},NK=(t,e={})=>({state:s,commands:n})=>{const a=qt(t,s.schema);return qi(s,a,e)?n.lift(a):n.wrapIn(a,e)},kK=()=>({state:t,dispatch:e})=>{const s=t.plugins;for(let n=0;n<s.length;n+=1){const a=s[n];let i;if(a.spec.isInputRules&&(i=a.getState(t))){if(e){const o=t.tr,l=i.transform;for(let c=l.steps.length-1;c>=0;c-=1)o.step(l.steps[c].invert(l.docs[c]));if(i.text){const c=o.doc.resolve(i.from).marks();o.replaceWith(i.from,i.to,t.schema.text(i.text,c))}else o.delete(i.from,i.to)}return!0}}return!1},CK=()=>({tr:t,dispatch:e})=>{const{selection:s}=t,{empty:n,ranges:a}=s;return n||e&&a.forEach(i=>{t.removeMark(i.$from.pos,i.$to.pos)}),!0},SK=(t,e={})=>({tr:s,state:n,dispatch:a})=>{var i;const{extendEmptyMarkRange:o=!1}=e,{selection:l}=s,c=Ha(t,n.schema),{$from:d,empty:u,ranges:h}=l;if(!a)return!0;if(u&&o){let{from:m,to:f}=l;const p=(i=d.marks().find(x=>x.type===c))==null?void 0:i.attrs,g=w1(d,c,p);g&&(m=g.from,f=g.to),s.removeMark(m,f,c)}else h.forEach(m=>{s.removeMark(m.$from.pos,m.$to.pos,c)});return s.removeStoredMark(c),!0},_K=t=>({tr:e,state:s,dispatch:n})=>{const{selection:a}=s;let i,o;return typeof t=="number"?(i=t,o=t):t&&"from"in t&&"to"in t?(i=t.from,o=t.to):(i=a.from,o=a.to),n&&e.doc.nodesBetween(i,o,(l,c)=>{if(l.isText)return;const d={...l.attrs};delete d.dir,e.setNodeMarkup(c,void 0,d)}),!0},TK=(t,e={})=>({tr:s,state:n,dispatch:a})=>{let i=null,o=null;const l=Px(typeof t=="string"?t:t.name,n.schema);if(!l)return!1;l==="node"&&(i=qt(t,n.schema)),l==="mark"&&(o=Ha(t,n.schema));let c=!1;return s.selection.ranges.forEach(d=>{const u=d.$from.pos,h=d.$to.pos;let m,f,p,g;s.selection.empty?n.doc.nodesBetween(u,h,(x,b)=>{i&&i===x.type&&(c=!0,p=Math.max(b,u),g=Math.min(b+x.nodeSize,h),m=b,f=x)}):n.doc.nodesBetween(u,h,(x,b)=>{b<u&&i&&i===x.type&&(c=!0,p=Math.max(b,u),g=Math.min(b+x.nodeSize,h),m=b,f=x),b>=u&&b<=h&&(i&&i===x.type&&(c=!0,a&&s.setNodeMarkup(b,void 0,{...x.attrs,...e})),o&&x.marks.length&&x.marks.forEach(y=>{if(o===y.type&&(c=!0,a)){const w=Math.max(b,u),N=Math.min(b+x.nodeSize,h);s.addMark(w,N,o.create({...y.attrs,...e}))}}))}),f&&(m!==void 0&&a&&s.setNodeMarkup(m,void 0,{...f.attrs,...e}),o&&f.marks.length&&f.marks.forEach(x=>{o===x.type&&a&&s.addMark(p,g,o.create({...x.attrs,...e}))}))}),c},EK=(t,e={})=>({state:s,dispatch:n})=>{const a=qt(t,s.schema);return sG(a,e)(s,n)},MK=(t,e={})=>({state:s,dispatch:n})=>{const a=qt(t,s.schema);return nG(a,e)(s,n)},AK=class{constructor(){this.callbacks={}}on(t,e){return this.callbacks[t]||(this.callbacks[t]=[]),this.callbacks[t].push(e),this}emit(t,...e){const s=this.callbacks[t];return s&&s.forEach(n=>n.apply(this,e)),this}off(t,e){const s=this.callbacks[t];return s&&(e?this.callbacks[t]=s.filter(n=>n!==e):delete this.callbacks[t]),this}once(t,e){const s=(...n)=>{this.off(t,s),e.apply(this,n)};return this.on(t,s)}removeAllListeners(){this.callbacks={}}},Lx=class{constructor(t){var e;this.find=t.find,this.handler=t.handler,this.undoable=(e=t.undoable)!=null?e:!0}},PK=(t,e)=>{if(v1(e))return e.exec(t);const s=e(t);if(!s)return null;const n=[s.text];return n.index=s.index,n.input=t,n.data=s.data,s.replaceWith&&(s.text.includes(s.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),n.push(s.replaceWith)),n};function sm(t){var e;const{editor:s,from:n,to:a,text:i,rules:o,plugin:l}=t,{view:c}=s;if(c.composing)return!1;const d=c.state.doc.resolve(n);if(d.parent.type.spec.code||(e=d.nodeBefore||d.nodeAfter)!=null&&e.marks.find(m=>m.type.spec.code))return!1;let u=!1;const h=rK(d)+i;return o.forEach(m=>{if(u)return;const f=PK(h,m.find);if(!f)return;const p=c.state.tr,g=Mx({state:c.state,transaction:p}),x={from:n-(f[0].length-i.length),to:a},{commands:b,chain:y,can:w}=new Ax({editor:s,state:g});m.handler({state:g,range:x,match:f,commands:b,chain:y,can:w})===null||!p.steps.length||(m.undoable&&p.setMeta(l,{transform:p,from:n,to:a,text:i}),c.dispatch(p),u=!0)}),u}function DK(t){const{editor:e,rules:s}=t,n=new Ct({state:{init(){return null},apply(a,i,o){const l=a.getMeta(n);if(l)return l;const c=a.getMeta("applyInputRules");return!!c&&setTimeout(()=>{let{text:u}=c;typeof u=="string"?u=u:u=N1(se.from(u),o.schema);const{from:h}=c,m=h+u.length;sm({editor:e,from:h,to:m,text:u,rules:s,plugin:n})}),a.selectionSet||a.docChanged?null:i}},props:{handleTextInput(a,i,o,l){return sm({editor:e,from:i,to:o,text:l,rules:s,plugin:n})},handleDOMEvents:{compositionend:a=>(setTimeout(()=>{const{$cursor:i}=a.state.selection;i&&sm({editor:e,from:i.pos,to:i.pos,text:"",rules:s,plugin:n})}),!1)},handleKeyDown(a,i){if(i.key!=="Enter")return!1;const{$cursor:o}=a.state.selection;return o?sm({editor:e,from:o.pos,to:o.pos,text:` 745`,rules:s,plugin:n}):!1}},isInputRules:!0});return n}function RK(t){return Object.prototype.toString.call(t).slice(8,-1)}function nm(t){return RK(t)!=="Object"?!1:t.constructor===Object&&Object.getPrototypeOf(t)===Object.prototype}function lA(t,e){const s={...t};return nm(t)&&nm(e)&&Object.keys(e).forEach(n=>{nm(e[n])&&nm(t[n])?s[n]=lA(t[n],e[n]):s[n]=e[n]}),s}var C1=class{constructor(t={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...t},this.name=this.config.name}get options(){return{...Xe(ke(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...Xe(ke(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(t={}){const e=this.extend({...this.config,addOptions:()=>lA(this.options,t)});return e.name=this.name,e.parent=this.parent,e}extend(t={}){const e=new this.constructor({...this.config,...t});return e.parent=this,this.child=e,e.name="name"in t?t.name:e.parent.name,e}},ul=class cA extends C1{constructor(){super(...arguments),this.type="mark"}static create(e={}){const s=typeof e=="function"?e():e;return new cA(s)}static handleExit({editor:e,mark:s}){const{tr:n}=e.state,a=e.state.selection.$from;if(a.pos===a.end()){const o=a.marks();if(!!!o.find(d=>(d==null?void 0:d.type.name)===s.name))return!1;const c=o.find(d=>(d==null?void 0:d.type.name)===s.name);return c&&n.removeStoredMark(c),n.insertText(" ",a.pos),e.view.dispatch(n),!0}return!1}configure(e){return super.configure(e)}extend(e){const s=typeof e=="function"?e():e;return super.extend(s)}};function LK(t){return typeof t=="number"}var OK=class{constructor(t){this.find=t.find,this.handler=t.handler}},IK=(t,e,s)=>{if(v1(e))return[...t.matchAll(e)];const n=e(t,s);return n?n.map(a=>{const i=[a.text];return i.index=a.index,i.input=t,i.data=a.data,a.replaceWith&&(a.text.includes(a.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),i.push(a.replaceWith)),i}):[]};function FK(t){const{editor:e,state:s,from:n,to:a,rule:i,pasteEvent:o,dropEvent:l}=t,{commands:c,chain:d,can:u}=new Ax({editor:e,state:s}),h=[];return s.doc.nodesBetween(n,a,(f,p)=>{var g,x,b,y,w;if((x=(g=f.type)==null?void 0:g.spec)!=null&&x.code||!(f.isText||f.isTextblock||f.isInline))return;const N=(w=(y=(b=f.content)==null?void 0:b.size)!=null?y:f.nodeSize)!=null?w:0,j=Math.max(n,p),S=Math.min(a,p+N);if(j>=S)return;const k=f.isText?f.text||"":f.textBetween(j-p,S-p,void 0,"");IK(k,i.find,o).forEach(T=>{if(T.index===void 0)return;const A=j+T.index+1,E=A+T[0].length,L={from:s.tr.mapping.map(A),to:s.tr.mapping.map(E)},D=i.handler({state:s,range:L,match:T,commands:c,chain:d,can:u,pasteEvent:o,dropEvent:l});h.push(D)})}),h.every(f=>f!==null)}var rm=null,$K=t=>{var e;const s=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=s.clipboardData)==null||e.setData("text/html",t),s};function zK(t){const{editor:e,rules:s}=t;let n=null,a=!1,i=!1,o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}const c=({state:u,from:h,to:m,rule:f,pasteEvt:p})=>{const g=u.tr,x=Mx({state:u,transaction:g});if(!(!FK({editor:e,state:x,from:Math.max(h-1,0),to:m.b-1,rule:f,pasteEvent:p,dropEvent:l})||!g.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return o=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,g}};return s.map(u=>new Ct({view(h){const m=p=>{var g;n=(g=h.dom.parentElement)!=null&&g.contains(p.target)?h.dom.parentElement:null,n&&(rm=e)},f=()=>{rm&&(rm=null)};return window.addEventListener("dragstart",m),window.addEventListener("dragend",f),{destroy(){window.removeEventListener("dragstart",m),window.removeEventListener("dragend",f)}}},props:{handleDOMEvents:{drop:(h,m)=>{if(i=n===h.dom.parentElement,l=m,!i){const f=rm;f!=null&&f.isEditable&&setTimeout(()=>{const p=f.state.selection;p&&f.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(h,m)=>{var f;const p=(f=m.clipboardData)==null?void 0:f.getData("text/html");return o=m,a=!!(p!=null&&p.includes("data-pm-slice")),!1}}},appendTransaction:(h,m,f)=>{const p=h[0],g=p.getMeta("uiEvent")==="paste"&&!a,x=p.getMeta("uiEvent")==="drop"&&!i,b=p.getMeta("applyPasteRules"),y=!!b;if(!g&&!x&&!y)return;if(y){let{text:j}=b;typeof j=="string"?j=j:j=N1(se.from(j),f.schema);const{from:S}=b,k=S+j.length,C=$K(j);return c({rule:u,state:f,from:S,to:{b:k},pasteEvt:C})}const w=m.doc.content.findDiffStart(f.doc.content),N=m.doc.content.findDiffEnd(f.doc.content);if(!(!LK(w)||!N||w===N.b))return c({rule:u,state:f,from:w,to:N,pasteEvt:o})}}))}var Ox=class{constructor(t,e){this.splittableMarks=[],this.editor=e,this.baseExtensions=t,this.extensions=eA(t),this.schema=Qq(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((t,e)=>{const s={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:fd(e.name,this.schema)},n=ke(e,"addCommands",s);return n?{...t,...n()}:t},{})}get plugins(){const{editor:t}=this;return su([...this.extensions].reverse()).flatMap(n=>{const a={name:n.name,options:n.options,storage:this.editor.extensionStorage[n.name],editor:t,type:fd(n.name,this.schema)},i=[],o=ke(n,"addKeyboardShortcuts",a);let l={};if(n.type==="mark"&&ke(n,"exitable",a)&&(l.ArrowRight=()=>ul.handleExit({editor:t,mark:n})),o){const m=Object.fromEntries(Object.entries(o()).map(([f,p])=>[f,()=>p({editor:t})]));l={...l,...m}}const c=ZY(l);i.push(c);const d=ke(n,"addInputRules",a);if(XC(n,t.options.enableInputRules)&&d){const m=d();if(m&&m.length){const f=DK({editor:t,rules:m}),p=Array.isArray(f)?f:[f];i.push(...p)}}const u=ke(n,"addPasteRules",a);if(XC(n,t.options.enablePasteRules)&&u){const m=u();if(m&&m.length){const f=zK({editor:t,rules:m});i.push(...f)}}const h=ke(n,"addProseMirrorPlugins",a);if(h){const m=h();i.push(...m)}return i})}get attributes(){return Z5(this.extensions)}get nodeViews(){const{editor:t}=this,{nodeExtensions:e}=_c(this.extensions);return Object.fromEntries(e.filter(s=>!!ke(s,"addNodeView")).map(s=>{const n=this.attributes.filter(c=>c.type===s.name),a={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:t,type:qt(s.name,this.schema)},i=ke(s,"addNodeView",a);if(!i)return[];const o=i();if(!o)return[];const l=(c,d,u,h,m)=>{const f=Tc(c,n);return o({node:c,view:d,getPos:u,decorations:h,innerDecorations:m,editor:t,extension:s,HTMLAttributes:f})};return[s.name,l]}))}dispatchTransaction(t){const{editor:e}=this;return su([...this.extensions].reverse()).reduceRight((n,a)=>{const i={name:a.name,options:a.options,storage:this.editor.extensionStorage[a.name],editor:e,type:fd(a.name,this.schema)},o=ke(a,"dispatchTransaction",i);return o?l=>{o.call(i,{transaction:l,next:n})}:n},t)}transformPastedHTML(t){const{editor:e}=this;return su([...this.extensions]).reduce((n,a)=>{const i={name:a.name,options:a.options,storage:this.editor.extensionStorage[a.name],editor:e,type:fd(a.name,this.schema)},o=ke(a,"transformPastedHTML",i);return o?(l,c)=>{const d=n(l,c);return o.call(i,d)}:n},t||(n=>n))}get markViews(){const{editor:t}=this,{markExtensions:e}=_c(this.extensions);return Object.fromEntries(e.filter(s=>!!ke(s,"addMarkView")).map(s=>{const n=this.attributes.filter(l=>l.type===s.name),a={name:s.name,options:s.options,storage:this.editor.extensionStorage[s.name],editor:t,type:Ha(s.name,this.schema)},i=ke(s,"addMarkView",a);if(!i)return[];const o=(l,c,d)=>{const u=Tc(l,n);return i()({mark:l,view:c,inline:d,editor:t,extension:s,HTMLAttributes:u,updateAttributes:h=>{tJ(l,t,h)}})};return[s.name,o]}))}setupExtensions(){const t=this.extensions;this.editor.extensionStorage=Object.fromEntries(t.map(e=>[e.name,e.storage])),t.forEach(e=>{var s;const n={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:fd(e.name,this.schema)};e.type==="mark"&&((s=Xe(ke(e,"keepOnSplit",n)))==null||s)&&this.splittableMarks.push(e.name);const a=ke(e,"onBeforeCreate",n),i=ke(e,"onCreate",n),o=ke(e,"onUpdate",n),l=ke(e,"onSelectionUpdate",n),c=ke(e,"onTransaction",n),d=ke(e,"onFocus",n),u=ke(e,"onBlur",n),h=ke(e,"onDestroy",n);a&&this.editor.on("beforeCreate",a),i&&this.editor.on("create",i),o&&this.editor.on("update",o),l&&this.editor.on("selectionUpdate",l),c&&this.editor.on("transaction",c),d&&this.editor.on("focus",d),u&&this.editor.on("blur",u),h&&this.editor.on("destroy",h)})}};Ox.resolve=eA;Ox.sort=su;Ox.flatten=j1;var BK={};y1(BK,{ClipboardTextSerializer:()=>uA,Commands:()=>hA,Delete:()=>mA,Drop:()=>fA,Editable:()=>pA,FocusEvents:()=>gA,Keymap:()=>bA,Paste:()=>yA,Tabindex:()=>vA,TextDirection:()=>wA,focusEventsPluginKey:()=>xA});var $t=class dA extends C1{constructor(){super(...arguments),this.type="extension"}static create(e={}){const s=typeof e=="function"?e():e;return new dA(s)}configure(e){return super.configure(e)}extend(e){const s=typeof e=="function"?e():e;return super.extend(s)}},uA=$t.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new Ct({key:new ts("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{const{editor:t}=this,{state:e,schema:s}=t,{doc:n,selection:a}=e,{ranges:i}=a,o=Math.min(...i.map(u=>u.$from.pos)),l=Math.max(...i.map(u=>u.$to.pos)),c=sA(s);return tA(n,{from:o,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:c})}}})]}}),hA=$t.create({name:"commands",addCommands(){return{...H5}}}),mA=$t.create({name:"delete",onUpdate({transaction:t,appendedTransactions:e}){var s,n,a;const i=()=>{var o,l,c,d;if((d=(c=(l=(o=this.editor.options.coreExtensionOptions)==null?void 0:o.delete)==null?void 0:l.filterTransaction)==null?void 0:c.call(l,t))!=null?d:t.getMeta("y-sync$"))return;const u=Q5(t.before,[t,...e]);rA(u).forEach(f=>{u.mapping.mapResult(f.oldRange.from).deletedAfter&&u.mapping.mapResult(f.oldRange.to).deletedBefore&&u.before.nodesBetween(f.oldRange.from,f.oldRange.to,(p,g)=>{const x=g+p.nodeSize-2,b=f.oldRange.from<=g&&x<=f.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:g,to:x,newFrom:u.mapping.map(g),newTo:u.mapping.map(x),deletedRange:f.oldRange,newRange:f.newRange,partial:!b,editor:this.editor,transaction:t,combinedTransform:u})})});const m=u.mapping;u.steps.forEach((f,p)=>{var g,x;if(f instanceof kr){const b=m.slice(p).map(f.from,-1),y=m.slice(p).map(f.to),w=m.invert().map(b,-1),N=m.invert().map(y),j=(g=u.doc.nodeAt(b-1))==null?void 0:g.marks.some(k=>k.eq(f.mark)),S=(x=u.doc.nodeAt(y))==null?void 0:x.marks.some(k=>k.eq(f.mark));this.editor.emit("delete",{type:"mark",mark:f.mark,from:f.from,to:f.to,deletedRange:{from:w,to:N},newRange:{from:b,to:y},partial:!!(S||j),editor:this.editor,transaction:t,combinedTransform:u})}})};(a=(n=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:n.async)==null||a?setTimeout(i,0):i()}}),fA=$t.create({name:"drop",addProseMirrorPlugins(){return[new Ct({key:new ts("tiptapDrop"),props:{handleDrop:(t,e,s,n)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:s,moved:n})}}})]}}),pA=$t.create({name:"editable",addProseMirrorPlugins(){return[new Ct({key:new ts("editable"),props:{editable:()=>this.editor.options.editable}})]}}),xA=new ts("focusEvents"),gA=$t.create({name:"focusEvents",addProseMirrorPlugins(){const{editor:t}=this;return[new Ct({key:xA,props:{handleDOMEvents:{focus:(e,s)=>{t.isFocused=!0;const n=t.state.tr.setMeta("focus",{event:s}).setMeta("addToHistory",!1);return e.dispatch(n),!1},blur:(e,s)=>{t.isFocused=!1;const n=t.state.tr.setMeta("blur",{event:s}).setMeta("addToHistory",!1);return e.dispatch(n),!1}}}})]}}),bA=$t.create({name:"keymap",addKeyboardShortcuts(){const t=()=>this.editor.commands.first(({commands:o})=>[()=>o.undoInputRule(),()=>o.command(({tr:l})=>{const{selection:c,doc:d}=l,{empty:u,$anchor:h}=c,{pos:m,parent:f}=h,p=h.parent.isTextblock&&m>0?l.doc.resolve(m-1):h,g=p.parent.type.spec.isolating,x=h.pos-h.parentOffset,b=g&&p.parent.childCount===1?x===h.pos:Fe.atStart(d).from===m;return!u||!f.type.isTextblock||f.textContent.length||!b||b&&h.parent.type.name==="paragraph"?!1:o.clearNodes()}),()=>o.deleteSelection(),()=>o.joinBackward(),()=>o.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:o})=>[()=>o.deleteSelection(),()=>o.deleteCurrentNode(),()=>o.joinForward(),()=>o.selectNodeForward()]),n={Enter:()=>this.editor.commands.first(({commands:o})=>[()=>o.newlineInCode(),()=>o.createParagraphNear(),()=>o.liftEmptyBlock(),()=>o.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:t,"Mod-Backspace":t,"Shift-Backspace":t,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},a={...n},i={...n,"Ctrl-h":t,"Alt-Backspace":t,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return Hu()||K5()?i:a},addProseMirrorPlugins(){return[new Ct({key:new ts("clearDocument"),appendTransaction:(t,e,s)=>{if(t.some(g=>g.getMeta("composition")))return;const n=t.some(g=>g.docChanged)&&!e.doc.eq(s.doc),a=t.some(g=>g.getMeta("preventClearDocument"));if(!n||a)return;const{empty:i,from:o,to:l}=e.selection,c=Fe.atStart(e.doc).from,d=Fe.atEnd(e.doc).to;if(i||!(o===c&&l===d)||!Rx(s.doc))return;const m=s.tr,f=Mx({state:s,transaction:m}),{commands:p}=new Ax({editor:this.editor,state:f});if(p.clearNodes(),!!m.steps.length)return m}})]}}),yA=$t.create({name:"paste",addProseMirrorPlugins(){return[new Ct({key:new ts("tiptapPaste"),props:{handlePaste:(t,e,s)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:s})}}})]}}),vA=$t.create({name:"tabindex",addProseMirrorPlugins(){return[new Ct({key:new ts("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),wA=$t.create({name:"textDirection",addOptions(){return{direction:void 0}},addGlobalAttributes(){if(!this.options.direction)return[];const{nodeExtensions:t}=_c(this.extensions);return[{types:t.filter(e=>e.name!=="text").map(e=>e.name),attributes:{dir:{default:this.options.direction,parseHTML:e=>{const s=e.getAttribute("dir");return s&&(s==="ltr"||s==="rtl"||s==="auto")?s:this.options.direction},renderHTML:e=>e.dir?{dir:e.dir}:{}}}}]},addProseMirrorPlugins(){return[new Ct({key:new ts("textDirection"),props:{attributes:()=>{const t=this.options.direction;return t?{dir:t}:{}}}})]}}),VK=class Pd{constructor(e,s,n=!1,a=null){this.currentNode=null,this.actualDepth=null,this.isBlock=n,this.resolvedPos=e,this.editor=s,this.currentNode=a}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let s=this.from,n=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You canât set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}s=this.from+1,n=this.to-1}this.editor.commands.insertContentAt({from:s,to:n},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;const e=this.resolvedPos.start(this.resolvedPos.depth-1),s=this.resolvedPos.doc.resolve(e);return new Pd(s,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new Pd(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new Pd(e,this.editor)}get children(){const e=[];return this.node.content.forEach((s,n)=>{const a=s.isBlock&&!s.isTextblock,i=s.isAtom&&!s.isText,o=s.isInline,l=this.pos+n+(i?0:1);if(l<0||l>this.resolvedPos.doc.nodeSize-2)return;const c=this.resolvedPos.doc.resolve(l);if(!a&&!o&&c.depth<=this.depth)return;const d=new Pd(c,this.editor,a,a||o?s:null);a&&(d.actualDepth=this.depth+1),e.push(d)}),e}get firstChild(){return this.children[0]||null}get lastChild(){const e=this.children;return e[e.length-1]||null}closest(e,s={}){let n=null,a=this.parent;for(;a&&!n;){if(a.node.type.name===e)if(Object.keys(s).length>0){const i=a.node.attrs,o=Object.keys(s);for(let l=0;l<o.length;l+=1){const c=o[l];if(i[c]!==s[c])break}}else n=a;a=a.parent}return n}querySelector(e,s={}){return this.querySelectorAll(e,s,!0)[0]||null}querySelectorAll(e,s={},n=!1){let a=[];if(!this.children||this.children.length===0)return a;const i=Object.keys(s);return this.children.forEach(o=>{n&&a.length>0||(o.node.type.name===e&&i.every(c=>s[c]===o.node.attrs[c])&&a.push(o),!(n&&a.length>0)&&(a=a.concat(o.querySelectorAll(e,s,n))))}),a}setAttribute(e){const{tr:s}=this.editor.state;s.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(s)}},UK=`.ProseMirror { 746 position: relative; 747} 748 749.ProseMirror { 750 word-wrap: break-word; 751 white-space: pre-wrap; 752 white-space: break-spaces; 753 -webkit-font-variant-ligatures: none; 754 font-variant-ligatures: none; 755 font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */ 756} 757 758.ProseMirror [contenteditable="false"] { 759 white-space: normal; 760} 761 762.ProseMirror [contenteditable="false"] [contenteditable="true"] { 763 white-space: pre-wrap; 764} 765 766.ProseMirror pre { 767 white-space: pre-wrap; 768} 769 770img.ProseMirror-separator { 771 display: inline !important; 772 border: none !important; 773 margin: 0 !important; 774 width: 0 !important; 775 height: 0 !important; 776} 777 778.ProseMirror-gapcursor { 779 display: none; 780 pointer-events: none; 781 position: absolute; 782 margin: 0; 783} 784 785.ProseMirror-gapcursor:after {
786 content: ""; 787 display: block; 788 position: absolute; 789 top: -2px; 790 width: 20px; 791 border-top: 1px solid black; 792 animation: ProseMirror-cursor-blink 1.1s steps(2, start) infinite; 793} 794 795@keyframes ProseMirror-cursor-blink { 796 to { 797 visibility: hidden; 798 } 799} 800 801.ProseMirror-hideselection *::selection { 802 background: transparent; 803} 804 805.ProseMirror-hideselection *::-moz-selection { 806 background: transparent; 807} 808 809.ProseMirror-hideselection * { 810 caret-color: transparent; 811} 812 813.ProseMirror-focused .ProseMirror-gapcursor { 814 display: block; 815}`;function HK(t,e,s){const n=document.querySelector("style[data-tiptap-style]");if(n!==null)return n;const a=document.createElement("style");return e&&a.setAttribute("nonce",e),a.setAttribute("data-tiptap-style",""),a.innerHTML=t,document.getElementsByTagName("head")[0].appendChild(a),a}var WK=class extends AK{constructor(t={}){super(),this.css=null,this.className="tiptap",this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,textDirection:void 0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,emitContentError:!1,onBeforeCreate:()=>null,onCreate:()=>null,onMount:()=>null,onUnmount:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:n})=>{throw n},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null,enableExtensionDispatchTransaction:!0},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.utils={getUpdatedPosition:lK,createMappablePosition:cK},this.setOptions(t),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("mount",this.options.onMount),this.on("unmount",this.options.onUnmount),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:n,slice:a,moved:i})=>this.options.onDrop(n,a,i)),this.on("paste",({event:n,slice:a})=>this.options.onPaste(n,a)),this.on("delete",this.options.onDelete);const e=this.createDoc(),s=Y5(e,this.options.autofocus);this.editorState=ec.create({doc:e,schema:this.schema,selection:s||void 0}),this.options.element&&this.mount(this.options.element)}mount(t){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(t),this.emit("mount",{editor:this}),this.css&&!document.head.contains(this.css)&&document.head.appendChild(this.css),window.setTimeout(()=>{this.isDestroyed||(this.options.autofocus!==!1&&this.options.autofocus!==null&&this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){if(this.editorView){const t=this.editorView.dom;t!=null&&t.editor&&delete t.editor,this.editorView.destroy()}if(this.editorView=null,this.isInitialized=!1,this.css&&!document.querySelectorAll(`.${this.className}`).length)try{typeof this.css.remove=="function"?this.css.remove():this.css.parentNode&&this.css.parentNode.removeChild(this.css)}catch(t){console.warn("Failed to remove CSS element:",t)}this.css=null,this.emit("unmount",{editor:this})}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=HK(UK,this.options.injectNonce))}setOptions(t={}){this.options={...this.options,...t},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(t,e=!0){this.setOptions({editable:t}
vendor: 8,522 bytes, lines 815-817
815),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:t=>{this.editorState=t},dispatch:t=>{this.dispatchTransaction(t)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(t,e)=>{if(this.editorView)return this.editorView[e];if(e==="state")return this.editorState;if(e in t)return Reflect.get(t,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(t,e){const s=X5(e)?e(t,[...this.state.plugins]):[...this.state.plugins,t],n=this.state.reconfigure({plugins:s});return this.view.updateState(n),n}unregisterPlugin(t){if(this.isDestroyed)return;const e=this.state.plugins;let s=e;if([].concat(t).forEach(a=>{const i=typeof a=="string"?`${a}$`:a.key;s=s.filter(o=>!o.key.startsWith(i))}),e.length===s.length)return;const n=this.state.reconfigure({plugins:s});return this.view.updateState(n),n}createExtensionManager(){var t,e;const n=[...this.options.enableCoreExtensions?[pA,uA.configure({blockSeparator:(e=(t=this.options.coreExtensionOptions)==null?void 0:t.clipboardTextSerializer)==null?void 0:e.blockSeparator}),hA,gA,bA,vA,fA,yA,mA,wA.configure({direction:this.options.textDirection})].filter(a=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[a.name]!==!1:!0):[],...this.options.extensions].filter(a=>["extension","node","mark"].includes(a==null?void 0:a.type));this.extensionManager=new Ox(n,this)}createCommandManager(){this.commandManager=new Ax({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let t;try{t=Fy(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(s=>s.name!=="collaboration"),this.createExtensionManager()}}),t=Fy(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return t}createView(t){const{editorProps:e,enableExtensionDispatchTransaction:s}=this.options,n=e.dispatchTransaction||this.dispatchTransaction.bind(this),a=s?this.extensionManager.dispatchTransaction(n):n,i=e.transformPastedHTML,o=this.extensionManager.transformPastedHTML(i);this.editorView=new V5(t,{...e,attributes:{role:"textbox",...e==null?void 0:e.attributes},dispatchTransaction:a,transformPastedHTML:o,state:this.editorState,markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews});const l=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(l),this.prependClass(),this.injectCSS();const c=this.view.dom;c.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`${this.className} ${this.view.dom.className}`}captureTransaction(t){this.isCapturingTransaction=!0,t(),this.isCapturingTransaction=!1;const e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(t){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=t;return}t.steps.forEach(d=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(d)});return}const{state:e,transactions:s}=this.state.applyTransaction(t),n=!this.state.selection.eq(e.selection),a=s.includes(t),i=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:t,nextState:e}),!a)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:t,appendedTransactions:s.slice(1)}),n&&this.emit("selectionUpdate",{editor:this,transaction:t});const o=s.findLast(d=>d.getMeta("focus")||d.getMeta("blur")),l=o==null?void 0:o.getMeta("focus"),c=o==null?void 0:o.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:o}),c&&this.emit("blur",{editor:this,event:c.event,transaction:o}),!(t.getMeta("preventUpdate")||!s.some(d=>d.docChanged)||i.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:t,appendedTransactions:s.slice(1)})}getAttributes(t){return nA(this.state,t)}isActive(t,e){const s=typeof t=="string"?t:null,n=typeof t=="string"?e:t;return aK(this.state,s,n)}getJSON(){return this.state.doc.toJSON()}getHTML(){return N1(this.state.doc.content,this.schema)}getText(t){const{blockSeparator:e=` 816 817`,textSerializers:s={}}=t||{};return Zq(this.state.doc,{blockSeparator:e,textSerializers:{...sA(this.schema),...s}})}get isEmpty(){return Rx(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var t,e;return(e=(t=this.editorView)==null?void 0:t.isDestroyed)!=null?e:!0}$node(t,e){var s;return((s=this.$doc)==null?void 0:s.querySelector(t,e))||null}$nodes(t,e){var s;return((s=this.$doc)==null?void 0:s.querySelectorAll(t,e))||null}$pos(t){const e=this.state.doc.resolve(t);return new VK(e,this)}get $doc(){return this.$pos(0)}};function Ec(t){return new Lx({find:t.find,handler:({state:e,range:s,match:n})=>{const a=Xe(t.getAttributes,void 0,n);if(a===!1||a===null)return null;const{tr:i}=e,o=n[n.length-1],l=n[0];if(o){const c=l.search(/\S/),d=s.from+l.indexOf(o),u=d+o.length;if(k1(s.from,s.to,e.doc).filter(f=>f.mark.type.excluded.find(g=>g===t.type&&g!==f.mark.type)).filter(f=>f.to>d).length)return null;u<s.to&&i.delete(u,s.to),d>s.from&&i.delete(s.from+c,d);const m=s.from+c+o.length;i.addMark(s.from+c,m,t.type.create(a||{})),i.removeStoredMark(t.type)}},undoable:t.undoable})}function jA(t){return new Lx({find:t.find,handler:({state:e,range:s,match:n})=>{const a=Xe(t.getAttributes,void 0,n)||{},{tr:i}=e,o=s.from;let l=s.to;const c=t.type.create(a);if(n[1]){const d=n[0].lastIndexOf(n[1]);let u=o+d;u>l?u=l:l=u+n[1].length;const h=n[0][n[0].length-1];i.insertText(h,o+n[0].length-1),i.replaceWith(u,l,c)}else if(n[0]){const d=t.type.isInline?o:o-1;i.insert(d,t.type.create(a)).delete(i.mapping.map(o),i.mapping.map(l))}i.scrollIntoView()},undoable:t.undoable})}function zy(t){return new Lx({find:t.find,handler:({state:e,range:s,match:n})=>{const a=e.doc.resolve(s.from),i=Xe(t.getAttributes,void 0,n)||{};if(!a.node(-1).canReplaceWith(a.index(-1),a.indexAfter(-1),t.type))return null;e.tr.delete(s.from,s.to).setBlockType(s.from,s.from,t.type,i)},undoable:t.undoable})}function Mc(t){return new Lx({find:t.find,handler:({state:e,range:s,match:n,chain:a})=>{const i=Xe(t.getAttributes,void 0,n)||{},o=e.tr.delete(s.from,s.to),c=o.doc.resolve(s.from).blockRange(),d=c&&n1(c,t.type,i);if(!d)return null;if(o.wrap(c,d),t.keepMarks&&t.editor){const{selection:h,storedMarks:m}=e,{splittableMarks:f}=t.editor.extensionManager,p=m||h.$to.parentOffset&&h.$from.marks();if(p){const g=p.filter(x=>f.includes(x.type.name));o.ensureMarks(g)}}if(t.keepAttributes){const h=t.type.name==="bulletList"||t.type.name==="orderedList"?"listItem":"taskList";a().updateAttributes(h,i).run()}const u=o.doc.resolve(s.from-1).nodeBefore;u&&u.type===t.type&&no(o.doc,s.from-1)&&(!t.joinPredicate||t.joinPredicate(n,u))&&o.join(s.from-1)},undoable:t.undoable})}var GK=t=>"touches"in t,YK=class{constructor(t){this.directions=["bottom-left","bottom-right","top-left","top-right"],this.minSize={height:8,width:8},this.preserveAspectRatio=!1,this.classNames={container:"",wrapper:"",handle:"",resizing:""},this.initialWidth=0,this.initialHeight=0,this.aspectRatio=1,this.isResizing=!1,this.activeHandle=null,this.startX=0,this.startY=0,this.startWidth=0,this.startHeight=0,this.isShiftKeyPressed=!1,this.lastEditableState=void 0,this.handleMap=new Map,this.handleMouseMove=l=>{if(!this.isResizing||!this.activeHandle)return;const c=l.clientX-this.startX,d=l.clientY-this.startY;this.handleResize(c,d)},this.handleTouchMove=l=>{if(!this.isResizing||!this.activeHandle)return;const c=l.touches[0];if(!c)return;const d=c.clientX-this.startX,u=c.clientY-this.startY;this.handleResize(d,u)},this.handleMouseUp=()=>
817{if(!this.isResizing)return;const l=this.element.offsetWidth,c=this.element.offsetHeight;this.onCommit(l,c),this.isResizing=!1,this.activeHandle=null,this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp)},this.handleKeyDown=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!0)},this.handleKeyUp=l=>{l.key==="Shift"&&(this.isShiftKeyPressed=!1)};var e,s,n,a,i,o;this.node=t.node,this.editor=t.editor,this.element=t.element,this.contentElement=t.contentElement,this.getPos=t.getPos,this.onResize=t.onResize,this.onCommit=t.onCommit,this.onUpdate=t.onUpdate,(e=t.options)!=null&&e.min&&(this.minSize={...this.minSize,...t.options.min}),(s=t.options)!=null&&s.max&&(this.maxSize=t.options.max),(n=t==null?void 0:t.options)!=null&&n.directions&&(this.directions=t.options.directions),(a=t.options)!=null&&a.preserveAspectRatio&&(this.preserveAspectRatio=t.options.preserveAspectRatio),(i=t.options)!=null&&i.className&&(this.classNames={container:t.options.className.container||"",wrapper:t.options.className.wrapper||"",handle:t.options.className.handle||"",resizing:t.options.className.resizing||""}),(o=t.options)!=null&&o.createCustomHandle&&(this.createCustomHandle=t.options.createCustomHandle),this.wrapper=this.createWrapper(),this.container=this.createContainer(),this.applyInitialSize(),this.attachHandles(),this.editor.on("update",this.handleEditorUpdate.bind(this))}get dom(){return this.container}get contentDOM(){var t;return(t=this.contentElement)!=null?t:null}handleEditorUpdate(){const t=this.editor.isEditable;t!==this.lastEditableState&&(this.lastEditableState=t,t?t&&this.handleMap.size===0&&this.attachHandles():this.removeHandles())}update(t,e,s){return t.type!==this.node.type?!1:(this.node=t,this.onUpdate?this.onUpdate(t,e,s):!0)}destroy(){this.isResizing&&(this.container.dataset.resizeState="false",this.classNames.resizing&&this.container.classList.remove(this.classNames.resizing),document.removeEventListener("mousemove",this.handleMouseMove),document.removeEventListener("mouseup",this.handleMouseUp),document.removeEventListener("keydown",this.handleKeyDown),document.removeEventListener("keyup",this.handleKeyUp),this.isResizing=!1,this.activeHandle=null),this.editor.off("update",this.handleEditorUpdate.bind(this)),this.container.remove()}createContainer(){const t=document.createElement("div");return t.dataset.resizeContainer="",t.dataset.node=this.node.type.name,t.style.display="flex",this.classNames.container&&(t.className=this.classNames.container),t.appendChild(this.wrapper),t}createWrapper(){const t=document.createElement("div");return t.style.position="relative",t.style.display="block",t.dataset.resizeWrapper="",this.classNames.wrapper&&(t.className=this.classNames.wrapper),t.appendChild(this.element),t}createHandle(t){const e=document.createElement("div");return e.dataset.resizeHandle=t,e.style.position="absolute",this.classNames.handle&&(e.className=this.classNames.handle),e}positionHandle(t,e){const s=e.includes("top"),n=e.includes("bottom"),a=e.includes("left"),i=e.includes("right");s&&(t.style.top="0"),n&&(t.style.bottom="0"),a&&(t.style.left="0"),i&&(t.style.right="0"),(e==="top"||e==="bottom")&&(t.style.left="0",t.style.right="0"),(e==="left"||e==="right")&&(t.style.top="0",t.style.bottom="0")}attachHandles(){this.directions.forEach(t=>{let e;this.createCustomHandle?e=this.createCustomHandle(t):e=this.createHandle(t),e instanceof HTMLElement||(console.warn(`[ResizableNodeView] createCustomHandle("${t}") did not return an HTMLElement. Falling back to default handle.`),e=this.createHandle(t)),this.createCustomHandle||this.positionHandle(e,t),e.addEventListener("mousedown",s=>this.handleResizeStart(s,t)),e.addEventListener("touchstart",s=>this.handleResizeStart(s,t)),this.handleMap.set(t,e),this.wrapper.appendChild(e)})}
817removeHandles(){this.handleMap.forEach(t=>t.remove()),this.handleMap.clear()}applyInitialSize(){const t=this.node.attrs.width,e=this.node.attrs.height;t?(this.element.style.width=`${t}px`,this.initialWidth=t):this.initialWidth=this.element.offsetWidth,e?(this.element.style.height=`${e}px`,this.initialHeight=e):this.initialHeight=this.element.offsetHeight,this.initialWidth>0&&this.initialHeight>0&&(this.aspectRatio=this.initialWidth/this.initialHeight)}handleResizeStart(t,e){t.preventDefault(),t.stopPropagation(),this.isResizing=!0,this.activeHandle=e,GK(t)?(this.startX=t.touches[0].clientX,this.startY=t.touches[0].clientY):(this.startX=t.clientX,this.startY=t.clientY),this.startWidth=this.element.offsetWidth,this.startHeight=this.element.offsetHeight,this.startWidth>0&&this.startHeight>0&&(this.aspectRatio=this.startWidth/this.startHeight),this.getPos(),this.container.dataset.resizeState="true",this.classNames.resizing&&this.container.classList.add(this.classNames.resizing),document.addEventListener("mousemove",this.handleMouseMove),document.addEventListener("touchmove",this.handleTouchMove),document.addEventListener("mouseup",this.handleMouseUp),document.addEventListener("keydown",this.handleKeyDown),document.addEventListener("keyup",this.handleKeyUp)}handleResize(t,e){if(!this.activeHandle)return;const s=this.preserveAspectRatio||this.isShiftKeyPressed,{width:n,height:a}=this.calculateNewDimensions(this.activeHandle,t,e),i=this.applyConstraints(n,a,s);this.element.style.width=`${i.width}px`,this.element.style.height=`${i.height}px`,this.onResize&&this.onResize(i.width,i.height)}calculateNewDimensions(t,e,s){let n=this.startWidth,a=this.startHeight;const i=t.includes("right"),o=t.includes("left"),l=t.includes("bottom"),c=t.includes("top");return i?n=this.startWidth+e:o&&(n=this.startWidth-e),l?a=this.startHeight+s:c&&(a=this.startHeight-s),(t==="right"||t==="left")&&(n=this.startWidth+(i?e:-e)),(t==="top"||t==="bottom")&&(a=this.startHeight+(l?s:-s)),this.preserveAspectRatio||this.isShiftKeyPressed?this.applyAspectRatio(n,a,t):{width:n,height:a}}applyConstraints(t,e,s){var n,a,i,o;if(!s){let d=Math.max(this.minSize.width,t),u=Math.max(this.minSize.height,e);return(n=this.maxSize)!=null&&n.width&&(d=Math.min(this.maxSize.width,d)),(a=this.maxSize)!=null&&a.height&&(u=Math.min(this.maxSize.height,u)),{width:d,height:u}}let l=t,c=e;return l<this.minSize.width&&(l=this.minSize.width,c=l/this.aspectRatio),c<this.minSize.height&&(c=this.minSize.height,l=c*this.aspectRatio),(i=this.maxSize)!=null&&i.width&&l>this.maxSize.width&&(l=this.maxSize.width,c=l/this.aspectRatio),(o=this.maxSize)!=null&&o.height&&c>this.maxSize.height&&(c=this.maxSize.height,l=c*this.aspectRatio),{width:l,height:c}}applyAspectRatio(t,e,s){const n=s==="left"||s==="right",a=s==="top"||s==="bottom";return n?{width:t,height:t/this.aspectRatio}:a?{width:e*this.aspectRatio,height:e}:{width:t,height:t/this.aspectRatio}}};function qK(t,e){const{selection:s}=t,{$from:n}=s;if(s instanceof Ce){const i=n.index();return n.parent.canReplaceWith(i,i+1,e)}let a=n.depth;for(;a>=0;){const i=n.index(a);if(n.node(a).contentMatchAt(i).matchType(e))return!0;a-=1}return!1}var KK={};y1(KK,{createAtomBlockMarkdownSpec:()=>JK,createBlockMarkdownSpec:()=>QK,createInlineMarkdownSpec:()=>eJ,parseAttributes:()=>S1,parseIndentedBlocks:()=>By,renderNestedMarkdownContent:()=>T1,serializeAttributes:()=>_1});function S1(t){if(!(t!=null&&t.trim()))return{};const e={},s=[],n=t.replace(/["']([^"']*)["']/g,d=>(s.push(d),`__QUOTED_${s.length-1}__`)),a=n.match(/(?:^|\s)\.([a-zA-Z][\w-]*)/g);if(a){const d=a.map(u=>u.trim().slice(1));e.class=d.join(" ")}const i=n.match(/(?:^|\s)#([a-zA-Z][\w-]*)/);i&&(e.id=i[1]);const o=/([a-zA-Z][\w-]*)\s*=\s*(__QUOTED_\d+__)/g;Array.from(n.matchAll(o)).forEach(([,d,u])=>{var h;const m=parseInt(((h=u.match(/__QUOTED_(\d+)__/))==null?void 0:h[1])||"0",10),f=s[m];f&&(e[d]=f.slice(1,-1))});const c=n.replace(/(?:^|\s)\.([a-zA-Z][\w-]*)/g,"").replace(/(?:^|\s)#([a-zA-Z][\w-]*)/g,"").replace(/([a-zA-Z][\w-]*)\s*=\s*__QUOTED_\d+__/g,"").trim();
vendor: 5,797 bytes, lines 817-832
817return c&&c.split(/\s+/).filter(Boolean).forEach(u=>{u.match(/^[a-zA-Z][\w-]*$/)&&(e[u]=!0)}),e}function _1(t){if(!t||Object.keys(t).length===0)return"";const e=[];return t.class&&String(t.class).split(/\s+/).filter(Boolean).forEach(n=>e.push(`.${n}`)),t.id&&e.push(`#${t.id}`),Object.entries(t).forEach(([s,n])=>{s==="class"||s==="id"||(n===!0?e.push(s):n!==!1&&n!=null&&e.push(`${s}="${String(n)}"`))}),e.join(" ")}function JK(t){const{nodeName:e,name:s,parseAttributes:n=S1,serializeAttributes:a=_1,defaultAttributes:i={},requiredAttributes:o=[],allowedAttributes:l}=t,c=s||e,d=u=>{if(!l)return u;const h={};return l.forEach(m=>{m in u&&(h[m]=u[m])}),h};return{parseMarkdown:(u,h)=>{const m={...i,...u.attributes};return h.createNode(e,m,[])},markdownTokenizer:{name:e,level:"block",start(u){var h;const m=new RegExp(`^:::${c}(?:\\s|$)`,"m"),f=(h=u.match(m))==null?void 0:h.index;return f!==void 0?f:-1},tokenize(u,h,m){const f=new RegExp(`^:::${c}(?:\\s+\\{([^}]*)\\})?\\s*:::(?:\\n|$)`),p=u.match(f);if(!p)return;const g=p[1]||"",x=n(g);if(!o.find(y=>!(y in x)))return{type:e,raw:p[0],attributes:x}}},renderMarkdown:u=>{const h=d(u.attrs||{}),m=a(h),f=m?` {${m}}`:"";return`:::${c}${f} :::`}}}function QK(t){const{nodeName:e,name:s,getContent:n,parseAttributes:a=S1,serializeAttributes:i=_1,defaultAttributes:o={},content:l="block",allowedAttributes:c}=t,d=s||e,u=h=>{if(!c)return h;const m={};return c.forEach(f=>{f in h&&(m[f]=h[f])}),m};return{parseMarkdown:(h,m)=>{let f;if(n){const g=n(h);f=typeof g=="string"?[{type:"text",text:g}]:g}else l==="block"?f=m.parseChildren(h.tokens||[]):f=m.parseInline(h.tokens||[]);const p={...o,...h.attributes};return m.createNode(e,p,f)},markdownTokenizer:{name:e,level:"block",start(h){var m;const f=new RegExp(`^:::${d}`,"m"),p=(m=h.match(f))==null?void 0:m.index;return p!==void 0?p:-1},tokenize(h,m,f){var p;const g=new RegExp(`^:::${d}(?:\\s+\\{([^}]*)\\})?\\s*\\n`),x=h.match(g);if(!x)return;const[b,y=""]=x,w=a(y);let N=1;const j=b.length;let S="";const k=/^:::([\w-]*)(\s.*)?/gm,C=h.slice(j);for(k.lastIndex=0;;){const T=k.exec(C);if(T===null)break;const A=T.index,E=T[1];if(!((p=T[2])!=null&&p.endsWith(":::"))){if(E)N+=1;else if(N-=1,N===0){const L=C.slice(0,A);S=L.trim();const D=h.slice(0,j+A+T[0].length);let P=[];if(S)if(l==="block")for(P=f.blockTokens(L),P.forEach(R=>{R.text&&(!R.tokens||R.tokens.length===0)&&(R.tokens=f.inlineTokens(R.text))});P.length>0;){const R=P[P.length-1];if(R.type==="paragraph"&&(!R.text||R.text.trim()===""))P.pop();else break}else P=f.inlineTokens(S);return{type:e,raw:D,attributes:w,content:S,tokens:P}}}}}},renderMarkdown:(h,m)=>{const f=u(h.attrs||{}),p=i(f),g=p?` {${p}}`:"",x=m.renderChildren(h.content||[],` 818 819`);return`:::${d}${g} 820 821${x} 822 823:::`}}}function XK(t){if(!t.trim())return{};const e={},s=/(\w+)=(?:"([^"]*)"|'([^']*)')/g;let n=s.exec(t);for(;n!==null;){const[,a,i,o]=n;e[a]=i||o,n=s.exec(t)}return e}function ZK(t){return Object.entries(t).filter(([,e])=>e!=null).map(([e,s])=>`${e}="${s}"`).join(" ")}function eJ(t){const{nodeName:e,name:s,getContent:n,parseAttributes:a=XK,serializeAttributes:i=ZK,defaultAttributes:o={},selfClosing:l=!1,allowedAttributes:c}=t,d=s||e,u=m=>{if(!c)return m;const f={};return c.forEach(p=>{const g=typeof p=="string"?p:p.name,x=typeof p=="string"?void 0:p.skipIfDefault;if(g in m){const b=m[g];if(x!==void 0&&b===x)return;f[g]=b}}),f},h=d.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return{parseMarkdown:(m,f)=>{const p={...o,...m.attributes};if(l)return f.createNode(e,p);const g=n?n(m):m.content||"";return g?f.createNode(e,p,[f.createTextNode(g)]):f.createNode(e,p,[])},markdownTokenizer:{name:e,level:"inline",start(m){const f=l?new RegExp(`\\[${h}\\s*[^\\]]*\\]`):new RegExp(`\\[${h}\\s*[^\\]]*\\][\\s\\S]*?\\[\\/${h}\\]`),p=m.match(f),g=p==null?void 0:p.index;return g!==void 0?g:-1},tokenize(m,f,p){const g=l?new RegExp(`^\\[${h}\\s*([^\\]]*)\\]`):new RegExp(`^\\[${h}\\s*([^\\]]*)\\]([\\s\\S]*?)\\[\\/${h}\\]`),x=m.match(g);if(!x)return;let b="",y="";if(l){const[,N]=x;y=N}else{const[,N,j]=x;y=N,b=j||""}const w=a(y.trim());return{type:e,raw:x[0],content:b.trim(),attributes:w}}},renderMarkdown:m=>{let f="";n?f=n(m):m.content&&m.content.length>0&&(f=m.content.filter(b=>b.type==="text").map(b=>b.text).join(""));const p=u(m.attrs||{}),g=i(p),x=g?` ${g}`:"";return l?`[${d}${x}]`:`[${d}${x}]${f}[/${d}]`}}}function By(t,e,s){var n,a,i,o;const l=t.split(` 824`),c=[];let d="",u=0;const h=e.baseIndentSize||2;for(;u<l.length;){const m=l[u],f=m.match(e.itemPattern);if(!f){if(c.length>0)break;if(m.trim()===""){u+=1,d=`${d}${m} 825`;continue}else return}const p=e.extractItemData(f),{indentLevel:g,mainContent:x}=p;d=`${d}${m} 826`;const b=[x];for(u+=1;u<l.length;){const j=l[u];if(j.trim()===""){const k=l.slice(u+1).findIndex(A=>A.trim()!=="");if(k===-1)break;if((((a=(n=l[u+1+k].match(/^(\s*)/))==null?void 0:n[1])==null?void 0:a.length)||0)>g){b.push(j),d=`${d}${j} 827`,u+=1;continue}else break}if((((o=(i=j.match(/^(\s*)/))==null?void 0:i[1])==null?void 0:o.length)||0)>g)b.push(j),d=`${d}${j} 828`,u+=1;else break}let y;const w=b.slice(1);if(w.length>0){const j=w.map(S=>S.slice(g+h)).join(` 829`);j.trim()&&(e.customNestedParser?y=e.customNestedParser(j):y=s.blockTokens(j))}const N=e.createToken(p,y);c.push(N)}if(c.length!==0)return{items:c,raw:d}}function T1(t,e,s,n){if(!t||!Array.isArray(t.content))return"";const a=typeof s=="function"?s(n):s,[i,...o]=t.content,l=e.renderChildren([i]),c=[`${a}${l}`];return o&&o.length>0&&o.forEach(d=>{const u=e.renderChildren([d]);if(u){const h=u.split(` 830`).map(m=>m?e.indent(m):"").join(` 831`);c.push(h)}}),c.join(` 832`)}function tJ(t,e,s={}){const{state:n}=e,{doc:a,tr:i}=n,o=t;a.descendants((l,c)=>{const d=i.mapping.map(c),u=i.mapping.map(c)+l.nodeSize;let h=null;if(l.marks.forEach(f=>{if(f!==o)return!1;h=f}),!h)return;let m=!1;
832if(Object.keys(s).forEach(f=>{s[f]!==h.attrs[f]&&(m=!0)}),m){const f=t.type.create({...t.attrs,...s});i.removeMark(d,u,t.type),i.addMark(d,u,f)}}),i.docChanged&&e.view.dispatch(i)}var tn=class NA extends C1{constructor(){super(...arguments),this.type="node"}static create(e={}){const s=typeof e=="function"?e():e;return new NA(s)}configure(e){return super.configure(e)}extend(e){const s=typeof e=="function"?e():e;return super.extend(s)}},sJ=class{constructor(t,e,s){this.isDragging=!1,this.component=t,this.editor=e.editor,this.options={stopEvent:null,ignoreMutation:null,...s},this.extension=e.extension,this.node=e.node,this.decorations=e.decorations,this.innerDecorations=e.innerDecorations,this.view=e.view,this.HTMLAttributes=e.HTMLAttributes,this.getPos=e.getPos,this.mount()}mount(){}get dom(){return this.editor.view.dom}get contentDOM(){return null}onDragStart(t){var e,s,n,a,i,o,l;const{view:c}=this.editor,d=t.target,u=d.nodeType===3?(e=d.parentElement)==null?void 0:e.closest("[data-drag-handle]"):d.closest("[data-drag-handle]");if(!this.dom||(s=this.contentDOM)!=null&&s.contains(d)||!u)return;let h=0,m=0;if(this.dom!==u){const y=this.dom.getBoundingClientRect(),w=u.getBoundingClientRect(),N=(a=t.offsetX)!=null?a:(n=t.nativeEvent)==null?void 0:n.offsetX,j=(o=t.offsetY)!=null?o:(i=t.nativeEvent)==null?void 0:i.offsetY;h=w.x-y.x+N,m=w.y-y.y+j}const f=this.dom.cloneNode(!0);try{const y=this.dom.getBoundingClientRect();f.style.width=`${Math.round(y.width)}px`,f.style.height=`${Math.round(y.height)}px`,f.style.boxSizing="border-box",f.style.pointerEvents="none"}catch{}let p=null;try{p=document.createElement("div"),p.style.position="absolute",p.style.top="-9999px",p.style.left="-9999px",p.style.pointerEvents="none",p.appendChild(f),document.body.appendChild(p),(l=t.dataTransfer)==null||l.setDragImage(f,h,m)}finally{p&&setTimeout(()=>{try{p==null||p.remove()}catch{}},0)}const g=this.getPos();if(typeof g!="number")return;const x=Ce.create(c.state.doc,g),b=c.state.tr.setSelection(x);c.dispatch(b)}stopEvent(t){var e;if(!this.dom)return!1;if(typeof this.options.stopEvent=="function")return this.options.stopEvent({event:t});const s=t.target;if(!(this.dom.contains(s)&&!((e=this.contentDOM)!=null&&e.contains(s))))return!1;const a=t.type.startsWith("drag"),i=t.type==="drop";if((["INPUT","BUTTON","SELECT","TEXTAREA"].includes(s.tagName)||s.isContentEditable)&&!i&&!a)return!0;const{isEditable:l}=this.editor,{isDragging:c}=this,d=!!this.node.type.spec.draggable,u=Ce.isSelectable(this.node),h=t.type==="copy",m=t.type==="paste",f=t.type==="cut",p=t.type==="mousedown";if(!d&&u&&a&&t.target===this.dom&&t.preventDefault(),d&&a&&!c&&t.target===this.dom)return t.preventDefault(),!1;if(d&&l&&!c&&p){const g=s.closest("[data-drag-handle]");g&&(this.dom===g||this.dom.contains(g))&&(this.isDragging=!0,document.addEventListener("dragend",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("drop",()=>{this.isDragging=!1},{once:!0}),document.addEventListener("mouseup",()=>{this.isDragging=!1},{once:!0}))}return!(c||i||h||m||f||p&&u)}ignoreMutation(t){return!this.dom||!this.contentDOM?!0:typeof this.options.ignoreMutation=="function"?this.options.ignoreMutation({mutation:t}):this.node.isLeaf||this.node.isAtom?!0:t.type==="selection"||this.dom.contains(t.target)&&t.type==="childList"&&(Hu()||Iy())&&this.editor.isFocused&&[...Array.from(t.addedNodes),...Array.from(t.removedNodes)].every(s=>s.isContentEditable)?!1:this.contentDOM===t.target&&t.type==="attributes"?!0:!this.contentDOM.contains(t.target)}updateAttributes(t){this.editor.commands.command(({tr:e})=>{const s=this.getPos();return typeof s!="number"?!1:(e.setNodeMarkup(s,void 0,{...this.node.attrs,...t}),!0)})}deleteNode(){const t=this.getPos();if(typeof t!="number")return;const e=t+this.node.nodeSize;this.editor.commands.deleteRange({from:t,to:e})}};function el(t){return new OK({find:t.find,handler:({state:e,range:s,match:n,pasteEvent:a})=>{const i=Xe(t.getAttributes,void 0,n,a);if(i===!1||i===null)return null;const{tr:o}=e,l=n[n.length-1],c=n[0];let d=s.to;if(l){const u=c.search(/\S/),h=s.from+c.indexOf(l),m=h+l.length;if(k1(s.from,s.to,e.doc).filter(p=>p.mark.type.excluded.find(x=>x===t.type&&x!==p.mark.type)).filter(p=>p.to>h).length)return null;m<s.to&&o.delete(m,s.to),h>s.from&&o.delete(s.from+u,h),d=s.from+u+l.length,o.addMark(s.from+u,d,t.type.create(i||{})),o.removeStoredMark(t.type)}}})}const{getOwnPropertyNames:nJ,getOwnPropertySymbols:rJ}=Object,{hasOwnProperty:aJ}=Object.prototype;function k0(t,e){return function(n,a,i){return t(n,a,i)&&e(n,a,i)}}function am(t){return function(s,n,a){if(!s||!n||typeof s!="object"||typeof n!="object")return t(s,n,a);const{cache:i}
832=a,o=i.get(s),l=i.get(n);if(o&&l)return o===n&&l===s;i.set(s,n),i.set(n,s);const c=t(s,n,a);return i.delete(s),i.delete(n),c}}function iJ(t){return t!=null?t[Symbol.toStringTag]:void 0}function tS(t){return nJ(t).concat(rJ(t))}const oJ=Object.hasOwn||((t,e)=>aJ.call(t,e));function hl(t,e){return t===e||!t&&!e&&t!==t&&e!==e}const lJ="__v",cJ="__o",dJ="_owner",{getOwnPropertyDescriptor:sS,keys:nS}=Object;function uJ(t,e){return t.byteLength===e.byteLength&&Jf(new Uint8Array(t),new Uint8Array(e))}function hJ(t,e,s){let n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!s.equals(t[n],e[n],n,n,t,e,s))return!1;return!0}function mJ(t,e){return t.byteLength===e.byteLength&&Jf(new Uint8Array(t.buffer,t.byteOffset,t.byteLength),new Uint8Array(e.buffer,e.byteOffset,e.byteLength))}function fJ(t,e){return hl(t.getTime(),e.getTime())}function pJ(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function xJ(t,e){return t===e}function rS(t,e,s){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const a=new Array(n),i=t.entries();let o,l,c=0;for(;(o=i.next())&&!o.done;){const d=e.entries();let u=!1,h=0;for(;(l=d.next())&&!l.done;){if(a[h]){h++;continue}const m=o.value,f=l.value;if(s.equals(m[0],f[0],c,h,t,e,s)&&s.equals(m[1],f[1],m[0],f[0],t,e,s)){u=a[h]=!0;break}h++}if(!u)return!1;c++}return!0}const gJ=hl;function bJ(t,e,s){const n=nS(t);let a=n.length;if(nS(e).length!==a)return!1;for(;a-- >0;)if(!kA(t,e,s,n[a]))return!1;return!0}function pd(t,e,s){const n=tS(t);let a=n.length;if(tS(e).length!==a)return!1;let i,o,l;for(;a-- >0;)if(i=n[a],!kA(t,e,s,i)||(o=sS(t,i),l=sS(e,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function yJ(t,e){return hl(t.valueOf(),e.valueOf())}function vJ(t,e){return t.source===e.source&&t.flags===e.flags}function aS(t,e,s){const n=t.size;if(n!==e.size)return!1;if(!n)return!0;const a=new Array(n),i=t.values();let o,l;for(;(o=i.next())&&!o.done;){const c=e.values();let d=!1,u=0;for(;(l=c.next())&&!l.done;){if(!a[u]&&s.equals(o.value,l.value,o.value,l.value,t,e,s)){d=a[u]=!0;break}u++}if(!d)return!1}return!0}function Jf(t,e){let s=t.byteLength;if(e.byteLength!==s||t.byteOffset!==e.byteOffset)return!1;for(;s-- >0;)if(t[s]!==e[s])return!1;return!0}function wJ(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function kA(t,e,s,n){return(n===dJ||n===cJ||n===lJ)&&(t.$$typeof||e.$$typeof)?!0:oJ(e,n)&&s.equals(t[n],e[n],n,n,t,e,s)}const jJ="[object ArrayBuffer]",NJ="[object Arguments]",kJ="[object Boolean]",CJ="[object DataView]",SJ="[object Date]",_J="[object Error]",TJ="[object Map]",EJ="[object Number]",MJ="[object Object]",AJ="[object RegExp]",PJ="[object Set]",DJ="[object String]",RJ={"[object Int8Array]":!0,"[object Uint8Array]":!0,"[object Uint8ClampedArray]":!0,"[object Int16Array]":!0,"[object Uint16Array]":!0,"[object Int32Array]":!0,"[object Uint32Array]":!0,"[object Float16Array]":!0,"[object Float32Array]":!0,"[object Float64Array]":!0,"[object BigInt64Array]":!0,"[object BigUint64Array]":!0},LJ="[object URL]",OJ=Object.prototype.toString;function IJ({areArrayBuffersEqual:t,areArraysEqual:e,areDataViewsEqual:s,areDatesEqual:n,areErrorsEqual:a,areFunctionsEqual:i,areMapsEqual:o,areNumbersEqual:l,areObjectsEqual:c,arePrimitiveWrappersEqual:d,areRegExpsEqual:u,areSetsEqual:h,areTypedArraysEqual:m,areUrlsEqual:f,unknownTagComparators:p}){return function(x,b,y){if(x===b)return!0;if(x==null||b==null)return!1;const w=typeof x;if(w!==typeof b)return!1;if(w!=="object")return w==="number"?l(x,b,y):w==="function"?i(x,b,y):!1;const N=x.constructor;if(N!==b.constructor)return!1;if(N===Object)return c(x,b,y);if(Array.isArray(x))return e(x,b,y);if(N===Date)return n(x,b,y);if(N===RegExp)return u(x,b,y);if(N===Map)return o(x,b,y);if(N===Set)return h(x,b,y);const j=OJ.call(x);if(j===SJ)return n(x,b,y);if(j===AJ)return u(x,b,y);if(j===TJ)return o(x,b,y);if(j===PJ)return h(x,b,y);if(j===MJ)return typeof x.then!="function"&&typeof b.then!="function"&&c(x,b,y);if(j===LJ)return f(x,b,y);if(j===_J)return a(x,b,y);if(j===NJ)return c(x,b,y);if(RJ[j])return m(x,b,y);if(j===jJ)return t(x,b,y);if(j===CJ)return s(x,b,y);if(j===kJ||j===EJ||j===DJ)return d(x,b,y);if(p){let S=p[j];if(!S){const k=iJ(x);k&&(S=p[k])}if(S)return S(x,b,y)}return!1}}function FJ({circular:t,createCustomConfig:e,strict:s}){let n={areArrayBuffersEqual:uJ,areArraysEqual:s?pd:hJ,areDataViewsEqual:mJ,areDatesEqual:fJ,areErrorsEqual:pJ,areFunctionsEqual:xJ,areMapsEqual:s?k0(rS,pd):rS,areNumbersEqual:gJ,areObjectsEqual:s?pd:bJ,arePrimitiveWrappersEqual:yJ,areRegExpsEqual:vJ,areSetsEqual:s?k0(aS,pd):aS,areTypedArraysEqual:s?k0(Jf,pd):Jf,areUrlsEqual:wJ,unknownTagComparators:void 0};if(e&&(n=Object.assign({},n,e(n))),t){const a=am(n.areArraysEqual),i=am(n.areMapsEqual),o=am(n.areObjectsEqual),l=am(n.areSetsEqual);n=Object.assign({},n,{areArraysEqual:a,areMapsEqual:i,areObjectsEqual:o,areSetsEqual:l})}return n}function $J(t){return function(e,s,n,a,i,o,l){return t(e,s,l)}}function zJ({circular:t,comparator:e,createState:s,equals:n,strict:a}){if(s)return function(l,c){const{cache:d=t?new WeakMap:void 0,meta:u}=s();return e(l,c,{cache:d,equals:n,meta:u,strict:a})};if(t)return function(l,c){return e(l,c,{cache:new WeakMap,equals:n,meta:void 0,strict:a})};const i={cache:void 0,equals:n,meta:void 0,strict:a};return function(l,c){return e(l,c,i)}}const BJ=ao();ao({strict:!0});ao({circular:!0});ao({circular:!0,strict:!0});ao({createInternalComparator:()=>hl});ao({strict:!0,createInternalComparator:()=>hl});ao({circular:!0,createInternalComparator:()=>hl});ao({circular:!0,createInternalComparator:()=>hl,strict:!0});function ao(t={}){const{circular:e=!1,createInternalComparator:s,createState:n,strict:a=!1}=t,i=FJ(t),o=IJ(i),l=s?s(o):$J(o);return zJ({circular:e,comparator:o,createState:n,equals:l,strict:a})}var CA={exports:{}},SA={};/** 833 * @license React 834 * use-sync-external-store-shim/with-selector.production.js 835 * 836 * Copyright (c) Meta Platforms, Inc. and affiliates. 837 * 838 * This source code is licensed under the MIT license found in the 839 * LICENSE file in the root directory of this source tree. 840 */var Ix=M,VJ=e1;function UJ(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var HJ=typeof Object.is=="function"?Object.is:UJ,WJ=VJ.useSyncExternalStore,GJ=Ix.useRef,YJ=Ix.useEffect,qJ=Ix.useMemo,KJ=Ix.useDebugValue;SA.useSyncExternalStoreWithSelector=function(t,e,s,n,a){var i=GJ(null);if(i.current===null){var o={hasValue:!1,value:null};i.current=o}else o=i.current;i=qJ(function(){function c(f){if(!d){if(d=!0,u=f,f=n(f),a!==void 0&&o.hasValue){var p=o.value;if(a(p,f))return h=p}return h=f}if(p=h,HJ(u,f))return p;var g=n(f);return a!==void 0&&a(p,g)?(u=f,p):(u=f,h=g)}var d=!1,u,h,m=s===void 0?null:s;return[function(){return c(e())},m===null?void 0:function(){return c(m())}]},[e,s,n,a]);var l=WJ(t,i[0],i[1]);return YJ(function(){o.hasValue=!0,o.value=l},[l]),KJ(l),l};CA.exports=SA;var JJ=CA.exports,QJ=(...t)=>e=>{t.forEach(s=>{typeof s=="function"?s(e):s&&(s.current=e)})},XJ=({contentComponent:t})=>{const e=e1.useSyncExternalStore(t.subscribe,t.getSnapshot,t.getServerSnapshot);return r.jsx(r.Fragment,{children:Object.values(e)})};function ZJ(){const t=new Set;let e={};return{subscribe(s){return t.add(s),()=>{t.delete(s)}},getSnapshot(){return e},getServerSnapshot(){return e},setRenderer(s,n){e={...e,[s]:zE.createPortal(n.reactElement,n.element,s)},t.forEach(a=>a())},removeRenderer(s){const n={...e};delete n[s],e=n,t.forEach(a=>a())}}}var eQ=class extends v.Component{constructor(t){var e;super(t),this.editorContentRef=v.createRef(),this.initialized=!1,this.state={hasContentComponentInitialized:!!((e=t.editor)!=null&&e.contentComponent)}}componentDidMount(){this.init()}componentDidUpdate(){this.init()}init(){var t;const e=this.props.editor;if(e&&!e.isDestroyed&&((t=e.view.dom)!=null&&t.parentNode)){if(e.contentComponent)return;const s=this.editorContentRef.current;s.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:s}),e.contentComponent=ZJ(),this.state.hasContentComponentInitialized||(this.unsubscribeToContentComponent=e.contentComponent.subscribe(()=>{this.setState(n=>n.hasContentComponentInitialized?n:{hasContentComponentInitialized:!0}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent()})),e.createNodeViews(),this.initialized=!0}}componentWillUnmount(){var t;const e=this.props.editor;if(e){this.initialized=!1,e.isDestroyed||e.view.setProps({nodeViews:{}}),this.unsubscribeToContentComponent&&this.unsubscribeToContentComponent(),e.contentComponent=null;try{if(!((t=e.view.dom)!=null&&t.parentNode))return;const s=document.createElement("div");s.append(...e.view.dom.parentNode.childNodes),e.setOptions({element:s})}catch{}}}render(){const{editor:t,innerRef:e,...s}=this.props;return r.jsxs(r.Fragment,{children:[r.jsx("div",{ref:QJ(e,this.editorContentRef),...s}),(t==null?void 0:t.contentComponent)&&r.jsx(XJ,{contentComponent:t.contentComponent})]})}},tQ=M.forwardRef((t,e)=>{const s=v.useMemo(()=>Math.floor(Math.random()*4294967295).toString(),[t.editor]);return v.createElement(eQ,{key:s,innerRef:e,...t})}),_A=v.memo(tQ),sQ=typeof window<"u"?M.useLayoutEffect:M.useEffect,nQ=class{constructor(t){this.transactionNumber=0,this.lastTransactionNumber=0,this.subscribers=new Set,this.editor=t,this.lastSnapshot={editor:t,transactionNumber:0}
840,this.getSnapshot=this.getSnapshot.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.watch=this.watch.bind(this),this.subscribe=this.subscribe.bind(this)}getSnapshot(){return this.transactionNumber===this.lastTransactionNumber?this.lastSnapshot:(this.lastTransactionNumber=this.transactionNumber,this.lastSnapshot={editor:this.editor,transactionNumber:this.transactionNumber},this.lastSnapshot)}getServerSnapshot(){return{editor:null,transactionNumber:0}}subscribe(t){return this.subscribers.add(t),()=>{this.subscribers.delete(t)}}watch(t){if(this.editor=t,this.editor){const e=()=>{this.transactionNumber+=1,this.subscribers.forEach(n=>n())},s=this.editor;return s.on("transaction",e),()=>{s.off("transaction",e)}}}};function rQ(t){var e;const[s]=M.useState(()=>new nQ(t.editor)),n=JJ.useSyncExternalStoreWithSelector(s.subscribe,s.getSnapshot,s.getServerSnapshot,t.selector,(e=t.equalityFn)!=null?e:BJ);return sQ(()=>s.watch(t.editor),[t.editor,s]),M.useDebugValue(n),n}var aQ=!1,Vy=typeof window>"u",iQ=Vy||!!(typeof window<"u"&&window.next),oQ=class TA{constructor(e){this.editor=null,this.subscriptions=new Set,this.isComponentMounted=!1,this.previousDeps=null,this.instanceId="",this.options=e,this.subscriptions=new Set,this.setEditor(this.getInitialEditor()),this.scheduleDestroy(),this.getEditor=this.getEditor.bind(this),this.getServerSnapshot=this.getServerSnapshot.bind(this),this.subscribe=this.subscribe.bind(this),this.refreshEditorInstance=this.refreshEditorInstance.bind(this),this.scheduleDestroy=this.scheduleDestroy.bind(this),this.onRender=this.onRender.bind(this),this.createEditor=this.createEditor.bind(this)}setEditor(e){this.editor=e,this.instanceId=Math.random().toString(36).slice(2,9),this.subscriptions.forEach(s=>s())}getInitialEditor(){return this.options.current.immediatelyRender===void 0?Vy||iQ?null:this.createEditor():(this.options.current.immediatelyRender,this.options.current.immediatelyRender?this.createEditor():null)}createEditor(){const e={...this.options.current,onBeforeCreate:(...n)=>{var a,i;return(i=(a=this.options.current).onBeforeCreate)==null?void 0:i.call(a,...n)},onBlur:(...n)=>{var a,i;return(i=(a=this.options.current).onBlur)==null?void 0:i.call(a,...n)},onCreate:(...n)=>{var a,i;return(i=(a=this.options.current).onCreate)==null?void 0:i.call(a,...n)},onDestroy:(...n)=>{var a,i;return(i=(a=this.options.current).onDestroy)==null?void 0:i.call(a,...n)},onFocus:(...n)=>{var a,i;return(i=(a=this.options.current).onFocus)==null?void 0:i.call(a,...n)},onSelectionUpdate:(...n)=>{var a,i;return(i=(a=this.options.current).onSelectionUpdate)==null?void 0:i.call(a,...n)},onTransaction:(...n)=>{var a,i;return(i=(a=this.options.current).onTransaction)==null?void 0:i.call(a,...n)},onUpdate:(...n)=>{var a,i;return(i=(a=this.options.current).onUpdate)==null?void 0:i.call(a,...n)},onContentError:(...n)=>{var a,i;return(i=(a=this.options.current).onContentError)==null?void 0:i.call(a,...n)},onDrop:(...n)=>{var a,i;return(i=(a=this.options.current).onDrop)==null?void 0:i.call(a,...n)},onPaste:(...n)=>{var a,i;return(i=(a=this.options.current).onPaste)==null?void 0:i.call(a,...n)},onDelete:(...n)=>{var a,i;return(i=(a=this.options.current).onDelete)==null?void 0:i.call(a,...n)}};return new WK(e)}getEditor(){return this.editor}getServerSnapshot(){return null}subscribe(e){return this.subscriptions.add(e),()=>{this.subscriptions.delete(e)}}static compareOptions(e,s){return Object.keys(e).every(n=>["onCreate","onBeforeCreate","onDestroy","onUpdate","onTransaction","onFocus","onBlur","onSelectionUpdate","onContentError","onDrop","onPaste"].includes(n)?!0:n==="extensions"&&e.extensions&&s.extensions?e.extensions.length!==s.extensions.length?!1:e.extensions.every((a,i)=>{var o;return a===((o=s.extensions)==null?void 0:o[i])}):e[n]===s[n])}onRender(e){return()=>(this.isComponentMounted=!0,clearTimeout(this.scheduledDestructionTimeout),this.editor&&!this.editor.isDestroyed&&e.length===0?TA.compareOptions(this.options.current,this.editor.options)||this.editor.setOptions({...this.options.current,editable:this.editor.isEditable}
840):this.refreshEditorInstance(e),()=>{this.isComponentMounted=!1,this.scheduleDestroy()})}refreshEditorInstance(e){if(this.editor&&!this.editor.isDestroyed){if(this.previousDeps===null){this.previousDeps=e;return}if(this.previousDeps.length===e.length&&this.previousDeps.every((n,a)=>n===e[a]))return}this.editor&&!this.editor.isDestroyed&&this.editor.destroy(),this.setEditor(this.createEditor()),this.previousDeps=e}scheduleDestroy(){const e=this.instanceId,s=this.editor;this.scheduledDestructionTimeout=setTimeout(()=>{if(this.isComponentMounted&&this.instanceId===e){s&&s.setOptions(this.options.current);return}s&&!s.isDestroyed&&(s.destroy(),this.instanceId===e&&this.setEditor(null))},1)}};function lQ(t={},e=[]){const s=M.useRef(t);s.current=t;const[n]=M.useState(()=>new oQ(s)),a=e1.useSyncExternalStore(n.subscribe,n.getEditor,n.getServerSnapshot);return M.useDebugValue(a),M.useEffect(n.onRender(e)),rQ({editor:a,selector:({transactionNumber:i})=>t.shouldRerenderOnTransaction===!1||t.shouldRerenderOnTransaction===void 0?null:t.immediatelyRender&&i===0?0:i+1}),a}var EA=M.createContext({editor:null});EA.Consumer;var MA=M.createContext({onDragStart:()=>{},nodeViewContentChildren:void 0,nodeViewContentRef:()=>{}}),cQ=()=>M.useContext(MA),dQ=v.forwardRef((t,e)=>{const{onDragStart:s}=cQ(),n=t.as||"div";return r.jsx(n,{...t,ref:e,"data-node-view-wrapper":"",onDragStart:s,style:{whiteSpace:"normal",...t.style}})});function iS(t){return!!(typeof t=="function"&&t.prototype&&t.prototype.isReactComponent)}function oS(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.forward_ref)"||t.$$typeof.description==="react.forward_ref"))}function uQ(t){return!!(typeof t=="object"&&t.$$typeof&&(t.$$typeof.toString()==="Symbol(react.memo)"||t.$$typeof.description==="react.memo"))}function hQ(t){if(iS(t)||oS(t))return!0;if(uQ(t)){const e=t.type;if(e)return iS(e)||oS(e)}return!1}function mQ(){try{if(M.version)return parseInt(M.version.split(".")[0],10)>=19}catch{}return!1}var fQ=class{constructor(t,{editor:e,props:s={},as:n="div",className:a=""}){this.ref=null,this.destroyed=!1,this.id=Math.floor(Math.random()*4294967295).toString(),this.component=t,this.editor=e,this.props=s,this.element=document.createElement(n),this.element.classList.add("react-renderer"),a&&this.element.classList.add(...a.split(" ")),this.editor.isInitialized?tx.flushSync(()=>{this.render()}):queueMicrotask(()=>{this.destroyed||this.render()})}render(){var t;if(this.destroyed)return;const e=this.component,s=this.props,n=this.editor,a=mQ(),i=hQ(e),o={...s};o.ref&&!(a||i)&&delete o.ref,!o.ref&&(a||i)&&(o.ref=l=>{this.ref=l}),this.reactElement=r.jsx(e,{...o}),(t=n==null?void 0:n.contentComponent)==null||t.setRenderer(this.id,this)}updateProps(t={}){this.destroyed||(this.props={...this.props,...t},this.render())}destroy(){var t;this.destroyed=!0;const e=this.editor;(t=e==null?void 0:e.contentComponent)==null||t.removeRenderer(this.id);try{this.element&&this.element.parentNode&&this.element.parentNode.removeChild(this.element)}catch{}}updateAttributes(t){Object.keys(t).forEach(e=>{this.element.setAttribute(e,t[e])})}};v.createContext({markViewContentRef:()=>{}});var pQ=class extends sJ{constructor(t,e,s){if(super(t,e,s),this.selectionRafId=null,this.cachedExtensionWithSyncedStorage=null,!this.node.isLeaf){this.options.contentDOMElementTag?this.contentDOMElement=document.createElement(this.options.contentDOMElementTag):this.contentDOMElement=document.createElement(this.node.isInline?"span":"div"),this.contentDOMElement.dataset.nodeViewContentReact="",this.contentDOMElement.dataset.nodeViewWrapper="",this.contentDOMElement.style.whiteSpace="inherit";const n=this.dom.querySelector("[data-node-view-content]");if(!n)return;n.appendChild(this.contentDOMElement)}}get extensionWithSyncedStorage(){if(!this.cachedExtensionWithSyncedStorage){const t=this.editor,e=this.extension;this.cachedExtensionWithSyncedStorage=new Proxy(e,{get(s,n,a){var i;return n==="storage"?(i=t.storage[e.name])!=null?i:{}:Reflect.get(s,n,a)}})}return this.cachedExtensionWithSyncedStorage}mount(){const t={editor:this.editor,node:this.node,decorations:this.decorations,innerDecorations:this.innerDecorations,view:this.view,selected:!1,extension:this.extensionWithSyncedStorage,HTMLAttributes:this.HTMLAttributes,getPos:()=>this.getPos(),updateAttributes:(c={})=>this.updateAttributes(c),deleteNode:()=>this.deleteNode(),ref:M.createRef()};if(!this.component.displayName){const c=d=>d.charAt(0).toUpperCase()+d.substring(1);this.component.displayName=c(this.extension.name)}const n={onDragStart:this.onDragStart.bind(this),nodeViewContentRef:c=>{c&&this.contentDOMElement&&c.firstChild!==this.contentDOMElement&&(c.hasAttribute("data-node-view-wrapper")&&c.removeAttribute("data-node-view-wrapper"),c.appendChild(this.contentDOMElement))}},a=this.component,i=M.memo(c=>r.jsx(MA.Provider,{value:n,children:M.createElement(a,c)}));i.displayName="ReactNodeView";let o=this.node.isInline?"span":"div";this.options.as&&(o=this.options.as);const{className:l=""}=this.options;this.handleSelectionUpdate=this.handleSelectionUpdate.bind(this),this.renderer=new fQ(i,{editor:this.editor,props:t,as:o,className:`node-${this.node.type.n
840ame} ${l}`.trim()}),this.editor.on("selectionUpdate",this.handleSelectionUpdate),this.updateElementAttributes()}get dom(){var t;if(this.renderer.element.firstElementChild&&!((t=this.renderer.element.firstElementChild)!=null&&t.hasAttribute("data-node-view-wrapper")))throw Error("Please use the NodeViewWrapper component for your node view.");return this.renderer.element}get contentDOM(){return this.node.isLeaf?null:this.contentDOMElement}handleSelectionUpdate(){this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null),this.selectionRafId=requestAnimationFrame(()=>{this.selectionRafId=null;const{from:t,to:e}=this.editor.state.selection,s=this.getPos();if(typeof s=="number")if(t<=s&&e>=s+this.node.nodeSize){if(this.renderer.props.selected)return;this.selectNode()}else{if(!this.renderer.props.selected)return;this.deselectNode()}})}update(t,e,s){const n=a=>{this.renderer.updateProps(a),typeof this.options.attrs=="function"&&this.updateElementAttributes()};if(t.type!==this.node.type)return!1;if(typeof this.options.update=="function"){const a=this.node,i=this.decorations,o=this.innerDecorations;return this.node=t,this.decorations=e,this.innerDecorations=s,this.options.update({oldNode:a,oldDecorations:i,newNode:t,newDecorations:e,oldInnerDecorations:o,innerDecorations:s,updateProps:()=>n({node:t,decorations:e,innerDecorations:s,extension:this.extensionWithSyncedStorage})})}return t===this.node&&this.decorations===e&&this.innerDecorations===s||(this.node=t,this.decorations=e,this.innerDecorations=s,n({node:t,decorations:e,innerDecorations:s,extension:this.extensionWithSyncedStorage})),!0}selectNode(){this.renderer.updateProps({selected:!0}),this.renderer.element.classList.add("ProseMirror-selectednode")}deselectNode(){this.renderer.updateProps({selected:!1}),this.renderer.element.classList.remove("ProseMirror-selectednode")}destroy(){this.renderer.destroy(),this.editor.off("selectionUpdate",this.handleSelectionUpdate),this.contentDOMElement=null,this.selectionRafId&&(cancelAnimationFrame(this.selectionRafId),this.selectionRafId=null)}updateElementAttributes(){if(this.options.attrs){let t={};if(typeof this.options.attrs=="function"){const e=this.editor.extensionManager.attributes,s=Tc(this.node,e);t=this.options.attrs({node:this.node,HTMLAttributes:s})}else t=this.options.attrs;this.renderer.updateAttributes(t)}}};function xQ(t,e){return s=>s.editor.contentComponent?new pQ(t,s,e):{}}var E1=M.createContext({get editor(){throw new Error("useTiptap must be used within a <Tiptap> provider")}});E1.displayName="TiptapContext";var gQ=()=>M.useContext(E1);function AA({editor:t,instance:e,children:s}){const n=t??e;if(!n)throw new Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");const a=M.useMemo(()=>({editor:n}),[n]),i=M.useMemo(()=>({editor:n}),[n]);return r.jsx(EA.Provider,{value:i,children:r.jsx(E1.Provider,{value:a,children:s})})}AA.displayName="Tiptap";function PA({...t}){const{editor:e}=gQ();return r.jsx(_A,{editor:e,...t})}PA.displayName="Tiptap.Content";Object.assign(AA,{Content:PA});var Qf=(t,e)=>{if(t==="slot")return 0;if(t instanceof Function)return t(e);const{children:s,...n}=e??{};if(t==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[t,n,s]},bQ=/^\s*>\s$/,yQ=tn.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:t}){return Qf("blockquote",{...At(this.options.HTMLAttributes,t),children:Qf("slot",{})})},parseMarkdown:(t,e)=>e.createNode("blockquote",void 0,e.parseChildren(t.tokens||[])),renderMarkdown:(t,e)=>{if(!t.content)return"";const s=">",n=[];return t.content.forEach(a=>{const l=e.renderChildren([a]).split(` 841`).map(c=>c.trim()===""?s:`${s} ${c}`);n.push(l.join(` 842`))}),n.join(` 843${s} 844`)},addCommands(){return{setBlockquote:()=>({commands:t})=>t.wrapIn(this.name),toggleBlockquote:()=>({commands:t})=>t.toggleWrap(this.name),unsetBlockquote:()=>({commands:t})=>t.lift(this.name)}}
vendor: 9,023 bytes, lines 844-865
844,addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[Mc({find:bQ,type:this.type})]}}),vQ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,wQ=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,jQ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,NQ=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,kQ=ul.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:t=>t.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:t=>t.type.name===this.name},{style:"font-weight",getAttrs:t=>/^(bold(er)?|[5-9]\d{2,})$/.test(t)&&null}]},renderHTML({HTMLAttributes:t}){return Qf("strong",{...At(this.options.HTMLAttributes,t),children:Qf("slot",{})})},markdownTokenName:"strong",parseMarkdown:(t,e)=>e.applyMark("bold",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`**${e.renderChildren(t)}**`,addCommands(){return{setBold:()=>({commands:t})=>t.setMark(this.name),toggleBold:()=>({commands:t})=>t.toggleMark(this.name),unsetBold:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[Ec({find:vQ,type:this.type}),Ec({find:jQ,type:this.type})]},addPasteRules(){return[el({find:wQ,type:this.type}),el({find:NQ,type:this.type})]}}),CQ=/(^|[^`])`([^`]+)`(?!`)$/,SQ=/(^|[^`])`([^`]+)`(?!`)/g,_Q=ul.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:t}){return["code",At(this.options.HTMLAttributes,t),0]},markdownTokenName:"codespan",parseMarkdown:(t,e)=>e.applyMark("code",[{type:"text",text:t.text||""}]),renderMarkdown:(t,e)=>t.content?`\`${e.renderChildren(t.content)}\``:"",addCommands(){return{setCode:()=>({commands:t})=>t.setMark(this.name),toggleCode:()=>({commands:t})=>t.toggleMark(this.name),unsetCode:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[Ec({find:CQ,type:this.type})]},addPasteRules(){return[el({find:SQ,type:this.type})]}}),C0=4,TQ=/^```([a-z]+)?[\s\n]$/,EQ=/^~~~([a-z]+)?[\s\n]$/,MQ=tn.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,enableTabIndentation:!1,tabSize:C0,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:t=>{var e;const{languageClassPrefix:s}=this.options;if(!s)return null;const i=[...((e=t.firstElementChild)==null?void 0:e.classList)||[]].filter(o=>o.startsWith(s)).map(o=>o.replace(s,""))[0];return i||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:t,HTMLAttributes:e}){return["pre",At(this.options.HTMLAttributes,e),["code",{class:t.attrs.language?this.options.languageClassPrefix+t.attrs.language:null},0]]},markdownTokenName:"code",parseMarkdown:(t,e)=>{var s;return((s=t.raw)==null?void 0:s.startsWith("```"))===!1&&t.codeBlockStyle!=="indented"?[]:e.createNode("codeBlock",{language:t.lang||null},t.text?[e.createTextNode(t.text)]:[])},renderMarkdown:(t,e)=>{var s;let n="";const a=((s=t.attrs)==null?void 0:s.language)||"";return t.content?n=[`\`\`\`${a}`,e.renderChildren(t.content),"```"].join(` 845`):n=`\`\`\`${a} 846 847\`\`\``,n},addCommands(){return{setCodeBlock:t=>({commands:e})=>e.setNode(this.name,t),toggleCodeBlock:t=>({commands:e})=>e.toggleNode(this.name,"paragraph",t)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{const{empty:t,$anchor:e}=this.editor.state.selection,s=e.pos===1;return!t||e.parent.type.name!==this.name?!1:s||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Tab:({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const s=(e=this.options.tabSize)!=null?e:C0,{state:n}=t,{selection:a}=n,{$from:i,empty:o}=a;if(i.parent.type!==this.type)return!1;const l=" ".repeat(s);return o?t.commands.insertContent(l):t.commands.command(({tr:c})=>{const{from:d,to:u}=a,f=n.doc.textBetween(d,u,` 848`,` 849`).split(` 850`).map(p=>l+p).join(` 851`);return c.replaceWith(d,u,n.schema.text(f)),!0})},"Shift-Tab":({editor:t})=>{var e;if(!this.options.enableTabIndentation)return!1;const s=(e=this.options.tabSize)!=null?e:C0,{state:n}=t,{selection:a}=n,{$from:i,empty:o}=a;return i.parent.type!==this.type?!1:o?t.commands.command(({tr:l})=>{var c;const{pos:d}=i,u=i.start(),h=i.end(),f=n.doc.textBetween(u,h,` 852`,` 853`).split(` 854`);let p=0,g=0;const x=d-u;for(let S=0;S<f.length;S+=1){if(g+f[S].length>=x){p=S;break}g+=f[S].length+1}const y=((c=f[p].match(/^ */))==null?void 0:c[0])||"",w=Math.min(y.length,s);if(w===0)return!0;let N=u;for(let S=0;S<p;S+=1)N+=f[S].length+1;return l.delete(N,N+w),d-N<=w&&l.setSelection(Me.create(l.doc,N)),!0}):t.commands.command(({tr:l})=>{const{from:c,to:d}=a,m=n.doc.textBetween(c,d,` 855`,` 856`).split(` 857`).map(f=>{var p;const g=((p=f.match(/^ */))==null?void 0:p[0])||"",x=Math.min(g.length,s);return f.slice(x)}).join(` 858`);return l.replaceWith(c,d,n.schema.text(m)),!0})},Enter:({editor:t})=>{if(!this.options.exitOnTripleEnter)return!1;const{state:e}=t,{selection:s}=e,{$from:n,empty:a}=s;if(!a||n.parent.type!==this.type)return!1;const i=n.parentOffset===n.parent.nodeSize-2,o=n.parent.textContent.endsWith(` 859 860`);return!i||!o?!1:t.chain().command(({tr:l})=>(l.delete(n.pos-2,n.pos),!0)).exitCode().run()},ArrowDown:({editor:t})=>{if(!this.options.exitOnArrowDown)return!1;const{state:e}=t,{selection:s,doc:n}=e,{$from:a,empty:i}=s;if(!i||a.parent.type!==this.type||!(a.parentOffset===a.parent.nodeSize-2))return!1;const l=a.after();return l===void 0?!1:n.nodeAt(l)?t.commands.command(({tr:d})=>(d.setSelection(Fe.near(n.resolve(l))),!0)):t.commands.exitCode()}}},addInputRules(){return[zy({find:TQ,type:this.type,getAttributes:t=>({language:t[1]})}),zy({find:EQ,type:this.type,getAttributes:t=>({language:t[1]})})]},addProseMirrorPlugins(){return[new Ct({key:new ts("codeBlockVSCodeHandler"),props:{handlePaste:(t,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;const s=e.clipboardData.getData("text/plain"),n=e.clipboardData.getData("vscode-editor-data"),a=n?JSON.parse(n):void 0,i=a==null?void 0:a.mode;if(!s||!i)return!1;const{tr:o,schema:l}=t.state,c=l.text(s.replace(/\r\n?/g,` 861`));return o.replaceSelectionWith(this.type.create({language:i},c)),o.selection.$from.parent.type!==this.type&&o.setSelection(Me.near(o.doc.resolve(Math.max(0,o.selection.from-2)))),o.setMeta("paste",!0),t.dispatch(o),!0}}})]}}),AQ=tn.create({name:"doc",topNode:!0,content:"block+",renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 862 863`):""}),PQ=tn.create({name:"hardBreak",markdownTokenName:"br",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",At(this.options.HTMLAttributes,t)]},renderText(){return` 864`},renderMarkdown:()=>` 865`,parseMarkdown:()=>({type:"hardBreak"}),addCommands(){return{setHardBreak:()=>({commands:t,chain:e,state:s,editor:n})=>t.first([()=>t.exitCode(),()=>t.command(()=>{const{selection:a,storedMarks:i}=s;if(a.$from.parent.type.spec.isolating)return!1;const{keepMarks:o}=this.options,{splittableMarks:l}=n.extensionManager,c=i||a.$to.parentOffset&&a.$from.marks();return e().insertContent({type:this.name}).command(({tr:d,dispatch:u})=>{if(u&&c&&o){const h=c.filter(m=>l.includes(m.type.name));d.ensureMarks(h)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}}),DQ=tn.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(t=>({tag:`h${t}`,attrs:{level:t}}))},renderHTML({node:t,HTMLAttributes:e}){return[`h${this.options.levels.includes(t.attrs.level)?t.attrs.level:this.options.levels[0]}`,At(this.options.HTMLAttributes,e),0]},parseMarkdown:(t,e)=>e.createNode("heading",{level:t.depth||1},e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>{var s;const n=(s=t.attrs)!=null&&s.level?parseInt(t.attrs.level,10):1,a="#".repeat(n);return t.content?`${a} ${e.renderChildren(t.content)}`:""},addCommands(){return{setHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.setNode(this.name,t):!1,toggleHeading:t=>({commands:e})=>this.options.levels.includes(t.level)?e.toggleNode(this.name,"paragraph",t):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((t,e)=>({...t,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(t=>zy({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${t}}
865)\\s$`),type:this.type,getAttributes:{level:t}}))}}),RQ=tn.create({name:"horizontalRule",addOptions(){return{HTMLAttributes:{},nextNodeType:"paragraph"}},group:"block",parseHTML(){return[{tag:"hr"}]},renderHTML({HTMLAttributes:t}){return["hr",At(this.options.HTMLAttributes,t)]},markdownTokenName:"hr",parseMarkdown:(t,e)=>e.createNode("horizontalRule"),renderMarkdown:()=>"---",addCommands(){return{setHorizontalRule:()=>({chain:t,state:e})=>{if(!qK(e,e.schema.nodes[this.name]))return!1;const{selection:s}=e,{$to:n}=s,a=t();return aA(s)?a.insertContentAt(n.pos,{type:this.name}):a.insertContent({type:this.name}),a.command(({state:i,tr:o,dispatch:l})=>{if(l){const{$to:c}=o.selection,d=c.end();if(c.nodeAfter)c.nodeAfter.isTextblock?o.setSelection(Me.create(o.doc,c.pos+1)):c.nodeAfter.isBlock?o.setSelection(Ce.create(o.doc,c.pos)):o.setSelection(Me.create(o.doc,c.pos));else{const u=i.schema.nodes[this.options.nextNodeType]||c.parent.type.contentMatch.defaultType,h=u==null?void 0:u.create();h&&(o.insert(d,h),o.setSelection(Me.create(o.doc,d+1)))}o.scrollIntoView()}return!0}).run()}}},addInputRules(){return[jA({find:/^(?:---|â-|___\s|\*\*\*\s)$/,type:this.t
vendor: 1,036 bytes, line 865
865ype})]}}),LQ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,OQ=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,IQ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,FQ=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,$Q=ul.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:t=>t.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:t=>t.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:t}){return["em",At(this.options.HTMLAttributes,t),0]},addCommands(){return{setItalic:()=>({commands:t})=>t.setMark(this.name),toggleItalic:()=>({commands:t})=>t.toggleMark(this.name),unsetItalic:()=>({commands:t})=>t.unsetMark(this.name)}},markdownTokenName:"em",parseMarkdown:(t,e)=>e.applyMark("italic",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`*${e.renderChildren(t)}*`,addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[Ec({find:LQ,type:this.t
865ype}),Ec({find:IQ,type:this.type})]},addPasteRules(){return[el({find:OQ,type:this.type}),el({find:FQ,type:this.type})]}});const zQ="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0axi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5mögensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yac
865hts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",BQ="ελ1Ï 2бг1ел3деÑи4еÑ2каÑолик6ом3мкд2он1Ñква6онлайн5Ñг3ÑÑÑ2Ñ2ÑайÑ3Ñб3ÑкÑ3Òаз3Õ°Õ¡Õµ3×שר××5×§××3Ø§Ø¨ÙØ¸Ø¨Ù5را٠ÙÙ5ÙØ§Ø±Ø¯Ù4Ø¨ØØ±ÙÙ5جزائر5Ø³Ø¹ÙØ¯ÙØ©6عÙÙØ§Ù5٠غرب5٠ارات5ÛØ±Ø§Ù5بارت2زار4ÙØªÙ3ھارت5تÙÙØ³4Ø³ÙØ¯Ø§Ù3Ø±ÙØ©5Ø´Ø¨ÙØ©4عراÙ2ب2٠اÙ4ÙÙØ³Ø·ÙÙ6ÙØ·Ø±3ÙØ§Ø«ÙÙÙÙ6ÙÙ 3٠صر2ÙÙØ³Ùا5ÙØ±ÙتاÙÙØ§7ÙØ¹4Ù٠راÙ5پاکستاÙ7ÚØ§Ø±Øª4à¤à¥à¤®3नà¥à¤3à¤à¤¾à¤°à¤¤0मà¥3à¥à¤¤5सà¤à¤à¤ न5বাà¦à¦²à¦¾5à¦à¦¾à¦°à¦¤2ৰত4à¨à¨¾à¨°à¨¤4àªàª¾àª°àª¤4à¬à¬¾à¬°à¬¤4à®à®¨à¯à®¤à®¿à®¯à®¾6லà®à¯à®à¯6à®à®¿à®à¯à®à®ªà¯à®ªà¯à®°à¯11à°à°¾à°°à°¤à±5à²à²¾à²°à²¤4à´à´¾à´°à´¤à´5à¶½à¶à¶à·4à¸à¸à¸¡3à¹à¸à¸¢3ລາວ3áá2ã¿ããª3ã¢ãã¾ã³4ã¯ã©ã¦ã4ã°ã¼ã°ã«4ã³ã 2ã¹ãã¢3ã»ã¼ã«3ãã¡ãã·ã§ã³6ãã¤ã³ã4ä¸ç2ä¸ä¿¡1å½1å1æç½3äºé©¬é3ä¼ä¸2ä½å±±2ä¿¡æ¯2å¥åº·2å «å¦2å ¬å¸1ç2å°æ¹¾1ç£2åå1åº1æ 2åé0大é åº5å¨çº¿2大æ¿2天主æ3娱ä¹2å®¶é»2广ä¸2å¾®å2æ å2æç±ä½ 3ææº2æè2æ¿å¡1åº2æ°å å¡2é»2æ¶å°2æ¸ç±2æºæ2淡马é¡3游æ2æ¾³é2ç¹ç2ç§»å¨2ç»ç»æºæ4ç½å1åº1ç«1ç»2èé2è°·æ2è´ç©2é販2éå¢2é»è¨çç§4é£å©æµ¦3é£å2é¤å 2馿 ¼éæ3港2ë·ë·1ì»´2ì¼ì±2íêµ2",Uy="numeric",Hy="ascii",Wy="alpha",nu="asciinumeric",Dd="alphanumeric",Gy="domain",DA="emoji",VQ="scheme",UQ="slashscheme",S0="whitespace";function HQ(t,e){return t in e||(e[t]=[]),e[t]}function Eo(t,e,s){e[Uy]&&(e[nu]=!0,e[Dd]=!0),e[Hy]&&(e[nu]=!0,e[Wy]=!0),e[nu]&&(e[Dd]=!0),e[Wy]&&(e[Dd]=!0),e[Dd]&&(e[Gy]=!0),e[DA]&&(e[Gy]=!0);for(const n in e){const a=HQ(n,s);a.indexOf(t)<0&&a.push(t)}}function WQ(t,e){const s={};for(const n in e)e[n].indexOf(t)>=0&&(s[n]=!0);return s}function hn(t=null){this.j={},this.jr=[],this.jd=null,this.t=t}hn.groups={};hn.prototype={accepts(){return!!this.t},go(t){const e=this,s=e.j[t];if(s)return s;for(let n=0;n<e.jr.length;n++){const a=e.jr[n][0],i=e.jr[n][1];if(i&&a.test(t))return i}return e.jd},has(t,e=!1){return e?t in this.j:!!this.go(t)},ta(t,e,s,n){for(let a=0;a<t.length;a++)this.tt(t[a],e,s,n)},tr(t,e,s,n){n=n||hn.groups;let a;return e&&e.j?a=e:(a=new hn(e),s&&n&&Eo(e,s,n)),this.jr.push([t,a]),a},ts(t,e,s,n){let a=this;const i=t.length;if(!i)return a;for(let o=0;o<i-1;o++)a=a.tt(t[o]);return a.tt(t[i-1],e,s,n)},tt(t,e,s,n){n=n||hn.groups;const a=this;if(e&&e.j)return a.j[t]=e,e;const i=e;let o,l=a.go(t);if(l?(o=new hn,Object.assign(o.j,l.j),o.jr.push.apply(o.jr,l.jr),o.jd=l.jd,o.t=l.t):o=new hn,i){if(n)if(o.t&&typeof o.t=="string"){const c=Object.assign(WQ(o.t,n),s);Eo(i,c,n)}else s&&Eo(i,s,n);o.t=i}return a.j[t]=o,o}};const Ie=(t,e,s,n,a)=>t.ta(e,s,n,a),St=(t,e,s,n,a)=>t.tr(e,s,n,a),lS=(t,e,s,n,a)=>t.ts(e,s,n,a),ae=(t,e,s,n,a)=>t.tt(e,s,n,a),va="WORD",Yy="UWORD",RA="ASCIINUMERICAL",LA="ALPHANUMERICAL",Gu="LOCALHOST",qy="TLD",Ky="UTLD",Vm="SCHEME",Dl="SLASH_SCHEME",M1="NUM",Jy="WS",A1="NL",ru="OPENBRACE",au="CLOSEBRACE",Xf="OPENBRACKET",Zf="CLOSEBRACKET",ep="OPENPAREN",tp="CLOSEPAREN",sp="OPENANGLEBRACKET",np="CLOSEANGLEBRACKET",rp="FULLWIDTHLEFTPAREN",ap="FULLWIDTHRIGHTPAREN",ip="LEFTCORNERBRACKET",op="RIGHTCORNERBRACKET",lp="LEFTWHITECORNERBRACKET",cp="RIGHTWHITECORNERBRACKET",dp="FULLWIDTHLESSTHAN",up="FULLWIDTHGREATERTHAN",hp="AMPERSAND",mp="APOSTROPHE",fp="ASTERISK",oi="AT",pp="BACKSLASH",xp="BACKTICK",gp="CARET",mi="COLON",P1="COMMA",bp="DOLLAR",zr="DOT",yp="EQUALS",D1="EXCLAMATION",Yn="HYPHEN",iu="PERCENT",vp="PIPE",wp="PLUS",jp="POUND",ou="QUERY",R1="QUOTE",OA="FULLWIDTHMIDDLEDOT",L1="SEMI",Br="SLASH",lu="TILDE",Np="UNDERSCORE",IA="EMOJI",kp="SYM";var FA=Object.freeze({__proto__:null,ALPHANUMERICAL:LA,AMPERSAND:hp,APOSTROPHE:mp,ASCIINUMERICAL:RA,ASTERISK:fp,AT:oi,BACKSLASH:pp,BACKTICK:xp,CARET:gp,CLOSEANGLEBRACKET:np,CLOSEBRACE:au,CLOSEBRACKET:Zf,CLOSEPAREN:tp,COLON:mi,COMMA:P1,DOLLAR:bp,DOT:zr,EMOJI:IA,EQUALS:yp,EXCLAMATION:D1,FULLWIDTHGREATERTHAN:up,FULLWIDTHLEFTPAREN:rp,FULLWIDTHLESSTHAN:dp,FULLWIDTHMIDDLEDOT:OA,FULLWIDTHRIGHTPAREN:ap,HYPHEN:Yn,LEFTCORNERBRACKET:ip,LEFTWHITECORNERBRACKET:lp,LOCALHOST:Gu,NL:A1,NUM:M1,OPENANGLEBRACKET:sp,OPENBRACE:ru,OPENBRACKET:Xf,OPENPAREN:ep,PERCENT:iu,PIPE:vp,PLUS:wp,POUND:jp,QUERY:ou,QUOTE:R1,RIGHTCORNERBRACKET:op,RIGHTWHITECORNERBRACKET:cp,SCHEME:Vm,SEMI:L1,SLASH:Br,SLASH_SCHEME:Dl,SYM:kp,TILDE:lu,TLD:qy,UNDERSCORE:Np,UTLD:Ky,UWORD:Yy,WORD:va,WS:Jy});const xa=/[a-z]/,xd=new RegExp("\\p{L}","u"),_0=new RegExp("\\p{Emoji}","u"),ga=/\d/,T0=/\s/,cS="\r",E0=` 866`,GQ="ï¸",YQ="â",M0="";let im=null,om=null;function qQ(t=[]){const e={};hn.groups=e;const s=new hn;im==null&&(im=dS(zQ)),om==null&&(om=dS(BQ)),ae(s,"'",mp),ae(s,"{",ru),ae(s,"}",au),ae(s,"[",Xf),ae(s,"]",Zf),ae(s,"(",ep),ae(s,")",tp),ae(s,"<",sp),ae(s,">",np),ae(s,"ï¼",rp),ae(s,"ï¼",ap),ae(s,"ã",ip),ae(s,"ã",op),ae(s,"ã",lp),ae(s,"ã",cp),ae(s,"ï¼",dp),ae(s,"ï¼",up),ae(s,"&",hp),ae(s,"*",fp),ae(s,"@",oi),ae(s,"`",x
vendor: 27,513 bytes, lines 866-879
866p),ae(s,"^",gp),ae(s,":",mi),ae(s,",",P1),ae(s,"$",bp),ae(s,".",zr),ae(s,"=",yp),ae(s,"!",D1),ae(s,"-",Yn),ae(s,"%",iu),ae(s,"|",vp),ae(s,"+",wp),ae(s,"#",jp),ae(s,"?",ou),ae(s,'"',R1),ae(s,"/",Br),ae(s,";",L1),ae(s,"~",lu),ae(s,"_",Np),ae(s,"\\",pp),ae(s,"ã»",OA);const n=St(s,ga,M1,{[Uy]:!0});St(n,ga,n);const a=St(n,xa,RA,{[nu]:!0}),i=St(n,xd,LA,{[Dd]:!0}),o=St(s,xa,va,{[Hy]:!0});St(o,ga,a),St(o,xa,o),St(a,ga,a),St(a,xa,a);const l=St(s,xd,Yy,{[Wy]:!0});St(l,xa),St(l,ga,i),St(l,xd,l),St(i,ga,i),St(i,xa),St(i,xd,i);const c=ae(s,E0,A1,{[S0]:!0}),d=ae(s,cS,Jy,{[S0]:!0}),u=St(s,T0,Jy,{[S0]:!0});ae(s,M0,u),ae(d,E0,c),ae(d,M0,u),St(d,T0,u),ae(u,cS),ae(u,E0),St(u,T0,u),ae(u,M0,u);const h=St(s,_0,IA,{[DA]:!0});ae(h,"#"),St(h,_0,h),ae(h,GQ,h);const m=ae(h,YQ);ae(m,"#"),St(m,_0,h);const f=[[xa,o],[ga,a]],p=[[xa,null],[xd,l],[ga,i]];for(let g=0;g<im.length;g++)Qa(s,im[g],qy,va,f);for(let g=0;g<om.length;g++)Qa(s,om[g],Ky,Yy,p);Eo(qy,{tld:!0,ascii:!0},e),Eo(Ky,{utld:!0,alpha:!0},e),Qa(s,"file",Vm,va,f),Qa(s,"mailto",Vm,va,f),Qa(s,"http",Dl,va,f),Qa(s,"https",Dl,va,f),Qa(s,"ftp",Dl,va,f),Qa(s,"ftps",Dl,va,f),Eo(Vm,{scheme:!0,ascii:!0},e),Eo(Dl,{slashscheme:!0,ascii:!0},e),t=t.sort((g,x)=>g[0]>x[0]?1:-1);for(let g=0;g<t.length;g++){const x=t[g][0],y=t[g][1]?{[VQ]:!0}:{[UQ]:!0};x.indexOf("-")>=0?y[Gy]=!0:xa.test(x)?ga.test(x)?y[nu]=!0:y[Hy]=!0:y[Uy]=!0,lS(s,x,x,y)}return lS(s,"localhost",Gu,{ascii:!0}),s.jd=new hn(kp),{start:s,tokens:Object.assign({groups:e},FA)}}function $A(t,e){const s=KQ(e.replace(/[A-Z]/g,l=>l.toLowerCase())),n=s.length,a=[];let i=0,o=0;for(;o<n;){let l=t,c=null,d=0,u=null,h=-1,m=-1;for(;o<n&&(c=l.go(s[o]));)l=c,l.accepts()?(h=0,m=0,u=l):h>=0&&(h+=s[o].length,m++),d+=s[o].length,i+=s[o].length,o++;i-=h,o-=m,d-=h,a.push({t:u.t,v:e.slice(i-d,i),s:i-d,e:i})}return a}function KQ(t){const e=[],s=t.length;let n=0;for(;n<s;){let a=t.charCodeAt(n),i,o=a<55296||a>56319||n+1===s||(i=t.charCodeAt(n+1))<56320||i>57343?t[n]:t.slice(n,n+2);e.push(o),n+=o.length}return e}function Qa(t,e,s,n,a){let i;const o=e.length;for(let l=0;l<o-1;l++){const c=e[l];t.j[c]?i=t.j[c]:(i=new hn(n),i.jr=a.slice(),t.j[c]=i),t=i}return i=new hn(s),i.jr=a.slice(),t.j[e[o-1]]=i,i}function dS(t){const e=[],s=[];let n=0,a="0123456789";for(;n<t.length;){let i=0;for(;a.indexOf(t[n+i])>=0;)i++;if(i>0){e.push(s.join(""));for(let o=parseInt(t.substring(n,n+i),10);o>0;o--)s.pop();n+=i}else s.push(t[n]),n++}return e}const Yu={defaultProtocol:"http",events:null,format:uS,formatHref:uS,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function O1(t,e=null){let s=Object.assign({},Yu);t&&(s=Object.assign(s,t instanceof O1?t.o:t));const n=s.ignoreTags,a=[];for(let i=0;i<n.length;i++)a.push(n[i].toUpperCase());this.o=s,e&&(this.defaultRender=e),this.ignoreTags=a}O1.prototype={o:Yu,ignoreTags:[],defaultRender(t){return t},check(t){return this.get("validate",t.toString(),t)},get(t,e,s){const n=e!=null;let a=this.o[t];return a&&(typeof a=="object"?(a=s.t in a?a[s.t]:Yu[t],typeof a=="function"&&n&&(a=a(e,s))):typeof a=="function"&&n&&(a=a(e,s.t,s)),a)},getObj(t,e,s){let n=this.o[t];return typeof n=="function"&&e!=null&&(n=n(e,s.t,s)),n},render(t){const e=t.render(this);return(this.get("render",null,t)||this.defaultRender)(e,t.t,t)}};function uS(t){return t}function zA(t,e){this.t="token",this.v=t,this.tk=e}zA.prototype={isLink:!1,toString(){return this.v},toHref(t){return this.toString()},toFormattedString(t){const e=this.toString(),s=t.get("truncate",e,this),n=t.get("format",e,this);return s&&n.length>s?n.substring(0,s)+"â¦":n},toFormattedHref(t){return t.get("formatHref",this.toHref(t.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(t=Yu.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(t),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(t){return{type:this.t,value:this.toFormattedString(t),isLink:this.isLink,href:this.toFormattedHref(t),start:this.startIndex(),end:this.endIndex()}},validate(t){return t.get("validate",this.toString(),this)},render(t){const e=this,s=this.toHref(t.get("defaultProtocol")),n=t.get("formatHref",s,this),a=t.get("tagName",s,e),i=this.toFormattedString(t),o={},l=t.get("className",s,e),c=t.get("target",s,e),d=t.get("rel",s,e),u=t.getObj("attributes",s,e),h=t.getObj("events",s,e);return o.href=n,l&&(o.class=l),c&&(o.target=c),d&&(o.rel=d),u&&Object.assign(o,u),{tagName:a,attributes:o,content:i,eventListeners:h}}};function Fx(t,e){class s extends zA{constructor(a,i){super(a,i),this.t=t}}for(const n in e)s.prototype[n]=e[n];return s.t=t,s}const hS=Fx("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),mS=Fx("text"),JQ=Fx("nl"),lm=Fx("url",{isLink:!0,toHref(t=Yu.defaultProtocol){return this.hasProtocol()?this.v:`${t}://${this.v}`},hasProtocol(){const t=this.tk;return t.length>=2&&t[0].t!==Gu&&t[1].t===mi}}),Wn=t=>new hn(t);function QQ({groups:t}){const e=t.domain.concat([hp,fp,oi,pp,xp,gp,bp,yp,Yn,M1,iu,vp,wp,jp,Br,kp,lu,Np]),s=[mp,mi,P1,zr,D1,iu,ou,R1,L1,sp,np,ru,au,Zf,Xf,ep,tp,rp,ap,ip,op,lp,cp,dp,up],n=[hp,mp,fp,pp,xp,gp,bp,yp,Yn,ru,au,iu,vp,wp,jp,ou,Br,kp,lu,Np],a=Wn(),i=ae(a,lu);Ie(i,n,i),Ie(i,t.domain,i);const o=Wn(),l=Wn(),c=Wn();Ie(a,t.domain,o),Ie(a,t.scheme,l),Ie(a,t.slashscheme,c),Ie(o,n,i),Ie(o,t.domain,o);const d=ae(o,oi);ae(i,oi,d),ae(l,oi,d),ae(c,oi,d);const u=ae(i,zr);Ie(u,n,i),Ie(u,t.domain,i);const h=Wn();Ie(d,t.domain,h),Ie(h,t.domain,h);const m=ae(h,zr);Ie(m,t.domain,h);const f=Wn(hS);Ie(m,t.tld,f),Ie(m,t.utld,f),ae(d,Gu,f);const p=ae(h,Yn);ae(p,Yn,p),Ie(p,t.domain,h),Ie(f,t.domain,h),ae(f,zr,m),ae(f,Yn,p);const g=ae(f,mi);Ie(g,t.numeric,hS);const x=ae(o,Yn),b=ae(o,zr);ae(x,Yn,x),Ie(x,t.domain,o),Ie(b,n,i),Ie(b,t.domain,o);const y=Wn(lm);Ie(b,t.tld,y),Ie(b,t.utld,y),Ie(y,t.domain,o),Ie(y,n,i),ae(y,zr,b),ae(y,Yn,x),ae(y,oi,d);const w=ae(y,mi),N=Wn(lm);Ie(w,t.numeric,N);const j=Wn(lm),S=Wn();Ie(j,e,j),Ie(j,s,S),Ie(S,e,j),Ie(S,s,S),ae(y,Br,j),ae(N,Br,j);const k=ae(l,mi),C=ae(c,mi),T=ae(C,Br),A=ae(T,Br);Ie(l,t.domain,o),ae(l,zr,b),ae(l,Yn,x),Ie(c,t.domain,o),ae(c,zr,b),ae(c,Yn,x),Ie(k,t.domain,j),ae(k,Br,j),ae(k,ou,j),Ie(A,t.domain,j),Ie(A,e,j),ae(A,Br,j);const E=[[ru,au],[Xf,Zf],[ep,tp],[sp,np],[rp,ap],[ip,op],[lp,cp],[dp,up]];for(let L=0;L<E.length;L++){const[D,P]=E[L],R=ae(j,D);ae(S,D,R),ae(R,P,j);const $=Wn(lm);Ie(R,e,$);const O=Wn();Ie(R,s),Ie($,e,$),Ie($,s,O),Ie(O,e,$),Ie(O,s,O),ae($,P,j),ae(O,P,j)}return ae(a,Gu,y),ae(a,A1,JQ),{start:a,tokens:FA}}function XQ(t,e,s){let n=s.length,a=0,i=[],o=[];for(;a<n;){let l=t,c=null,d=null,u=0,h=null,m=-1;for(;a<n&&!(c=l.go(s[a].t));)o.push(s[a++]);for(;a<n&&(d=c||l.go(s[a].t));)c=null,l=d,l.accepts()?(m=0,h=l):m>=0&&m++,a++,u++;if(m<0)a-=u,a<n&&(o.push(s[a]),a++);else{o.length>0&&(i.push(A0(mS,e,o)),o=[]),a-=m,u-=m;const f=h.t,p=s.slice(a-u,a);i.push(A0(f,e,p))}}return o.length>0&&i.push(A0(mS,e,o)),i}function A0(t,e,s){const n=s[0].s,a=s[s.length-1].e,i=e.slice(n,a);return new t(i,s)}const ZQ=typeof console<"u"&&console&&console.warn||(()=>{}),eX="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",ct={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function tX(){return hn.groups={},ct.scanner=null,ct.parser=null,ct.tokenQueue=[],ct.pluginQueue=[],ct.customSchemes=[],ct.initialized=!1,ct}function fS(t,e=!1){if(ct.initialized&&ZQ(`linkifyjs: already initialized - will not register custom scheme "${t}" ${eX}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(t))throw new Error(`linkifyjs: incorrect scheme format. 8671. Must only contain digits, lowercase ASCII letters or "-" 8682. Cannot start or end with "-" 8693. "-" cannot repeat`);ct.customSchemes.push([t,e])}function sX(){ct.scanner=qQ(ct.customSchemes);for(let t=0;t<ct.tokenQueue.length;t++)ct.tokenQueue[t][1]({scanner:ct.scanner});ct.parser=QQ(ct.scanner.tokens);for(let t=0;t<ct.pluginQueue.length;t++)ct.pluginQueue[t][1]({scanner:ct.scanner,parser:ct.parser});return ct.initialized=!0,ct}function I1(t){return ct.initialized||sX(),XQ(ct.parser.start,t,$A(ct.scanner.start,t))}I1.scan=$A;function BA(t,e=null,s=null){if(e&&typeof e=="object"){if(s)throw Error(`linkifyjs: Invalid link type ${e}; must be a string`);s=e,e=null}const n=new O1(s),a=I1(t),i=[];for(let o=0;o<a.length;o++){const l=a[o];l.isLink&&(!e||l.t===e)&&n.check(l)&&i.push(l.toFormattedObject(n))}return i}var F1="[\0-  áá â-\u2029âã]",nX=new RegExp(F1),rX=new RegExp(`${F1}$`),aX=new RegExp(F1,"g");function iX(t){return t.length===1?t[0].isLink:t.length===3&&t[1].isLink?["()","[]"].includes(t[0].value+t[2].value):!1}function oX(t){return new Ct({key:new ts("autolink"),appendTransaction:(e,s,n)=>{const a=e.some(d=>d.docChanged)&&!s.doc.eq(n.doc),i=e.some(d=>d.getMeta("preventAutolink"));if(!a||i)return;const{tr:o}=n,l=Q5(s.doc,[...e]);if(rA(l).forEach(({newRange:d})=>{const u=Gq(n.doc,d,f=>f.isTextblock);let h,m;if(u.length>1)h=u[0],m=n.doc.textBetween(h.pos,h.pos+h.node.nodeSize,void 0," ");else if(u.length){const f=n.doc.textBetween(d.from,d.to," "," ");if(!rX.test(f))return;h=u[0],m=n.doc.textBetween(h.pos,d.to,void 0," ")}if(h&&m){const f=m.split(nX).filter(Boolean);if(f.length<=0)return!1;const p=f[f.length-1],g=h.pos+m.lastIndexOf(p);if(!p)return!1;const x=I1(p).map(b=>b.toObject(t.defaultProtocol));if(!iX(x))return!1;x.filter(b=>b.isLink).map(b=>({...b,from:g+b.start+1,to:g+b.end+1})).filter(b=>n.schema.marks.code?!n.doc.rangeHasMark(b.from,b.to,n.schema.marks.code):!0).filter(b=>t.validate(b.value)).filter(b=>t.shouldAutoLink(b.value)).forEach(b=>{k1(b.from,b.to,n.doc).some(y=>y.mark.type===t.type)||o.addMark(b.from,b.to,t.type.create({href:b.href}))})}}),!!o.steps.length)return o}})}function lX(t){return new Ct({key:new ts("handleClickLink"),props:{handleClick:(e,s,n)=>{var a,i;if(n.button!==0||!e.editable)return!1;let o=null;if(n.target instanceof HTMLAnchorElement)o=n.target;else{const c=n.target;if(!c)return!1;const d=t.editor.view.dom;o=c.closest("a"),o&&!d.contains(o)&&(o=null)}if(!o)return!1;let l=!1;if(t.enableClickSelection&&(l=t.editor.commands.extendMarkRange(t.type.name)),t.openOnClick){const c=nA(e.state,t.type.name),d=(a=o.href)!=null?a:c.href,u=(i=o.target)!=null?i:c.target;d&&(window.open(d,u),l=!0)}return l}}})}function cX(t){return new Ct({key:new ts("handlePasteLink"),props:{handlePaste:(e,s,n)=>{const{shouldAutoLink:a}=t,{state:i}=e,{selection:o}=i,{empty:l}=o;if(l)return!1;let c="";n.content.forEach(u=>{c+=u.textContent});const d=BA(c,{defaultProtocol:t.defaultProtocol}).find(u=>u.isLink&&u.value===c);return!c||!d||a!==void 0&&!a(d.value)?!1:t.editor.commands.setMark(t.type,{href:d.href})}}})}function ho(t,e){const s=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(n=>{const a=typeof n=="string"?n:n.scheme;a&&s.push(a)}),!t||t.replace(aX,"").match(new RegExp(`^(?:(?:${s.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var VA=ul.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(t=>{if(typeof t=="string"){fS(t);return}fS(t.scheme,t.optionalSlashes)})},onDestroy(){tX()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,enableClickSelection:!1,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(t,e)=>!!ho(t,e.protocols),validate:t=>!!t,shouldAutoLink:t=>{const e=/^[a-z][a-z0-9+.-]*:\/\//i.test(t),s=/^[a-z][a-z0-9+.-]*:/i.test(t);if(e||s&&!t.includes("@"))return!0;const a=(t.includes("@")?t.split("@").pop():t).split(/[/?#:]/)[0];return!(/^\d{1,3}(\.\d{1,3}){3}$/.test(a)||!/\./.test(a))}}},addAttributes(){return{href:{default:null,parseHTML(t){return t.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class},title:{default:null}}},parseHTML(){return[{tag:"a[href]",getAttrs:t=>{const e=t.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:s=>!!ho(s,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:t}){return this.options.isAllowedUri(t.href,{defaultValidate:e=>!!ho(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",At(this.options.HTMLAttributes,t),0]:["a",At(this.options.HTMLAttributes,{...t,href:""}),0]},markdownTokenName:"link",parseMarkdown:(t,e)=>e.applyMark("link",e.parseInline(t.tokens||[]),{href:t.href,title:t.title||null}),renderMarkdown:(t,e)=>{var s,n,a,i;const o=(n=(s=t.attrs)==null?void 0:s.href)!=null?n:"",l=(i=(a=t.attrs)==null?void 0:a.title)!=null?i:"",c=e.renderChildren(t);return l?`[${c}](${o} "${l}")`:`[${c}](${o})`},addCommands(){return{setLink:t=>({chain:e})=>{const{href:s}=t;return this.options.isAllowedUri(s,{defaultValidate:n=>!!ho(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,t).setMeta("preventAutolink",!0).run():!1},toggleLink:t=>({chain:e})=>{const{href:s}=t||{};return s&&!this.options.isAllowedUri(s,{defaultValidate:n=>!!ho(n,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:e().toggleMark(this.name,t,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()},unsetLink:()=>({chain:t})=>t().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[el({find:t=>{const e=[];if(t){const{protocols:s,defaultProtocol:n}=this.options,a=BA(t).filter(i=>i.isLink&&this.options.isAllowedUri(i.value,{defaultValidate:o=>!!ho(o,s),protocols:s,defaultProtocol:n}));a.length&&a.forEach(i=>{this.options.shouldAutoLink(i.value)&&e.push({text:i.value,data:{href:i.href},index:i.start})})}return e},type:this.type,getAttributes:t=>{var e;return{href:(e=t.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){const t=[],{protocols:e,defaultProtocol:s}=this.options;return this.options.autolink&&t.push(oX({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:n=>this.options.isAllowedUri(n,{defaultValidate:a=>!!ho(a,e),protocols:e,defaultProtocol:s}),shouldAutoLink:this.options.shouldAutoLink})),t.push(lX({type:this.type,editor:this.editor,openOnClick:this.options.openOnClick==="whenNotEditable"?!0:this.options.openOnClick,enableClickSelection:this.options.enableClickSelection})),this.options.linkOnPaste&&t.push(cX({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type,shouldAutoLink:this.options.shouldAutoLink})),t}}),dX=VA,uX=Object.defineProperty,hX=(t,e)=>{for(var s in e)uX(t,s,{get:e[s],enumerable:!0})},mX="listItem",pS="textStyle",xS=/^\s*([-+*])\s$/,UA=tn.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:t}){return["ul",At(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>t.type!=="list"||t.ordered?[]:{type:"bulletList",content:t.items?e.parseChildren(t.items):[]},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 870`):"",markdownOptions:{indentsContent:!0},addCommands(){return{toggleBulletList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(mX,this.editor.getAttributes(pS)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let t=Mc({find:xS,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mc({find:xS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(pS),editor:this.editor})),[t]}}),HA=tn.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:t}){return["li",At(this.options.HTMLAttributes,t),0]},markdownTokenName:"list_item",parseMarkdown:(t,e)=>{if(t.type!=="list_item")return[];let s=[];if(t.tokens&&t.tokens.length>0)if(t.tokens.some(a=>a.type==="paragraph"))s=e.parseChildren(t.tokens);else{const a=t.tokens[0];if(a&&a.type==="text"&&a.tokens&&a.tokens.length>0){if(s=[{type:"paragraph",content:e.parseInline(a.tokens)}],t.tokens.length>1){const o=t.tokens.slice(1),l=e.parseChildren(o);s.push(...l)}}else s=e.parseChildren(t.tokens)}return s.length===0&&(s=[{type:"paragraph",content:[]}]),{type:"listItem",content:s}},renderMarkdown:(t,e,s)=>T1(t,e,n=>{var a,i;return n.parentType==="bulletList"?"- ":n.parentType==="orderedList"?`${(((i=(a=n.meta)==null?void 0:a.parentAttrs)==null?void 0:i.start)||1)+n.index}. `:"- "},s),addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),fX={};hX(fX,{findListItemPos:()=>mh,getNextListDepth:()=>$1,handleBackspace:()=>Qy,handleDelete:()=>Xy,hasListBefore:()=>WA,hasListItemAfter:()=>pX,hasListItemBefore:()=>GA,listItemHasSubList:()=>YA,nextListIsDeeper:()=>qA,nextListIsHigher:()=>KA});var mh=(t,e)=>{const{$from:s}=e.selection,n=qt(t,e.schema);let a=null,i=s.depth,o=s.pos,l=null;for(;i>0&&l===null;)a=s.node(i),a.type===n?l=i:(i-=1,o-=1);return l===null?null:{$pos:e.doc.resolve(o),depth:l}},$1=(t,e)=>{const s=mh(t,e);if(!s)return!1;const[,n]=nK(e,t,s.$pos.pos+4);return n},WA=(t,e,s)=>{const{$anchor:n}=t.selection,a=Math.max(0,n.pos-2),i=t.doc.resolve(a).node();return!(!i||!s.includes(i.type.name))},GA=(t,e)=>{var s;const{$anchor:n}=e.selection,a=e.doc.resolve(n.pos-2);return!(a.index()===0||((s=a.nodeBefore)==null?void 0:s.type.name)!==t)},YA=(t,e,s)=>{if(!s)return!1;const n=qt(t,e.schema);let a=!1;return s.descendants(i=>{i.type===n&&(a=!0)}),a},Qy=(t,e,s)=>{if(t.commands.undoInputRule())return!0;if(t.state.selection.from!==t.state.selection.to)return!1;if(!qi(t.state,e)&&WA(t.state,e,s)){const{$anchor:l}=t.state.selection,c=t.state.doc.resolve(l.before()-1),d=[];c.node().descendants((m,f)=>{m.type.name===e&&d.push({node:m,pos:f})});const u=d.at(-1);if(!u)return!1;const h=t.state.doc.resolve(c.start()+u.pos+1);return t.chain().cut({from:l.start()-1,to:l.end()+1},h.end()).joinForward().run()}if(!qi(t.state,e)||!oK(t.state))return!1;const n=mh(e,t.state);if(!n)return!1;const i=t.state.doc.resolve(n.$pos.pos-2).node(n.depth),o=YA(e,t.state,i);return GA(e,t.state)&&!o?t.commands.joinItemBackward():t.chain().liftListItem(e).run()},qA=(t,e)=>{const s=$1(t,e),n=mh(t,e);return!n||!s?!1:s>n.depth},KA=(t,e)=>{const s=$1(t,e),n=mh(t,e);return!n||!s?!1:s<n.depth},Xy=(t,e)=>{if(!qi(t.state,e)||!iK(t.state,e))return!1;const{selection:s}=t.state,{$from:n,$to:a}=s;return!s.empty&&n.sameParent(a)?!1:qA(e,t.state)?t.chain().focus(t.state.selection.from+4).lift(e).joinBackward().run():KA(e,t.state)?t.chain().joinForward().joinBackward().run():t.commands.joinItemForward()},pX=(t,e)=>{var s;const{$anchor:n}=e.selection,a=e.doc.resolve(n.pos-n.parentOffset-2);return!(a.index()===a.parent.childCount-1||((s=a.nodeAfter)==null?void 0:s.type.name)!==t)},JA=$t.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:s})=>{t.state.schema.nodes[s]!==void 0&&Xy(t,s)&&(e=!0)}),e},"Mod-Delete":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:s})=>{t.state.schema.nodes[s]!==void 0&&Xy(t,s)&&(e=!0)}),e},Backspace:({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:s,wrapperNames:n})=>{t.state.schema.nodes[s]!==void 0&&Qy(t,s,n)&&(e=!0)}),e},"Mod-Backspace":({editor:t})=>{let e=!1;return this.options.listTypes.forEach(({itemName:s,wrapperNames:n})=>{t.state.schema.nodes[s]!==void 0&&Qy(t,s,n)&&(e=!0)}),e}}}}),gS=/^(\s*)(\d+)\.\s+(.*)$/,xX=/^\s/;function gX(t){const e=[];let s=0,n=0;for(;s<t.length;){const a=t[s],i=a.match(gS);if(!i)break;const[,o,l,c]=i,d=o.length;let u=c,h=s+1;const m=[a];for(;h<t.length;){const f=t[h];if(f.match(gS))break;if(f.trim()==="")m.push(f),u+=` 871`,h+=1;else if(f.match(xX))m.push(f),u+=` 872${f.slice(d+2)}`,h+=1;else break}e.push({indent:d,number:parseInt(l,10),content:u.trim(),raw:m.join(` 873`)}),n=h,s=h}return[e,n]}function QA(t,e,s){var n;const a=[];let i=0;for(;i<t.length;){const o=t[i];if(o.indent===e){const l=o.content.split(` 874`),c=((n=l[0])==null?void 0:n.trim())||"",d=[];c&&d.push({type:"paragraph",raw:c,tokens:s.inlineTokens(c)});const u=l.slice(1).join(` 875`).trim();if(u){const f=s.blockTokens(u);d.push(...f)}let h=i+1;const m=[];for(;h<t.length&&t[h].indent>e;)m.push(t[h]),h+=1;if(m.length>0){const f=Math.min(...m.map(g=>g.indent)),p=QA(m,f,s);d.push({type:"list",ordered:!0,start:m[0].number,items:p,raw:m.map(g=>g.raw).join(` 876`)})}a.push({type:"list_item",raw:o.raw,tokens:d}),i=h}else i+=1}return a}function bX(t,e){return t.map(s=>{if(s.type!=="list_item")return e.parseChildren([s])[0];const n=[];return s.tokens&&s.tokens.length>0&&s.tokens.forEach(a=>{if(a.type==="paragraph"||a.type==="list"||a.type==="blockquote"||a.type==="code")n.push(...e.parseChildren([a]));else if(a.type==="text"&&a.tokens){const i=e.parseChildren([a]);n.push({type:"paragraph",content:i})}else{const i=e.parseChildren([a]);i.length>0&&n.push(...i)}}),{type:"listItem",content:n}})}var yX="listItem",bS="textStyle",yS=/^(\d+)\.\s$/,XA=tn.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:t=>t.hasAttribute("start")?parseInt(t.getAttribute("start")||"",10):1},type:{default:null,parseHTML:t=>t.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:t}){const{start:e,...s}=t;return e===1?["ol",At(this.options.HTMLAttributes,s),0]:["ol",At(this.options.HTMLAttributes,t),0]},markdownTokenName:"list",parseMarkdown:(t,e)=>{if(t.type!=="list"||!t.ordered)return[];const s=t.start||1,n=t.items?bX(t.items,e):[];return s!==1?{type:"orderedList",attrs:{start:s},content:n}:{type:"orderedList",content:n}},renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 877`):"",markdownTokenizer:{name:"orderedList",level:"block",start:t=>{const e=t.match(/^(\s*)(\d+)\.\s+/),s=e==null?void 0:e.index;return s!==void 0?s:-1},tokenize:(t,e,s)=>{var n;const a=t.split(` 878`),[i,o]=gX(a);if(i.length===0)return;const l=QA(i,0,s);return l.length===0?void 0:{type:"list",ordered:!0,start:((n=i[0])==null?void 0:n.number)||1,items:l,raw:a.slice(0,o).join(` 879`)}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleOrderedList:()=>({commands:t,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(yX,this.editor.getAttributes(bS)).run():t.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let t=Mc({find:yS,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,s)=>s.childCount+s.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(t=Mc({find:yS,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(bS)}),joinPredicate:(e,s)=>s.childCount+s.attrs.start===+e[1],editor:this.editor})),[t]}}),vX=/^\s*(\[([( |x])?\])\s$/,wX=tn.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList",a11y:void 0}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:t=>{const e=t.getAttribute("data-checked");return e===""||e==="true"},renderHTML:t=>({"data-checked":t.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:t,HTMLAttributes:e}){return["li",At(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:t.attrs.checked?"checked":null}],["span"]],["div",0]]},parseMarkdown:(t,e)=>{const s=[];if(t.tokens&&t.tokens.length>0?s.push(e.createNode("paragraph",{},e.parseInline(t.tokens))):t.text?s.push(e.createNode("paragraph",{},[e.createNode("text",{text:t.text})])):s.push(e.createNode("paragraph",{},[])),t.nestedTokens&&t.nestedTokens.length>0){const n=e.parseChildren(t.nestedTokens);s.push(...n)}return e.createNode("taskItem",{checked:t.checked||!1},s)},renderMarkdown:(t,e)=>{var s;const a=`- [${(s=t.attrs)!=null&&s.checked?"x":" "}] `;return T1(t,e,a)},addKeyboardShortcuts(){const t={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...t,Tab:()=>this.editor.commands.sinkListItem(this.name)}:t},addNodeView(){return({node:t,HTMLAttributes:e,getPos:s,editor:n})=>{const a=document.createElement("li"),i=document.createElement("label"),o=document.createElement("span"),l=document.createElement("input"),c=document.createElement("div"),d=h=>{var m,f;l.ariaLabel=((f=(m=this.options.a11y)==null?void 0:m.checkboxLabel)==null?void 0:f.call(m,h,l.checked))||`Task item checkbox for ${h.textContent||"empty task item"}`};d(t),i.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",h=>h.preventDefault()),l.addEventListener("change",h=>{if(!n.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}const{checked:m}=h.target;n.isEditable&&typeof s=="function"&&n.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{const p=s();if(typeof p!="number")return!1;const g=f.doc.nodeAt(p);return f.setNodeMarkup(p,void 0,{...g==null?void 0:g.attrs,checked:m}),!0}).run(),!n.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(t,m)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([h,m])=>{a.setAttribute(h,m)}),a.dataset.checked=t.attrs.checked,l.checked=t.attrs.checked,i.append(l,o),a.append(i,c),Object.entries(e).forEach(([h,m])=>{a.setAttribute(h,m)});let u=new Set(Object.keys(e));return{dom:a,contentDOM:c,update:h=>{if(h.type!==this.type)return!1;a.dataset.checked=h.attrs.checked,l.checked=h.attrs.checked,d(h);const m=n.extensionManager.attributes,f=Tc(h,m),p=new Set(Object.keys(f)),g=this.options.HTMLAttributes;return u.forEach(x=>{p.has(x)||(x in g?a.setAttribute(x,g[x]):a.removeAttribute(x))}),Object.entries(f).forEach(([x,b])=>{b==null?x in g?a.setAttribute(x,g[x]):a.removeAttribute(x):a.setAttribute(x,b)}),u=p,!0}}}}
vendor: 8,320 bytes, lines 879-880
879,addInputRules(){return[Mc({find:vX,type:this.type,getAttributes:t=>({checked:t[t.length-1]==="x"})})]}}),jX=tn.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:t}){return["ul",At(this.options.HTMLAttributes,t,{"data-type":this.name}),0]},parseMarkdown:(t,e)=>e.createNode("taskList",{},e.parseChildren(t.items||[])),renderMarkdown:(t,e)=>t.content?e.renderChildren(t.content,` 880`):"",markdownTokenizer:{name:"taskList",level:"block",start(t){var e;const s=(e=t.match(/^\s*[-+*]\s+\[([ xX])\]\s+/))==null?void 0:e.index;return s!==void 0?s:-1},tokenize(t,e,s){const n=i=>{const o=By(i,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:l=>({indentLevel:l[1].length,mainContent:l[4],checked:l[3].toLowerCase()==="x"}),createToken:(l,c)=>({type:"taskItem",raw:"",mainContent:l.mainContent,indentLevel:l.indentLevel,checked:l.checked,text:l.mainContent,tokens:s.inlineTokens(l.mainContent),nestedTokens:c}),customNestedParser:n},s);return o?[{type:"taskList",raw:o.raw,items:o.items}]:s.blockTokens(i)},a=By(t,{itemPattern:/^(\s*)([-+*])\s+\[([ xX])\]\s+(.*)$/,extractItemData:i=>({indentLevel:i[1].length,mainContent:i[4],checked:i[3].toLowerCase()==="x"}),createToken:(i,o)=>({type:"taskItem",raw:"",mainContent:i.mainContent,indentLevel:i.indentLevel,checked:i.checked,text:i.mainContent,tokens:s.inlineTokens(i.mainContent),nestedTokens:o}),customNestedParser:n},s);if(a)return{type:"taskList",raw:a.raw,items:a.items}}},markdownOptions:{indentsContent:!0},addCommands(){return{toggleTaskList:()=>({commands:t})=>t.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}});$t.create({name:"listKit",addExtensions(){const t=[];return this.options.bulletList!==!1&&t.push(UA.configure(this.options.bulletList)),this.options.listItem!==!1&&t.push(HA.configure(this.options.listItem)),this.options.listKeymap!==!1&&t.push(JA.configure(this.options.listKeymap)),this.options.orderedList!==!1&&t.push(XA.configure(this.options.orderedList)),this.options.taskItem!==!1&&t.push(wX.configure(this.options.taskItem)),this.options.taskList!==!1&&t.push(jX.configure(this.options.taskList)),t}});var vS=" ",NX="Â ",kX=tn.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:t}){return["p",At(this.options.HTMLAttributes,t),0]},parseMarkdown:(t,e)=>{const s=t.tokens||[];if(s.length===1&&s[0].type==="image")return e.parseChildren([s[0]]);const n=e.parseInline(s);return n.length===1&&n[0].type==="text"&&(n[0].text===vS||n[0].text===NX)?e.createNode("paragraph",void 0,[]):e.createNode("paragraph",void 0,n)},renderMarkdown:(t,e)=>{if(!t)return"";const s=Array.isArray(t.content)?t.content:[];return s.length===0?vS:e.renderChildren(s)},addCommands(){return{setParagraph:()=>({commands:t})=>t.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),CX=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,SX=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,_X=ul.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["s",At(this.options.HTMLAttributes,t),0]},markdownTokenName:"del",parseMarkdown:(t,e)=>e.applyMark("strike",e.parseInline(t.tokens||[])),renderMarkdown:(t,e)=>`~~${e.renderChildren(t)}~~`,addCommands(){return{setStrike:()=>({commands:t})=>t.setMark(this.name),toggleStrike:()=>({commands:t})=>t.toggleMark(this.name),unsetStrike:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[Ec({find:CX,type:this.type})]},addPasteRules(){return[el({find:SX,type:this.type})]}}),TX=tn.create({name:"text",group:"inline",parseMarkdown:t=>({type:"text",text:t.text||""}),renderMarkdown:t=>t.text||""}),ZA=ul.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:t=>t.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:t}){return["u",At(this.options.HTMLAttributes,t),0]},parseMarkdown(t,e){return e.applyMark(this.name||"underline",e.parseInline(t.tokens||[]))},renderMarkdown(t,e){return`++${e.renderChildren(t)}++`},markdownTokenizer:{name:"underline",level:"inline",start(t){return t.indexOf("++")},tokenize(t,e,s){const a=/^(\+\+)([\s\S]+?)(\+\+)/.exec(t);if(!a)return;const i=a[2].trim();return{type:"underline",raw:a[0],text:i,tokens:s.inlineTokens(i)}}},addCommands(){return{setUnderline:()=>({commands:t})=>t.setMark(this.name),toggleUnderline:()=>({commands:t})=>t.toggleMark(this.name),unsetUnderline:()=>({commands:t})=>t.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),EX=ZA;function MX(t={}){return new Ct({view(e){return new AX(e,t)}})}class AX{constructor(e,s){var n;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(n=s.width)!==null&&n!==void 0?n:1,this.color=s.color===!1?void 0:s.color||"black",this.class=s.class,this.handlers=["dragover","dragend","drop","dragleave"].map(a=>{let i=o=>{this[a](o)};return e.dom.addEventListener(a,i),{name:a,handler:i}})}destroy(){this.handlers.forEach(({name:e,handler:s})=>this.editorView.dom.removeEventListener(e,s))}update(e,s){this.cursorPos!=null&&s.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),s=!e.parent.inlineContent,n,a=this.editorView.dom,i=a.getBoundingClientRect(),o=i.width/a.offsetWidth,l=i.height/a.offsetHeight;if(s){let h=e.nodeBefore,m=e.nodeAfter;if(h||m){let f=this.editorView.nodeDOM(this.cursorPos-(h?h.nodeSize:0));if(f){let p=f.getBoundingClientRect(),g=h?p.bottom:p.top;h&&m&&(g=(g+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let x=this.width/2*l;n={left:p.left,right:p.right,top:g-x,bottom:g+x}}}}if(!n){let h=this.editorView.coordsAtPos(this.cursorPos),m=this.width/2*o;n={left:h.left-m,right:h.left+m,top:h.top,bottom:h.bottom}}let c=this.editorView.dom.offsetParent;this.element||(this.element=c.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",s),this.element.classList.toggle("prosemirror-dropcursor-inline",!s);let d,u;if(!c||c==document.body&&getComputedStyle(c).position=="static")d=-pageXOffset,u=-pageYOffset;else{let h=c.getBoundingClientRect(),m=h.width/c.offsetWidth,f=h.height/c.offsetHeight;d=h.left-c.scrollLeft*m,u=h.top-c.scrollTop*f}this.element.style.left=(n.left-d)/o+"px",this.element.style.top=(n.top-u)/l+"px",this.element.style.width=(n.right-n.left)/o+"px",this.element.style.height=(n.bottom-n.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let s=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),n=s&&s.inside>=0&&this.editorView.state.doc.nodeAt(s.inside),a=n&&n.type.spec.disableDropCursor,i=typeof a=="function"?a(this.editorView,s,e):a;if(s&&!i){let o=s.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=VM(this.editorView.state.doc,o,this.editorView.dragging.slice);l!=null&&(o=l)}this.setCursor(o),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}}class Mt extends Fe{constructor(e){super(e,e)}
vendor: 20,718 bytes, line 880
880map(e,s){let n=e.resolve(s.map(this.head));return Mt.valid(n)?new Mt(n):Fe.near(n)}content(){return me.empty}eq(e){return e instanceof Mt&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,s){if(typeof s.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new Mt(e.resolve(s.pos))}getBookmark(){return new z1(this.anchor)}static valid(e){let s=e.parent;if(s.isTextblock||!PX(e)||!DX(e))return!1;let n=s.type.spec.allowGapCursor;if(n!=null)return n;let a=s.contentMatchAt(e.index()).defaultType;return a&&a.isTextblock}static findGapCursorFrom(e,s,n=!1){e:for(;;){if(!n&&Mt.valid(e))return e;let a=e.pos,i=null;for(let o=e.depth;;o--){let l=e.node(o);if(s>0?e.indexAfter(o)<l.childCount:e.index(o)>0){i=l.child(s>0?e.indexAfter(o):e.index(o)-1);break}else if(o==0)return null;a+=s;let c=e.doc.resolve(a);if(Mt.valid(c))return c}for(;;){let o=s>0?i.firstChild:i.lastChild;if(!o){if(i.isAtom&&!i.isText&&!Ce.isSelectable(i)){e=e.doc.resolve(a+i.nodeSize*s),n=!1;continue e}break}i=o,a+=s;let l=e.doc.resolve(a);if(Mt.valid(l))return l}return null}}}Mt.prototype.visible=!1;Mt.findFrom=Mt.findGapCursorFrom;Fe.jsonID("gapcursor",Mt);class z1{constructor(e){this.pos=e}map(e){return new z1(e.map(this.pos))}resolve(e){let s=e.resolve(this.pos);return Mt.valid(s)?new Mt(s):Fe.near(s)}}function eP(t){return t.isAtom||t.spec.isolating||t.spec.createGapCursor}function PX(t){for(let e=t.depth;e>=0;e--){let s=t.index(e),n=t.node(e);if(s==0){if(n.type.spec.isolating)return!0;continue}for(let a=n.child(s-1);;a=a.lastChild){if(a.childCount==0&&!a.inlineContent||eP(a.type))return!0;if(a.inlineContent)return!1}}return!0}function DX(t){for(let e=t.depth;e>=0;e--){let s=t.indexAfter(e),n=t.node(e);if(s==n.childCount){if(n.type.spec.isolating)return!0;continue}for(let a=n.child(s);;a=a.firstChild){if(a.childCount==0&&!a.inlineContent||eP(a.type))return!0;if(a.inlineContent)return!1}}return!0}function RX(){return new Ct({props:{decorations:FX,createSelectionBetween(t,e,s){return e.pos==s.pos&&Mt.valid(s)?new Mt(s):null},handleClick:OX,handleKeyDown:LX,handleDOMEvents:{beforeinput:IX}}})}const LX=U5({ArrowLeft:cm("horiz",-1),ArrowRight:cm("horiz",1),ArrowUp:cm("vert",-1),ArrowDown:cm("vert",1)});function cm(t,e){const s=t=="vert"?e>0?"down":"up":e>0?"right":"left";return function(n,a,i){let o=n.selection,l=e>0?o.$to:o.$from,c=o.empty;if(o instanceof Me){if(!i.endOfTextblock(s)||l.depth==0)return!1;c=!1,l=n.doc.resolve(e>0?l.after():l.before())}let d=Mt.findGapCursorFrom(l,e,c);return d?(a&&a(n.tr.setSelection(new Mt(d))),!0):!1}}function OX(t,e,s){if(!t||!t.editable)return!1;let n=t.state.doc.resolve(e);if(!Mt.valid(n))return!1;let a=t.posAtCoords({left:s.clientX,top:s.clientY});return a&&a.inside>-1&&Ce.isSelectable(t.state.doc.nodeAt(a.inside))?!1:(t.dispatch(t.state.tr.setSelection(new Mt(n))),!0)}function IX(t,e){if(e.inputType!="insertCompositionText"||!(t.state.selection instanceof Mt))return!1;let{$from:s}=t.state.selection,n=s.parent.contentMatchAt(s.index()).findWrapping(t.state.schema.nodes.text);if(!n)return!1;let a=se.empty;for(let o=n.length-1;o>=0;o--)a=se.from(n[o].createAndFill(null,a));let i=t.state.tr.replace(s.pos,s.pos,new me(a,0,0));return i.setSelection(Me.near(i.doc.resolve(s.pos+1))),t.dispatch(i),!1}function FX(t){if(!(t.selection instanceof Mt))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",bt.create(t.doc,[Us.widget(t.selection.head,e,{key:"gapcursor"})])}var Cp=200,us=function(){};us.prototype.append=function(e){return e.length?(e=us.from(e),!this.length&&e||e.length<Cp&&this.leafAppend(e)||this.length<Cp&&e.leafPrepend(this)||this.appendInner(e)):this};us.prototype.prepend=function(e){return e.length?us.from(e).append(this):this};us.prototype.appendInner=function(e){return new $X(this,e)};us.prototype.slice=function(e,s){return e===void 0&&(e=0),s===void 0&&(s=this.length),e>=s?us.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,s))};us.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};us.prototype.forEach=function(e,s,n){s===void 0&&(s=0),n===void 0&&(n=this.length),s<=n?this.forEachInner(e,s,n,0):this.forEachInvertedInner(e,s,n,0)};us.prototype.map=function(e,s,n){s===void 0&&(s=0),n===void 0&&(n=this.length);var a=[];return this.forEach(function(i,o){return a.push(e(i,o))},s,n),a};us.from=function(e){return e instanceof us?e:e&&e.length?new tP(e):us.empty};var tP=function(t){function e(n){t.call(this),this.values=n}t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e;var s={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(a,i){return a==0&&i==this.length?this:new e(this.values.slice(a,i))},e.prototype.getInner=function(a){return this.values[a]},e.prototype.forEachInner=function(a,i,o,l){for(var c=i;c<o;c++)if(a(this.values[c],l+c)===!1)return!1},e.prototype.forEachInvertedInner=function(a,i,o,l){for(var c=i-1;c>=o;c--)if(a(this.values[c],l+c)===!1)return!1},e.prototype.leafAppend=function(a){if(this.length+a.length<=Cp)return new e(this.values.concat(a.flatten()))},e.prototype.leafPrepend=function(a){if(this.length+a.length<=Cp)return new e(a.flatten().concat(this.values))},s.length.get=function(){return this.values.length},s.depth.get=function(){return 0},Object.defineProperties(e.prototype,s),e}(us);us.empty=new tP([]);var $X=function(t){function e(s,n){t.call(this),this.left=s,this.right=n,this.length=s.length+n.length,this.depth=Math.max(s.depth,n.depth)+1}return t&&(e.__proto__=t),e.prototype=Object.create(t&&t.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(n){return n<this.left.length?this.left.get(n):this.right.get(n-this.left.length)},e.prototype.forEachInner=function(n,a,i,o){var l=this.left.length;if(a<l&&this.left.forEachInner(n,a,Math.min(i,l),o)===!1||i>l&&this.right.forEachInner(n,Math.max(a-l,0),Math.min(this.length,i)-l,o+l)===!1)return!1},e.prototype.forEachInvertedInner=function(n,a,i,o){var l=this.left.length;if(a>l&&this.right.forEachInvertedInner(n,a-l,Math.max(i,l)-l,o+l)===!1||i<l&&this.left.forEachInvertedInner(n,Math.min(a,l),i,o)===!1)return!1},e.prototype.sliceInner=function(n,a){if(n==0&&a==this.length)return this;var i=this.left.length;return a<=i?this.left.slice(n,a):n>=i?this.right.slice(n-i,a-i):this.left.slice(n,i).append(this.right.slice(0,a-i))},e.prototype.leafAppend=function(n){var a=this.right.leafAppend(n);if(a)return new e(this.left,a)},e.prototype.leafPrepend=function(n){var a=this.left.leafPrepend(n);if(a)return new e(a,this.right)},e.prototype.appendInner=function(n){return this.left.depth>=Math.max(this.right.depth,n.depth)+1?new e(this.left,new e(this.right,n)):new e(this,n)},e}(us);const zX=500;class Nr{constructor(e,s){this.items=e,this.eventCount=s}popEvent(e,s){if(this.eventCount==0)return null;let n=this.items.length;for(;;n--)if(this.items.get(n-1).selection){--n;break}let a,i;s&&(a=this.remapping(n,this.items.length),i=a.maps.length);let o=e.tr,l,c,d=[],u=[];return this.items.forEach((h,m)=>{if(!h.step){a||(a=this.remapping(n,m+1),i=a.maps.length),i--,u.push(h);return}if(a){u.push(new Vr(h.map));let f=h.step.map(a.slice(i)),p;f&&o.maybeStep(f).doc&&(p=o.mapping.maps[o.mapping.maps.length-1],d.push(new Vr(p,void 0,void 0,d.length+u.length))),i--,p&&a.appendMap(p,i)}else o.maybeStep(h.step);if(h.selection)return l=a?h.selection.map(a.slice(i)):h.selection,c=new Nr(this.items.slice(0,n).append(u.reverse().concat(d)),this.eventCount-1),!1},this.items.length,0),{remaining:c,transform:o,selection:l}}addTransform(e,s,n,a){let i=[],o=this.eventCount,l=this.items,c=!a&&l.length?l.get(l.length-1):null;for(let u=0;u<e.steps.length;u++){let h=e.steps[u].invert(e.docs[u]),m=new Vr(e.mapping.maps[u],h,s),f;(f=c&&c.merge(m))&&(m=f,u?i.pop():l=l.slice(0,l.length-1)),i.push(m),s&&(o++,s=void 0),a||(c=m)}let d=o-n.depth;return d>VX&&(l=BX(l,d),o-=d),new Nr(l.append(i),o)}remapping(e,s){let n=new $u;return this.items.forEach((a,i)=>{let o=a.mirrorOffset!=null&&i-a.mirrorOffset>=e?n.maps.length-a.mirrorOffset:void 0;n.appendMap(a.map,o)},e,s),n}addMaps(e){return this.eventCount==0?this:new Nr(this.items.append(e.map(s=>new Vr(s))),this.eventCount)}rebased(e,s){if(!this.eventCount)return this;let n=[],a=Math.max(0,this.items.length-s),i=e.mapping,o=e.steps.length,l=this.eventCount;this.items.forEach(m=>{m.selection&&l--},a);let c=s;this.items.forEach(m=>{let f=i.getMirror(--c);if(f==null)return;o=Math.min(o,f);let p=i.maps[f];if(m.step){let g=e.steps[f].invert(e.docs[f]),x=m.selection&&m.selection.map(i.slice(c+1,f));x&&l++,n.push(new Vr(p,g,x))}else n.push(new Vr(p))},a);let d=[];for(let m=s;m<o;m++)d.push(new Vr(i.maps[m]));let u=this.items.slice(0,a).append(d).append(n),h=new Nr(u,l);return h.emptyItemCount()>zX&&(h=h.compress(this.items.length-n.length)),h}emptyItemCount(){let e=0;return this.items.forEach(s=>{s.step||e++}),e}compress(e=this.items.length){let s=this.remapping(0,e),n=s.maps.length,a=[],i=0;return this.items.forEach((o,l)=>{if(l>=e)a.push(o),o.selection&&i++;else if(o.step){let c=o.step.map(s.slice(n)),d=c&&c.getMap();if(n--,d&&s.appendMap(d,n),c){let u=o.selection&&o.selection.map(s.slice(n));u&&i++;let h=new Vr(d.invert(),c,u),m,f=a.length-1;(m=a.length&&a[f].merge(h))?a[f]=m:a.push(h)}}else o.map&&n--},this.items.length,0),new Nr(us.from(a.reverse()),i)}}Nr.empty=new Nr(us.empty,0);function BX(t,e){let s;return t.forEach((n,a)=>{if(n.selection&&e--==0)return s=a,!1}),t.slice(s)}class Vr{constructor(e,s,n,a){this.map=e,this.step=s,this.selection=n,this.mirrorOffset=a}merge(e){if(this.step&&e.step&&!e.selection){let s=e.step.merge(this.step);if(s)return new Vr(s.getMap().invert(),s,this.selection)}}}class li{constructor(e,s,n,a,i){this.done=e,this.undone=s,this.prevRanges=n,this.prevTime=a,this.prevComposition=i}}const VX=20;function UX(t,e,s,n){let a=s.getMeta(Bo),i;if(a)return a.historyState;s.getMeta(GX)&&(t=new li(t.done,t.undone,null,0,-1));let o=s.getMeta("appendedTransaction");if(s.steps.length==0)return t;if(o&&o.getMeta(Bo))return o.getMeta(Bo).redo?new li(t.done.addTransform(s,void 0,n,Um(e)),t.undone,wS(s.mapping.maps),t.prevTime,t.prevComposition):new li(t.done,t.undone.addTransform(s,void 0,n,Um(e)),null,t.prevTime,t.prevComposition);if(s.getMeta("addToHistory")!==!1&&!(o&&o.getMeta("addToHistory")===!1)){let l=s.getMeta("composition"),c=t.prevTime==0||!o&&t.prevComposition!=l&&(t.prevTime<(s.time||0)-n.newGroupDelay||!HX(s,t.prevRanges)),d=o?P0(t.prevRanges,s.mapping):wS(s.mapping.maps);return new li(t.done.addTransform(s,c?e.selection.getBookmark():void 0,n,Um(e)),Nr.empty,d,s.time,l??t.prevComposition)}else return(i=s.getMeta("rebased"))?new li(t.done.rebased(s,i),t.undone.rebased(s,i),P0(t.prevRanges,s.mapping),t.prevTime,t.prevComposition):new li(t.done.addMaps(s.mapping.maps),t.undone.addMaps(s.mapping.maps),P0(t.prevRanges,s.mapping),t.prevTime,t.prevComposition)}function HX(t,e){if(!e)return!1;if(!t.docChanged)return!0;let s=!1;return t.mapping.maps[0].forEach((n,a)=>{for(let i=0;i<e.length;i+=2)n<=e[i+1]&&a>=e[i]&&(s=!0)}),s}function wS(t){let e=[];for(let s=t.length-1;s>=0&&e.length==0;s--)t[s].forEach((n,a,i,o)=>e.push(i,o));return e}function P0(t,e){if(!t)return null;let s=[];for(let n=0;n<t.length;n+=2){let a=e.map(t[n],1),i=e.map(t[n+1],-1);a<=i&&s.push(a,i)}return s}function WX(t,e,s){let n=Um(e),a=Bo.get(e).spec.config,i=(s?t.undone:t.done).popEvent(e,n);if(!i)return null;let o=i.selection.resolve(i.transform.doc),l=(s?t.done:t.undone).addTransform(i.transform,e.selection.getBookmark(),a,n),c=new li(s?l:i.remaining,s?i.remaining:l,null,0,-1);return i.transform.setSelection(o).setMeta(Bo,{redo:s,historyState:c})}let D0=!1,jS=null;function Um(t){let e=t.plugins;if(jS!=e){D0=!1,jS=e;for(let s=0;s<e.length;s++)if(e[s].spec.historyPreserveItems){D0=!0;break}}return D0}const Bo=new ts("history"),GX=new ts("closeHistory");function YX(t={}){return t={depth:t.depth||100,newGroupDelay:t.newGroupDelay||500},new Ct({key:Bo,state:{init(){return new li(Nr.empty,Nr.empty,null,0,-1)},apply(e,s,n){return UX(s,n,e,t)}},config:t,props:{handleDOMEvents:{beforeinput(e,s){let n=s.inputType,a=n=="historyUndo"?nP:n=="historyRedo"?rP:null;return!a||!e.editable?!1:(s.preventDefault(),a(e.state,e.dispatch))}}}})}function sP(t,e){return(s,n)=>{let a=Bo.getState(s);if(!a||(t?a.undone:a.done).eventCount==0)return!1;if(n){let i=WX(a,s,t);i&&n(e?i.scrollIntoView():i)}return!0}}const nP=sP(!1,!0),rP=sP(!0,!0);$t.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:t=>t.length,wordCounter:t=>t.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc;if(((t==null?void 0:t.mode)||this.options.mode)==="textSize"){const n=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(n)}return e.nodeSize},this.storage.words=t=>{const e=(t==null?void 0:t.node)||this.editor.state.doc,s=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(s)}},addProseMirrorPlugins(){let t=!1;return[new Ct({key:new ts("characterCount"),appendTransaction:(e,s,n)=>{if(t)return;const a=this.options.limit;if(a==null||a===0){t=!0;return}const i=this.storage.characters({node:n.doc});if(i>a){const o=i-a,l=0,c=o;console.warn(`[CharacterCount] Initial content exceeded limit of ${a} characters. Content was automatically trimmed.`);const d=n.tr.deleteRange(l,c);return t=!0,d}t=!0},filterTransaction:(e,s)=>{const n=this.options.limit;if(!e.docChanged||n===0||n===null||n===void 0)return!0;const a=this.storage.characters({node:s.doc}),i=this.storage.characters({node:e.doc});if(i<=n||a>n&&i>n&&i<=a)return!0;if(a>n&&i>n&&i>a||!e.getMeta("paste"))return!1;const l=e.selection.$head.pos,c=i-n,d=l-c,u=l;return e.deleteRange(d,u),!(this.storage.characters({node:e.doc})>n)}})]}});var qX=$t.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[MX(this.options)]}});$t.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new Ct({key:new ts("focus"),props:{decorations:({doc:t,selection:e})=>{const{isEditable:s,isFocused:n}=this.editor,{anchor:a}=e,i=[];if(!s||!n)return bt.create(t,[]);let o=0;this.options.mode==="deepest"&&t.descendants((c,d)=>{if(c.isText)return;if(!(a>=d&&a<=d+c.nodeSize-1))return!1;o+=1});let l=0;return t.descendants((c,d)=>{if(c.isText||!(a>=d&&a<=d+c.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&o-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";i.push(Us.node(d,d+c.nodeSize,{class:this.options.className}))}),bt.create(t,i)}}})]}});var KX=$t.create({name:"gapCursor",addProseMirrorPlugins(){return[RX()]},extendNodeSchema(t){var e;const s={name:t.name,options:t.options,storage:t.storage};return{allowGapCursor:(e=Xe(ke(t,"allowGapCursor",s)))!=null?e:null}}}),NS="placeholder";function JX(t){return t.replace(/\s+/g,"-").replace(/[^a-zA-Z0-9-]/g,"").replace(/^[0-9-]+/,"").replace(/^-+/,"").toLowerCase()}var QX=$t.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",dataAttribute:NS,placeholder:"Write something â¦",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){const t=this.options.dataAttribute?`data-${JX(this.options.dataAttribute)}`:`data-${NS}`;return[new Ct({key:new ts("placeholder"),props:{decorations:({doc:e,selection:s})=>{const n=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:a}=s,i=[];if(!n)return null;const o=this.editor.isEmpty;return e.descendants((l,c)=>{const d=a>=c&&a<=c+l.nodeSize,u=!l.isLeaf&&Rx(l);if((d||!this.options.showOnlyCurrent)&&u){const h=[this.options.emptyNodeClass];o&&h.push(this.options.emptyEditorClass);const m=Us.node(c,c+l.nodeSize,{class:h.join(" "),[t]:typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:l,pos:c,hasAnchor:d}):this.options.placeholder});i.push(m)}return this.options.includeChildren}),bt.create(e,i)}}})]}});$t.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){const{editor:t,options:e}=this;return[new Ct({key:new ts("selection"),props:{decorations(s){return s.selection.empty||t.isFocused||!t.isEditable||aA(s.selection)||t.view.dragging?null:bt.create(s.doc,[Us.inline(s.selection.from,s.selection.to,{class:e.className})])}}})]}});function kS({types:t,node:e}){return e&&Array.isArray(t)&&t.includes(e.type)||(e==null?void 0:e.type)===t}var XX=$t.create({name:"trailingNode",addOptions(){return{node:void 0,notAfter:[]}},addProseMirrorPlugins(){var t;const e=new ts(this.name),s=this.options.node||((t=this.editor.schema.topNodeType.contentMatch.defaultType)==null?void 0:t.name)||"paragraph",n=Object.entries(this.editor.schema.nodes).map(([,a])=>a).filter(a=>(this.options.notAfter||[]).concat(s).includes(a.name));return[new Ct({key:e,appendTransaction:(a,i,o)=>{const{doc:l,tr:c,schema:d}=o,u=e.getState(o),h=l.content.size,m=d.nodes[s];if(u)return c.insert(h,m.create())},state:{init:(a,i)=>{const o=i.tr.doc.lastChild;return!kS({node:o,types:n})},apply:(a,i)=>{if(!a.docChanged||a.getMeta("__uniqueIDTransaction"))return i;const o=a.doc.lastChild;return!kS({node:o,types:n})}}})]}}),ZX=$t.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:t,dispatch:e})=>nP(t,e),redo:()=>({state:t,dispatch:e})=>rP(t,e)}},addProseMirrorPlugins(){return[YX(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-Ñ":()=>this.editor.commands.undo(),"Shift-Mod-Ñ":()=>this.editor.commands.redo()}}}),eZ=$t.create({name:"starterKit",addExtensions(){var t,e,s,n;const a=[];return this.options.bold!==!1&&a.push(kQ.configure(this.options.bold)),this.options.blockquote!==!1&&a.push(yQ.configure(this.options.blockquote)),this.options.bulletList!==!1&&a.push(UA.configure(this.options.bulletList)),this.options.code!==!1&&a.push(_Q.configure(this.options.code)),this.options.codeBlock!==!1&&a.push(MQ.configure(this.options.codeBlock)),this.options.document!==!1&&a.push(AQ.configure(this.options.document)),this.options.dropcursor!==!1&&a.push(qX.configure(this.options.dropcursor)),this.options.gapcursor!==!1&&a.push(KX.configure(this.options.gapcursor)),this.options.hardBreak!==!1&&a.push(PQ.configure(this.options.hardBreak)),this.options.heading!==!1&&a.push(DQ.configure(this.options.heading)),this.options.undoRedo!==!1&&a.push(ZX.configure(this.options.undoRedo)),this.options.horizontalRule!==!1&&a.push(RQ.configure(this.options.horizontalRule)),this.options.italic!==!1&&a.push($Q.configure(this.options.italic)),this.options.listItem!==!1&&a.push(HA.configure(this.options.listItem)),this.options.listKeymap!==!1&&a.push(JA.configure((t=this.options)==null?void 0:t.listKeymap)),this.options.link!==!1&&a.push(VA.configure((e=this.options)==null?void 0:e.link)),this.options.orderedList!==!1&&a.push(XA.configure(this.options.orderedList)),this.options.paragraph!==!1&&a.push(kX.configure(this.options.paragraph)),this.options.strike!==!1&&a.push(_X.configure(this.options.strike)),this.options.text!==!1&&a.push(TX.configure(this.options.text)),this.options.underline!==!1&&a.push(ZA.configure((s=this.options)==null?void 0:s.underline)),this.options.trailingNode!==!1&&a.push(XX.configure((n=this.options)==null?void 0:n.trailingNode)),a}}),tZ=eZ,sZ=QX,nZ=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,rZ=tn.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{},resize:!1}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:t}){return["img",At(this.options.HTMLAttributes,t)]},parseMarkdown:(t,e)=>e.createNode("image",{src:t.href,title:t.title,alt:t.text}),renderMarkdown:t=>{var e,s,n,a,i,o;const l=(s=(e=t.attrs)==null?void 0:e.src)!=null?s:"",c=(a=(n=t.attrs)==null?void 0:n.alt)!=null?a:"",d=(o=(i=t.attrs)==null?void 0:i.title)!=null?o:"";return d?``:``}
880,addNodeView(){if(!this.options.resize||!this.options.resize.enabled||typeof document>"u")return null;const{directions:t,minWidth:e,minHeight:s,alwaysPreserveAspectRatio:n}=this.options.resize;return({node:a,getPos:i,HTMLAttributes:o,editor:l})=>{const c=document.createElement("img");Object.entries(o).forEach(([h,m])=>{if(m!=null)switch(h){case"width":case"height":break;default:c.setAttribute(h,m);break}}),c.src=o.src;const d=new YK({element:c,editor:l,node:a,getPos:i,onResize:(h,m)=>{c.style.width=`${h}px`,c.style.height=`${m}px`},onCommit:(h,m)=>{const f=i();f!==void 0&&this.editor.chain().setNodeSelection(f).updateAttributes(this.name,{width:h,height:m}).run()},onUpdate:(h,m,f)=>h.type===a.type,options:{directions:t,min:{width:e,height:s},preserveAspectRatio:n===!0}}),u=d.dom;return u.style.visibility="hidden",u.style.pointerEvents="none",c.onload=()=>{u.style.visibility="",u.style.pointerEvents=""},d}},addCommands(){return{setImage:t=>({commands:e})=>e.insertContent({type:this.name,attrs:t})}},addInputRules(){return[jA({find:nZ,type:this.t
880ype,getAttributes:t=>{const[,,e,s,n]=t;return{src:s,alt:e,title:n}}})]}}),aZ=rZ;function iZ(t){var s;const e=((s=t==null?void 0:t.split(".").pop())==null?void 0:s.toLowerCase())||"";return e==="pdf"?es:["xls","xlsx","csv"].includes(e)?v7:["ppt","pptx"].includes(e)?so:["jpg","jpeg","png"].includes(e)?y7:w7}function oZ({node:t,deleteNode:e}){const{src:s,filename:n}=t.attrs,a=iZ(n);return r.jsx(dQ,{as:"span",className:"inline-block my-1",children:r.jsxs("span",{contentEditable:!1,className:"inline-flex items-center gap-2 px-3 py-2 rounded-lg border border-slate-300 bg-slate-100 text-sm select-none cursor-default group",children:[r.jsx(a,{className:"h-4 w-4 text-slate-500 shrink-0"}),r.jsx("span",{className:"font-medium text-slate-700 max-w-[240px] truncate",children:n}),r.jsx("button",{type:"button",onClick:()=>window.open(s,"_blank"),className:"text-xs text-[#c08a2f] hover:underline shrink-0",children:"View"}),r.jsx("button",{type:"button",onClick:e,className:"text-slate-400 hover:text-red-500 shrink-0 ml-1",title:"Remove attachment",children:"Ã"})]})})}const lZ=tn.create({name:"attachment",group:"inline",inline:!0,atom:!0,addAttributes(){return{src:{default:null},filename:{default:"File"}}},parseHTML(){return[{tag:"span[data-attachment]"}]},renderHTML({HTMLAttributes:t}){const{src:e,filename:s}=t;return["span",At({"data-attachment":"true","data-src":e,"data-filename":s},{class:"attachment-card",style:"display:inline-flex;align-items:center;gap:6px;padding:4px 10px;border:1px solid #cbd5e1;border-radius:8px;background:#f1f5f9;font-size:0.875rem;"}),`ð ${s}`]},addNodeView(){return xQ(oZ)}});function Fr({editor:t,action:e,level:s,darkMode:n,icon:a,title:i}){const o=s?t.isActive(e,{level:s}):t.isActive(e),l=()=>{e==="heading"?t.chain().focus().toggleHeading({level:s}).run():e==="bold"?t.chain().focus().toggleBold().run():e==="italic"?t.chain().focus().toggleItalic().run():e==="underline"?t.chain().focus().toggleUnderline().run():e==="bulletList"?t.chain().focus().toggleBulletList().run():e==="orderedList"?t.chain().focus().toggleOrderedList().run():e==="blockquote"?t.chain().focus().toggleBlockquote().run():e==="horizontalRule"&&t.chain().focus().setHorizontalRule().run()};return r.jsx("button",{type:"button",onClick:l,className:`p-2 rounded transition ${n?o?"bg-slate-600 text-white":"text-slate-300 hover:bg-slate-600":o?"bg-slate-200 text-slate-900":"text-slate-600 hover:bg-slate-100"}`,title:i,children:r.jsx(a,{className:"h-4 w-4"})})}function cZ(t){return t?/<(?:p|div|h[1-6]|ul|ol|li|br|blockquote|table|img)[\s>/]/i.test(t)?t:t.split(/\n\s*\n/).filter(e=>e.trim()).map(e=>`<p>${e.replace(/\n/g,"<br>")}</p>`).join(` 881`):""}function $x({value:t,onChange:e,placeholder:s="Start typing...",className:n="",darkMode:a=!1,onImageUpload:i,onFileUpload:o,minHeight:l="200px"}){const c=v.useMemo(()=>cZ(t),[t]),d=lQ({extensions:[tZ.configure({link:!1,underline:!1}),sZ.configure({placeholder:s}),aZ.configure({inline:!1,allowBase64:!1}),dX.configure({openOnClick:!1,HTMLAttributes:{class:"text-[#c08a2f] underline"}}),EX,lZ],content:c||"",onUpdate:({editor:f})=>{e(f.getHTML())},editorProps:{attributes:{class:`prose prose-sm max-w-none focus:outline-none overflow-y-auto p-3 font-sans ${a?"prose-invert bg-slate-800 text-white":"prose-slate bg-white text-slate-900"}`,style:`min-height: ${l}; max-height: 500px;`}}});v.useEffect(()=>{d&&c!==d.getHTML()&&d.commands.setContent(c||"",!1)},[c,d]);const u=v.useCallback(async()=>{if(i){const f=document.createElement("input");f.type="file",f.accept="image/*",f.onchange=async p=>{var x;const g=(x=p.target.files)==null?void 0:x[0];if(g)try{const b=await i(g);b&&d&&d.chain().focus().setImage({src:b}).run()}catch(b){console.error("Image upload failed:",b)}},f.click()}else{const f=window.prompt("Image URL:");f&&d&&d.chain().focus().setImage({src:f}).run()}},[d,i]),h=v.useCallback(()=>{if(!o||!d)return;const f=document.createElement("input");f.type="file",f.accept=".pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx,.txt,.zip,.jpg,.jpeg,.png",f.onchange=async p=>{var x;const g=(x=p.target.files)==null?void 0:x[0];if(g)try{const{file_url:b,file_name:y}=await o(g);b&&d.chain().focus().insertContent({type:"attachment",attrs:{src:b,filename:y||g.name}}).run()}catch(b){console.error("File upload failed:",b)}},f.click()},[d,o]),m=v.useCallback(()=>
881{if(!d)return;const f=d.getAttributes("link").href,p=window.prompt("URL:",f||"https://");if(p!==null){if(p===""){d.chain().focus().extendMarkRange("link").unsetLink().run();return}d.chain().focus().extendMarkRange("link").setLink({href:p}).run()}},[d]);return d?r.jsxs("div",{className:`border rounded-lg ${a?"border-slate-600 bg-slate-800":"border-slate-300 bg-white"} ${n}`,children:[r.jsxs("div",{className:`border-b p-2 flex flex-wrap gap-1 ${a?"border-slate-600 bg-slate-700":"border-slate-200 bg-white"}`,children:[r.jsx(Fr,{editor:d,action:"bold",darkMode:a,icon:m7,title:"Bold"}),r.jsx(Fr,{editor:d,action:"italic",darkMode:a,icon:P7,title:"Italic"}),r.jsx(Fr,{editor:d,action:"underline",darkMode:a,icon:J7,title:"Underline"}),r.jsx("div",{className:`w-px h-6 mx-1 self-center ${a?"bg-slate-500":"bg-slate-300"}`}),r.jsx(Fr,{editor:d,action:"heading",level:1,darkMode:a,icon:C7,title:"Heading 1"}),r.jsx(Fr,{editor:d,action:"heading",level:2,darkMode:a,icon:S7,title:"Heading 2"}),r.jsx(Fr,{editor:d,action:"heading",level:3,darkMode:a,icon:_7,title:"Heading 3"}),r.jsx("div",{className:`w-px h-6 mx-1 self-center ${a?"bg-slate-500":"bg-slate-300"}`}),r.jsx(Fr,{editor:d,action:"bulletList",darkMode:a,icon:I7,title:"Bullet List"}),r.jsx(Fr,{editor:d,action:"orderedList",darkMode:a,icon:O7,title:"Numbered List"}),r.jsx(Fr,{editor:d,action:"blockquote",darkMode:a,icon:U7,title:"Quote"}),r.jsx(Fr,{editor:d,action:"horizontalRule",darkMode:a,icon:z7,title:"Divider"}),r.jsx("div",{className:`w-px h-6 mx-1 self-center ${a?"bg-slate-500":"bg-slate-300"}`}),r.jsx("button",{type:"button",onClick:m,className:`p-2 rounded transition ${a?d.isActive("link")?"bg-slate-600 text-white":"text-slate-300 hover:bg-slate-600":d.isActive("link")?"bg-slate-200 text-slate-900":"text-slate-600 hover:bg-slate-100"}`,title:"Link",children:r.jsx(L7,{className:"h-4 w-4"})}),r.jsx("button",{type:"button",onClick:u,className:`p-2 rounded transition ${a?"text-slate-300 hover:bg-slate-600":"text-slate-600 hover:bg-slate-100"}`,title:"Image",children:r.jsx(A7,{className:"h-4 w-4"})}),o&&r.jsx("button",{type:"button",onClick:h,className:`p-2 rounded transition ${a?"text-slate-300 hover:bg-slate-600":"text-slate-600 hover:bg-slate-100"}`,title:"Attach file (PDF, Word, Excel, etc.)",children:r.jsx(B7,{className:"h-4 w-4"})})]}),r.jsx(_A,{editor:d})]}):r.jsx("div",{className:"border border-slate-300 rounded-lg p-3 min-h-[100px] bg-white",children:r.jsxs("div",{className:"animate-pulse",children:[r.jsx("div",{className:"h-4 bg-slate-200 rounded w-3/4 mb-2"}),r.jsx("div",{className:"h-4 bg-slate-200 rounded w-1/2 mb-2"}),r.jsx("div",{className:"h-4 bg-slate-200 rounded w-2/3"})]})})}function aP(t){var e,s,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(s=aP(t[e]))&&(n&&(n+=" "),n+=s)}else for(s in t)t[s]&&(n&&(n+=" "),n+=s);return n}function Zt(){for(var t,e,s=0,n="",a=arguments.length;s<a;s++)(t=arguments[s])&&(e=aP(t))&&(n&&(n+=" "),n+=e);return n}const iP=6048e5,dZ=864e5,zx=6e4,Bx=36e5,uZ=1e3,CS=Symbol.for("constructDateFrom");function st(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&CS in t?t[CS](e):t instanceof Date?new t.constructor(e):new Date(e)}function Ne(t,e){return st(e||t,t)}function Tr(t,e,s){const n=Ne(t,s==null?void 0:s.in);return isNaN(e)?st((s==null?void 0:s.in)||t,NaN):(e&&n.setDate(n.getDate()+e),n)}function Dr(t,e,s){const n=Ne(t,s==null?void 0:s.in);if(isNaN(e))return st(t,NaN);if(!e)return n;const a=n.getDate(),i=st(t,n.getTime());i.setMonth(n.getMonth()+e+1,0);const o=i.getDate();return a>=o?i:(n.setFullYear(i.getFullYear(),i.getMonth(),a),n)}function oP(t,e,s){return st(t,+Ne(t)+e)}function hZ(t,e,s){return oP(t,e*Bx)}let mZ={};function ml(){return mZ}function za(t,e){var l,c,d,u;const s=ml(),n=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??s.weekStartsOn??((u=(d=s.locale)==null?void 0:d.options)==null?void 0:u.weekStartsOn)??0,a=Ne(t,e==null?void 0:e.in),i=a.getDay(),o=(i<n?7:0)+i-n;return a.setDate(a.getDate()-o),a.setHours(0,0,0,0),a}function Ac(t,e){return za(t,{...e,weekStartsOn:1}
vendor: 4,436 bytes, line 881
881)}function lP(t,e){const s=Ne(t,e==null?void 0:e.in),n=s.getFullYear(),a=st(s,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);const i=Ac(a),o=st(s,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);const l=Ac(o);return s.getTime()>=i.getTime()?n+1:s.getTime()>=l.getTime()?n:n-1}function Sp(t){const e=Ne(t),s=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return s.setUTCFullYear(e.getFullYear()),+t-+s}function Wa(t,...e){const s=st.bind(null,e.find(n=>typeof n=="object"));return e.map(s)}function tl(t,e){const s=Ne(t,e==null?void 0:e.in);return s.setHours(0,0,0,0),s}function Pc(t,e,s){const[n,a]=Wa(s==null?void 0:s.in,t,e),i=tl(n),o=tl(a),l=+i-Sp(i),c=+o-Sp(o);return Math.round((l-c)/dZ)}function fZ(t,e){const s=lP(t,e),n=st(t,0);return n.setFullYear(s,0,4),n.setHours(0,0,0,0),Ac(n)}function qu(t,e,s){const n=Ne(t,s==null?void 0:s.in);return n.setTime(n.getTime()+e*zx),n}function B1(t,e,s){return Dr(t,e*3,s)}function pZ(t,e,s){return oP(t,e*1e3)}function _p(t,e,s){return Tr(t,e*7,s)}function Er(t,e,s){return Dr(t,e*12,s)}function SS(t,e){let s,n=e==null?void 0:e.in;return t.forEach(a=>{!n&&typeof a=="object"&&(n=st.bind(null,a));const i=Ne(a,n);(!s||s<i||isNaN(+i))&&(s=i)}),st(n,s||NaN)}function _S(t,e){let s,n=e==null?void 0:e.in;return t.forEach(a=>{!n&&typeof a=="object"&&(n=st.bind(null,a));const i=Ne(a,n);(!s||s>i||isNaN(+i))&&(s=i)}),st(n,s||NaN)}function xZ(t,e,s){const[n,a]=Wa(s==null?void 0:s.in,t,e);return+tl(n)==+tl(a)}function sa(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function Dc(t){return!(!sa(t)&&typeof t!="number"||isNaN(+Ne(t)))}function Tp(t,e,s){const[n,a]=Wa(s==null?void 0:s.in,t,e),i=n.getFullYear()-a.getFullYear(),o=n.getMonth()-a.getMonth();return i*12+o}function wi(t,e){const s=Ne(t,e==null?void 0:e.in);return Math.trunc(s.getMonth()/3)+1}function Ep(t,e,s){const[n,a]=Wa(s==null?void 0:s.in,t,e),i=n.getFullYear()-a.getFullYear(),o=wi(n)-wi(a);return i*4+o}function Mp(t,e,s){const[n,a]=Wa(s==null?void 0:s.in,t,e);return n.getFullYear()-a.getFullYear()}function gZ(t,e,s){const[n,a]=Wa(s==null?void 0:s.in,t,e),i=TS(n,a),o=Math.abs(Pc(n,a));n.setDate(n.getDate()-i*o);const l=+(TS(n,a)===-i),c=i*(o-l);return c===0?0:c}function TS(t,e){const s=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return s<0?-1:s>0?1:s}function cP(t,e){const s=Ne(t,e==null?void 0:e.in);return s.setHours(23,59,59,999),s}function dP(t,e){const s=Ne(t,e==null?void 0:e.in),n=s.getMonth();return s.setFullYear(s.getFullYear(),n+1,0),s.setHours(23,59,59,999),s}function Zy(t,e){const s=Ne(t,e==null?void 0:e.in),n=s.getMonth(),a=n-n%3;return s.setMonth(a,1),s.setHours(0,0,0,0),s}function uP(t,e){const s=Ne(t,e==null?void 0:e.in);return s.setDate(1),s.setHours(0,0,0,0),s}function hP(t,e){const s=Ne(t,e==null?void 0:e.in),n=s.getFullYear();return s.setFullYear(n+1,0,0),s.setHours(23,59,59,999),s}function Vx(t,e){const s=Ne(t,e==null?void 0:e.in);return s.setFullYear(s.getFullYear(),0,1),s.setHours(0,0,0,0),s}function bZ(t,e){var l,c;const s=ml(),n=s.weekStartsOn??((c=(l=s.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??0,a=Ne(t,e==null?void 0:e.in),i=a.getDay(),o=(i<n?-7:0)+6-(i-n);return a.setDate(a.getDate()+o),a.setHours(23,59,59,999),a}const yZ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},vZ=(t,e,s)=>{let n;const a=yZ[t];
vendor: 17,577 bytes, line 881
881return typeof a=="string"?n=a:e===1?n=a.one:n=a.other.replace("{{count}}",e.toString()),s!=null&&s.addSuffix?s.comparison&&s.comparison>0?"in "+n:n+" ago":n};function R0(t){return(e={})=>{const s=e.width?String(e.width):t.defaultWidth;return t.formats[s]||t.formats[t.defaultWidth]}}const wZ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},jZ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},NZ={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},kZ={date:R0({formats:wZ,defaultWidth:"full"}),time:R0({formats:jZ,defaultWidth:"full"}),dateTime:R0({formats:NZ,defaultWidth:"full"})},CZ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},SZ=(t,e,s,n)=>CZ[t];function gd(t){return(e,s)=>{const n=s!=null&&s.context?String(s.context):"standalone";let a;if(n==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,l=s!=null&&s.width?String(s.width):o;a=t.formattingValues[l]||t.formattingValues[o]}else{const o=t.defaultWidth,l=s!=null&&s.width?String(s.width):t.defaultWidth;a=t.values[l]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return a[i]}}const _Z={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},TZ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},EZ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},MZ={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},AZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},PZ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},DZ=(t,e)=>{const s=Number(t),n=s%100;if(n>20||n<10)switch(n%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd"}return s+"th"},RZ={ordinalNumber:DZ,era:gd({values:_Z,defaultWidth:"wide"}),quarter:gd({values:TZ,defaultWidth:"wide",argumentCallback:t=>t-1}),month:gd({values:EZ,defaultWidth:"wide"}),day:gd({values:MZ,defaultWidth:"wide"}),dayPeriod:gd({values:AZ,defaultWidth:"wide",formattingValues:PZ,defaultFormattingWidth:"wide"})};function bd(t){return(e,s={})=>{const n=s.width,a=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],i=e.match(a);if(!i)return null;const o=i[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?OZ(l,h=>h.test(o)):LZ(l,h=>h.test(o));let d;d=t.valueCallback?t.valueCallback(c):c,d=s.valueCallback?s.valueCallback(d):d;const u=e.slice(o.length);return{value:d,rest:u}}}function LZ(t,e){for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)&&e(t[s]))return s}function OZ(t,e){for(let s=0;s<t.length;s++)if(e(t[s]))return s}function IZ(t){return(e,s={})=>{const n=e.match(t.matchPattern);if(!n)return null;const a=n[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=s.valueCallback?s.valueCallback(o):o;const l=e.slice(a.length);return{value:o,rest:l}}}const FZ=/^(\d+)(th|st|nd|rd)?/i,$Z=/\d+/i,zZ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},BZ={any:[/^b/i,/^(a|c)/i]},VZ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},UZ={any:[/1/i,/2/i,/3/i,/4/i]},HZ={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},WZ={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},GZ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},YZ={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},qZ={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},KZ={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},JZ={ordinalNumber:IZ({matchPattern:FZ,parsePattern:$Z,valueCallback:t=>parseInt(t,10)}),era:bd({matchPatterns:zZ,defaultMatchWidth:"wide",parsePatterns:BZ,defaultParseWidth:"any"}),quarter:bd({matchPatterns:VZ,defaultMatchWidth:"wide",parsePatterns:UZ,defaultParseWidth:"any",valueCallback:t=>t+1}),month:bd({matchPatterns:HZ,defaultMatchWidth:"wide",parsePatterns:WZ,defaultParseWidth:"any"}),day:bd({matchPatterns:GZ,defaultMatchWidth:"wide",parsePatterns:YZ,defaultParseWidth:"any"}),dayPeriod:bd({matchPatterns:qZ,defaultMatchWidth:"any",parsePatterns:KZ,defaultParseWidth:"any"})},mP={code:"en-US",formatDistance:vZ,formatLong:kZ,formatRelative:SZ,localize:RZ,match:JZ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function QZ(t,e){const s=Ne(t,e==null?void 0:e.in);return Pc(s,Vx(s))+1}function V1(t,e){const s=Ne(t,e==null?void 0:e.in),n=+Ac(s)-+fZ(s);return Math.round(n/iP)+1}function U1(t,e){var u,h,m,f;const s=Ne(t,e==null?void 0:e.in),n=s.getFullYear(),a=ml(),i=(e==null?void 0:e.firstWeekContainsDate)??((h=(u=e==null?void 0:e.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??a.firstWeekContainsDate??((f=(m=a.locale)==null?void 0:m.options)==null?void 0:f.firstWeekContainsDate)??1,o=st((e==null?void 0:e.in)||t,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=za(o,e),c=st((e==null?void 0:e.in)||t,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const d=za(c,e);return+s>=+l?n+1:+s>=+d?n:n-1}function XZ(t,e){var l,c,d,u;const s=ml(),n=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??s.firstWeekContainsDate??((u=(d=s.locale)==null?void 0:d.options)==null?void 0:u.firstWeekContainsDate)??1,a=U1(t,e),i=st((e==null?void 0:e.in)||t,0);return i.setFullYear(a,0,n),i.setHours(0,0,0,0),za(i,e)}function fP(t,e){const s=Ne(t,e==null?void 0:e.in),n=+za(s,e)-+XZ(s,e);return Math.round(n/iP)+1}function Ze(t,e){const s=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return s+n}const Xa={y(t,e){const s=t.getFullYear(),n=s>0?s:1-s;return Ze(e==="yy"?n%100:n,e.length)},M(t,e){const s=t.getMonth();return e==="M"?String(s+1):Ze(s+1,2)},d(t,e){return Ze(t.getDate(),e.length)},a(t,e){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.toUpperCase();case"aaa":return s;case"aaaaa":return s[0];case"aaaa":default:return s==="am"?"a.m.":"p.m."}},h(t,e){return Ze(t.getHours()%12||12,e.length)},H(t,e){return Ze(t.getHours(),e.length)},m(t,e){return Ze(t.getMinutes(),e.length)},s(t,e){return Ze(t.getSeconds(),e.length)},S(t,e){const s=e.length,n=t.getMilliseconds(),a=Math.trunc(n*Math.pow(10,s-3));return Ze(a,e.length)}},Cl={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},ES={G:function(t,e,s){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return s.era(n,{width:"abbreviated"});case"GGGGG":return s.era(n,{width:"narrow"});case"GGGG":default:return s.era(n,{width:"wide"})}},y:function(t,e,s){if(e==="yo"){const n=t.getFullYear(),a=n>0?n:1-n;return s.ordinalNumber(a,{unit:"year"})}return Xa.y(t,e)},Y:function(t,e,s,n){const a=U1(t,n),i=a>0?a:1-a;if(e==="YY"){const o=i%100;return Ze(o,2)}return e==="Yo"?s.ordinalNumber(i,{unit:"year"}):Ze(i,e.length)},R:function(t,e){const s=lP(t);return Ze(s,e.length)},u:function(t,e){const s=t.getFullYear();return Ze(s,e.length)},Q:function(t,e,s){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return Ze(n,2);case"Qo":return s.ordinalNumber(n,{unit:"quarter"});case"QQQ":return s.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return s.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return s.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,s){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return Ze(n,2);case"qo":return s.ordinalNumber(n,{unit:"quarter"});case"qqq":return s.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return s.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return s.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,s){const n=t.getMonth();switch(e){case"M":case"MM":return Xa.M(t,e);case"Mo":return s.ordinalNumber(n+1,{unit:"month"});case"MMM":return s.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return s.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return s.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,s){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return Ze(n+1,2);case"Lo":return s.ordinalNumber(n+1,{unit:"month"});case"LLL":return s.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return s.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return s.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,s,n){const a=fP(t,n);return e==="wo"?s.ordinalNumber(a,{unit:"week"}):Ze(a,e.length)},I:function(t,e,s){const n=V1(t);return e==="Io"?s.ordinalNumber(n,{unit:"week"}):Ze(n,e.length)},d:function(t,e,s){return e==="do"?s.ordinalNumber(t.getDate(),{unit:"date"}):Xa.d(t,e)},D:function(t,e,s){const n=QZ(t);return e==="Do"?s.ordinalNumber(n,{unit:"dayOfYear"}):Ze(n,e.length)},E:function(t,e,s){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return s.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return s.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return s.day(n,{width:"short",context:"formatting"});case"EEEE":default:return s.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,s,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return Ze(i,2);case"eo":return s.ordinalNumber(i,{unit:"day"});case"eee":return s.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return s.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return s.day(a,{width:"short",context:"formatting"});case"eeee":default:return s.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,s,n){const a=t.getDay(),i=(a-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return Ze(i,e.length);case"co":return s.ordinalNumber(i,{unit:"day"});case"ccc":return s.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return s.day(a,{width:"narrow",context:"standalone"});case"cccccc":return s.day(a,{width:"short",context:"standalone"});case"cccc":default:return s.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,s){const n=t.getDay(),a=n===0?7:n;switch(e){case"i":return String(a);case"ii":return Ze(a,e.length);case"io":return s.ordinalNumber(a,{unit:"day"});case"iii":return s.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return s.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return s.day(n,{width:"short",context:"formatting"});case"iiii":default:return s.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,s){const a=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"aaa":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return s.dayPeriod(a,{width:"narrow",context:"formatting"});case"aaaa":default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},b:function(t,e,s){const n=t.getHours();let a;switch(n===12?a=Cl.noon:n===0?a=Cl.midnight:a=n/12>=1?"pm":"am",e){case"b":case"bb":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return s.dayPeriod(a,{width:"narrow",context:"formatting"});case"bbbb":default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,s){const n=t.getHours();let a;switch(n>=17?a=Cl.evening:n>=12?a=Cl.afternoon:n>=4?a=Cl.morning:a=Cl.night,e){case"B":case"BB":case"BBB":return s.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return s.dayPeriod(a,{width:"narrow",context:"formatting"});case"BBBB":default:return s.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,s){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),s.ordinalNumber(n,{unit:"hour"})}return Xa.h(t,e)},H:function(t,e,s){return e==="Ho"?s.ordinalNumber(t.getHours(),{unit:"hour"}):Xa.H(t,e)},K:function(t,e,s){const n=t.getHours()%12;return e==="Ko"?s.ordinalNumber(n,{unit:"hour"}):Ze(n,e.length)},k:function(t,e,s){let n=t.getHours();return n===0&&(n=24),e==="ko"?s.ordinalNumber(n,{unit:"hour"}):Ze(n,e.length)},m:function(t,e,s){return e==="mo"?s.ordinalNumber(t.getMinutes(),{unit:"minute"}):Xa.m(t,e)},s:function(t,e,s){return e==="so"?s.ordinalNumber(t.getSeconds(),{unit:"second"}):Xa.s(t,e)},S:function(t,e){return Xa.S(t,e)},X:function(t,e,s){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return AS(n);case"XXXX":case"XX":return yo(n);case"XXXXX":case"XXX":default:return yo(n,":")}},x:function(t,e,s){const n=t.getTimezoneOffset();switch(e){case"x":return AS(n);case"xxxx":case"xx":return yo(n);case"xxxxx":case"xxx":default:return yo(n,":")}},O:function(t,e,s){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+MS(n,":");case"OOOO":default:return"GMT"+yo(n,":")}},z:function(t,e,s){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+MS(n,":");case"zzzz":default:return"GMT"+yo(n,":")}},t:function(t,e,s){const n=Math.trunc(+t/1e3);return Ze(n,e.length)},T:function(t,e,s){return Ze(+t,e.length)}};function MS(t,e=""){const s=t>0?"-":"+",n=Math.abs(t),a=Math.trunc(n/60),i=n%60;return i===0?s+String(a):s+String(a)+e+Ze(i,2)}function AS(t,e){return t%60===0?(t>0?"-":"+")+Ze(Math.abs(t)/60,2):yo(t,e)}function yo(t,e=""){const s=t>0?"-":"+",n=Math.abs(t),a=Ze(Math.trunc(n/60),2),i=Ze(n%60,2);return s+a+e+i}const PS=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},pP=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},ZZ=(t,e)=>{const s=t.match(/(P+)(p+)?/)||[],n=s[1],a=s[2];if(!a)return PS(t,e);let i;switch(n){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",PS(n,e)).replace("{{time}}",pP(a,e))},ev={p:pP,P:ZZ},eee=/^D+$/,tee=/^Y+$/,see=["D","DD","YY","YYYY"];function nee(t){return eee.test(t)}function ree(t){return tee.test(t)}function aee(t,e,s){const n=iee(t,e,s);if(console.warn(n),see.includes(t))throw new RangeError(n)}function iee(t,e,s){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${s}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}const oee=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,lee=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,cee=/^'([^]*?)'?$/,dee=/''/g,uee=/[a-zA-Z]/;function DS(t,e,s){var u,h,m,f,p,g,x,b;const n=ml(),a=(s==null?void 0:s.locale)??n.locale??mP,i=(s==null?void 0:s.firstWeekContainsDate)??((h=(u=s==null?void 0:s.locale)==null?void 0:u.options)==null?void 0:h.firstWeekContainsDate)??n.firstWeekContainsDate??((f=(m=n.locale)==null?void 0:m.options)==null?void 0:f.firstWeekContainsDate)??1,o=(s==null?void 0:s.weekStartsOn)??((g=(p=s==null?void 0:s.locale)==null?void 0:p.options)==null?void 0:g.weekStartsOn)??n.weekStartsOn??((b=(x=n.locale)==null?void 0:x.options)==null?void 0:b.weekStartsOn)??0,l=Ne(t,s==null?void 0:s.in);if(!Dc(l))throw new RangeError("Invalid time value");let c=e.match(lee).map(y=>{const w=y[0];if(w==="p"||w==="P"){const N=ev[w];return N(y,a.formatLong)}return y}).join("").match(oee).map(y=>{if(y==="''")return{isToken:!1,value:"'"};const w=y[0];if(w==="'")return{isToken:!1,value:hee(y)};if(ES[w])return{isToken:!0,value:y};
vendor: 28,130 bytes, line 881
881if(w.match(uee))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:y}});a.localize.preprocessor&&(c=a.localize.preprocessor(l,c));const d={firstWeekContainsDate:i,weekStartsOn:o,locale:a};return c.map(y=>{if(!y.isToken)return y.value;const w=y.value;(!(s!=null&&s.useAdditionalWeekYearTokens)&&ree(w)||!(s!=null&&s.useAdditionalDayOfYearTokens)&&nee(w))&&aee(w,e,String(t));const N=ES[w[0]];return N(l,w,a.localize,d)}).join("")}function hee(t){const e=t.match(cee);return e?e[1].replace(dee,"'"):t}function RS(t,e){return Ne(t,e==null?void 0:e.in).getDate()}function mee(t,e){return Ne(t,e==null?void 0:e.in).getDay()}function fee(t,e){const s=Ne(t,e==null?void 0:e.in),n=s.getFullYear(),a=s.getMonth(),i=st(s,0);return i.setFullYear(n,a+1,0),i.setHours(0,0,0,0),i.getDate()}function pee(){return Object.assign({},ml())}function Es(t,e){return Ne(t,e==null?void 0:e.in).getHours()}function xee(t,e){const s=Ne(t,e==null?void 0:e.in).getDay();return s===0?7:s}function Ms(t,e){return Ne(t,e==null?void 0:e.in).getMinutes()}function mn(t,e){return Ne(t,e==null?void 0:e.in).getMonth()}function Ii(t){return Ne(t).getSeconds()}function tv(t){return+Ne(t)}function Ue(t,e){return Ne(t,e==null?void 0:e.in).getFullYear()}function Da(t,e){return+Ne(t)>+Ne(e)}function Jr(t,e){return+Ne(t)<+Ne(e)}function gee(t,e){return+Ne(t)==+Ne(e)}function bee(t,e){const s=yee(e)?new e(0):st(e,0);return s.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),s.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),s}function yee(t){var e;return typeof t=="function"&&((e=t.prototype)==null?void 0:e.constructor)===t}const vee=10;class xP{constructor(){xe(this,"subPriority",0)}validate(e,s){return!0}}class wee extends xP{constructor(e,s,n,a,i){super(),this.value=e,this.validateValue=s,this.setValue=n,this.priority=a,i&&(this.subPriority=i)}validate(e,s){return this.validateValue(e,this.value,s)}set(e,s,n){return this.setValue(e,s,this.value,n)}}class jee extends xP{constructor(s,n){super();xe(this,"priority",vee);xe(this,"subPriority",-1);this.context=s||(a=>st(n,a))}set(s,n){return n.timestampIsSet?s:st(s,bee(s,this.context))}}class Qe{run(e,s,n,a){const i=this.parse(e,s,n,a);return i?{setter:new wee(i.value,this.validate,this.set,this.priority,this.subPriority),rest:i.rest}:null}validate(e,s,n){return!0}}class Nee extends Qe{constructor(){super(...arguments);xe(this,"priority",140);xe(this,"incompatibleTokens",["R","u","t","T"])}parse(s,n,a){switch(n){case"G":case"GG":case"GGG":return a.era(s,{width:"abbreviated"})||a.era(s,{width:"narrow"});case"GGGGG":return a.era(s,{width:"narrow"});case"GGGG":default:return a.era(s,{width:"wide"})||a.era(s,{width:"abbreviated"})||a.era(s,{width:"narrow"})}}set(s,n,a){return n.era=a,s.setFullYear(a,0,1),s.setHours(0,0,0,0),s}}const Ot={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},Gr={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function It(t,e){return t&&{value:e(t.value),rest:t.rest}}function vt(t,e){const s=e.match(t);return s?{value:parseInt(s[0],10),rest:e.slice(s[0].length)}:null}function Yr(t,e){const s=e.match(t);if(!s)return null;if(s[0]==="Z")return{value:0,rest:e.slice(1)};const n=s[1]==="+"?1:-1,a=s[2]?parseInt(s[2],10):0,i=s[3]?parseInt(s[3],10):0,o=s[5]?parseInt(s[5],10):0;return{value:n*(a*Bx+i*zx+o*uZ),rest:e.slice(s[0].length)}}function gP(t){return vt(Ot.anyDigitsSigned,t)}function Pt(t,e){switch(t){case 1:return vt(Ot.singleDigit,e);case 2:return vt(Ot.twoDigits,e);case 3:return vt(Ot.threeDigits,e);case 4:return vt(Ot.fourDigits,e);default:return vt(new RegExp("^\\d{1,"+t+"}"),e)}}function Ap(t,e){switch(t){case 1:return vt(Ot.singleDigitSigned,e);case 2:return vt(Ot.twoDigitsSigned,e);case 3:return vt(Ot.threeDigitsSigned,e);case 4:return vt(Ot.fourDigitsSigned,e);default:return vt(new RegExp("^-?\\d{1,"+t+"}"),e)}}function H1(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0}}function bP(t,e){const s=e>0,n=s?e:1-e;let a;if(n<=50)a=t||100;else{const i=n+50,o=Math.trunc(i/100)*100,l=t>=i%100;a=t+o-(l?100:0)}return s?a:1-a}function yP(t){return t%400===0||t%4===0&&t%100!==0}class kee extends Qe{constructor(){super(...arguments);xe(this,"priority",130);xe(this,"incompatibleTokens",["Y","R","u","w","I","i","e","c","t","T"])}parse(s,n,a){const i=o=>({year:o,isTwoDigitYear:n==="yy"});switch(n){case"y":return It(Pt(4,s),i);case"yo":return It(a.ordinalNumber(s,{unit:"year"}),i);default:return It(Pt(n.length,s),i)}}validate(s,n){return n.isTwoDigitYear||n.year>0}set(s,n,a){const i=s.getFullYear();if(a.isTwoDigitYear){const l=bP(a.year,i);return s.setFullYear(l,0,1),s.setHours(0,0,0,0),s}const o=!("era"in n)||n.era===1?a.year:1-a.year;return s.setFullYear(o,0,1),s.setHours(0,0,0,0),s}}class Cee extends Qe{constructor(){super(...arguments);xe(this,"priority",130);xe(this,"incompatibleTokens",["y","R","u","Q","q","M","L","I","d","D","i","t","T"])}parse(s,n,a){const i=o=>({year:o,isTwoDigitYear:n==="YY"});switch(n){case"Y":return It(Pt(4,s),i);case"Yo":return It(a.ordinalNumber(s,{unit:"year"}),i);default:return It(Pt(n.length,s),i)}}validate(s,n){return n.isTwoDigitYear||n.year>0}set(s,n,a,i){const o=U1(s,i);if(a.isTwoDigitYear){const c=bP(a.year,o);return s.setFullYear(c,0,i.firstWeekContainsDate),s.setHours(0,0,0,0),za(s,i)}const l=!("era"in n)||n.era===1?a.year:1-a.year;return s.setFullYear(l,0,i.firstWeekContainsDate),s.setHours(0,0,0,0),za(s,i)}}class See extends Qe{constructor(){super(...arguments);xe(this,"priority",130);xe(this,"incompatibleTokens",["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"])}parse(s,n){return Ap(n==="R"?4:n.length,s)}set(s,n,a){const i=st(s,0);return i.setFullYear(a,0,4),i.setHours(0,0,0,0),Ac(i)}}class _ee extends Qe{constructor(){super(...arguments);xe(this,"priority",130);xe(this,"incompatibleTokens",["G","y","Y","R","w","I","i","e","c","t","T"])}parse(s,n){return Ap(n==="u"?4:n.length,s)}set(s,n,a){return s.setFullYear(a,0,1),s.setHours(0,0,0,0),s}}class Tee extends Qe{constructor(){super(...arguments);xe(this,"priority",120);xe(this,"incompatibleTokens",["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"])}parse(s,n,a){switch(n){case"Q":case"QQ":return Pt(n.length,s);case"Qo":return a.ordinalNumber(s,{unit:"quarter"});case"QQQ":return a.quarter(s,{width:"abbreviated",context:"formatting"})||a.quarter(s,{width:"narrow",context:"formatting"});case"QQQQQ":return a.quarter(s,{width:"narrow",context:"formatting"});case"QQQQ":default:return a.quarter(s,{width:"wide",context:"formatting"})||a.quarter(s,{width:"abbreviated",context:"formatting"})||a.quarter(s,{width:"narrow",context:"formatting"})}}validate(s,n){return n>=1&&n<=4}set(s,n,a){return s.setMonth((a-1)*3,1),s.setHours(0,0,0,0),s}}class Eee extends Qe{constructor(){super(...arguments);xe(this,"priority",120);xe(this,"incompatibleTokens",["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"])}parse(s,n,a){switch(n){case"q":case"qq":return Pt(n.length,s);case"qo":return a.ordinalNumber(s,{unit:"quarter"});case"qqq":return a.quarter(s,{width:"abbreviated",context:"standalone"})||a.quarter(s,{width:"narrow",context:"standalone"});case"qqqqq":return a.quarter(s,{width:"narrow",context:"standalone"});case"qqqq":default:return a.quarter(s,{width:"wide",context:"standalone"})||a.quarter(s,{width:"abbreviated",context:"standalone"})||a.quarter(s,{width:"narrow",context:"standalone"})}}validate(s,n){return n>=1&&n<=4}set(s,n,a){return s.setMonth((a-1)*3,1),s.setHours(0,0,0,0),s}}class Mee extends Qe{constructor(){super(...arguments);xe(this,"incompatibleTokens",["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]);xe(this,"priority",110)}parse(s,n,a){const i=o=>o-1;switch(n){case"M":return It(vt(Ot.month,s),i);case"MM":return It(Pt(2,s),i);case"Mo":return It(a.ordinalNumber(s,{unit:"month"}),i);case"MMM":return a.month(s,{width:"abbreviated",context:"formatting"})||a.month(s,{width:"narrow",context:"formatting"});case"MMMMM":return a.month(s,{width:"narrow",context:"formatting"});case"MMMM":default:return a.month(s,{width:"wide",context:"formatting"})||a.month(s,{width:"abbreviated",context:"formatting"})||a.month(s,{width:"narrow",context:"formatting"})}}validate(s,n){return n>=0&&n<=11}set(s,n,a){return s.setMonth(a,1),s.setHours(0,0,0,0),s}}class Aee extends Qe{constructor(){super(...arguments);xe(this,"priority",110);xe(this,"incompatibleTokens",["Y","R","q","Q","M","w","I","D","i","e","c","t","T"])}parse(s,n,a){const i=o=>o-1;switch(n){case"L":return It(vt(Ot.month,s),i);case"LL":return It(Pt(2,s),i);case"Lo":return It(a.ordinalNumber(s,{unit:"month"}),i);case"LLL":return a.month(s,{width:"abbreviated",context:"standalone"})||a.month(s,{width:"narrow",context:"standalone"});case"LLLLL":return a.month(s,{width:"narrow",context:"standalone"});case"LLLL":default:return a.month(s,{width:"wide",context:"standalone"})||a.month(s,{width:"abbreviated",context:"standalone"})||a.month(s,{width:"narrow",context:"standalone"})}}validate(s,n){return n>=0&&n<=11}set(s,n,a){return s.setMonth(a,1),s.setHours(0,0,0,0),s}}function Pee(t,e,s){const n=Ne(t,s==null?void 0:s.in),a=fP(n,s)-e;return n.setDate(n.getDate()-a*7),Ne(n,s==null?void 0:s.in)}class Dee extends Qe{constructor(){super(...arguments);xe(this,"priority",100);xe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","i","t","T"])}parse(s,n,a){switch(n){case"w":return vt(Ot.week,s);case"wo":return a.ordinalNumber(s,{unit:"week"});default:return Pt(n.length,s)}}validate(s,n){return n>=1&&n<=53}set(s,n,a,i){return za(Pee(s,a,i),i)}}function Ree(t,e,s){const n=Ne(t,s==null?void 0:s.in),a=V1(n,s)-e;return n.setDate(n.getDate()-a*7),n}class Lee extends Qe{constructor(){super(...arguments);xe(this,"priority",100);xe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"])}parse(s,n,a){switch(n){case"I":return vt(Ot.week,s);case"Io":return a.ordinalNumber(s,{unit:"week"});default:return Pt(n.length,s)}}validate(s,n){return n>=1&&n<=53}set(s,n,a){return Ac(Ree(s,a))}}const Oee=[31,28,31,30,31,30,31,31,30,31,30,31],Iee=[31,29,31,30,31,30,31,31,30,31,30,31];class Fee extends Qe{constructor(){super(...arguments);xe(this,"priority",90);xe(this,"subPriority",1);xe(this,"incompatibleTokens",["Y","R","q","Q","w","I","D","i","e","c","t","T"])}parse(s,n,a){switch(n){case"d":return vt(Ot.date,s);case"do":return a.ordinalNumber(s,{unit:"date"});default:return Pt(n.length,s)}}validate(s,n){const a=s.getFullYear(),i=yP(a),o=s.getMonth();return i?n>=1&&n<=Iee[o]:n>=1&&n<=Oee[o]}set(s,n,a){return s.setDate(a),s.setHours(0,0,0,0),s}}class $ee extends Qe{constructor(){super(...arguments);xe(this,"priority",90);xe(this,"subpriority",1);xe(this,"incompatibleTokens",["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"])}parse(s,n,a){switch(n){case"D":case"DD":return vt(Ot.dayOfYear,s);case"Do":return a.ordinalNumber(s,{unit:"date"});default:return Pt(n.length,s)}}validate(s,n){const a=s.getFullYear();return yP(a)?n>=1&&n<=366:n>=1&&n<=365}set(s,n,a){return s.setMonth(0,a),s.setHours(0,0,0,0),s}}function W1(t,e,s){var h,m,f,p;const n=ml(),a=(s==null?void 0:s.weekStartsOn)??((m=(h=s==null?void 0:s.locale)==null?void 0:h.options)==null?void 0:m.weekStartsOn)??n.weekStartsOn??((p=(f=n.locale)==null?void 0:f.options)==null?void 0:p.weekStartsOn)??0,i=Ne(t,s==null?void 0:s.in),o=i.getDay(),c=(e%7+7)%7,d=7-a,u=e<0||e>6?e-(o+d)%7:(c+d)%7-(o+d)%7;return Tr(i,u,s)}class zee extends Qe{constructor(){super(...arguments);xe(this,"priority",90);xe(this,"incompatibleTokens",["D","i","e","c","t","T"])}parse(s,n,a){switch(n){case"E":case"EE":case"EEE":return a.day(s,{width:"abbreviated",context:"formatting"})||a.day(s,{width:"short",context:"formatting"})||a.day(s,{width:"narrow",context:"formatting"});case"EEEEE":return a.day(s,{width:"narrow",context:"formatting"});case"EEEEEE":return a.day(s,{width:"short",context:"formatting"})||a.day(s,{width:"narrow",context:"formatting"});case"EEEE":default:return a.day(s,{width:"wide",context:"formatting"})||a.day(s,{width:"abbreviated",context:"formatting"})||a.day(s,{width:"short",context:"formatting"})||a.day(s,{width:"narrow",context:"formatting"})}}validate(s,n){return n>=0&&n<=6}set(s,n,a,i){return s=W1(s,a,i),s.setHours(0,0,0,0),s}}class Bee extends Qe{constructor(){super(...arguments);xe(this,"priority",90);xe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"])}parse(s,n,a,i){const o=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(n){case"e":case"ee":return It(Pt(n.length,s),o);case"eo":return It(a.ordinalNumber(s,{unit:"day"}),o);case"eee":return a.day(s,{width:"abbreviated",context:"formatting"})||a.day(s,{width:"short",context:"formatting"})||a.day(s,{width:"narrow",context:"formatting"});case"eeeee":return a.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return a.day(s,{width:"short",context:"formatting"})||a.day(s,{width:"narrow",context:"formatting"});case"eeee":default:return a.day(s,{width:"wide",context:"formatting"})||a.day(s,{width:"abbreviated",context:"formatting"})||a.day(s,{width:"short",context:"formatting"})||a.day(s,{width:"narrow",context:"formatting"})}}validate(s,n){return n>=0&&n<=6}set(s,n,a,i){return s=W1(s,a,i),s.setHours(0,0,0,0),s}}class Vee extends Qe{constructor(){super(...arguments);xe(this,"priority",90);xe(this,"incompatibleTokens",["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"])}parse(s,n,a,i){const o=l=>{const c=Math.floor((l-1)/7)*7;return(l+i.weekStartsOn+6)%7+c};switch(n){case"c":case"cc":return It(Pt(n.length,s),o);case"co":return It(a.ordinalNumber(s,{unit:"day"}),o);case"ccc":return a.day(s,{width:"abbreviated",context:"standalone"})||a.day(s,{width:"short",context:"standalone"})||a.day(s,{width:"narrow",context:"standalone"});case"ccccc":return a.day(s,{width:"narrow",context:"standalone"});case"cccccc":return a.day(s,{width:"short",context:"standalone"})||a.day(s,{width:"narrow",context:"standalone"});case"cccc":default:return a.day(s,{width:"wide",context:"standalone"})||a.day(s,{width:"abbreviated",context:"standalone"})||a.day(s,{width:"short",context:"standalone"})||a.day(s,{width:"narrow",context:"standalone"})}}validate(s,n){return n>=0&&n<=6}set(s,n,a,i){return s=W1(s,a,i),s.setHours(0,0,0,0),s}}function Uee(t,e,s){const n=Ne(t,s==null?void 0:s.in),a=xee(n,s),i=e-a;return Tr(n,i,s)}class Hee extends Qe{constructor(){super(...arguments);xe(this,"priority",90);xe(this,"incompatibleTokens",["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"])}parse(s,n,a){const i=o=>o===0?7:o;switch(n){case"i":case"ii":return Pt(n.length,s);case"io":return a.ordinalNumber(s,{unit:"day"});case"iii":return It(a.day(s,{width:"abbreviated",context:"formatting"})||a.day(s,{width:"short",context:"formatting"})||a.day(s,{width:"narrow",context:"formatting"}),i);case"iiiii":return It(a.day(s,{width:"narrow",context:"formatting"}),i);case"iiiiii":return It(a.day(s,{width:"short",context:"formatting"})||a.day(s,{width:"narrow",context:"formatting"}),i);case"iiii":default:return It(a.day(s,{width:"wide",context:"formatting"})||a.day(s,{width:"abbreviated",context:"formatting"})||a.day(s,{width:"short",context:"formatting"})||a.day(s,{width:"narrow",context:"formatting"}),i)}}validate(s,n){return n>=1&&n<=7}set(s,n,a){return s=Uee(s,a),s.setHours(0,0,0,0),s}}class Wee extends Qe{constructor(){super(...arguments);xe(this,"priority",80);xe(this,"incompatibleTokens",["b","B","H","k","t","T"])}parse(s,n,a){switch(n){case"a":case"aa":case"aaa":return a.dayPeriod(s,{width:"abbreviated",context:"formatting"})||a.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaaa":return a.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return a.dayPeriod(s,{width:"wide",context:"formatting"})||a.dayPeriod(s,{width:"abbreviated",context:"formatting"})||a.dayPeriod(s,{width:"narrow",context:"formatting"})}}set(s,n,a){return s.setHours(H1(a),0,0,0),s}}class Gee extends Qe{constructor(){super(...arguments);xe(this,"priority",80);xe(this,"incompatibleTokens",["a","B","H","k","t","T"])}parse(s,n,a){switch(n){case"b":case"bb":case"bbb":return a.dayPeriod(s,{width:"abbreviated",context:"formatting"})||a.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbbb":return a.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return a.dayPeriod(s,{width:"wide",context:"formatting"})||a.dayPeriod(s,{width:"abbreviated",context:"formatting"})||a.dayPeriod(s,{width:"narrow",context:"formatting"})}}set(s,n,a){return s.setHours(H1(a),0,0,0),s}}class Yee extends Qe{constructor(){super(...arguments);xe(this,"priority",80);xe(this,"incompatibleTokens",["a","b","t","T"])}parse(s,n,a){switch(n){case"B":case"BB":case"BBB":return a.dayPeriod(s,{width:"abbreviated",context:"formatting"})||a.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBBB":return a.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return a.dayPeriod(s,{width:"wide",context:"formatting"})||a.dayPeriod(s,{width:"abbreviated",context:"formatting"})||a.dayPeriod(s,{width:"narrow",context:"formatting"})}}set(s,n,a){return s.setHours(H1(a),0,0,0),s}}class qee extends Qe{constructor(){super(...arguments);xe(this,"priority",70);xe(this,"incompatibleTokens",["H","K","k","t","T"])}parse(s,n,a){switch(n){case"h":return vt(Ot.hour12h,s);case"ho":return a.ordinalNumber(s,{unit:"hour"});default:return Pt(n.length,s)}}validate(s,n){return n>=1&&n<=12}set(s,n,a){const i=s.getHours()>=12;return i&&a<12?s.setHours(a+12,0,0,0):!i&&a===12?s.setHours(0,0,0,0):s.setHours(a,0,0,0),s}}class Kee extends Qe{constructor(){super(...arguments);xe(this,"priority",70);xe(this,"incompatibleTokens",["a","b","h","K","k","t","T"])}parse(s,n,a){switch(n){case"H":return vt(Ot.hour23h,s);case"Ho":return a.ordinalNumber(s,{unit:"hour"});default:return Pt(n.length,s)}}validate(s,n){return n>=0&&n<=23}set(s,n,a){return s.setHours(a,0,0,0),s}}class Jee extends Qe{constructor(){super(...arguments);xe(this,"priority",70);xe(this,"incompatibleTokens",["h","H","k","t","T"])}parse(s,n,a){switch(n){case"K":return vt(Ot.hour11h,s);case"Ko":return a.ordinalNumber(s,{unit:"hour"});default:return Pt(n.length,s)}}validate(s,n){return n>=0&&n<=11}set(s,n,a){return s.getHours()>=12&&a<12?s.setHours(a+12,0,0,0):s.setHours(a,0,0,0),s}}class Qee extends Qe{constructor(){super(...arguments);xe(this,"priority",70);xe(this,"incompatibleTokens",["a","b","h","H","K","t","T"])}parse(s,n,a){switch(n){case"k":return vt(Ot.hour24h,s);case"ko":return a.ordinalNumber(s,{unit:"hour"});default:return Pt(n.length,s)}}validate(s,n){return n>=1&&n<=24}set(s,n,a){const i=a<=24?a%24:a;return s.setHours(i,0,0,0),s}}class Xee extends Qe{constructor(){super(...arguments);xe(this,"priority",60);xe(this,"incompatibleTokens",["t","T"])}parse(s,n,a){switch(n){case"m":return vt(Ot.minute,s);case"mo":return a.ordinalNumber(s,{unit:"minute"});default:return Pt(n.length,s)}}validate(s,n){return n>=0&&n<=59}set(s,n,a){return s.setMinutes(a,0,0),s}}class Zee extends Qe{constructor(){super(...arguments);xe(this,"priority",50);xe(this,"incompatibleTokens",["t","T"])}parse(s,n,a){switch(n){case"s":return vt(Ot.second,s);case"so":return a.ordinalNumber(s,{unit:"second"});default:return Pt(n.length,s)}}validate(s,n){return n>=0&&n<=59}set(s,n,a){return s.setSeconds(a,0),s}}class ete extends Qe{constructor(){super(...arguments);xe(this,"priority",30);xe(this,"incompatibleTokens",["t","T"])}parse(s,n){const a=i=>Math.trunc(i*Math.pow(10,-n.length+3));return It(Pt(n.length,s),a)}set(s,n,a){return s.setMilliseconds(a),s}}class tte extends Qe{constructor(){super(...arguments);xe(this,"priority",10);xe(this,"incompatibleTokens",["t","T","x"])}parse(s,n){switch(n){case"X":return Yr(Gr.basicOptionalMinutes,s);case"XX":return Yr(Gr.basic,s);case"XXXX":return Yr(Gr.basicOptionalSeconds,s);case"XXXXX":return Yr(Gr.extendedOptionalSeconds,s);case"XXX":default:return Yr(Gr.extended,s)}}set(s,n,a){return n.timestampIsSet?s:st(s,s.getTime()-Sp(s)-a)}}class ste extends Qe{constructor(){super(...arguments);xe(this,"priority",10);xe(this,"incompatibleTokens",["t","T","X"])}parse(s,n){switch(n){case"x":return Yr(Gr.basicOptionalMinutes,s);case"xx":return Yr(Gr.basic,s);case"xxxx":return Yr(Gr.basicOptionalSeconds,s);case"xxxxx":return Yr(Gr.extendedOptionalSeconds,s);case"xxx":default:return Yr(Gr.extended,s)}}set(s,n,a){return n.timestampIsSet?s:st(s,s.getTime()-Sp(s)-a)}}class nte extends Qe{constructor(){super(...arguments);xe(this,"priority",40);xe(this,"incompatibleTokens","*")}parse(s){return gP(s)}set(s,n,a){return[st(s,a*1e3),{timestampIsSet:!0}]}}class rte extends Qe{constructor(){super(...arguments);xe(this,"priority",20);xe(this,"incompatibleTokens","*")}parse(s){return gP(s)}set(s,n,a){return[st(s,a),{timestampIsSet:!0}]}}const ate={G:new Nee,y:new kee,Y:new Cee,R:new See,u:new _ee,Q:new Tee,q:new Eee,M:new Mee,L:new Aee,w:new Dee,I:new Lee,d:new Fee,D:new $ee,E:new zee,e:new Bee,c:new Vee,i:new Hee,a:new Wee,b:new Gee,B:new Yee,h:new qee,H:new Kee,K:new Jee,k:new Qee,m:new Xee,s:new Zee,S:new ete,X:new tte,x:new ste,t:new nte,T:new rte},ite=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,ote=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,lte=/^'([^]*?)'?$/,cte=/''/g,dte=/\S/,ute=/[a-zA-Z]/;function hte(t,e,s,n){var x,b,y,w,N,j,S,k;const a=()=>st((n==null?void 0:n.in)||s,NaN),i=pee(),o=(n==null?void 0:n.locale)??i.locale??mP,l=(n==null?void 0:n.firstWeekContainsDate)??((b=(x=n==null?void 0:n.locale)==null?void 0:x.options)==null?void 0:b.firstWeekContainsDate)??i.firstWeekContainsDate??((w=(y=i.locale)==null?void 0:y.options)==null?void 0:w.firstWeekContainsDate)??1,c=(n==null?void 0:n.weekStartsOn)??((j=(N=n==null?void 0:n.locale)==null?void 0:N.options)==null?void 0:j.weekStartsOn)??i.weekStartsOn??((k=(S=i.locale)==null?void 0:S.options)==null?void 0:k.weekStartsOn)??0;if(!e)return t?a():Ne(s,n==null?void 0:n.in);const d={firstWeekContainsDate:l,weekStartsOn:c,locale:o},u=[new jee(n==null?void 0:n.in,s)],h=e.match(ote).map(C=>{const T=C[0];if(T in ev){const A=ev[T];return A(C,o.formatLong)}return C}).join("").match(ite),m=[];for(let C of h){const T=C[0],A=ate[T];if(A){const{incompatibleTokens:E}=A;if(Array.isArray(E)){const D=m.find(P=>E.includes(P.token)||P.token===T);if(D)throw new RangeError(`The format string mustn't contain \`${D.fullToken}\` and \`${C}\` at the same time`)}else if(A.incompatibleTokens==="*"&&m.length>0)throw new RangeError(`The format string mustn't contain \`${C}\` and any other token at the same time`);m.push({token:T,fullToken:C});const L=A.run(t,C,o.match,d);if(!L)return a();u.push(L.setter),t=L.rest}else{if(T.match(ute))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");if(C==="''"?C="'":T==="'"&&(C=mte(C)),t.indexOf(C)===0)t=t.slice(C.length);else return a()}}if(t.length>0&&dte.test(t))return a();const f=u.map(C=>C.priority).sort((C,T)=>T-C).filter((C,T,A)=>A.indexOf(C)===T).map(C=>u.filter(T=>T.priority===C).sort((T,A)=>A.subPriority-T.subPriority)).map(C=>C[0]);let p=Ne(s,n==null?void 0:n.in);if(isNaN(+p))return a();const g={};for(const C of f){if(!C.validate(p,d))return a();const T=C.set(p,g,d);Array.isArray(T)?(p=T[0],Object.assign(g,T[1])):p=T}return p}function mte(t){return t.match(lte)[1].replace(cte,"'")}function fte(t,e,s){const[n,a]=Wa(s==null?void 0:s.in,t,e);return n.getFullYear()===a.getFullYear()&&n.getMonth()===a.getMonth()}function pte(t,e,s){const[n,a]=Wa(s==null?void 0:s.in,t,e);return+Zy(n)==+Zy(a)}function xte(t,e,s){const[n,a]=Wa(s==null?void 0:s.in,t,e);return n.getFullYear()===a.getFullYear()}function Ku(t,e,s){const n=+Ne(t,s==null?void 0:s.in),[a,i]=[+Ne(e.start,s==null?void 0:s.in),+Ne(e.end,s==null?void 0:s.in)].sort((o,l)=>o-l);return n>=a&&n<=i}function gte(t,e,s){return Tr(t,-1,s)}function bte(t,e){const s=()=>st(e==null?void 0:e.in,NaN),a=jte(t);let i;if(a.date){const d=Nte(a.date,2);i=kte(d.restDateString,d.year)}if(!i||isNaN(+i))return s();const o=+i;let l=0,c;if(a.time&&(l=Cte(a.time),isNaN(l)))return s();if(a.timezone){if(c=Ste(a.timezone),isNaN(c))return s()}else{const d=new Date(o+l),u=Ne(0,e==null?void 0:e.in);return u.setFullYear(d.getUTCFullYear(),d.getUTCMonth(),d.getUTCDate()),u.setHours(d.getUTCHours(),d.getUTCMinutes(),d.getUTCSeconds(),d.getUTCMilliseconds()),u}return Ne(o+l+c,e==null?void 0:e.in)}const dm={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},yte=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,vte=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,wte=/^([+-])(\d{2})(?::?(\d{2}))?$/;function jte(t){const e={},s=t.split(dm.dateTimeDelimiter);let n;if(s.length>2)return e;if(/:/.test(s[0])?n=s[0]:(e.date=s[0],n=s[1],dm.timeZoneDelimiter.test(e.date)&&(e.date=t.split(dm.timeZoneDelimiter)[0],n=t.substr(e.date.length,t.length))),n){const a=dm.timezone.exec(n);a?(e.time=n.replace(a[1],""),e.timezone=a[1]):e.time=n}return e}function Nte(t,e){const s=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(s);if(!n)return{year:NaN,restDateString:""};const a=n[1]?parseInt(n[1]):null,i=n[2]?parseInt(n[2]):null;return{year:i===null?a:i*100,restDateString:t.slice((n[1]||n[2]).length)}}function kte(t,e){if(e===null)return new Date(NaN);const s=t.match(yte);if(!s)return new Date(NaN);const n=!!s[4],a=yd(s[1]),i=yd(s[2])-1,o=yd(s[3]),l=yd(s[4]),c=yd(s[5])-1;if(n)return Ate(e,l,c)?_te(e,l,c):new Date(NaN);{const d=new Date(0);return!Ete(e,i,o)||!Mte(e,a)?new Date(NaN):(d.setUTCFullYear(e,i,Math.max(a,o)),d)}}function yd(t){return t?parseInt(t):1}function Cte(t){const e=t.match(vte);if(!e)return NaN;const s=L0(e[1]),n=L0(e[2]),a=L0(e[3]);return Pte(s,n,a)?s*Bx+n*zx+a*1e3:NaN}function L0(t){return t&&parseFloat(t.replace(",","."))||0}function Ste(t){if(t==="Z")return 0;const e=t.match(wte);if(!e)return 0;const s=e[1]==="+"?-1:1,n=parseInt(e[2]),a=e[3]&&parseInt(e[3])||0;return Dte(n,a)?s*(n*Bx+a*zx):NaN}function _te(t,e,s){const n=new Date(0);n.setUTCFullYear(t,0,4);const a=n.getUTCDay()||7,i=(e-1)*7+s+1-a;return n.setUTCDate(n.getUTCDate()+i),n}const Tte=[31,null,31,30,31,30,31,31,30,31,30,31];function vP(t){return t%400===0||t%4===0&&t%100!==0}function Ete(t,e,s){return e>=0&&e<=11&&s>=1&&s<=(Tte[e]||(vP(t)?29:28))}function Mte(t,e){return e>=1&&e<=(vP(t)?366:365)}function Ate(t,e,s){return e>=1&&e<=53&&s>=0&&s<=6}function Pte(t,e,s){return t===24?e===0&&s===0:s>=0&&s<60&&e>=0&&e<60&&t>=0&&t<25}function Dte(t,e){return e>=0&&e<=59}function Cn(t,e,s){const n=Ne(t,s==null?void 0:s.in),a=n.getFullYear(),i=n.getDate(),o=st(t,0);o.setFullYear(a,e,15),o.setHours(0,0,0,0);const l=fee(o);return n.setMonth(e,Math.min(i,l)),n}function Hm(t,e,s){const n=Ne(t,s==null?void 0:s.in);return n.setHours(e),n}function Wm(t,e,s){const n=Ne(t,s==null?void 0:s.in);return n.setMinutes(e),n}function Rl(t,e,s){const n=Ne(t,s==null?void 0:s.in),a=Math.trunc(n.getMonth()/3)+1,i=e-a;return Cn(n,n.getMonth()+i*3)}function Gm(t,e,s){const n=Ne(t,s==null?void 0:s.in);return n.setSeconds(e),n}function Ur(t,e,s){const n=Ne(t,s==null?void 0:s.in);return isNaN(+n)?st(t,NaN):(n.setFullYear(e),n)}function Vo(t,e,s){return Dr(t,-e,s)}function wP(t,e,s){return B1(t,-1,s)}function LS(t,e,s){return _p(t,-1,s)}function Ki(t,e,s){return Er(t,-e,s)}function Ux(){return typeof window<"u"}
881function Yc(t){return jP(t)?(t.nodeName||"").toLowerCase():"#document"}function Dn(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function ua(t){var e;return(e=(jP(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function jP(t){return Ux()?t instanceof Node||t instanceof Dn(t).Node:!1}function Hs(t){return Ux()?t instanceof Element||t instanceof Dn(t).Element:!1}function Ga(t){return Ux()?t instanceof HTMLElement||t instanceof Dn(t).HTMLElement:!1}function OS(t){return!Ux()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Dn(t).ShadowRoot}function fh(t){const{overflow:e,overflowX:s,overflowY:n,display:a}=dr(t);return/auto|scroll|overlay|hidden|clip/.test(e+n+s)&&a!=="inline"&&a!=="contents"}function Rte(t){return/^(table|td|th)$/.test(Yc(t))}function Hx(t){try{if(t.matches(":popover-open"))return!0}catch{}try{return t.matches(":modal")}catch{return!1}}const Lte=/transform|translate|scale|rotate|perspective|filter/,Ote=/paint|layout|strict|content/,mo=t=>!!t&&t!=="none";let O0;function G1(t){const e=Hs(t)?dr(t):t;return mo(e.transform)||mo(e.translate)||mo(e.scale)||mo(e.rotate)||mo(e.perspective)||!Y1()&&(mo(e.backdropFilter)||mo(e.filter))||Lte.test(e.willChange||"")||Ote.test(e.contain||"")}function Ite(t){let e=Ji(t);for(;Ga(e)&&!Rc(e);){if(G1(e))return e;if(Hx(e))return null;e=Ji(e)}return null}function Y1(){return O0==null&&(O0=typeof CSS<"u"&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),O0}function Rc(t){return/^(html|body|#document)$/.test(Yc(t))}function dr(t){return Dn(t).getComputedStyle(t)}function Wx(t){return Hs(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Ji(t){if(Yc(t)==="html")return t;const e=t.assignedSlot||t.parentNode||OS(t)&&t.host||ua(t);return OS(e)?e.host:e}function NP(t){const e=Ji(t);return Rc(e)?t.ownerDocument?t.ownerDocument.body:t.body:Ga(e)&&fh(e)?e:NP(e)}function Ju(t,e,s){var n;e===void 0&&(e=[]),s===void 0&&(s=!0);const a=NP(t),i=a===((n=t.ownerDocument)==null?void 0:n.body),o=Dn(a);if(i){const l=sv(o);return e.concat(o,o.visualViewport||[],fh(a)?a:[],l&&s?Ju(l):[])}else return e.concat(a,Ju(a,[],s))}function sv(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}const Lc=Math.min,Uo=Math.max,Pp=Math.round,um=Math.floor,na=t=>({x:t,y:t}),Fte={left:"right",right:"left",bottom:"top",top:"bottom"};function $te(t,e,s){return Uo(t,Lc(e,s))}function Gx(t,e){return typeof t=="function"?t(e):t}function Oc(t){return t.split("-")[0]}function ph(t){return t.split("-")[1]}function zte(t){return t==="x"?"y":"x"}function q1(t){return t==="y"?"height":"width"}function Mo(t){const e=t[0];return e==="t"||e==="b"?"y":"x"}function K1(t){return zte(Mo(t))}function Bte(t,e,s){s===void 0&&(s=!1);const n=ph(t),a=K1(t),i=q1(a);let o=a==="x"?n===(s?"end":"start")?"right":"left":n==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Dp(o)),[o,Dp(o)]}function Vte(t){const e=Dp(t);return[nv(t),e,nv(e)]}function nv(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const IS=["left","right"],FS=["right","left"],Ute=["top","bottom"],Hte=["bottom","top"];function Wte(t,e,s){switch(t){case"top":case"bottom":return s?e?FS:IS:e?IS:FS;case"left":case"right":return e?Ute:Hte;default:return[]}}function Gte(t,e,s,n){const a=ph(t);let i=Wte(Oc(t),s==="start",n);return a&&(i=i.map(o=>o+"-"+a),e&&(i=i.concat(i.map(nv)))),i}function Dp(t){const e=Oc(t);return Fte[e]+t.slice(e.length)}function Yte(t){return{top:0,right:0,bottom:0,left:0,...t}}function kP(t){return typeof t!="number"?Yte(t):{top:t,right:t,bottom:t,left:t}}function Rp(t){const{x:e,y:s,width:n,height:a}=t;return{width:n,height:a,top:s,left:e,right:e+n,bottom:s+a,x:e,y:s}}var qte=typeof document<"u",Kte=function(){},Lp=qte?M.useLayoutEffect:Kte;const Jte={...dv},Qte=Jte.useInsertionEffect,Xte=Qte||(t=>t());function Zte(t){const e=M.useRef(()=>{});return Xte(()=>{e.current=t}),M.useCallback(function(){for(var s=arguments.length,n=new Array(s),a=0;a<s;a++)n[a]=arguments[a];return e.current==null?void 0:e.current(...n)},[])}function $S(t,e,s){let{reference:n,floating:a}=t;
vendor: 4,134 bytes, line 881
881const i=Mo(e),o=K1(e),l=q1(o),c=Oc(e),d=i==="y",u=n.x+n.width/2-a.width/2,h=n.y+n.height/2-a.height/2,m=n[l]/2-a[l]/2;let f;switch(c){case"top":f={x:u,y:n.y-a.height};break;case"bottom":f={x:u,y:n.y+n.height};break;case"right":f={x:n.x+n.width,y:h};break;case"left":f={x:n.x-a.width,y:h};break;default:f={x:n.x,y:n.y}}switch(ph(e)){case"start":f[o]-=m*(s&&d?-1:1);break;case"end":f[o]+=m*(s&&d?-1:1);break}return f}async function ese(t,e){var s;e===void 0&&(e={});const{x:n,y:a,platform:i,rects:o,elements:l,strategy:c}=t,{boundary:d="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:m=!1,padding:f=0}=Gx(e,t),p=kP(f),x=l[m?h==="floating"?"reference":"floating":h],b=Rp(await i.getClippingRect({element:(s=await(i.isElement==null?void 0:i.isElement(x)))==null||s?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:d,rootBoundary:u,strategy:c})),y=h==="floating"?{x:n,y:a,width:o.floating.width,height:o.floating.height}:o.reference,w=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),N=await(i.isElement==null?void 0:i.isElement(w))?await(i.getScale==null?void 0:i.getScale(w))||{x:1,y:1}:{x:1,y:1},j=Rp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:c}):y);return{top:(b.top-j.top+p.top)/N.y,bottom:(j.bottom-b.bottom+p.bottom)/N.y,left:(b.left-j.left+p.left)/N.x,right:(j.right-b.right+p.right)/N.x}}const tse=50,sse=async(t,e,s)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=s,l=o.detectOverflow?o:{...o,detectOverflow:ese},c=await(o.isRTL==null?void 0:o.isRTL(e));let d=await o.getElementRects({reference:t,floating:e,strategy:a}),{x:u,y:h}=$S(d,n,c),m=n,f=0;const p={};for(let g=0;g<i.length;g++){const x=i[g];if(!x)continue;const{name:b,fn:y}=x,{x:w,y:N,data:j,reset:S}=await y({x:u,y:h,initialPlacement:n,placement:m,strategy:a,middlewareData:p,rects:d,platform:l,elements:{reference:t,floating:e}});u=w??u,h=N??h,p[b]={...p[b],...j},S&&f<tse&&(f++,typeof S=="object"&&(S.placement&&(m=S.placement),S.rects&&(d=S.rects===!0?await o.getElementRects({reference:t,floating:e,strategy:a}):S.rects),{x:u,y:h}=$S(d,m,c)),g=-1)}return{x:u,y:h,placement:m,strategy:a,middlewareData:p}},nse=t=>({name:"arrow",options:t,async fn(e){const{x:s,y:n,placement:a,rects:i,platform:o,elements:l,middlewareData:c}=e,{element:d,padding:u=0}=Gx(t,e)||{};if(d==null)return{};const h=kP(u),m={x:s,y:n},f=K1(a),p=q1(f),g=await o.getDimensions(d),x=f==="y",b=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",N=i.reference[p]+i.reference[f]-m[f]-i.floating[p],j=m[f]-i.reference[f],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(d));let k=S?S[w]:0;(!k||!await(o.isElement==null?void 0:o.isElement(S)))&&(k=l.floating[w]||i.floating[p]);const C=N/2-j/2,T=k/2-g[p]/2-1,A=Lc(h[b],T),E=Lc(h[y],T),L=A,D=k-g[p]-E,P=k/2-g[p]/2+C,R=$te(L,P,D),$=!c.arrow&&ph(a)!=null&&P!==R&&i.reference[p]/2-(P<L?A:E)-g[p]/2<0,O=$?P<L?P-L:P-D:0;return{[f]:m[f]+O,data:{[f]:R,centerOffset:P-R-O,...$&&{alignmentOffset:O}},reset:$}}}),rse=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var s,n;const{placement:a,middlewareData:i,rects:o,initialPlacement:l,platform:c,elements:d}=e,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...x}=Gx(t,e);if((s=i.arrow)!=null&&s.alignmentOffset)return{};const b=Oc(a),y=Mo(l),w=Oc(l)===l,N=await(c.isRTL==null?void 0:c.isRTL(d.floating)),j=m||(w||!g?[Dp(l)]:Vte(l)),S=p!=="none";!m&&S&&j.push(...Gte(l,g,p,N));const k=[l,...j],C=await c.detectOverflow(e,x),T=[];let A=((n=i.flip)==null?void 0:n.overflows)||[];if(u&&T.push(C[b]),h){const P=Bte(a,o,N);T.push(C[P[0]],C[P[1]])}if(A=[...A,{placement:a,overflows:T}],!T.every(P=>P<=0)){var E,L;const P=(((E=i.flip)==null?void 0:E.index)||0)+1,R=k[P];if(R&&(!(h==="alignment"?y!==Mo(R):!1)||A.every(_=>Mo(_.placement)===y?_.overflows[0]>0:!0)))return{data:{index:P,overflows:A},reset:{placement:R}};
vendor: 9,629 bytes, line 881
881let $=(L=A.filter(O=>O.overflows[0]<=0).sort((O,_)=>O.overflows[1]-_.overflows[1])[0])==null?void 0:L.placement;if(!$)switch(f){case"bestFit":{var D;const O=(D=A.filter(_=>{if(S){const B=Mo(_.placement);return B===y||B==="y"}return!0}).map(_=>[_.placement,_.overflows.filter(B=>B>0).reduce((B,J)=>B+J,0)]).sort((_,B)=>_[1]-B[1])[0])==null?void 0:D[0];O&&($=O);break}case"initialPlacement":$=l;break}if(a!==$)return{reset:{placement:$}}}return{}}}},ase=new Set(["left","top"]);async function ise(t,e){const{placement:s,platform:n,elements:a}=t,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=Oc(s),l=ph(s),c=Mo(s)==="y",d=ase.has(o)?-1:1,u=i&&c?-1:1,h=Gx(e,t);let{mainAxis:m,crossAxis:f,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof p=="number"&&(f=l==="end"?p*-1:p),c?{x:f*u,y:m*d}:{x:m*d,y:f*u}}const ose=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var s,n;const{x:a,y:i,placement:o,middlewareData:l}=e,c=await ise(e,t);return o===((s=l.offset)==null?void 0:s.placement)&&(n=l.arrow)!=null&&n.alignmentOffset?{}:{x:a+c.x,y:i+c.y,data:{...c,placement:o}}}}};function CP(t){const e=dr(t);let s=parseFloat(e.width)||0,n=parseFloat(e.height)||0;const a=Ga(t),i=a?t.offsetWidth:s,o=a?t.offsetHeight:n,l=Pp(s)!==i||Pp(n)!==o;return l&&(s=i,n=o),{width:s,height:n,$:l}}function J1(t){return Hs(t)?t:t.contextElement}function dc(t){const e=J1(t);if(!Ga(e))return na(1);const s=e.getBoundingClientRect(),{width:n,height:a,$:i}=CP(e);let o=(i?Pp(s.width):s.width)/n,l=(i?Pp(s.height):s.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!l||!Number.isFinite(l))&&(l=1),{x:o,y:l}}const lse=na(0);function SP(t){const e=Dn(t);return!Y1()||!e.visualViewport?lse:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function cse(t,e,s){return e===void 0&&(e=!1),!s||e&&s!==Dn(t)?!1:e}function sl(t,e,s,n){e===void 0&&(e=!1),s===void 0&&(s=!1);const a=t.getBoundingClientRect(),i=J1(t);let o=na(1);e&&(n?Hs(n)&&(o=dc(n)):o=dc(t));const l=cse(i,s,n)?SP(i):na(0);let c=(a.left+l.x)/o.x,d=(a.top+l.y)/o.y,u=a.width/o.x,h=a.height/o.y;if(i){const m=Dn(i),f=n&&Hs(n)?Dn(n):n;let p=m,g=sv(p);for(;g&&n&&f!==p;){const x=dc(g),b=g.getBoundingClientRect(),y=dr(g),w=b.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,N=b.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;c*=x.x,d*=x.y,u*=x.x,h*=x.y,c+=w,d+=N,p=Dn(g),g=sv(p)}}return Rp({width:u,height:h,x:c,y:d})}function Yx(t,e){const s=Wx(t).scrollLeft;return e?e.left+s:sl(ua(t)).left+s}function _P(t,e){const s=t.getBoundingClientRect(),n=s.left+e.scrollLeft-Yx(t,s),a=s.top+e.scrollTop;return{x:n,y:a}}function dse(t){let{elements:e,rect:s,offsetParent:n,strategy:a}=t;const i=a==="fixed",o=ua(n),l=e?Hx(e.floating):!1;if(n===o||l&&i)return s;let c={scrollLeft:0,scrollTop:0},d=na(1);const u=na(0),h=Ga(n);if((h||!h&&!i)&&((Yc(n)!=="body"||fh(o))&&(c=Wx(n)),h)){const f=sl(n);d=dc(n),u.x=f.x+n.clientLeft,u.y=f.y+n.clientTop}const m=o&&!h&&!i?_P(o,c):na(0);return{width:s.width*d.x,height:s.height*d.y,x:s.x*d.x-c.scrollLeft*d.x+u.x+m.x,y:s.y*d.y-c.scrollTop*d.y+u.y+m.y}}function use(t){return Array.from(t.getClientRects())}function hse(t){const e=ua(t),s=Wx(t),n=t.ownerDocument.body,a=Uo(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=Uo(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let o=-s.scrollLeft+Yx(t);const l=-s.scrollTop;return dr(n).direction==="rtl"&&(o+=Uo(e.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:l}}const zS=25;function mse(t,e){const s=Dn(t),n=ua(t),a=s.visualViewport;let i=n.clientWidth,o=n.clientHeight,l=0,c=0;if(a){i=a.width,o=a.height;const u=Y1();(!u||u&&e==="fixed")&&(l=a.offsetLeft,c=a.offsetTop)}const d=Yx(n);if(d<=0){const u=n.ownerDocument,h=u.body,m=getComputedStyle(h),f=u.compatMode==="CSS1Compat"&&parseFloat(m.marginLeft)+parseFloat(m.marginRight)||0,p=Math.abs(n.clientWidth-h.clientWidth-f);p<=zS&&(i-=p)}else d<=zS&&(i+=d);return{width:i,height:o,x:l,y:c}}function fse(t,e){const s=sl(t,!0,e==="fixed"),n=s.top+t.clientTop,a=s.left+t.clientLeft,i=Ga(t)?dc(t):na(1),o=t.clientWidth*i.x,l=t.clientHeight*i.y,c=a*i.x,d=n*i.y;return{width:o,height:l,x:c,y:d}}function BS(t,e,s){let n;if(e==="viewport")n=mse(t,s);else if(e==="document")n=hse(ua(t));else if(Hs(e))n=fse(e,s);else{const a=SP(t);n={x:e.x-a.x,y:e.y-a.y,width:e.width,height:e.height}}return Rp(n)}function TP(t,e){const s=Ji(t);return s===e||!Hs(s)||Rc(s)?!1:dr(s).position==="fixed"||TP(s,e)}function pse(t,e){const s=e.get(t);if(s)return s;let n=Ju(t,[],!1).filter(l=>Hs(l)&&Yc(l)!=="body"),a=null;const i=dr(t).position==="fixed";let o=i?Ji(t):t;for(;Hs(o)&&!Rc(o);){const l=dr(o),c=G1(o);!c&&l.position==="fixed"&&(a=null),(i?!c&&!a:!c&&l.position==="static"&&!!a&&(a.position==="absolute"||a.position==="fixed")||fh(o)&&!c&&TP(t,o))?n=n.filter(u=>u!==o):a=l,o=Ji(o)}return e.set(t,n),n}function xse(t){let{element:e,boundary:s,rootBoundary:n,strategy:a}=t;const o=[...s==="clippingAncestors"?Hx(e)?[]:pse(e,this._c):[].concat(s),n],l=BS(e,o[0],a);let c=l.top,d=l.right,u=l.bottom,h=l.left;for(let m=1;m<o.length;m++){const f=BS(e,o[m],a);c=Uo(f.top,c),d=Lc(f.right,d),u=Lc(f.bottom,u),h=Uo(f.left,h)}return{width:d-h,height:u-c,x:h,y:c}}function gse(t){const{width:e,height:s}=CP(t);return{width:e,height:s}}function bse(t,e,s){const n=Ga(e),a=ua(e),i=s==="fixed",o=sl(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=na(0);function d(){c.x=Yx(a)}if(n||!n&&!i)if((Yc(e)!=="body"||fh(a))&&(l=Wx(e)),n){const f=sl(e,!0,i,e);c.x=f.x+e.clientLeft,c.y=f.y+e.clientTop}else a&&d();i&&!n&&a&&d();const u=a&&!n&&!i?_P(a,l):na(0),h=o.left+l.scrollLeft-c.x-u.x,m=o.top+l.scrollTop-c.y-u.y;return{x:h,y:m,width:o.width,height:o.height}}function I0(t){return dr(t).position==="static"}function VS(t,e){if(!Ga(t)||dr(t).position==="fixed")return null;if(e)return e(t);let s=t.offsetParent;return ua(t)===s&&(s=s.ownerDocument.body),s}function EP(t,e){const s=Dn(t);if(Hx(t))return s;if(!Ga(t)){let a=Ji(t);for(;a&&!Rc(a);){if(Hs(a)&&!I0(a))return a;a=Ji(a)}return s}let n=VS(t,e);for(;n&&Rte(n)&&I0(n);)n=VS(n,e);return n&&Rc(n)&&I0(n)&&!G1(n)?s:n||Ite(t)||s}const yse=async function(t){const e=this.getOffsetParent||EP,s=this.getDimensions,n=await s(t.floating);return{reference:bse(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function vse(t){return dr(t).direction==="rtl"}const wse={convertOffsetParentRelativeRectToViewportRelativeRect:dse,getDocumentElement:ua,getClippingRect:xse,getOffsetParent:EP,getElementRects:yse,getClientRects:use,getDimensions:gse,getScale:dc,isElement:Hs,isRTL:vse};function MP(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function jse(t,e){let s=null,n;const a=ua(t);function i(){var l;clearTimeout(n),(l=s)==null||l.disconnect(),s=null}function o(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const d=t.getBoundingClientRect(),{left:u,top:h,width:m,height:f}=d;if(l||e(),!m||!f)return;const p=um(h),g=um(a.clientWidth-(u+m)),x=um(a.clientHeight-(h+f)),b=um(u),w={rootMargin:-p+"px "+-g+"px "+-x+"px "+-b+"px",threshold:Uo(0,Lc(1,c))||1};let N=!0;function j(S){const k=S[0].intersectionRatio;if(k!==c){if(!N)return o();k?o(!1,k):n=setTimeout(()=>{o(!1,1e-7)},1e3)}k===1&&!MP(d,t.getBoundingClientRect())&&o(),N=!1}try{s=new IntersectionObserver(j,{...w,root:a.ownerDocument})}catch{s=new IntersectionObserver(j,w)}s.observe(t)}return o(!0),i}function Nse(t,e,s,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=n,d=J1(t),u=a||i?[...d?Ju(d):[],...e?Ju(e):[]]:[];u.forEach(b=>{a&&b.addEventListener("scroll",s,{passive:!0}),i&&b.addEventListener("resize",s)});const h=d&&l?jse(d,s):null;let m=-1,f=null;o&&(f=new ResizeObserver(b=>{let[y]=b;y&&y.target===d&&f&&e&&(f.unobserve(e),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var w;(w=f)==null||w.observe(e)})),s()}),d&&!c&&f.observe(d),e&&f.observe(e));let p,g=c?sl(t):null;c&&x();function x(){const b=sl(t);g&&!MP(g,b)&&s(),g=b,p=requestAnimationFrame(x)}return s(),()=>{var b;u.forEach(y=>{a&&y.removeEventListener("scroll",s),i&&y.removeEventListener("resize",s)}),h==null||h(),(b=f)==null||b.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const kse=ose,Cse=rse,US=nse,Sse=(t,e,s)=>{const n=new Map,a={platform:wse,...s},i={...a.platform,_c:n};return sse(t,e,{...a,platform:i})};var _se=typeof document<"u",Tse=function(){},Ym=_se?M.useLayoutEffect:Tse;function Op(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let s,n,a;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(s=t.length,s!==e.length)return!1;for(n=s;n--!==0;)if(!Op(t[n],e[n]))return!1;return!0}if(a=Object.keys(t),s=a.length,s!==Object.keys(e).length)return!1;for(n=s;n--!==0;)if(!{}.hasOwnProperty.call(e,a[n]))return!1;for(n=s;n--!==0;){const i=a[n];if(!(i==="_owner"&&t.$$typeof)&&!Op(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function AP(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function HS(t,e){const s=AP(t);return Math.round(e*s)/s}function F0(t){const e=M.useRef(t);return Ym(()=>{e.current=t}),e}function Ese(t){t===void 0&&(t={});const{placement:e="bottom",strategy:s="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:l=!0,whileElementsMounted:c,open:d}=t,[u,h]=M.useState({x:0,y:0,strategy:s,placement:e,middlewareData:{},isPositioned:!1}
881),[m,f]=M.useState(n);Op(m,n)||f(n);const[p,g]=M.useState(null),[x,b]=M.useState(null),y=M.useCallback(_=>{_!==S.current&&(S.current=_,g(_))},[]),w=M.useCallback(_=>{_!==k.current&&(k.current=_,b(_))},[]),N=i||p,j=o||x,S=M.useRef(null),k=M.useRef(null),C=M.useRef(u),T=c!=null,A=F0(c),E=F0(a),L=F0(d),D=M.useCallback(()=>{if(!S.current||!k.current)return;const _={placement:e,strategy:s,middleware:m};E.current&&(_.platform=E.current),Sse(S.current,k.current,_).then(B=>{const J={...B,isPositioned:L.current!==!1};P.current&&!Op(C.current,J)&&(C.current=J,tx.flushSync(()=>{h(J)}))})},[m,e,s,E,L]);Ym(()=>{d===!1&&C.current.isPositioned&&(C.current.isPositioned=!1,h(_=>({..._,isPositioned:!1})))},[d]);const P=M.useRef(!1);Ym(()=>(P.current=!0,()=>{P.current=!1}),[]),Ym(()=>{if(N&&(S.current=N),j&&(k.current=j),N&&j){if(A.current)return A.current(N,j,D);D()}},[N,j,D,A,T]);const R=M.useMemo(()=>({reference:S,floating:k,setReference:y,setFloating:w}),[y,w]),$=M.useMemo(()=>({reference:N,floating:j}),[N,j]),O=M.useMemo(()=>{const _={position:s,left:0,top:0};if(!$.floating)return _;const B=HS($.floating,u.x),J=HS($.floating,u.y);return l?{..._,transform:"translate("+B+"px, "+J+"px)",...AP($.floating)>=1.5&&{willChange:"transform"}}:{position:s,left:B,top:J}},[s,l,$.floating,u.x,u.y]);return M.useMemo(()=>({...u,update:D,refs:R,elements:$,floatingStyles:O}),[u,D,R,$,O])}const Mse=t=>{function e(s){return{}.hasOwnProperty.call(s,"current")}return{name:"arrow",options:t,fn(s){const{element:n,padding:a}=typeof t=="function"?t(s):t;return n&&e(n)?n.current!=null?US({element:n.current,padding:a}).fn(s):{}:n?US({element:n,padding:a}).fn(s):{}}}},Ase=(t,e)=>{const s=kse(t);return{name:s.name,fn:s.fn,options:[t,e]}},Pse=(t,e)=>{const s=Cse(t);return{name:s.name,fn:s.fn,options:[t,e]}},Dse=(t,e)=>{const s=Mse(t);return{name:s.name,fn:s.fn,options:[t,e]}},Rse={...dv};let WS=!1,Lse=0;const GS=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+Lse++;function Ose(){const[t,e]=M.useState(()=>WS?GS():void 0);return Lp(()=>{t==null&&e(GS())},[]),M.useEffect(()=>{WS=!0},[]),t}const Ise=Rse.useId,PP=Ise||Ose,Fse=M.forwardRef(function(e,s){const{context:{placement:n,elements:{floating:a},middlewareData:{arrow:i,shift:o}},width:l=14,height:c=7,tipRadius:d=0,strokeWidth:u=0,staticOffset:h,stroke:m,d:f,style:{transform:p,...g}={},...x}=e,b=PP(),[y,w]=M.useState(!1);if(Lp(()=>{if(!a)return;dr(a).direction==="rtl"&&w(!0)},[a]),!a)return null;const[N,j]=n.split("-"),S=N==="top"||N==="bottom";let k=h;(S&&o!=null&&o.x||!S&&o!=null&&o.y)&&(k=null);const C=u*2,T=C/2,A=l/2*(d/-8+1),E=c/2*d/4,L=!!f,D=k&&j==="end"?"bottom":"top";let P=k&&j==="end"?"right":"left";k&&y&&(P=j==="end"?"left":"right");const R=(i==null?void 0:i.x)!=null?k||i.x:"",$=(i==null?void 0:i.y)!=null?k||i.y:"",O=f||"M0,0"+(" H"+l)+(" L"+(l-A)+","+(c-E))+(" Q"+l/2+","+c+" "+A+","+(c-E))+" Z",_={top:L?"rotate(180deg)":"",left:L?"rotate(90deg)":"rotate(-90deg)",bottom:L?"":"rotate(180deg)",right:L?"rotate(-90deg)":"rotate(90deg)"}[N];return r.jsxs("svg",{...x,"aria-hidden":!0,ref:s,width:L?l:l+C,height:l,viewBox:"0 0 "+l+" "+(c>l?c:l),style:{position:"absolute",pointerEvents:"none",[P]:R,[D]:$,[N]:S||L?"100%":"calc(100% - "+C/2+"px)",transform:[_,p].filter(B=>!!B).join(" "),...g},children:[C>0&&r.jsx("path",{clipPath:"url(#"+b+")",fill:"none",stroke:m,strokeWidth:C+(f?0:1),d:O}),r.jsx("path",{stroke:C&&!f?x.fill:"none",d:O}),r.jsx("clipPath",{id:b,children:r.jsx("rect",{x:-T,y:T*(L?-1:1),width:l+C,height:l})})]})});function $se(){const t=new Map;return{emit(e,s){var n;(n=t.get(e))==null||n.forEach(a=>a(s))},on(e,s){t.has(e)||t.set(e,new Set),t.get(e).add(s)},off(e,s){var n;(n=t.get(e))==null||n.delete(s)}}}const zse=M.createContext(null),Bse=M.createContext(null),Vse=()=>{var t;return((t=M.useContext(zse))==null?void 0:t.id)||null},Use=()=>M.useContext(Bse);function Hse(t){const{open:e=!1,onOpenChange:s,elements:n}=t,a=PP(),i=M.useRef({}),[o]=M.useState(()=>$se()),l=Vse()!=null,[c,d]=M.useState(n.reference),u=Zte((f,p,g)=>{i.current.openEvent=f?p:void 0,o.emit("openchange",{open:f,event:p,reason:g,nested:l}),s==null||s(f,p,g)}
881),h=M.useMemo(()=>({setPositionReference:d}),[]),m=M.useMemo(()=>({reference:c||n.reference||null,floating:n.floating||null,domReference:n.reference}),[c,n.reference,n.floating]);return M.useMemo(()=>({dataRef:i,open:e,onOpenChange:u,elements:m,events:o,floatingId:a,refs:h}),[e,u,m,o,a,h])}function Wse(t){t===void 0&&(t={});const{nodeId:e}=t,s=Hse({...t,elements:{reference:null,floating:null,...t.elements}}),n=t.rootContext||s,a=n.elements,[i,o]=M.useState(null),[l,c]=M.useState(null),u=(a==null?void 0:a.domReference)||i,h=M.useRef(null),m=Use();Lp(()=>{u&&(h.current=u)},[u]);const f=Ese({...t,elements:{...a,...l&&{reference:l}}}),p=M.useCallback(w=>{const N=Hs(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;c(N),f.refs.setReference(N)},[f.refs]),g=M.useCallback(w=>{(Hs(w)||w===null)&&(h.current=w,o(w)),(Hs(f.refs.reference.current)||f.refs.reference.current===null||w!==null&&!Hs(w))&&f.refs.setReference(w)},[f.refs]),x=M.useMemo(()=>({...f.refs,setReference:g,setPositionReference:p,domReference:h}),[f.refs,g,p]),b=M.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),y=M.useMemo(()=>({...f,...n,refs:x,elements:b,nodeId:e}),[f,x,b,e,n]);return Lp(()=>{n.dataRef.current.floatingContext=y;const w=m==null?void 0:m.nodesRef.current.find(N=>N.id===e);w&&(w.context=y)}),M.useMemo(()=>({...f,context:y,refs:x,elements:b}),[f,x,b,y])}/*! 882 react-datepicker v9.1.0 883 https://github.com/Hacker0x01/react-datepicker 884 Released under the MIT License. 885*/var rv=function(e,s){return rv=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,a){n.__proto__=a}||function(n,a){for(var i in a)Object.prototype.hasOwnProperty.call(a,i)&&(n[i]=a[i])},rv(e,s)};function Ns(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");rv(t,e);function s(){this.constructor=t}t.prototype=e===null?Object.create(e):(s.prototype=e.prototype,new s)}var Be=function(){return Be=Object.assign||function(s){for(var n,a=1,i=arguments.length;a<i;a++){n=arguments[a];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(s[o]=n[o])}return s},Be.apply(this,arguments)};function Qr(t,e,s){if(s||arguments.length===2)for(var n=0,a=e.length,i;n<a;n++)(i||!(n in e))&&(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}var Gse=function(t){var e=t.showTimeSelectOnly,s=e===void 0?!1:e,n=t.showTime,a=n===void 0?!1:n,i=t.className,o=t.children,l=t.inline,c=s?"Choose Time":"Choose Date".concat(a?" and Time":"");return v.createElement("div",{className:i,"aria-label":c,role:l?void 0:"dialog","aria-modal":l?void 0:"true",translate:"no"},o)},Yse=function(t,e){var s=M.useRef(null),n=M.useRef(t);M.useEffect(function(){n.current=t},[t]);var a=M.useCallback(function(i){var o,l=i.composed&&i.composedPath&&i.composedPath().find(function(c){return c instanceof Node})||i.target;s.current&&!s.current.contains(l)&&(e&&l instanceof HTMLElement&&l.classList.contains(e)||(o=n.current)===null||o===void 0||o.call(n,i))},[e]);return M.useEffect(function(){return document.addEventListener("mousedown",a),function(){document.removeEventListener("mousedown",a)}},[a]),s},qx=function(t){var e=t.children,s=t.onClickOutside,n=t.className,a=t.containerRef,i=t.style,o=t.ignoreClass,l=Yse(s,o);return v.createElement("div",{className:n,style:i,ref:function(c){l.current=c,a&&(a.current=c)}},e)},hm=null,YS=!1;function DP(){if(YS)return hm;YS=!0;try{var t="date-fns-tz";hm=require(t)}catch{hm=null}return hm}function qS(t,e){if(!e)return t;var s=DP();return s?s.toZonedTime(t,e):t}function ba(t,e){if(!e)return t;var s=DP();return s?s.fromZonedTime(t,e):t}var ue;(function(t){t.ArrowUp="ArrowUp",t.ArrowDown="ArrowDown",t.ArrowLeft="ArrowLeft",t.ArrowRight="ArrowRight",t.PageUp="PageUp",t.PageDown="PageDown",t.Home="Home",t.End="End",t.Enter="Enter",t.Space=" ",t.Tab="Tab",t.Escape="Escape",t.Backspace="Backspace",t.X="x"})(ue||(ue={}));function RP(){var t=typeof window<"u"?window:globalThis;return t}var xh=12;function Ke(t){if(t==null)return new Date;var e=typeof t=="string"?bte(t):Ne(t);return cn(e)?e:new Date}function fo(t,e,s,n,a){a===void 0&&(a=Ke());for(var i=Ic(s)||Ic(Q1()),o=Array.isArray(e)?e:[e],l=0,c=o;l<c.length;l++){var d=c[l],u=hte(t,d,a,{locale:i});if(cn(u)&&(!n||t===ut(u,d,s)))return u}if(!n&&t&&t.length>=8){var h=new Date(t);if(Dc(h))return h}return null}function qse(t,e){if(e===void 0&&(e=Ke()),!t)return null;var s=t.match(/\b(1\d{3}|2\d{3})\b/);if(!s||!s[1])return null;var n=parseInt(s[1],10),a=t.match(/(?:^|[/\-\s])?(0?[1-9]|1[0-2])(?:[/\-\s]|$)/),i=a&&a[1]?parseInt(a[1],10)-1:e.getMonth();return new Date(n,i,1)}function cn(t){return Dc(t)}function Ao(t){return t==null?null:sa(t)&&Dc(t)?t:null}function ut(t,e,s){if(s==="en")return DS(t,e,{useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0});var n=s?Ic(s):void 0;return s&&!n&&console.warn('A locale object was not found for the provided string ["'.concat(s,'"].')),n=n||Ic(Q1()),DS(t,e,{locale:n,useAdditionalWeekYearTokens:!0,useAdditionalDayOfYearTokens:!0})}function ln(t,e){var s=e.dateFormat,n=e.locale,a=Array.isArray(s)&&s.length>0?s[0]:s;return t&&ut(t,a,n)||""}var LP=" - ";function Kse(t,e,s){if(!t&&!e)return"";var n=t?ln(t,s):"",a=e?ln(e,s):"",i=s.rangeSeparator||LP;
885return"".concat(n).concat(i).concat(a)}function Jse(t,e){if(!(t!=null&&t.length))return"";var s=t[0]?ln(t[0],e):"";if(t.length===1)return s;if(t.length===2&&t[1]){var n=ln(t[1],e);return"".concat(s,", ").concat(n)}var a=t.length-1;return"".concat(s," (+").concat(a,")")}function ya(t,e){var s=e.hour,n=s===void 0?0:s,a=e.minute,i=a===void 0?0:a,o=e.second,l=o===void 0?0:o;return Hm(Wm(Gm(t,l),i),n)}function Qse(t){return V1(t)}function Xse(t,e){return ut(t,"ddd",e)}function Rd(t){return tl(t)}function Fi(t,e,s){var n=Ic(e||Q1());return za(t,{locale:n,weekStartsOn:s})}function Ra(t){return uP(t)}function Ld(t){return Vx(t)}function KS(t){return Zy(t)}function JS(){return tl(Ke())}function QS(t){return cP(t)}function Zse(t){return bZ(t)}function ene(t){return dP(t)}function Hr(t,e){return t&&e?xte(t,e):!t&&!e}function Bs(t,e){return t&&e?fte(t,e):!t&&!e}function Ip(t,e){return t&&e?pte(t,e):!t&&!e}function Ge(t,e){return t&&e?xZ(t,e):!t&&!e}function Po(t,e){return t&&e?gee(t,e):!t&&!e}function vo(t,e,s){var n,a=tl(e),i=cP(s);try{n=Ku(t,{start:a,end:i})}catch{n=!1}return n}function Q1(){var t=RP();return t.__localeId__}function Ic(t){if(typeof t=="string"){var e=RP();return e.__localeData__?e.__localeData__[t]:void 0}else return t}function tne(t,e,s){return e(ut(t,"EEEE",s))}function sne(t,e){return ut(t,"EEEEEE",e)}function nne(t,e){return ut(t,"EEE",e)}function X1(t,e){return ut(Cn(Ke(),t),"LLLL",e)}function OP(t,e){return ut(Cn(Ke(),t),"LLL",e)}function rne(t,e){return ut(Rl(Ke(),t),"QQQ",e)}function Qn(t,e){var s=e===void 0?{}:e,n=s.minDate,a=s.maxDate,i=s.excludeDates,o=s.excludeDateIntervals,l=s.includeDates,c=s.includeDateIntervals,d=s.filterDate,u=s.disabled;return u?!0:gh(t,{minDate:n,maxDate:a})||i&&i.some(function(h){return h instanceof Date?Ge(t,h):Ge(t,h.date)})||o&&o.some(function(h){var m=h.start,f=h.end;return Ku(t,{start:m,end:f})})||l&&!l.some(function(h){return Ge(t,h)})||c&&!c.some(function(h){var m=h.start,f=h.end;return Ku(t,{start:m,end:f})})||d&&!d(Ke(t))||!1}function Z1(t,e){var s=e===void 0?{}:e,n=s.excludeDates,a=s.excludeDateIntervals;return a&&a.length>0?a.some(function(i){var o=i.start,l=i.end;return Ku(t,{start:o,end:l})}):n&&n.some(function(i){var o;return i instanceof Date?Ge(t,i):Ge(t,(o=i.date)!==null&&o!==void 0?o:new Date)})||!1}function IP(t,e){var s=e===void 0?{}:e,n=s.minDate,a=s.maxDate,i=s.excludeDates,o=s.includeDates,l=s.filterDate;return gh(t,{minDate:n?uP(n):void 0,maxDate:a?dP(a):void 0})||(i==null?void 0:i.some(function(c){return Bs(t,c instanceof Date?c:c.date)}))||o&&!o.some(function(c){return Bs(t,c)})||l&&!l(Ke(t))||!1}function mm(t,e,s,n){var a=Ue(t),i=mn(t),o=Ue(e),l=mn(e),c=Ue(n);return a===o&&a===c?i<=s&&s<=l:a<o?c===a&&i<=s||c===o&&l>=s||c<o&&c>a:!1}function ane(t,e){var s=e===void 0?{}:e,n=s.minDate,a=s.maxDate,i=s.excludeDates,o=s.includeDates;return gh(t,{minDate:n,maxDate:a})||i&&i.some(function(l){return Bs(l instanceof Date?l:l.date,t)})||o&&!o.some(function(l){return Bs(l,t)})||!1}function fm(t,e){var s=e===void 0?{}:e,n=s.minDate,a=s.maxDate,i=s.excludeDates,o=s.includeDates,l=s.filterDate,c=s.disabled;return c?!0:gh(t,{minDate:n,maxDate:a})||(i==null?void 0:i.some(function(d){return Ip(t,d instanceof Date?d:d.date)}))||o&&!o.some(function(d){return Ip(t,d)})||l&&!l(Ke(t))||!1}function pm(t,e,s){if(!e||!s||!Dc(e)||!Dc(s))return!1;var n=Ue(e),a=Ue(s);return n<=t&&a>=t}function qm(t,e){var s=e===void 0?{}:e,n=s.minDate,a=s.maxDate,i=s.excludeDates,o=s.includeDates,l=s.filterDate,c=s.disabled;if(c)return!0;var d=new Date(t,0,1);return gh(d,{minDate:n?Vx(n):void 0,maxDate:a?hP(a):void 0})||(i==null?void 0:i.some(function(u){return Hr(d,u instanceof Date?u:u.date)}))||o&&!o.some(function(u){return Hr(d,u)})||l&&!l(Ke(d))||!1}function xm(t,e,s,n){var a=Ue(t),i=wi(t),o=Ue(e),l=wi(e),c=Ue(n);return a===o&&a===c?i<=s&&s<=l:a<o?c===a&&i<=s||c===o&&l>=s||c<o&&c>a:!1}function gh(t,e){var s,n=e===void 0?{}:e,a=n.minDate,i=n.maxDate;return(s=a&&Pc(t,a)<0||i&&Pc(t,i)>0)!==null&&s!==void 0?s:!1}function XS(t,e){return e.some(function(s){return Es(s)===Es(t)&&Ms(s)===Ms(t)&&Ii(s)===Ii(t)})}function ZS(t,e){var s=e===void 0?{}:e,n=s.excludeTimes,a=s.includeTimes,i=s.filterTime;return n&&XS(t,n)||a&&!XS(t,a)||i&&!i(t)||!1}function e_(t,e){var s=e.minTime,n=e.maxTime;if(!s||!n)throw new Error("Both minTime and maxTime props required");var a=Ke();a=Hm(a,Es(t)),a=Wm(a,Ms(t)),a=Gm(a,Ii(t));var i=Ke();i=Hm(i,Es(s)),i=Wm(i,Ms(s)),i=Gm(i,Ii(s));var o=Ke();o=Hm(o,Es(n)),o=Wm(o,Ms(n)),o=Gm(o,Ii(n));var l;try{l=!Ku(a,{start:i,end:o})}catch{l=!1}return l}function t_(t,e){var s=e===void 0?{}:e,n=s.minDate,a=s.includeDates,i=Vo(t,1);return n&&Tp(n,i)>0||a&&a.every(function(o){return Tp(o,i)>0})||!1}function s_(t,e){var s=e===void 0?{}:e,n=s.maxDate,a=s.includeDates,i=Dr(t,1);return n&&Tp(i,n)>0||a&&a.every(function(o){return Tp(i,o)>0})||!1}function ine(t,e){var s=e===void 0?{}:e,n=s.minDate,a=s.includeDates,i=Vx(t),o=wP(i);return n&&Ep(n,o)>0||a&&a.every(function(l){return Ep(l,o)>0})||!1}function one(t,e){var s=e===void 0?{}:e,n=s.maxDate,a=s.includeDates,i=hP(t),o=B1(i,1);return n&&Ep(o,n)>0||a&&a.every(function(l){return Ep(o,l)>0})||!1}function n_(t,e){var s=e===void 0?{}:e,n=s.minDate,a=s.includeDates,i=Ki(t,1);return n&&Mp(n,i)>0||a&&a.every(function(o){return Mp(o,i)>0})||!1}function lne(t,e){var s=e===void 0?{}:e,n=s.minDate,a=s.yearItemNumber,i=a===void 0?xh:a,o=Ld(Ki(t,i)),l=_a(o,i).endPeriod,c=n&&Ue(n);return c&&c>l||!1}function r_(t,e){var s=e===void 0?{}:e,n=s.maxDate,a=s.includeDates,i=Er(t,1);return n&&Mp(i,n)>0||a&&a.every(function(o){return Mp(i,o)>0})||!1}function cne(t,e){var s=e===void 0?{}:e,n=s.maxDate,a=s.yearItemNumber,i=a===void 0?xh:a,o=Er(t,i),l=_a(o,i).startPeriod,c=n&&Ue(n);return c&&c<l||!1}function FP(t){var e=t.minDate,s=t.includeDates;if(s&&e){var n=s.filter(function(a){return Pc(a,e)>=0});return _S(n)}else return s?_S(s):e}function $P(t){var e=t.maxDate,s=t.includeDates;if(s&&e){var n=s.filter(function(a){return Pc(a,e)<=0});return SS(n)}else return s?SS(s):e}function a_(t,e){var s;
885t===void 0&&(t=[]),e===void 0&&(e="react-datepicker__day--highlighted");for(var n=new Map,a=0,i=t.length;a<i;a++){var o=t[a];if(sa(o)){var l=ut(o,"MM.dd.yyyy"),c=n.get(l)||[];c.includes(e)||(c.push(e),n.set(l,c))}else if(typeof o=="object"){var d=Object.keys(o),u=(s=d[0])!==null&&s!==void 0?s:"",h=o[u];if(typeof u=="string"&&Array.isArray(h))for(var m=0,f=h.length;m<f;m++){var p=h[m];if(p){var l=ut(p,"MM.dd.yyyy"),c=n.get(l)||[];c.includes(u)||(c.push(u),n.set(l,c))}}}}return n}function dne(t,e){return t.length!==e.length?!1:t.every(function(s,n){return s===e[n]})}function une(t,e){t===void 0&&(t=[]),e===void 0&&(e="react-datepicker__day--holidays");var s=new Map;return t.forEach(function(n){var a=n.date,i=n.holidayName;if(sa(a)){var o=ut(a,"MM.dd.yyyy"),l=s.get(o)||{className:"",holidayNames:[]};if(!("className"in l&&l.className===e&&dne(l.holidayNames,[i]))){l.className=e;var c=l.holidayNames;l.holidayNames=c?Qr(Qr([],c,!0),[i],!1):[i],s.set(o,l)}}}),s}function hne(t,e,s,n,a){for(var i=a.length,o=[],l=0;l<i;l++){var c=t,d=a[l];d&&(c=hZ(c,Es(d)),c=qu(c,Ms(d)),c=pZ(c,Ii(d)));var u=qu(t,(s+1)*n);Da(c,e)&&Jr(c,u)&&d!=null&&o.push(d)}return o}function Sl(t){return t<10?"0".concat(t):"".concat(t)}function _a(t,e){e===void 0&&(e=xh);var s=Math.ceil(Ue(t)/e)*e,n=s-(e-1);return{startPeriod:n,endPeriod:s}}function mne(t){var e=new Date(t.getFullYear(),t.getMonth(),t.getDate()),s=new Date(t.getFullYear(),t.getMonth(),t.getDate(),24);return Math.round((+s-+e)/36e5)}function i_(t){var e=t.getSeconds(),s=t.getMilliseconds();return Ne(t.getTime()-e*1e3-s)}function zP(t,e){return i_(t).getTime()===i_(e).getTime()}function o_(t){if(!sa(t))throw new Error("Invalid date");var e=new Date(t);return e.setHours(0,0,0,0),e}function $0(t,e){if(!sa(t)||!sa(e))throw new Error("Invalid date received");var s=o_(t),n=o_(e);return Jr(s,n)}function BP(t){return t.key===ue.Space}var z0=function(t){Ns(e,t);function e(s){var n=t.call(this,s)||this;return n.inputRef=v.createRef(),n.onTimeChange=function(a){var i,o;n.setState({time:a});var l=n.props.date,c=l instanceof Date&&!isNaN(+l),d=c?l:new Date;if(a!=null&&a.includes(":")){var u=a.split(":"),h=u[0],m=u[1];d.setHours(Number(h)),d.setMinutes(Number(m))}(o=(i=n.props).onChange)===null||o===void 0||o.call(i,d)},n.renderTimeInput=function(){var a=n.state.time,i=n.props,o=i.date,l=i.timeString,c=i.customTimeInput;return c?M.cloneElement(c,{date:o,value:a,onChange:n.onTimeChange}):v.createElement("input",{type:"time",className:"react-datepicker-time__input",placeholder:"Time",name:"time-input",ref:n.inputRef,onClick:function(){var d;(d=n.inputRef.current)===null||d===void 0||d.focus()},required:!0,value:a,onChange:function(d){n.onTimeChange(d.target.value||l)}})},n.state={time:n.props.timeString},n}return e.getDerivedStateFromProps=function(s,n){return s.timeString!==n.time?{time:s.timeString}:null},e.prototype.render=function(){return v.createElement("div",{className:"react-datepicker__input-time-container"},v.createElement("div",{className:"react-datepicker-time__caption"},this.props.timeInputLabel),v.createElement("div",{className:"react-datepicker-time__input-container"},v.createElement("div",{className:"react-datepicker-time__input"},this.renderTimeInput())))},e}(M.Component),fne=function(t){Ns(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.dayEl=M.createRef(),s.handleClick=function(n){!s.isDisabled()&&s.props.onClick&&s.props.onClick(n)},s.handleMouseEnter=function(n){!s.isDisabled()&&s.props.onMouseEnter&&s.props.onMouseEnter(n)},s.handleOnKeyDown=function(n){var a,i,o=n.key;o===ue.Space&&(n.preventDefault(),n.key=ue.Enter),(i=(a=s.props).handleOnKeyDown)===null||i===void 0||i.call(a,n)},s.isSameDay=function(n){return Ge(s.props.day,n)},s.isKeyboardSelected=function(){var n;if(s.props.disabledKeyboardNavigation)return!1;var a=s.props.selectsMultiple?(n=s.props.selectedDates)===null||n===void 0?void 0:n.some(function(o){return s.isSameDayOrWeek(o)}):s.isSameDayOrWeek(s.props.selected),i=s.props.preSelection&&s.isDisabled(s.props.preSelection);return!a&&s.isSameDayOrWeek(s.props.preSelection)&&!i},s.isDisabled=function(n){return n===void 0&&(n=s.props.day),Qn(n,{minDate:s.props.minDate,maxDate:s.props.maxDate,excludeDates:s.props.excludeDates,excludeDateIntervals:s.props.excludeDateIntervals,includeDateIntervals:s.props.includeDateIntervals,includeDates:s.props.includeDates,filterDate:s.props.filterDate,disabled:s.props.disabled})},s.isExcluded=function(){return Z1(s.props.day,{excludeDates:s.props.excludeDates,excludeDateIntervals:s.props.excludeDateIntervals})},s.isStartOfWeek=function(){return Ge(s.props.day,Fi(s.props.day,s.props.locale,s.props.calendarStartDay))},s.isSameWeek=function(n){return s.props.showWeekPicker&&Ge(n,Fi(s.props.day,s.props.locale,s.props.calendarStartDay))},s.isSameDayOrWeek=function(n){return s.isSameDay(n)||s.isSameWeek(n)},s.getHighLightedClass=function(){var n=s.props,a=n.day,i=n.highlightDates;if(!i)return!1;var o=ut(a,"MM.dd.yyyy");return i.get(o)},s.getHolidaysClass=function(){var n,a=s.props,i=a.day,o=a.holidays;if(!o)return[void 0];var l=ut(i,"MM.dd.yyyy");return o.has(l)?[(n=o.get(l))===null||n===void 0?void 0:n.className]:[void 0]},s.isInRange=function(){var n=s.props,a=n.day,i=n.startDate,o=n.endDate;return!i||!o?!1:vo(a,i,o)},s.isInSelectingRange=function(){var n,a=s.props,i=a.day,o=a.selectsStart,l=a.selectsEnd,c=a.selectsRange,d=a.selectsDisabledDaysInRange,u=a.startDate,h=a.swapRange,m=a.endDate,f=(n=s.props.selectingDate)!==null&&n!==void 0?n:s.props.preSelection;if(s.isAfterMonth()||s.isBeforeMonth()||!(o||l||c)||!f||!d&&s.isDisabled())return!1;if(o&&m&&(Jr(f,m)||Po(f,m)))return vo(i,f,m);if(l&&u&&(Da(f,u)||Po(f,u)))return vo(i,u,f);if(c&&u&&!m){if(Po(f,u)||Da(f,u))return vo(i,u,f);if(h&&Jr(f,u))return vo(i,f,u)}return!1},s.isSelectingRangeStart=function(){var n;if(!s.isInSelectingRange())return!1;var a=s.props,i=a.day,o=a.startDate,l=a.selectsStart,c=a.swapRange,d=a.selectsRange,u=(n=s.props.selectingDate)!==null&&n!==void 0?n:s.props.preSelection;return l?Ge(i,u):d&&c&&o&&u?Ge(i,Jr(u,o)?u:o):Ge(i,o)},s.isSelectingRangeEnd=function(){var n;if(!s.isInSelectingRange())return!1;var a=s.props,i=a.day,o=a.endDate,l=a.selectsEnd,c=a.selectsRange,d=a.swapRange,u=a.startDate,h=(n=s.props.selectingDate)!==null&&n!==void 0?n:s.props.preSelection;return l?Ge(i,h):c&&d&&u&&h?Ge(i,Jr(h,u)?u:h):c?Ge(i,h):Ge(i,o)},s.isRangeStart=function(){var n=s.props,a=n.day,i=n.startDate,o=n.endDate;return!i||!o?!1:Ge(i,a)},s.isRangeEnd=function(){var n=s.props,a=n.day,i=n.startDate,o=n.endDate;return!i||!o?!1:Ge(o,a)},s.isWeekend=function(){var n=mee(s.props.day);return n===0||n===6},s.isAfterMonth=function(){return s.props.month!==void 0&&(s.props.month+1)%12===mn(s.props.day)},s.isBeforeMonth=function(){return s.props.month!==void 0&&(mn(s.props.day)+1)%12===s.props.month},s.isCurrentDay=function(){return s.isSameDay(Ke())},s.isSelected=function(){var n;return s.props.selectsMultiple?(n=s.props.selectedDates)===null||n===void 0?void 0:n.some(function(a){return s.isSameDayOrWeek(a)}):s.isSameDayOrWeek(s.props.selected)},s.getClassNames=function(n){var a=s.props.dayClassName?s.props.dayClassName(n):void 0;return Zt("react-datepicker__day",a,"react-datepicker__day--"+Xse(s.props.day),{"react-datepicker__day--disabled":s.isDisabled(),"react-datepicker__day--excluded":s.isExcluded(),"react-datepicker__day--selected":s.isSelected(),"react-datepicker__day--keyboard-selected":s.isKeyboardSelected(),"react-datepicker__day--range-start":s.isRangeStart(),"react-datepicker__day--range-end":s.isRangeEnd(),"react-datepicker__day--in-range":s.isInRange(),"react-datepicker__day--in-selecting-range":s.isInSelectingRange(),"react-datepicker__day--selecting-range-start":s.isSelectingRangeStart(),"react-datepicker__day--selecting-range-end":s.isSelectingRangeEnd(),"react-datepicker__day--today":s.isCurrentDay(),"react-datepicker__day--weekend":s.isWeekend(),"react-datepicker__day--outside-month":s.isAfterMonth()||s.isBeforeMonth()},s.getHighLightedClass(),s.getHolidaysClass())},s.getAriaLabel=function(){var n=s.props,a=n.day,i=n.ariaLabelPrefixWhenEnabled,o=i===void 0?"Choose":i,l=n.ariaLabelPrefixWhenDisabled,c=l===void 0?"Not available":l,d=s.isDisabled()||s.isExcluded()?c:o;return"".concat(d," ").concat(ut(a,"PPPP",s.props.locale))},s.getTitle=function(){var n=s.props,a=n.day,i=n.holidays,o=i===void 0?new Map:i,l=n.excludeDates,c=ut(a,"MM.dd.yyyy"),d=[];return o.has(c)&&d.push.apply(d,o.get(c).holidayNames),s.isExcluded()&&d.push(l==null?void 0:l.filter(function(u){return u instanceof Date?Ge(u,a):Ge(u==null?void 0:u.date,a)}).map(function(u){if(!(u instanceof Date))return u==null?void 0:u.message})),d.join(", ")},s.getTabIndex=function(){var n=s.props.selected,a=s.props.preSelection,i=!(s.props.showWeekPicker&&(s.props.showWeekNumber||!s.isStartOfWeek()))&&(s.isKeyboardSelected()||s.isSameDay(n)&&Ge(a,n))?0:-1;return i},s.handleFocusDay=function(){var n;s.shouldFocusDay()&&((n=s.dayEl.current)===null||n===void 0||n.focus({preventScroll:!0}))},s.renderDayContents=function(){return s.props.monthShowsDuplicateDaysEnd&&s.isAfterMonth()||s.props.monthShowsDuplicateDaysStart&&s.isBeforeMonth()?null:s.props.renderDayContents?s.props.renderDayContents(RS(s.props.day),s.props.day):RS(s.props.day)},s.render=function(){return v.createElement("div",{ref:s.dayEl,className:s.getClassNames(s.props.day),onKeyDown:s.handleOnKeyDown,onClick:s.handleClick,onMouseEnter:s.props.usePointerEvent?void 0:s.handleMouseEnter,onPointerEnter:s.props.usePointerEvent?s.handleMouseEnter:void 0,tabIndex:s.getTabIndex(),"aria-label":s.getAriaLabel(),role:"gridcell",title:s.getTitle(),"aria-disabled":s.isDisabled(),"aria-current":s.isCurrentDay()?"date":void 0,"aria-selected":s.isSelected()||s.isInRange()},s.renderDayContents(),s.getTitle()!==""&&v.createElement("span",{className:"overlay"},s.getTitle()))},s}return e.prototype.componentDidMount=function(){this.handleFocusDay()},e.prototype.componentDidUpdate=function(){this.handleFocusDay()},e.prototype.shouldFocusDay=function(){var s=!1;return this.getTabIndex()===0&&this.isSameDay(this.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(s=!0),this.props.inline&&!this.props.shouldFocusDayInline&&(s=!1),this.isDayActiveElement()&&
885(s=!0),this.isDuplicateDay()&&(s=!1)),s},e.prototype.isDayActiveElement=function(){var s,n,a;return((n=(s=this.props.containerRef)===null||s===void 0?void 0:s.current)===null||n===void 0?void 0:n.contains(document.activeElement))&&((a=document.activeElement)===null||a===void 0?void 0:a.classList.contains("react-datepicker__day"))},e.prototype.isDuplicateDay=function(){return this.props.monthShowsDuplicateDaysEnd&&this.isAfterMonth()||this.props.monthShowsDuplicateDaysStart&&this.isBeforeMonth()},e}(M.Component),pne=function(t){Ns(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.weekNumberEl=M.createRef(),s.handleClick=function(n){s.props.onClick&&s.props.onClick(n)},s.handleOnKeyDown=function(n){var a,i,o=n.key;o===ue.Space&&(n.preventDefault(),n.key=ue.Enter),(i=(a=s.props).handleOnKeyDown)===null||i===void 0||i.call(a,n)},s.isKeyboardSelected=function(){return!s.props.disabledKeyboardNavigation&&!Ge(s.props.date,s.props.selected)&&Ge(s.props.date,s.props.preSelection)},s.getTabIndex=function(){return s.props.showWeekPicker&&s.props.showWeekNumber&&(s.isKeyboardSelected()||Ge(s.props.date,s.props.selected)&&Ge(s.props.preSelection,s.props.selected))?0:-1},s.handleFocusWeekNumber=function(n){var a=!1;s.getTabIndex()===0&&!(n!=null&&n.isInputFocused)&&Ge(s.props.date,s.props.preSelection)&&((!document.activeElement||document.activeElement===document.body)&&(a=!0),s.props.inline&&!s.props.shouldFocusDayInline&&(a=!1),s.props.containerRef&&s.props.containerRef.current&&s.props.containerRef.current.contains(document.activeElement)&&document.activeElement&&document.activeElement.classList.contains("react-datepicker__week-number")&&(a=!0)),a&&s.weekNumberEl.current&&s.weekNumberEl.current.focus({preventScroll:!0})},s}return Object.defineProperty(e,"defaultProps",{get:function(){return{ariaLabelPrefix:"week "}},enumerable:!1,configurable:!0}),e.prototype.componentDidMount=function(){this.handleFocusWeekNumber()},e.prototype.componentDidUpdate=function(s){this.handleFocusWeekNumber(s)},e.prototype.render=function(){var s=this.props,n=s.weekNumber,a=s.isWeekDisabled,i=s.ariaLabelPrefix,o=i===void 0?e.defaultProps.ariaLabelPrefix:i,l=s.onClick,c={"react-datepicker__week-number":!0,"react-datepicker__week-number--clickable":!!l&&!a,"react-datepicker__week-number--selected":!!l&&Ge(this.props.date,this.props.selected)};return v.createElement("div",{ref:this.weekNumberEl,className:Zt(c),"aria-label":"".concat(o," ").concat(this.props.weekNumber),onClick:this.handleClick,onKeyDown:this.handleOnKeyDown,tabIndex:this.getTabIndex(),role:"gridcell"},n)},e}(M.Component),xne=function(t){Ns(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.isDisabled=function(n){return Qn(n,{minDate:s.props.minDate,maxDate:s.props.maxDate,excludeDates:s.props.excludeDates,excludeDateIntervals:s.props.excludeDateIntervals,includeDateIntervals:s.props.includeDateIntervals,includeDates:s.props.includeDates,filterDate:s.props.filterDate})},s.handleDayClick=function(n,a){s.props.onDayClick&&s.props.onDayClick(n,a)},s.handleDayMouseEnter=function(n){s.props.onDayMouseEnter&&s.props.onDayMouseEnter(n)},s.handleWeekClick=function(n,a,i){for(var o,l,c,d=new Date(n),u=0;u<7;u++){var h=new Date(n);h.setDate(h.getDate()+u);var m=!s.isDisabled(h);if(m){d=h;break}}typeof s.props.onWeekSelect=="function"&&s.props.onWeekSelect(d,a,i),s.props.showWeekPicker&&s.handleDayClick(d,i),((o=s.props.shouldCloseOnSelect)!==null&&o!==void 0?o:e.defaultProps.shouldCloseOnSelect)&&((c=(l=s.props).setOpen)===null||c===void 0||c.call(l,!1))},s.formatWeekNumber=function(n){return s.props.formatWeekNumber?s.props.formatWeekNumber(n):Qse(n)},s.isWeekDisabled=function(){for(var n=s.startOfWeek(),a=Tr(n,6),i=new Date(n);i<=a;){if(!s.isDisabled(i))return!1;i=Tr(i,1)}return!0},s.renderDays=function(){var n=s.startOfWeek(),a=[],i=s.formatWeekNumber(n);if(s.props.showWeekNumber){var o=s.props.onWeekSelect||s.props.showWeekPicker?s.handleWeekClick.bind(s,n,i):void 0;a.push(v.createElement(pne,Be({key:"W"},e.defaultProps,s.props,{weekNumber:i,isWeekDisabled:s.isWeekDisabled(),date:n,onClick:o})))}return a.concat([0,1,2,3,4,5,6].map(function(l){var c=Tr(n,l);return v.createElement(fne,Be({},e.defaultProps,s.props,{ariaLabelPrefixWhenEnabled:s.props.chooseDayAriaLabelPrefix,ariaLabelPrefixWhenDisabled:s.props.disabledDayAriaLabelPrefix,key:c.valueOf(),day:c,onClick:s.handleDayClick.bind(s,c),onMouseEnter:s.handleDayMouseEnter.bind(s,c)}))}))},s.startOfWeek=function(){return Fi(s.props.day,s.props.locale,s.props.calendarStartDay)},s.isKeyboardSelected=function(){return!s.props.disabledKeyboardNavigation&&!Ge(s.startOfWeek(),s.props.selected)&&Ge(s.startOfWeek(),s.props.preSelection)},s}return Object.defineProperty(e,"defaultProps",{get:function(){return{shouldCloseOnSelect:!0}}
885,enumerable:!1,configurable:!0}),e.prototype.render=function(){var s={"react-datepicker__week":!0,"react-datepicker__week--selected":Ge(this.startOfWeek(),this.props.selected),"react-datepicker__week--keyboard-selected":this.isKeyboardSelected()},n=this.props.weekClassName?this.props.weekClassName(this.startOfWeek()):void 0;return v.createElement("div",{className:Zt(s,n),role:"row"},this.renderDays())},e}(M.Component),vd,gne=6,uc={TWO_COLUMNS:"two_columns",THREE_COLUMNS:"three_columns",FOUR_COLUMNS:"four_columns"},B0=(vd={},vd[uc.TWO_COLUMNS]={grid:[[0,1],[2,3],[4,5],[6,7],[8,9],[10,11]],verticalNavigationOffset:2},vd[uc.THREE_COLUMNS]={grid:[[0,1,2],[3,4,5],[6,7,8],[9,10,11]],verticalNavigationOffset:3},vd[uc.FOUR_COLUMNS]={grid:[[0,1,2,3],[4,5,6,7],[8,9,10,11]],verticalNavigationOffset:4},vd),gm=1;function l_(t,e){return t?uc.FOUR_COLUMNS:e?uc.TWO_COLUMNS:uc.THREE_COLUMNS}var bne=function(t){Ns(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.MONTH_REFS=Qr([],Array(12),!0).map(function(){return M.createRef()}),s.QUARTER_REFS=Qr([],Array(4),!0).map(function(){return M.createRef()}),s.isDisabled=function(n){return Qn(n,{minDate:s.props.minDate,maxDate:s.props.maxDate,excludeDates:s.props.excludeDates,excludeDateIntervals:s.props.excludeDateIntervals,includeDateIntervals:s.props.includeDateIntervals,includeDates:s.props.includeDates,filterDate:s.props.filterDate,disabled:s.props.disabled})},s.isExcluded=function(n){return Z1(n,{excludeDates:s.props.excludeDates,excludeDateIntervals:s.props.excludeDateIntervals})},s.handleDayClick=function(n,a){var i,o;
885(o=(i=s.props).onDayClick)===null||o===void 0||o.call(i,n,a,s.props.orderInDisplay)},s.handleDayMouseEnter=function(n){var a,i;(i=(a=s.props).onDayMouseEnter)===null||i===void 0||i.call(a,n)},s.handleMouseLeave=function(){var n,a;(a=(n=s.props).onMouseLeave)===null||a===void 0||a.call(n)},s.isRangeStartMonth=function(n){var a=s.props,i=a.day,o=a.startDate,l=a.endDate;return!o||!l?!1:Bs(Cn(i,n),o)},s.isRangeStartQuarter=function(n){var a=s.props,i=a.day,o=a.startDate,l=a.endDate;return!o||!l?!1:Ip(Rl(i,n),o)},s.isRangeEndMonth=function(n){var a=s.props,i=a.day,o=a.startDate,l=a.endDate;return!o||!l?!1:Bs(Cn(i,n),l)},s.isRangeEndQuarter=function(n){var a=s.props,i=a.day,o=a.startDate,l=a.endDate;return!o||!l?!1:Ip(Rl(i,n),l)},s.isInSelectingRangeMonth=function(n){var a,i=s.props,o=i.day,l=i.selectsStart,c=i.selectsEnd,d=i.selectsRange,u=i.startDate,h=i.endDate,m=(a=s.props.selectingDate)!==null&&a!==void 0?a:s.props.preSelection;return!(l||c||d)||!m?!1:l&&h?mm(m,h,n,o):c&&u||d&&u&&!h?mm(u,m,n,o):!1},s.isSelectingMonthRangeStart=function(n){var a;if(!s.isInSelectingRangeMonth(n))return!1;var i=s.props,o=i.day,l=i.startDate,c=i.selectsStart,d=Cn(o,n),u=(a=s.props.selectingDate)!==null&&a!==void 0?a:s.props.preSelection;return c?Bs(d,u):Bs(d,l)},s.isSelectingMonthRangeEnd=function(n){var a;if(!s.isInSelectingRangeMonth(n))return!1;var i=s.props,o=i.day,l=i.endDate,c=i.selectsEnd,d=i.selectsRange,u=Cn(o,n),h=(a=s.props.selectingDate)!==null&&a!==void 0?a:s.props.preSelection;return c||d?Bs(u,h):Bs(u,l)},s.isInSelectingRangeQuarter=function(n){var a,i=s.props,o=i.day,l=i.selectsStart,c=i.selectsEnd,d=i.selectsRange,u=i.startDate,h=i.endDate,m=(a=s.props.selectingDate)!==null&&a!==void 0?a:s.props.preSelection;return!(l||c||d)||!m?!1:l&&h?xm(m,h,n,o):c&&u||d&&u&&!h?xm(u,m,n,o):!1},s.isWeekInMonth=function(n){var a=s.props.day,i=Tr(n,6);return Bs(n,a)||Bs(i,a)},s.isCurrentMonth=function(n,a){return Ue(n)===Ue(Ke())&&a===mn(Ke())},s.isCurrentQuarter=function(n,a){return Ue(n)===Ue(Ke())&&a===wi(Ke())},s.isSelectedMonth=function(n,a,i){return mn(i)===a&&Ue(n)===Ue(i)},s.isSelectMonthInList=function(n,a,i){return i.some(function(o){return s.isSelectedMonth(n,a,o)})},s.isSelectedQuarter=function(n,a,i){return wi(i)===a&&Ue(n)===Ue(i)},s.isSelectQuarterInList=function(n,a,i){return i.some(function(o){return s.isSelectedQuarter(n,a,o)})},s.isMonthSelected=function(){var n=s.props,a=n.day,i=n.selected,o=n.selectedDates,l=n.selectsMultiple,c=mn(a);return l?o==null?void 0:o.some(function(d){return s.isSelectedMonth(a,c,d)}):!!i&&s.isSelectedMonth(a,c,i)},s.isQuarterSelected=function(){var n=s.props,a=n.day,i=n.selected,o=n.selectedDates,l=n.selectsMultiple,c=wi(a);return l?o==null?void 0:o.some(function(d){return s.isSelectedQuarter(a,c,d)}):!!i&&s.isSelectedQuarter(a,c,i)},s.renderWeeks=function(){if(!cn(s.props.day))return[];for(var n=[],a=s.props.fixedHeight,i=0,o=!1,l=Fi(Ra(s.props.day),s.props.locale,s.props.calendarStartDay),c=function(p){return s.props.showWeekPicker?Fi(p,s.props.locale,s.props.calendarStartDay):s.props.preSelection},d=function(p){return s.props.showWeekPicker?Fi(p,s.props.locale,s.props.calendarStartDay):s.props.selected},u=s.props.selected?d(s.props.selected):void 0,h=s.props.preSelection?c(s.props.preSelection):void 0;n.push(v.createElement(xne,Be({},s.props,{ariaLabelPrefix:s.props.weekAriaLabelPrefix,key:i,day:l,month:mn(s.props.day),onDayClick:s.handleDayClick,onDayMouseEnter:s.handleDayMouseEnter,selected:u,preSelection:h,showWeekNumber:s.props.showWeekNumbers}))),!o;){i++,l=_p(l,1);var m=a&&i>=gne,f=!a&&!s.isWeekInMonth(l);if(m||f)if(s.props.peekNextMonth)o=!0;else break}return n},s.onMonthClick=function(n,a){var i=s.isMonthDisabledForLabelDate(a),o=i.isDisabled,l=i.labelDate;o||s.handleDayClick(Ra(l),n)},s.onMonthMouseEnter=function(n){var a=s.isMonthDisabledForLabelDate(n),i=a.isDisabled,o=a.labelDate;i||s.handleDayMouseEnter(Ra(o))},s.handleMonthNavigation=function(n,a){var i,o,l,c;(o=(i=s.props).setPreSelection)===null||o===void 0||o.call(i,a),(c=(l=s.MONTH_REFS[n])===null||l===void 0?void 0:l.current)===null||c===void 0||c.focus()},s.handleKeyboardNavigation=function(n,a,i){var o,l=s.props,c=l.selected,d=l.preSelection,u=l.setPreSelection,h=l.minDate,m=l.maxDate,f=l.showFourColumnMonthYearPicker,p=l.showTwoColumnMonthYearPicker;
885if(d){var g=l_(f,p),x=s.getVerticalOffset(g),b=(o=B0[g])===null||o===void 0?void 0:o.grid,y=function(k,C,T){var A,E,L=C,D=T;switch(k){case ue.ArrowRight:L=Dr(C,gm),D=T===11?0:T+gm;break;case ue.ArrowLeft:L=Vo(C,gm),D=T===0?11:T-gm;break;case ue.ArrowUp:L=Vo(C,x),D=!((A=b==null?void 0:b[0])===null||A===void 0)&&A.includes(T)?T+12-x:T-x;break;case ue.ArrowDown:L=Dr(C,x),D=!((E=b==null?void 0:b[b.length-1])===null||E===void 0)&&E.includes(T)?T-12+x:T+x;break}return{newCalculatedDate:L,newCalculatedMonth:D}},w=function(k,C,T){for(var A=40,E=k,L=!1,D=0,P=y(E,C,T),R=P.newCalculatedDate,$=P.newCalculatedMonth;!L;){if(D>=A){R=C,$=T;break}if(h&&R<h){E=ue.ArrowRight;var O=y(E,R,$);R=O.newCalculatedDate,$=O.newCalculatedMonth}if(m&&R>m){E=ue.ArrowLeft;var O=y(E,R,$);R=O.newCalculatedDate,$=O.newCalculatedMonth}if(ane(R,s.props)){var O=y(E,R,$);R=O.newCalculatedDate,$=O.newCalculatedMonth}else L=!0;D++}return{newCalculatedDate:R,newCalculatedMonth:$}};if(a===ue.Enter){s.isMonthDisabled(i)||(s.onMonthClick(n,i),u==null||u(c));return}var N=w(a,d,i),j=N.newCalculatedDate,S=N.newCalculatedMonth;switch(a){case ue.ArrowRight:case ue.ArrowLeft:case ue.ArrowUp:case ue.ArrowDown:s.handleMonthNavigation(S,j);break}}},s.getVerticalOffset=function(n){var a,i;return(i=(a=B0[n])===null||a===void 0?void 0:a.verticalNavigationOffset)!==null&&i!==void 0?i:0},s.onMonthKeyDown=function(n,a){var i=s.props,o=i.disabledKeyboardNavigation,l=i.handleOnMonthKeyDown,c=n.key;c!==ue.Tab&&n.preventDefault(),o||s.handleKeyboardNavigation(n,c,a),l&&l(n)},s.onQuarterClick=function(n,a){var i=Rl(s.props.day,a);fm(i,s.props)||s.handleDayClick(KS(i),n)},s.onQuarterMouseEnter=function(n){var a=Rl(s.props.day,n);fm(a,s.props)||s.handleDayMouseEnter(KS(a))},s.handleQuarterNavigation=function(n,a){var i,o,l,c;s.isDisabled(a)||s.isExcluded(a)||((o=(i=s.props).setPreSelection)===null||o===void 0||o.call(i,a),(c=(l=s.QUARTER_REFS[n-1])===null||l===void 0?void 0:l.current)===null||c===void 0||c.focus())},s.onQuarterKeyDown=function(n,a){var i,o,l=n.key;if(!s.props.disabledKeyboardNavigation)switch(l){case ue.Enter:s.onQuarterClick(n,a),(o=(i=s.props).setPreSelection)===null||o===void 0||o.call(i,s.props.selected);break;case ue.ArrowRight:if(!s.props.preSelection)break;s.handleQuarterNavigation(a===4?1:a+1,B1(s.props.preSelection,1));break;case ue.ArrowLeft:if(!s.props.preSelection)break;s.handleQuarterNavigation(a===1?4:a-1,wP(s.props.preSelection));break}},s.isMonthDisabledForLabelDate=function(n){var a,i=s.props,o=i.day,l=i.disabled,c=i.minDate,d=i.maxDate,u=i.excludeDates,h=i.includeDates,m=Cn(o,n);return l?{isDisabled:!0,labelDate:Cn(o,n)}:{isDisabled:(a=(c||d||u||h)&&IP(m,s.props))!==null&&a!==void 0?a:!1,labelDate:m}},s.isMonthDisabled=function(n){var a=s.isMonthDisabledForLabelDate(n).isDisabled;return a},s.getMonthClassNames=function(n){var a=s.props,i=a.day,o=a.startDate,l=a.endDate,c=a.preSelection,d=a.monthClassName,u=d?d(Cn(i,n)):void 0,h=s.getSelection();return Zt("react-datepicker__month-text","react-datepicker__month-".concat(n),u,{"react-datepicker__month-text--disabled":s.isMonthDisabled(n),"react-datepicker__month-text--selected":h?s.isSelectMonthInList(i,n,h):void 0,"react-datepicker__month-text--keyboard-selected":!s.props.disabledKeyboardNavigation&&c&&s.isSelectedMonth(i,n,c)&&!s.isMonthSelected()&&!s.isMonthDisabled(n),"react-datepicker__month-text--in-selecting-range":s.isInSelectingRangeMonth(n),"react-datepicker__month-text--in-range":o&&l?mm(o,l,n,i):void 0,"react-datepicker__month-text--range-start":s.isRangeStartMonth(n),"react-datepicker__month-text--range-end":s.isRangeEndMonth(n),"react-datepicker__month-text--selecting-range-start":s.isSelectingMonthRangeStart(n),"react-datepicker__month-text--selecting-range-end":s.isSelectingMonthRangeEnd(n),"react-datepicker__month-text--today":s.isCurrentMonth(i,n)})},s.getTabIndex=function(n){if(s.props.preSelection==null)return"-1";var a=mn(s.props.preSelection),i=s.isMonthDisabledForLabelDate(a).isDisabled,o=n===a&&!(i||s.props.disabledKeyboardNavigation)?"0":"-1";return o},s.getQuarterTabIndex=function(n){if(s.props.preSelection==null)return"-1";var a=wi(s.props.preSelection),i=fm(s.props.day,s.props),o=n===a&&!(i||s.props.disabledKeyboardNavigation)?"0":"-1";return o},s.getAriaLabel=function(n){var a=s.props,i=a.chooseDayAriaLabelPrefix,o=i===void 0?"Choose":i,l=a.disabledDayAriaLabelPrefix,c=l===void 0?"Not available":l,d=a.day,u=a.locale,h=Cn(d,n),m=s.isDisabled(h)||s.isExcluded(h)?c:o;return"".concat(m," ").concat(ut(h,"MMMM yyyy",u))},s.getQuarterClassNames=function(n){var a=s.props,i=a.day,o=a.startDate,l=a.endDate,c=a.minDate,d=a.maxDate,u=a.excludeDates,h=a.includeDates,m=a.filterDate,f=a.preSelection,p=a.disabledKeyboardNavigation,g=a.disabled,x=(c||d||u||h||m||g)&&fm(Rl(i,n),s.props),b=s.getSelection();return Zt("react-datepicker__quarter-text","react-datepicker__quarter-".concat(n),{"react-datepicker__quarter-text--disabled":x,"react-datepicker__quarter-text--selected":b?s.isSelectQuarterInList(i,n,b):void 0,"react-datepicker__quarter-text--keyboard-selected":!p&&f&&s.isSelectedQuarter(i,n,f)&&!s.isQuarterSelected()&&!x,"react-datepicker__quarter-text--in-selecting-range":s.isInSelectingRangeQuarter(n),"react-datepicker__quarter-text--in-range":o&&l?xm(o,l,n,i):void 0,"react-datepicker__quarter-text--range-start":s.isRangeStartQuarter(n),"react-datepicker__quarter-text--range-end":s.isRangeEndQuarter(n),"react-datepicker__quarter-text--today":s.isCurrentQuarter(i,n)})},s.getMonthContent=function(n){var a=s.props,i=a.showFullMonthYearPicker,o=a.renderMonthContent,l=a.locale,c=a.day,d=OP(n,l),u=X1(n,l);return o?o(n,d,u,c):i?u:d},s.getQuarterContent=function(n){var a,i=s.props,o=i.renderQuarterContent,l=i.locale,c=rne(n,l);return(a=o==null?void 0:o(n,c))!==null&&a!==void 0?a:c},s.renderMonths=function(){var n,a=s.props,i=a.showTwoColumnMonthYearPicker,o=a.showFourColumnMonthYearPicker,l=a.day,c=a.selected,d=(n=B0[l_(o,i)])===null||n===void 0?void 0:n.grid;return d==null?void 0:d.map(function(u,h){return v.createElement("div",{className:"react-datepicker__month-wrapper",key:h},u.map(function(m,f){return v.createElement("div",{ref:s.MONTH_REFS[m],key:f,onClick:function(p){s.onMonthClick(p,m)},onKeyDown:function(p){BP(p)&&(p.preventDefault(),p.key=ue.Enter),s.onMonthKeyDown(p,m)},onMouseEnter:s.props.usePointerEvent?void 0:function(){return s.onMonthMouseEnter(m)},onPointerEnter:s.props.usePointerEvent?function(){return s.onMonthMouseEnter(m)}:void 0,tabIndex:Number(s.getTabIndex(m)),className:s.getMonthClassNames(m),"aria-disabled":s.isMonthDisabled(m),role:"option","aria-label":s.getAriaLabel(m),"aria-current":s.isCurrentMonth(l,m)?"date":void 0,"aria-selected":c?s.isSelectedMonth(l,m,c):void 0},s.getMonthContent(m))}))})},s.renderQuarters=function(){var n=s.props,a=n.day,i=n.selected,o=[1,2,3,4];return v.createElement("div",{className:"react-datepicker__quarter-wrapper"},o.map(function(l,c){return v.createElement("div",{key:c,ref:s.QUARTER_REFS[c],role:"option",onClick:function(d){s.onQuarterClick(d,l)},onKeyDown:function(d){s.onQuarterKeyDown(d,l)},onMouseEnter:s.props.usePointerEvent?void 0:function(){return s.onQuarterMouseEnter(l)},onPointerEnter:s.props.usePointerEvent?function(){return s.onQuarterMouseEnter(l)}:void 0,className:s.getQuarterClassNames(l),"aria-selected":i?s.isSelectedQuarter(a,l,i):void 0,tabIndex:Number(s.getQuarterTabIndex(l)),"aria-current":s.isCurrentQuarter(a,l)?"date":void 0},s.getQuarterContent(l))}))},s.getClassNames=function(){var n=s.props,a=n.selectingDate,i=n.selectsStart,o=n.selectsEnd,l=n.showMonthYearPicker,c=n.showQuarterYearPicker,d=n.showWeekPicker;return Zt("react-datepicker__month",{"react-datepicker__month--selecting-range":a&&(i||o)},{"react-datepicker__monthPicker":l},{"react-datepicker__quarterPicker":c},{"react-datepicker__weekPicker":d})},s}return e.prototype.getSelection=function(){var s=this.props,n=s.selected,a=s.selectedDates,i=s.selectsMultiple;if(i)return a;
885if(n)return[n]},e.prototype.render=function(){var s=this.props,n=s.showMonthYearPicker,a=s.showQuarterYearPicker,i=s.day,o=s.ariaLabelPrefix,l=o===void 0?"Month ":o,c=l?l.trim()+" ":"",d=cn(i)?"".concat(c).concat(ut(i,"MMMM, yyyy",this.props.locale)):"",u=n||a;return u?v.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":d,role:"listbox"},n?this.renderMonths():this.renderQuarters()):v.createElement("div",{role:"table"},this.props.dayNamesHeader&&v.createElement("div",{role:"rowgroup"},this.props.dayNamesHeader),this.props.monthHeader&&v.createElement("div",{role:"rowgroup"},this.props.monthHeader),v.createElement("div",{className:this.getClassNames(),onMouseLeave:this.props.usePointerEvent?void 0:this.handleMouseLeave,onPointerLeave:this.props.usePointerEvent?this.handleMouseLeave:void 0,"aria-label":d,role:"rowgroup"},this.renderWeeks()),this.props.monthFooter&&v.createElement("div",{role:"rowgroup"},this.props.monthFooter))},e}(M.Component),yne=function(t){Ns(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.monthOptionButtonsRef={},s.isSelectedMonth=function(n){return s.props.month===n},s.handleOptionKeyDown=function(n,a){var i;switch(a.key){case"Enter":a.preventDefault(),s.onChange(n);break;case"Escape":a.preventDefault(),s.props.onCancel();break;case"ArrowUp":case"ArrowDown":{a.preventDefault();var o=(n+(a.key==="ArrowUp"?-1:1)+s.props.monthNames.length)%s.props.monthNames.length;(i=s.monthOptionButtonsRef[o])===null||i===void 0||i.focus();break}}},s.renderOptions=function(){return s.monthOptionButtonsRef={},s.props.monthNames.map(function(n,a){return v.createElement("div",{ref:function(i){s.monthOptionButtonsRef[a]=i,s.isSelectedMonth(a)&&(i==null||i.focus())},role:"button",tabIndex:0,className:s.isSelectedMonth(a)?"react-datepicker__month-option react-datepicker__month-option--selected_month":"react-datepicker__month-option",key:n,onClick:s.onChange.bind(s,a),onKeyDown:s.handleOptionKeyDown.bind(s,a),"aria-selected":s.isSelectedMonth(a)?"true":void 0},s.isSelectedMonth(a)?v.createElement("span",{className:"react-datepicker__month-option--selected"},"â"):"",n)})},s.onChange=function(n){return s.props.onChange(n)},s.handleClickOutside=function(){return s.props.onCancel()},s}return e.prototype.render=function(){return v.createElement(qx,{className:"react-datepicker__month-dropdown",onClickOutside:this.handleClickOutside},this.renderOptions())},e}(M.Component),vne=function(t){Ns(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.state={dropdownVisible:!1},s.renderSelectOptions=function(n){return n.map(function(a,i){return v.createElement("option",{key:a,value:i},a)})},s.renderSelectMode=function(n){return v.createElement("select",{value:s.props.month,className:"react-datepicker__month-select",onChange:function(a){return s.onChange(parseInt(a.target.value))}},s.renderSelectOptions(n))},s.renderReadView=function(n,a){return v.createElement("button",{key:"read",type:"button",style:{visibility:n?"visible":"hidden"},className:"react-datepicker__month-read-view",onClick:s.toggleDropdown},v.createElement("span",{className:"react-datepicker__month-read-view--down-arrow"}),v.createElement("span",{className:"react-datepicker__month-read-view--selected-month"},a[s.props.month]))},s.renderDropdown=function(n){return v.createElement(yne,Be({key:"dropdown"},s.props,{monthNames:n,onChange:s.onChange,onCancel:s.toggleDropdown}))},s.renderScrollMode=function(n){var a=s.state.dropdownVisible,i=[s.renderReadView(!a,n)];return a&&i.unshift(s.renderDropdown(n)),i},s.onChange=function(n){s.toggleDropdown(),n!==s.props.month&&s.props.onChange(n)},s.toggleDropdown=function(){return s.setState({dropdownVisible:!s.state.dropdownVisible})},s}return e.prototype.render=function(){var s=this,n=[0,1,2,3,4,5,6,7,8,9,10,11].map(this.props.useShortMonthInDropdown?function(i){return OP(i,s.props.locale)}:function(i){return X1(i,s.props.locale)}),a;switch(this.props.dropdownMode){case"scroll":a=this.renderScrollMode(n);break;case"select":a=this.renderSelectMode(n);break}return v.createElement("div",{className:"react-datepicker__month-dropdown-container react-datepicker__month-dropdown-container--".concat(this.props.dropdownMode)},a)},e}(M.Component),c_=5;function wne(t,e,s){for(var n=[],a=t??Ki(s,c_),i=e??Er(s,c_),o=Ra(a),l=Ra(i);!Da(o,l);)n.push(Ke(o)),o=Dr(o,1);return n}var jne=function(t){Ns(e,t);function e(s){var n=t.call(this,s)||this;return n.renderOptions=function(){return n.state.monthYearsList.map(function(a){var i=tv(a),o=Hr(n.props.date,a)&&Bs(n.props.date,a);return v.createElement("div",{className:o?"react-datepicker__month-year-option--selected_month-year":"react-datepicker__month-year-option",key:i,onClick:n.onChange.bind(n,i),"aria-selected":o?"true":void 0},o?v.createElement("span",{className:"react-datepicker__month-year-option--selected"},"â"):"",ut(a,n.props.dateFormat,n.props.locale))})},n.onChange=function(a){return n.props.onChange(a)},n.handleClickOutside=function(){n.props.onCancel()},n.state={monthYearsList:wne(n.props.minDate,n.props.maxDate,n.props.date)},n}return e.prototype.render=function(){var s=Zt({"react-datepicker__month-year-dropdown":!0,"react-datepicker__month-year-dropdown--scrollable":this.props.scrollableMonthYearDropdown});return v.createElement(qx,{className:s,onClickOutside:this.handleClickOutside},this.renderOptions())},e}(M.Component),d_=5,Nne=function(t){Ns(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.state={dropdownVisible:!1},s.renderSelectOptions=function(){for(var n,a,i=(n=s.props.minDate)!==null&&n!==void 0?n:Ki(s.props.date,d_),o=(a=s.props.maxDate)!==null&&a!==void 0?a:Er(s.props.date,d_),l=Ra(i),c=Ra(o),d=[];!Da(l,c);){var u=tv(l);d.push(v.createElement("option",{key:u,value:u},ut(l,s.props.dateFormat,s.props.locale))),l=Dr(l,1)}return d},s.onSelectChange=function(n){s.onChange(parseInt(n.target.value))},s.renderSelectMode=function(){return v.createElement("select",{value:tv(Ra(s.props.date)),className:"react-datepicker__month-year-select",onChange:s.onSelectChange},s.renderSelectOptions())},s.renderReadView=function(n){var a=ut(s.props.date,s.props.dateFormat,s.props.locale);return v.createElement("div",{key:"read",style:{visibility:n?"visible":"hidden"},className:"react-datepicker__month-year-read-view",onClick:s.toggleDropdown},v.createElement("span",{className:"react-datepicker__month-year-read-view--down-arrow"}),v.createElement("span",{className:"react-datepicker__month-year-read-view--selected-month-year"},a))},s.renderDropdown=function(){return v.createElement(jne,Be({key:"dropdown"},s.props,{onChange:s.onChange,onCancel:s.toggleDropdown}))},s.renderScrollMode=function(){var n=s.state.dropdownVisible,a=[s.renderReadView(!n)];return n&&a.unshift(s.renderDropdown()),a},s.onChange=function(n){s.toggleDropdown();var a=Ke(n);Hr(s.props.date,a)&&Bs(s.props.date,a)||s.props.onChange(a)},s.toggleDropdown=function(){return s.setState({dropdownVisible:!s.state.dropdownVisible})},s}return e.prototype.render=function(){var s;switch(this.props.dropdownMode){case"scroll":s=this.renderScrollMode();break;case"select":s=this.renderSelectMode();break}return v.createElement("div",{className:"react-datepicker__month-year-dropdown-container react-datepicker__month-year-dropdown-container--".concat(this.props.dropdownMode)},s)},e}(M.Component),kne=function(t){Ns(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.state={height:null},s.scrollToTheSelectedTime=function(){requestAnimationFrame(function(){var n,a,i;s.list&&(s.list.scrollTop=(i=s.centerLi&&e.calcCenterPosition(s.props.monthRef?s.props.monthRef.clientHeight-((a=(n=s.header)===null||n===void 0?void 0:n.clientHeight)!==null&&a!==void 0?a:0):s.list.clientHeight,s.centerLi))!==null&&i!==void 0?i:0)})},s.handleClick=function(n){var a,i;(s.props.minTime||s.props.maxTime)&&e_(n,s.props)||(s.props.excludeTimes||s.props.includeTimes||s.props.filterTime)&&ZS(n,s.props)||(i=(a=s.props).onChange)===null||i===void 0||i.call(a,n)},s.isSelectedTime=function(n){var a=Ao(s.props.selected);return a&&zP(a,n)},s.isDisabledTime=function(n){return(s.props.minTime||s.props.maxTime)&&e_(n,s.props)||(s.props.excludeTimes||s.props.includeTimes||s.props.filterTime)&&ZS(n,s.props)},s.liClasses=function(n){var a,i=["react-datepicker__time-list-item",s.props.timeClassName?s.props.timeClassName(n):void 0];return s.isSelectedTime(n)&&i.push("react-datepicker__time-list-item--selected"),s.isDisabledTime(n)&&i.push("react-datepicker__time-list-item--disabled"),s.props.injectTimes&&(Es(n)*3600+Ms(n)*60+Ii(n))%(((a=s.props.intervals)!==null&&a!==void 0?a:e.defaultProps.intervals)*60)!==0&&i.push("react-datepicker__time-list-item--injected"),i.join(" ")},s.handleOnKeyDown=function(n,a){var i,o;n.key===ue.Space&&(n.preventDefault(),n.key=ue.Enter),(n.key===ue.ArrowUp||n.key===ue.ArrowLeft)&&n.target instanceof HTMLElement&&n.target.previousSibling&&(n.preventDefault(),n.target.previousSibling instanceof HTMLElement&&n.target.previousSibling.focus()),(n.key===ue.ArrowDown||n.key===ue.ArrowRight)&&n.target instanceof HTMLElement&&n.target.nextSibling&&(n.preventDefault(),n.target.nextSibling instanceof HTMLElement&&n.target.nextSibling.focus()),n.key===ue.Enter&&s.handleClick(a),(o=(i=s.props).handleOnKeyDown)===null||o===void 0||o.call(i,n)},s.renderTimes=function(){for(var n,a=[],i=typeof s.props.format=="string"?s.props.format:"p",o=(n=s.props.intervals)!==null&&n!==void 0?n:e.defaultProps.intervals,l=Ao(s.props.selected)||Ao(s.props.openToDate)||Ke(),c=Rd(l),d=s.props.injectTimes&&s.props.injectTimes.sort(function(x,b){return x.getTime()-b.getTime()}),u=60*mne(l),h=u/o,m=0;m<h;m++){var f=qu(c,m*o);if(a.push(f),d){var p=hne(c,f,m,o,d);a=a.concat(p)}}var g=a.reduce(function(x,b){return b.getTime()<=l.getTime()?b:x},a[0]);return a.map(function(x){return v.createElement("li",{key:x.valueOf(),onClick:s.handleClick.bind(s,x),className:s.liClasses(x),ref:function(b){x===g&&(s.centerLi=b)},onKeyDown:function(b){s.handleOnKeyDown(b,x)},tabIndex:x===g?0:-1,role:"option","aria-selected":s.isSelectedTime(x
885)?"true":void 0,"aria-disabled":s.isDisabledTime(x)?"true":void 0},ut(x,i,s.props.locale))})},s.renderTimeCaption=function(){return s.props.showTimeCaption===!1?v.createElement(v.Fragment,null):v.createElement("div",{className:"react-datepicker__header react-datepicker__header--time ".concat(s.props.showTimeSelectOnly?"react-datepicker__header--time--only":""),ref:function(n){s.header=n}},v.createElement("div",{className:"react-datepicker-time__header"},s.props.timeCaption))},s}return Object.defineProperty(e,"defaultProps",{get:function(){return{intervals:30,todayButton:null,timeCaption:"Time",showTimeCaption:!0}},enumerable:!1,configurable:!0}),e.prototype.componentDidMount=function(){this.scrollToTheSelectedTime(),this.observeDatePickerHeightChanges()},e.prototype.componentWillUnmount=function(){var s;(s=this.resizeObserver)===null||s===void 0||s.disconnect()},e.prototype.observeDatePickerHeightChanges=function(){var s=this,n=this.props.monthRef;this.updateContainerHeight(),n&&(this.resizeObserver=new ResizeObserver(function(){s.updateContainerHeight()}),this.resizeObserver.observe(n))},e.prototype.updateContainerHeight=function(){if(this.props.monthRef&&this.header){var s=this.props.monthRef.clientHeight-this.header.clientHeight;this.state.height!==s&&this.setState({height:s})}},e.prototype.render=function(){var s=this,n,a=this.state.height;return v.createElement("div",{className:"react-datepicker__time-container ".concat(((n=this.props.todayButton)!==null&&n!==void 0?n:e.defaultProps.todayButton)?"react-datepicker__time-container--with-today-button":"")},this.renderTimeCaption(),v.createElement("div",{className:"react-datepicker__time"},v.createElement("div",{className:"react-datepicker__time-box"},v.createElement("ul",{className:"react-datepicker__time-list",ref:function(i){s.list=i},style:a?{height:a}:{},role:"listbox","aria-label":this.props.timeCaption},this.renderTimes()))))},e.calcCenterPosition=function(s,n){return n.offsetTop-(s/2-n.clientHeight/2)},e}(M.Component),u_=3,Cne=function(t){Ns(e,t);function e(s){var n=t.call(this,s)||this;return n.YEAR_REFS=Qr([],Array(n.props.yearItemNumber),!0).map(function(){return M.createRef()}),n.isDisabled=function(a){return Qn(a,{minDate:n.props.minDate,maxDate:n.props.maxDate,excludeDates:n.props.excludeDates,includeDates:n.props.includeDates,filterDate:n.props.filterDate})},n.isExcluded=function(a){return Z1(a,{excludeDates:n.props.excludeDates})},n.selectingDate=function(){var a;return(a=n.props.selectingDate)!==null&&a!==void 0?a:n.props.preSelection},n.updateFocusOnPaginate=function(a){var i=function(){var o,l;(l=(o=n.YEAR_REFS[a])===null||o===void 0?void 0:o.current)===null||l===void 0||l.focus()};window.requestAnimationFrame(i)},n.handleYearClick=function(a,i){n.props.onDayClick&&n.props.onDayClick(a,i)},n.handleYearNavigation=function(a,i){var o,l,c,d,u=n.props,h=u.date,m=u.yearItemNumber;if(!(h===void 0||m===void 0)){var f=_a(h,m).startPeriod;n.isDisabled(i)||n.isExcluded(i)||((l=(o=n.props).setPreSelection)===null||l===void 0||l.call(o,i),a-f<0?n.updateFocusOnPaginate(m-(f-a)):a-f>=m?n.updateFocusOnPaginate(Math.abs(m-(a-f))):(d=(c=n.YEAR_REFS[a-f])===null||c===void 0?void 0:c.current)===null||d===void 0||d.focus())}},n.isSameDay=function(a,i){return Ge(a,i)},n.isCurrentYear=function(a){return a===Ue(Ke())},n.isRangeStart=function(a){return n.props.startDate&&n.props.endDate&&Hr(Ur(Ke(),a),n.props.startDate)},n.isRangeEnd=function(a){return n.props.startDate&&n.props.endDate&&Hr(Ur(Ke(),a),n.props.endDate)},n.isInRange=function(a){return pm(a,n.props.startDate,n.props.endDate)},n.isInSelectingRange=function(a){var i=n.props,o=i.selectsStart,l=i.selectsEnd,c=i.selectsRange,d=i.startDate,u=i.endDate;return!(o||l||c)||!n.selectingDate()?!1:o&&u?pm(a,n.selectingDate(),u):l&&d||c&&d&&!u?pm(a,d,n.selectingDate()):!1},n.isSelectingRangeStart=function(a){var i;if(!n.isInSelectingRange(a))return!1;var o=n.props,l=o.startDate,c=o.selectsStart,d=Ur(Ke(),a);return c?Hr(d,(i=n.selectingDate())!==null&&i!==void 0?i:null):Hr(d,l??null)},n.isSelectingRangeEnd=function(a){var i;if(!n.isInSelectingRange(a))return!1;var o=n.props,l=o.endDate,c=o.selectsEnd,d=o.selectsRange,u=Ur(Ke(),a);return c||d?Hr(u,(i=n.selectingDate())!==null&&i!==void 0?i:null):Hr(u,l??null)}
885,n.isKeyboardSelected=function(a){if(!(n.props.disabledKeyboardNavigation||n.props.date===void 0||n.props.preSelection==null)){var i=n.props,o=i.minDate,l=i.maxDate,c=i.excludeDates,d=i.includeDates,u=i.filterDate,h=i.selected,m=Ld(Ur(n.props.date,a)),f=(o||l||c||d||u)&&qm(a,n.props),p=!!h&&Ge(m,Ld(h)),g=Ge(m,Ld(n.props.preSelection));return!n.props.inline&&!p&&g&&!f}},n.isSelectedYear=function(a){var i=n.props,o=i.selectsMultiple,l=i.selected,c=i.selectedDates;return o?c==null?void 0:c.some(function(d){return a===Ue(d)}):!!l&&a===Ue(l)},n.onYearClick=function(a,i){var o=n.props.date;o!==void 0&&n.handleYearClick(Ld(Ur(o,i)),a)},n.onYearKeyDown=function(a,i){var o,l,c=a.key,d=n.props,u=d.date,h=d.yearItemNumber,m=d.handleOnKeyDown;if(c!==ue.Tab&&a.preventDefault(),!n.props.disabledKeyboardNavigation)switch(c){case ue.Enter:if(n.props.selected==null)break;n.onYearClick(a,i),(l=(o=n.props).setPreSelection)===null||l===void 0||l.call(o,n.props.selected);break;case ue.ArrowRight:if(n.props.preSelection==null)break;n.handleYearNavigation(i+1,Er(n.props.preSelection,1));break;case ue.ArrowLeft:if(n.props.preSelection==null)break;n.handleYearNavigation(i-1,Ki(n.props.preSelection,1));break;case ue.ArrowUp:{if(u===void 0||h===void 0||n.props.preSelection==null)break;var f=_a(u,h).startPeriod,p=u_,g=i-p;if(g<f){var x=h%p;i>=f&&i<f+x?p=x:p+=x,g=i-p}n.handleYearNavigation(g,Ki(n.props.preSelection,p));break}case ue.ArrowDown:{if(u===void 0||h===void 0||n.props.preSelection==null)break;var b=_a(u,h).endPeriod,p=u_,g=i+p;if(g>b){var x=h%p;i<=b&&i>b-x?p=x:p+=x,g=i+p}n.handleYearNavigation(g,Er(n.props.preSelection,p));break}}m&&m(a)},n.getYearClassNames=function(a){var i=n.props,o=i.date,l=i.disabled,c=i.minDate,d=i.maxDate,u=i.excludeDates,h=i.includeDates,m=i.filterDate,f=i.yearClassName;return Zt("react-datepicker__year-text","react-datepicker__year-".concat(a),o?f==null?void 0:f(Ur(o,a)):void 0,{"react-datepicker__year-text--selected":n.isSelectedYear(a),"react-datepicker__year-text--disabled":(c||d||u||h||m||l)&&qm(a,n.props),"react-datepicker__year-text--keyboard-selected":n.isKeyboardSelected(a),"react-datepicker__year-text--range-start":n.isRangeStart(a),"react-datepicker__year-text--range-end":n.isRangeEnd(a),"react-datepicker__year-text--in-range":n.isInRange(a),"react-datepicker__year-text--in-selecting-range":n.isInSelectingRange(a),"react-datepicker__year-text--selecting-range-start":n.isSelectingRangeStart(a),"react-datepicker__year-text--selecting-range-end":n.isSelectingRangeEnd(a),"react-datepicker__year-text--today":n.isCurrentYear(a)})},n.getYearTabIndex=function(a){if(n.props.disabledKeyboardNavigation||n.props.preSelection==null)return"-1";var i=Ue(n.props.preSelection),o=qm(a,n.props);return a===i&&!o?"0":"-1"},n.getYearContent=function(a){return n.props.renderYearContent?n.props.renderYearContent(a):a},n}return e.prototype.render=function(){var s=this,n=[],a=this.props,i=a.date,o=a.yearItemNumber,l=a.onYearMouseEnter,c=a.onYearMouseLeave;if(i===void 0)return null;for(var d=_a(i,o),u=d.startPeriod,h=d.endPeriod,m=function(g){n.push(v.createElement("div",{ref:f.YEAR_REFS[g-u],onClick:function(x){s.onYearClick(x,g)},onKeyDown:function(x){BP(x)&&(x.preventDefault(),x.key=ue.Enter),s.onYearKeyDown(x,g)},tabIndex:Number(f.getYearTabIndex(g)),className:f.getYearClassNames(g),onMouseEnter:f.props.usePointerEvent?void 0:function(x){return l(x,g)},onPointerEnter:f.props.usePointerEvent?function(x){return l(x,g)}:void 0,onMouseLeave:f.props.usePointerEvent?void 0:function(x){return c(x,g)},onPointerLeave:f.props.usePointerEvent?function(x){return c(x,g)}:void 0,key:g,"aria-current":f.isCurrentYear(g)?"date":void 0},f.getYearContent(g)))},f=this,p=u;p<=h;p++)m(p);return v.createElement("div",{className:"react-datepicker__year"},v.createElement("div",{className:"react-datepicker__year-wrapper",onMouseLeave:this.props.usePointerEvent?void 0:this.props.clearSelectingDate,onPointerLeave:this.props.usePointerEvent?this.props.clearSelectingDate:void 0},n))},e}(M.Component);function Sne(t,e,s,n){for(var a=[],i=0;i<2*e+1;i++){var o=t+e-i,l=!0;
885s&&(l=Ue(s)<=o),n&&l&&(l=Ue(n)>=o),l&&a.push(o)}return a}var _ne=function(t){Ns(e,t);function e(s){var n=t.call(this,s)||this;n.yearOptionButtonsRef={},n.handleOptionKeyDown=function(l,c){var d;switch(c.key){case"Enter":c.preventDefault(),n.onChange(l);break;case"Escape":c.preventDefault(),n.props.onCancel();break;case"ArrowUp":case"ArrowDown":{c.preventDefault();var u=l+(c.key==="ArrowUp"?1:-1);n.yearOptionButtonsRef[u]&&((d=n.yearOptionButtonsRef[u])===null||d===void 0||d.focus());break}}},n.renderOptions=function(){n.yearOptionButtonsRef={};var l=n.props.year,c=n.state.yearsList.map(function(h){return v.createElement("div",{ref:function(m){n.yearOptionButtonsRef[h]=m,h===l&&(m==null||m.focus())},role:"button",tabIndex:0,className:l===h?"react-datepicker__year-option react-datepicker__year-option--selected_year":"react-datepicker__year-option",key:h,onClick:n.onChange.bind(n,h),onKeyDown:n.handleOptionKeyDown.bind(n,h),"aria-selected":l===h?"true":void 0},l===h?v.createElement("span",{className:"react-datepicker__year-option--selected"},"â"):"",h)}),d=n.props.minDate?Ue(n.props.minDate):null,u=n.props.maxDate?Ue(n.props.maxDate):null;return(!u||!n.state.yearsList.find(function(h){return h===u}))&&c.unshift(v.createElement("div",{className:"react-datepicker__year-option",key:"upcoming",onClick:n.incrementYears},v.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-upcoming"}))),(!d||!n.state.yearsList.find(function(h){return h===d}))&&c.push(v.createElement("div",{className:"react-datepicker__year-option",key:"previous",onClick:n.decrementYears},v.createElement("a",{className:"react-datepicker__navigation react-datepicker__navigation--years react-datepicker__navigation--years-previous"}))),c},n.onChange=function(l){n.props.onChange(l)},n.handleClickOutside=function(){n.props.onCancel()},n.shiftYears=function(l){var c=n.state.yearsList.map(function(d){return d+l});n.setState({yearsList:c})},n.incrementYears=function(){return n.shiftYears(1)},n.decrementYears=function(){return n.shiftYears(-1)};var a=s.yearDropdownItemNumber,i=s.scrollableYearDropdown,o=a||(i?10:5);return n.state={yearsList:Sne(n.props.year,o,n.props.minDate,n.props.maxDate)},n.dropdownRef=M.createRef(),n}return e.prototype.componentDidMount=function(){var s=this.dropdownRef.current;if(s){var n=s.children?Array.from(s.children):null,a=n?n.find(function(i){return i.ariaSelected}):null;s.scrollTop=a&&a instanceof HTMLElement?a.offsetTop+(a.clientHeight-s.clientHeight)/2:(s.scrollHeight-s.clientHeight)/2}},e.prototype.render=function(){var s=Zt({"react-datepicker__year-dropdown":!0,"react-datepicker__year-dropdown--scrollable":this.props.scrollableYearDropdown});return v.createElement(qx,{className:s,containerRef:this.dropdownRef,onClickOutside:this.handleClickOutside},this.renderOptions())},e}(M.Component),Tne=function(t){Ns(e,t);function e(){var s=t!==null&&t.apply(this,arguments)||this;return s.state={dropdownVisible:!1},s.renderSelectOptions=function(){for(var n=s.props.minDate?Ue(s.props.minDate):1900,a=s.props.maxDate?Ue(s.props.maxDate):2100,i=[],o=n;o<=a;o++)i.push(v.createElement("option",{key:o,value:o},o));return i},s.onSelectChange=function(n){s.onChange(parseInt(n.target.value))},s.renderSelectMode=function(){return v.createElement("select",{value:s.props.year,className:"react-datepicker__year-select",onChange:s.onSelectChange},s.renderSelectOptions())},s.renderReadView=function(n){return v.createElement("button",{key:"read",type:"button",style:{visibility:n?"visible":"hidden"},className:"react-datepicker__year-read-view",onClick:s.toggleDropdown},v.createElement("span",{className:"react-datepicker__year-read-view--down-arrow"}),v.createElement("span",{className:"react-datepicker__year-read-view--selected-year"},s.props.year))},s.renderDropdown=function(){return v.createElement(_ne,Be({key:"dropdown"},s.props,{onChange:s.onChange,onCancel:s.toggleDropdown}))},s.renderScrollMode=function(){var n=s.state.dropdownVisible,a=[s.renderReadView(!n)];return n&&a.unshift(s.renderDropdown()),a},s.onChange=function(n){s.toggleDropdown(),n!==s.props.year&&s.props.onChange(n)},s.toggleDropdown=function(n){s.setState({dropdownVisible:!s.state.dropdownVisible},function(){s.props.adjustDateOnChange&&s.handleYearChange(s.props.date,n)})},s.handleYearChange=function(n,a){var i;(i=s.onSelect)===null||i===void 0||i.call(s,n,a),s.setOpen()},s.onSelect=function(n,a){var i,o;(o=(i=s.props).onSelect)===null||o===void 0||o.call(i,n,a)},s.setOpen=function(){var n,a;(a=(n=s.props).setOpen)===null||a===void 0||a.call(n,!0)},s}return e.prototype.render=function(){var s;switch(this.props.dropdownMode){case"scroll":s=this.renderScrollMode();break;case"select":s=this.renderSelectMode();break}return v.createElement("div",{className:"react-datepicker__year-dropdown-container react-datepicker__year-dropdown-container--".concat(this.props.dropdownMode)},s)},e}(M.Component),Ene=["react-datepicker__year-select","react-datepicker__month-select","react-datepicker__month-year-select"],VP="react-datepicker-ignore-onclickoutside",Mne=function(t){var e=(t.className||"").split(/\s+/);return Ene.some(function(s){return e.indexOf(s)>=0})},Ane=function(t){Ns(e,t);function e(s){var n=t.call(this,s)||this;return n.monthContainer=void 0,n.handleClickOutside=function(a){n.props.onClickOutside(a)},n.setClickOutsideRef=function(){return n.containerRef.current},n.handleDropdownFocus=function(a){var i,o;Mne(a.target)&&((o=(i=n.props).onDropdownFocus)===null||o===void 0||o.call(i,a))},n.getDateInView=function(){var a=n.props,i=a.preSelection,o=a.selected,l=a.openToDate,c=FP(n.props),d=$P(n.props),u=Ke(),h=l||o||i;return h||(c&&Jr(u,c)?c:d&&Da(u,d)?d:u)},n.increaseMonth=function(){n.setState(function(a){var i=a.date;return{date:Dr(i,1)}},function(){return n.handleMonthChange(n.state.date)})},n.decreaseMonth=function(){n.setState(function(a){var i=a.date;return{date:Vo(i,1)}},function(){return n.handleMonthChange(n.state.date)})},n.handleDayClick=function(a,i,o){n.props.onSelect(a,i,o),n.props.setPreSelection&&n.props.setPreSelection(a)},n.handleDayMouseEnter=function(a){n.setState({selectingDate:a}),n.props.onDayMouseEnter&&n.props.onDayMouseEnter(a)},n.handleMonthMouseLeave=function(){n.setState({selectingDate:void 0}),n.props.onMonthMouseLeave&&n.props.onMonthMouseLeave()},n.handleYearMouseEnter=function(a,i){n.setState({selectingDate:Ur(Ke(),i)}),n.props.onYearMouseEnter&&n.props.onYearMouseEnter(a,i)},n.handleYearMouseLeave=function(a,i){n.props.onYearMouseLeave&&n.props.onYearMouseLeave(a,i)},n.handleYearChange=function(a){var i,o,l,c;(o=(i=n.props).onYearChange)===null||o===void 0||o.call(i,a),n.setState({isRenderAriaLiveMessage:!0}),n.props.adjustDateOnChange&&(n.props.onSelect(a),(c=(l=n.props).setOpen)===null||c===void 0||c.c
885all(l,!0)),n.props.setPreSelection&&n.props.setPreSelection(a)},n.getEnabledPreSelectionDateForMonth=function(a){if(!Qn(a,n.props))return a;for(var i=Ra(a),o=ene(a),l=gZ(o,i),c=null,d=0;d<=l;d++){var u=Tr(i,d);if(!Qn(u,n.props)){c=u;break}}return c},n.handleMonthChange=function(a){var i,o,l,c=(i=n.getEnabledPreSelectionDateForMonth(a))!==null&&i!==void 0?i:a;n.handleCustomMonthChange(c),n.props.adjustDateOnChange&&(n.props.onSelect(c),(l=(o=n.props).setOpen)===null||l===void 0||l.call(o,!0)),n.props.setPreSelection&&n.props.setPreSelection(c)},n.handleCustomMonthChange=function(a){var i,o;(o=(i=n.props).onMonthChange)===null||o===void 0||o.call(i,a),n.setState({isRenderAriaLiveMessage:!0})},n.handleMonthYearChange=function(a){n.handleYearChange(a),n.handleMonthChange(a)},n.changeYear=function(a){n.setState(function(i){var o=i.date;return{date:Ur(o,Number(a))}},function(){return n.handleYearChange(n.state.date)})},n.changeMonth=function(a){n.setState(function(i){var o=i.date;return{date:Cn(o,Number(a))}},function(){var i,o;n.handleMonthChange(n.state.date),(o=(i=n.props).onMonthSelectedInChange)===null||o===void 0||o.call(i,0)})},n.changeMonthYear=function(a){n.setState(function(i){var o=i.date;return{date:Ur(Cn(o,mn(a)),Ue(a))}},function(){return n.handleMonthYearChange(n.state.date)})},n.header=function(a,i){if(a===void 0&&(a=n.state.date),i===void 0&&(i=0),!cn(a))return[];var o=n.props.disabled,l=Fi(a,n.props.locale,n.props.calendarStartDay),c=[];return n.props.showWeekNumbers&&c.push(v.createElement("div",{key:"W",className:"react-datepicker__day-name ".concat(o?"react-datepicker__day-name--disabled":""),role:"columnheader"},v.createElement("span",{className:"react-datepicker__sr-only"},"Week number"),v.createElement("span",{"aria-hidden":"true"},n.props.weekLabel||"#"))),c.concat([0,1,2,3,4,5,6].map(function(d){var u=Tr(l,d),h=n.formatWeekday(u,n.props.locale),m=ut(u,"EEEE",n.props.locale),f=n.props.weekDayClassName?n.props.weekDayClassName(u):void 0;if(n.props.renderCustomDayName){var p=n.props.renderCustomDayName({day:u,shortName:h,fullName:m,locale:n.props.locale,customDayNameCount:i});return v.createElement("div",{key:d,role:"columnheader",className:Zt("react-datepicker__day-name",f,o?"react-datepicker__day-name--disabled":"")},p)}return v.createElement("div",{key:d,role:"columnheader",className:Zt("react-datepicker__day-name",f,o?"react-datepicker__day-name--disabled":"")},v.createElement("span",{className:"react-datepicker__sr-only"},m),v.createElement("span",{"aria-hidden":"true"},h))}))},n.formatWeekday=function(a,i){return n.props.formatWeekDay?tne(a,n.props.formatWeekDay,i):n.props.useWeekdaysShort?nne(a,i):sne(a,i)},n.decreaseYear=function(){n.setState(function(a){var i,o=a.date;return{date:Ki(o,n.props.showYearPicker?(i=n.props.yearItemNumber)!==null&&i!==void 0?i:e.defaultProps.yearItemNumber:1)}},function(){return n.handleYearChange(n.state.date)})},n.clearSelectingDate=function(){n.setState({selectingDate:void 0})},n.renderPreviousButton=function(){var a,i,o;if(!n.props.renderCustomHeader){var l=(a=n.props.monthsShown)!==null&&a!==void 0?a:e.defaultProps.monthsShown,c=n.props.showPreviousMonths?l-1:0,d=(i=n.props.monthSelectedIn)!==null&&i!==void 0?i:c,u=Vo(n.state.date,d),h;switch(!0){case n.props.disabled:h=!0;break;case n.props.showMonthYearPicker:h=n_(n.state.date,n.props);break;case n.props.showYearPicker:h=lne(n.state.date,n.props);break;case n.props.showQuarterYearPicker:h=ine(n.state.date,n.props);break;default:h=t_(u,n.props);break}if(!(!((o=n.props.forceShowMonthNavigation)!==null&&o!==void 0?o:e.defaultProps.forceShowMonthNavigation)&&!n.props.showDisabledMonthNavigation&&h||n.props.showTimeSelectOnly)){var m=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--previous"],f=["react-datepicker__navigation","react-datepicker__navigation--previous"],p=n.decreaseMonth;(n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker)&&(p=n.decreaseYear),h&&n.props.showDisabledMonthNavigation&&(f.push("react-datepicker__navigation--previous--disabled"),p=void 0);var g=n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker,x=n.props,b=x.previousMonthButtonLabel,y=b===void 0?e.defaultProps.previousMonthButtonLabel:b,w=x.previousYearButtonLabel,N=w===void 0?e.defaultProps.previousYearButtonLabel:w,j=n.props,S=j.previousMonthAriaLabel,k=S===void 0?typeof y=="string"?y:"Previous Month":S,C=j.previousYearAriaLabel,T=C===void 0?typeof N=="string"?N:"Previous Year":C;return v.createElement("button",{type:"button",className:f.join(" "),onClick:p,onKeyDown:n.props.handleOnKeyDown,"aria-label":g?T:k},v.createElement("span",{className:m.join(" ")},g?N:y))}}},n.increaseYear=function(){n.setState(function(a){var i,o=a.date;return{date:Er(o,n.props.showYearPicker?(i=n.props.yearItemNumber)!==null&&i!==void 0?i:e.defaultProps.yearItemNumber:1)}},function(){return n.handleYearChange(n.state.date)})},n.renderNextButton=function(){var a;if(!n.props.renderCustomHeader){var i;switch(!0){case n.props.disabled:i=!0;break;case n.props.showMonthYearPicker:i=r_(n.state.date,n.props);break;case n.props.showYearPicker:i=cne(n.state.date,n.props);break;case n.props.showQuarterYearPicker:i=one(n.state.date,n.props);break;default:i=s_(n.state.date,n.props);break}if(!(!((a=n.props.forceShowMonthNavigation)!==null&&a!==void 0?a:e.defaultProps.forceShowMonthNavigation)&&!n.props.showDisabledMonthNavigation&&i||n.props.showTimeSelectOnly)){var o=["react-datepicker__navigation","react-datepicker__navigation--next"],l=["react-datepicker__navigation-icon","react-datepicker__navigation-icon--next"];n.props.showTimeSelect&&o.push("react-datepicker__navigation--next--with-time"),n.props.todayButton&&o.push("react-datepicker__navigation--next--with-today-button");var c=n.increaseMonth;(n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker)&&(c=n.increaseYear),i&&n.props.showDisabledMonthNavigation&&(o.push("react-datepicker__navigation--next--disabled"),c=void 0);var d=n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker,u=n.props,h=u.nextMonthButtonLabel,m=h===void 0?e.defaultProps.nextMonthButtonLabel:h,f=u.nextYearButtonLabel,p=f===void 0?e.defaultProps.nextYearButtonLabel:f,g=n.props,x=g.nextMonthAriaLabel,b=x===void 0?typeof m=="string"?m:"Next Month":x,y=g.nextYearAriaLabel,w=y===void 0?typeof p=="string"?p:"Next Year":y;return v.createElement("button",{type:"button",className:o.join(" "),onClick:c,onKeyDown:n.props.handleOnKeyDown,"aria-label":d?w:b},v.createElement("span",{className:l.join(" ")},d?p:m))}}},n.renderCurrentMonth=function(a){a===void 0&&(a=n.state.date);var i=["react-datepicker__current-month"];return n.props.showYearDropdown&&i.push("react-datepicker__current-month--hasYearDropdown"),n.props.showMonthDropdown&&i.push("react-datepicker__current-month--hasMonthDropdown"),n.props.showMonthYearDropdown&&i.push("react-datepicker__current-month--hasMonthYearDropdown"),v.createElement("h2",{className:i.join(" ")},cn(a)?ut(a,n.props.dateFormat,n.props.locale):"")}
885,n.renderYearDropdown=function(a){if(a===void 0&&(a=!1),!(!n.props.showYearDropdown||a))return v.createElement(Tne,Be({},e.defaultProps,n.props,{date:n.state.date,onChange:n.changeYear,year:Ue(n.state.date)}))},n.renderMonthDropdown=function(a){if(a===void 0&&(a=!1),!(!n.props.showMonthDropdown||a))return v.createElement(vne,Be({},e.defaultProps,n.props,{month:mn(n.state.date),onChange:n.changeMonth}))},n.renderMonthYearDropdown=function(a){if(a===void 0&&(a=!1),!(!n.props.showMonthYearDropdown||a))return v.createElement(Nne,Be({},e.defaultProps,n.props,{date:n.state.date,onChange:n.changeMonthYear}))},n.handleTodayButtonClick=function(a){n.props.onSelect(JS(),a),n.props.setPreSelection&&n.props.setPreSelection(JS())},n.renderTodayButton=function(){if(!(!n.props.todayButton||n.props.showTimeSelectOnly))return v.createElement("div",{className:"react-datepicker__today-button",onClick:n.handleTodayButtonClick},n.props.todayButton)},n.renderDayNamesHeader=function(a,i){return i===void 0&&(i=0),v.createElement("div",{className:"react-datepicker__day-names",role:"row"},n.header(a,i))},n.renderDefaultHeader=function(a){var i=a.monthDate,o=a.i,l=v.createElement("div",{className:Zt("react-datepicker__header",{"react-datepicker__header--has-time-select":n.props.showTimeSelect,"react-datepicker__header--middle":n.props.monthHeaderPosition==="middle","react-datepicker__header--bottom":n.props.monthHeaderPosition==="bottom"})},n.renderCurrentMonth(i),v.createElement("div",{className:"react-datepicker__header__dropdown react-datepicker__header__dropdown--".concat(n.props.dropdownMode),onFocus:n.handleDropdownFocus},n.renderMonthDropdown(o!==0),n.renderMonthYearDropdown(o!==0),n.renderYearDropdown(o!==0)));return n.props.monthHeaderPosition==="top"?l:v.createElement("div",{className:"react-datepicker__header-wrapper"},n.renderPreviousButton()||null,n.renderNextButton()||null,l)},n.renderCustomHeader=function(a){var i,o,l=a.monthDate,c=a.i;if(n.props.showTimeSelect&&!n.state.monthContainer||n.props.showTimeSelectOnly)return null;var d=n.props,u=d.showYearPicker,h=d.yearItemNumber,m;if(u){var f=_a(l,h),p=f.startPeriod,g=f.endPeriod;m={startYear:p,endYear:g}}var x=t_(n.state.date,n.props),b=s_(n.state.date,n.props),y=n_(n.state.date,n.props),w=r_(n.state.date,n.props);return v.createElement("div",{className:"react-datepicker__header react-datepicker__header--custom",onFocus:n.props.onDropdownFocus},(o=(i=n.props).renderCustomHeader)===null||o===void 0?void 0:o.call(i,Be(Be(Be({},n.state),u&&{visibleYearsRange:m}),{customHeaderCount:c,monthDate:l,changeMonth:n.changeMonth,changeYear:n.changeYear,decreaseMonth:n.decreaseMonth,increaseMonth:n.increaseMonth,decreaseYear:n.decreaseYear,increaseYear:n.increaseYear,prevMonthButtonDisabled:x,nextMonthButtonDisabled:b,prevYearButtonDisabled:y,nextYearButtonDisabled:w})))},n.renderYearHeader=function(a){var i=a.monthDate,o=n.props,l=o.showYearPicker,c=o.yearItemNumber,d=c===void 0?e.defaultProps.yearItemNumber:c,u=_a(i,d),h=u.startPeriod,m=u.endPeriod;return v.createElement("div",{className:"react-datepicker__header react-datepicker-year-header"},l?"".concat(h," - ").concat(m):Ue(i))},n.renderHeader=function(a){var i=a.monthDate,o=a.i,l=o===void 0?0:o,c={monthDate:i,i:l};switch(!0){case n.props.renderCustomHeader!==void 0:return n.renderCustomHeader(c);case(n.props.showMonthYearPicker||n.props.showQuarterYearPicker||n.props.showYearPicker):return n.renderYearHeader(c);default:return n.renderDefaultHeader(c)}},n.renderMonths=function(){var a,i;if(!(n.props.showTimeSelectOnly||n.props.showYearPicker)){for(var o=[],l=(a=n.props.monthsShown)!==null&&a!==void 0?a:e.defaultProps.monthsShown,c=n.props.showPreviousMonths?l-1:0,d=n.props.showMonthYearPicker||n.props.showQuarterYearPicker?Er(n.state.date,c):Vo(n.state.date,c),u=(i=n.props.monthSelectedIn)!==null&&i!==void 0?i:c,h=0;h<l;++h){var m=h-u+c,f=n.props.showMonthYearPicker||n.props.showQuarterYearPicker?Er(d,m):Dr(d,m),p="month-".concat(h),g=h<l-1,x=h>0;o.push(v.createElement("div",{key:p,ref:function(b){n.monthContainer=b??void 0},className:"react-datepicker__month-container"},n.props.monthHeaderPosition==="top"&&n.renderHeader({monthDate:f,i:h}),v.createElement(bne,Be({},e.defaultProps,n.props,{containerRef:n.containerRef,ariaLabelPrefix:n.props.monthAriaLabelPrefix,day:f,onDayClick:n.handleDayClick,handleOnKeyDown:n.props.handleOnDayKeyDown,handleOnMonthKeyDown:n.props.handleOnKeyDown,onDayMouseEnter:n.handleDayMouseEnter,onMouseLeave:n.handleMonthMouseLeave,orderInDisplay:h,selectingDate:n.state.selectingDate,monthShowsDuplicateDaysEnd:g,monthShowsDuplicateDaysStart:x,dayNamesHeader:n.renderDayNamesHeader(f,h),monthHeader:n.props.monthHeaderPosition==="middle"?n.renderHeader({monthDate:f,i:h}):void 0,monthFooter:n.props.monthHeaderPosition==="bottom"?n.renderHeader({monthDate:f,i:h}):void 0}))))}return o}},n.renderYears=function(){if(!n.props.showTimeSelectOnly&&n.props.showYearPicker)return v.createElement("div",{className:"react-datepicker__year--container"},n.renderHeader({monthDate:n.state.date}),v.createElement(Cne,Be({},e.defaultProps,n.props,{selectingDate:n.state.selectingDate,date:n.state.date,onDayClick:n.handleDayClick,clearSelectingDate:n.clearSelectingDate,onYearMouseEnter:n.handleYearMouseEnter,onYearMouseLeave:n.handleYearMouseLeave})))},n.renderTimeSection=function(){if(n.props.showTimeSelect&&(n.state.monthContainer||n.props.showTimeSelectOnly))return v.createElement(kne,Be({},e.defaultProps,n.props,{onChange:n.props.onTimeChange,format:n.props.timeFormat,intervals:n.props.timeIntervals,monthRef:n.state.monthContainer}))},n.renderInputTimeSection=function(){var a,i;if(n.props.showTimeInput){if(n.props.selectsRange){var o=n.props,l=o.startDate,c=o.endDate,d=l?new Date(l):void 0,u=d&&cn(d)&&!!l,h=u?"".concat(Sl(d.getHours()),":").concat(Sl(d.getMinutes())):"",m=c?new Date(c):void 0,f=m&&cn(m)&&!!c,p=f?"".concat(Sl(m.getHours()),":").concat(Sl(m.getMinutes())):"";return v.createElement(v.Fragment,null,v.createElement(z0,Be({},e.defaultProps,n.props,{date:d,timeString:h,onChange:function(y){var w,N;(N=(w=n.props).onTimeChange)===null||N===void 0||N.call(w,y,"start")},timeInputLabel:((a=n.props.timeInputLabel)!==null&&a!==void 0?a:"Time")+" (Start)"})),v.createElement(z0,Be({}
885,e.defaultProps,n.props,{date:m,timeString:p,onChange:function(y){var w,N;(N=(w=n.props).onTimeChange)===null||N===void 0||N.call(w,y,"end")},timeInputLabel:((i=n.props.timeInputLabel)!==null&&i!==void 0?i:"Time")+" (End)"})))}var g=n.props.selected?new Date(n.props.selected):void 0,x=g&&cn(g)&&!!n.props.selected,b=x?"".concat(Sl(g.getHours()),":").concat(Sl(g.getMinutes())):"";return v.createElement(z0,Be({},e.defaultProps,n.props,{date:g,timeString:b,onChange:function(y){var w,N;(N=(w=n.props).onTimeChange)===null||N===void 0||N.call(w,y)}}))}},n.renderAriaLiveRegion=function(){var a;if(!cn(n.state.date))return v.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"});var i=_a(n.state.date,(a=n.props.yearItemNumber)!==null&&a!==void 0?a:e.defaultProps.yearItemNumber),o=i.startPeriod,l=i.endPeriod,c;return n.props.showYearPicker?c="".concat(o," - ").concat(l):n.props.showMonthYearPicker||n.props.showQuarterYearPicker?c=Ue(n.state.date):c="".concat(X1(mn(n.state.date),n.props.locale)," ").concat(Ue(n.state.date)),v.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},n.state.isRenderAriaLiveMessage&&c)},n.renderChildren=function(){if(n.props.children)return v.createElement("div",{className:"react-datepicker__children-container"},n.props.children)},n.containerRef=M.createRef(),n.state={date:n.getDateInView(),selectingDate:void 0,monthContainer:void 0,isRenderAriaLiveMessage:!1},n}return Object.defineProperty(e,"defaultProps",{get:function(){return{monthsShown:1,forceShowMonthNavigation:!1,outsideClickIgnoreClass:VP,timeCaption:"Time",previousYearButtonLabel:"Previous Year",nextYearButtonLabel:"Next Year",previousMonthButtonLabel:"Previous Month",nextMonthButtonLabel:"Next Month",yearItemNumber:xh,monthHeaderPosition:"top"}},enumerable:!1,configurable:!0}),e.prototype.componentDidMount=function(){var s=this;this.props.showTimeSelect&&(this.assignMonthContainer=function(){s.setState({monthContainer:s.monthContainer})}())},e.prototype.componentDidUpdate=function(s){var n=this;if(this.props.preSelection&&cn(this.props.preSelection)&&(!Ge(this.props.preSelection,s.preSelection)||this.props.monthSelectedIn!==s.monthSelectedIn)){var a=!Bs(this.state.date,this.props.preSelection);this.setState({date:this.props.preSelection},function(){return a&&n.handleCustomMonthChange(n.state.date)})}else this.props.openToDate&&!Ge(this.props.openToDate,s.openToDate)&&this.setState({date:this.props.openToDate})},e.prototype.render=function(){var s=this.props.container||Gse;return v.createElement(qx,{onClickOutside:this.handleClickOutside,style:{display:"contents"},ignoreClass:this.props.outsideClickIgnoreClass},v.createElement("div",{style:{display:"contents"},ref:this.containerRef},v.createElement(s,{className:Zt("react-datepicker",this.props.className,{"react-datepicker--time-only":this.props.showTimeSelectOnly}),showTime:this.props.showTimeSelect||this.props.showTimeInput,showTimeSelectOnly:this.props.showTimeSelectOnly,inline:this.props.inline},this.renderAriaLiveRegion(),this.props.monthHeaderPosition==="top"&&this.renderPreviousButton(),this.props.monthHeaderPosition==="top"&&this.renderNextButton(),this.renderMonths(),this.renderYears(),this.renderTodayButton(),this.renderTimeSection(),this.renderInputTimeSection(),this.renderChildren())))},e}(M.Component),Pne=function(t){var e=t.icon,s=t.className,n=s===void 0?"":s,a=t.onClick,i="react-datepicker__calendar-icon";if(typeof e=="string")return v.createElement("i",{className:"".concat(i," ").concat(e," ").concat(n),"aria-hidden":"true",onClick:a});if(v.isValidElement(e)){var o=e;return v.cloneElement(o,{className:"".concat(o.props.className||""," ").concat(i," ").concat(n),onClick:function(l){typeof o.props.onClick=="function"&&o.props.onClick(l),typeof a=="function"&&a(l)}})}return v.createElement("svg",{className:"".concat(i," ").concat(n),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 448 512",onClick:a},v.createElement("path",{d:"M96 32V64H48C21.5 64 0 85.5 0 112v48H448V112c0-26.5-21.5-48-48-48H352V32c0-17.7-14.3-32-32-32s-32 14.3-32 32V64H160V32c0-17.7-14.3-32-32-32S96 14.3 9
8856 32zM448 192H0V464c0 26.5 21.5 48 48 48H400c26.5 0 48-21.5 48-48V192z"}))},UP=function(t){Ns(e,t);function e(s){var n=t.call(this,s)||this;return n.portalRoot=null,n.el=document.createElement("div"),n}return e.prototype.componentDidMount=function(){this.portalRoot=(this.props.portalHost||document).getElementById(this.props.portalId),this.portalRoot||(this.portalRoot=document.createElement("div"),this.portalRoot.setAttribute("id",this.props.portalId),(this.props.portalHost||document.body).appendChild(this.portalRoot)),this.portalRoot.appendChild(this.el)},e.prototype.componentWillUnmount=function(){this.portalRoot&&this.portalRoot.removeChild(this.el)},e.prototype.render=function(){return zE.createPortal(this.props.children,this.el)},e}(M.Component),Dne="[tabindex], a, button, input, select, textarea",Rne=function(t){return(t instanceof HTMLAnchorElement||!t.disabled)&&t.tabIndex!==-1},HP=function(t){Ns(e,t);function e(s){var n=t.call(this,s)||this;return n.getTabChildren=function(){var a;return Array.prototype.slice.call((a=n.tabLoopRef.current)===null||a===void 0?void 0:a.querySelectorAll(Dne),1,-1).filter(Rne)},n.handleFocusStart=function(){var a=n.getTabChildren();a&&a.length>1&&a[a.length-1].focus()},n.handleFocusEnd=function(){var a=n.getTabChildren();a&&a.length>1&&a[0].focus()},n.tabLoopRef=M.createRef(),n}return e.prototype.render=function(){var s;return((s=this.props.enableTabLoop)!==null&&s!==void 0?s:e.defaultProps.enableTabLoop)?v.createElement("div",{className:"react-datepicker__tab-loop",ref:this.tabLoopRef},v.createElement("div",{className:"react-datepicker__tab-loop__start",tabIndex:0,onFocus:this.handleFocusStart}),this.props.children,v.createElement("div",{className:"react-datepicker__tab-loop__end",tabIndex:0,onFocus:this.handleFocusEnd})):this.props.children},e.defaultProps={enableTabLoop:!0},e}(M.Component);function Lne(t){function e(s){var n,a=typeof s.hidePopper=="boolean"?s.hidePopper:!0,i=M.useRef(null),o=Wse(Be({open:!a,whileElementsMounted:Nse,placement:s.popperPlacement,middleware:Qr([Pse({padding:15}),Ase(10),Dse({element:i})],(n=s.popperModifiers)!==null&&n!==void 0?n:[],!0)},s.popperProps)),l=Be(Be({},s),{hidePopper:a,popperProps:Be(Be({},o),{arrowRef:i})});return v.createElement(t,Be({},l))}return e.displayName="withFloating(".concat(t.displayName||t.name||"Component",")"),e}var One=function(t){var e=t.className,s=t.wrapperClassName,n=t.hidePopper,a=n===void 0?!0:n,i=t.popperComponent,o=t.targetComponent,l=t.enableTabLoop,c=t.popperOnKeyDown,d=t.portalId,u=t.portalHost,h=t.popperProps,m=t.showArrow,f=t.popperTargetRef,p=t.monthHeaderPosition;M.useEffect(function(){f!=null&&f.current&&h.refs.setPositionReference(f.current)},[f,h.refs]);var g=void 0;if(!a){var x=Zt("react-datepicker-popper",!m&&"react-datepicker-popper-offset",p==="middle"&&"react-datepicker-popper--header-middle",p==="bottom"&&"react-datepicker-popper--header-bottom",e);g=v.createElement(HP,{enableTabLoop:l},v.createElement("div",{ref:h.refs.setFloating,style:h.floatingStyles,className:x,"data-placement":h.placement,onKeyDown:c},i,m&&v.createElement(Fse,{ref:h.arrowRef,context:h.context,fill:"currentColor",strokeWidth:1,height:8,width:16,style:{transform:"translateY(-1px)"},className:"react-datepicker__triangle"})))}t.popperContainer&&(g=M.createElement(t.popperContainer,{},g)),d&&!a&&(g=v.createElement(UP,{portalId:d,portalHost:u},g));var b=Zt("react-datepicker-wrapper",s);return v.createElement(v.Fragment,null,v.createElement("div",{ref:h.refs.setReference,className:b},o),g)},Ine=Lne(One);function h_(t,e){return t&&e?mn(t)!==mn(e)||Ue(t)!==Ue(e):t!==e}var V0="Date input not valid.",Fne=function(t){Ns(e,t);function e(s){var n=t.call(this,s)||this;return n.calendar=null,n.input=null,n.getPreSelection=function(){var a=n.props.timeZone,i=n.props.openToDate?n.props.openToDate:n.props.selectsEnd&&n.props.startDate?n.props.startDate:n.props.selectsStart&&n.props.endDate?n.props.endDate:Ke();return a?qS(i,a):i},n.modifyHolidays=function(){var a;return(a=n.props.holidays)===null||a===void 0?void 0:a.reduce(function(i,o){var l=fo(o.date,"yyyy-MM-dd",void 0,!1);return l?Qr(Qr([],i,!0),[Be(Be({},o),{date:l})],!1):i},[])},n.calcInitialState=function(){var a=n.props.timeZone,i=n.getPreSelection(),o=FP(n.props),l=$P(n.props),c=o&&Jr(i,Rd(o))?o:l&&Da(i,QS(l))?l:i,d=n.props.selectsRange?n.props.startDate:n.props.selected;return d&&a&&(d=qS(d,a)),{open:n.props.startOpen||!1,preventFocus:!1,inputValue:null,preSelection:d??c,highlightDates:a_(n.props.highlightDates),focused:!1,shouldFocusDayInline:!1,isRenderAriaLiveMessage:!1,wasHidden:!1}},n.getInputValue=function(){var a,i=n.props,o=i.locale,l=i.startDate,c=i.endDate,d=i.rangeSeparator,u=i.selected,h=i.selectedDates,m=i.selectsMultiple,f=i.selectsRange,p=i.formatMultipleDates,g=i.value,x=(a=n.props.dateFormat)!==null&&a!==void 0?a:e.defaultProps.dateFormat,b=n.state.inputValue;if(typeof g=="string")return g;if(typeof b=="string")return b;if(f)return Kse(l,c,{dateFormat:x,locale:o,rangeSeparator:d});if(m){if(p){var y=function(w){return ln(w,{dateFormat:x,locale:o})};return p(h??[],y)}return Jse(h??[],{dateFormat:x,locale:o})}return ln(u,{dateFormat:x,locale:o})},n.resetHiddenStatus=function(){n.setState(Be(Be({},n.state),{wasHidden:!1}))},n.setHiddenStatus=function(){n.setState(Be(Be({},n.state),{wasHidden:!0}))},n.setHiddenStateOnVisibilityHidden=function(){document.visibilityState==="hidden"&&n.setHiddenStatus()},n.clearPreventFocusTimeout=function(){n.preventFocusTimeout&&clearTimeout(n.preventFocusTimeout)},n.setFocus=function(){var a,i;(i=(a=n.input)===null||a===void 0?void 0:a.focus)===null||i===void 0||i.call(a,{preventScroll:!0})},n.setBlur=function(){var a,i;(i=(a=n.input)===null||a===void 0?void 0:a.blur)===null||i===void 0||i.call(a),n.cancelFocusInput()},n.deferBlur=function(){requestAnimationFrame(function(){n.setBlur()})},n.setOpen=function(a,i){i===void 0&&(i=!1),n.setState({open:a,preSelection:a&&n.state.open?n.state.preSelection:n.calcInitialState().preSelection,lastPreSelectChange:U0},function(){a||n.setState(function(o){return{focused:i?o.focused:!1}},function(){!i&&n.deferBlur(),n.setState({inputValue:null})})})},n.inputOk=function(){return sa(n.state.preSelection)},n.isCalendarOpen=function(){return n.props.open===void 0?n.state.open&&!n.props.disabled&&!n.props.readOnly:n.props.open},n.handleFocus=function(a){var i,o,l=n.state.wasHidden,c=l?n.state.open:!0;l&&n.resetHiddenStatus(),n.state.preventFocus||((o=(i=n.props).onFocus)===null||o===void 0||o.call(i,a),c&&!n.props.preventOpenOnFocus&&!n.props.readOnly&&n.setOpen(!0)),n.setState({focused:!0})},n.sendFocusBackToInput=function(){n.preventFocusTimeout&&n.clearPreventFocusTimeout(),n.setState({preventFocus:!0},function(){n.preventFocusTimeout=setTimeout(function(){n.setFocus(),n.setState({preventFocus:!1})})})}
885,n.cancelFocusInput=function(){clearTimeout(n.inputFocusTimeout),n.inputFocusTimeout=void 0},n.deferFocusInput=function(){n.cancelFocusInput(),n.inputFocusTimeout=setTimeout(function(){return n.setFocus()},1)},n.handleDropdownFocus=function(){n.cancelFocusInput()},n.resetInputValue=function(){n.setState(Be(Be({},n.state),{inputValue:null}))},n.handleBlur=function(a){var i,o;(!n.state.open||n.props.withPortal||n.props.showTimeInput)&&((o=(i=n.props).onBlur)===null||o===void 0||o.call(i,a));var l=n.state.inputValue;if(typeof l=="string"&&l.length>0){var c=/[a-zA-Z0-9]/.test(l);!c&&n.props.selected&&n.setSelected(null,void 0,!0)}n.resetInputValue(),n.state.open&&n.props.open===!1&&n.setOpen(!1),n.setState({focused:!1})},n.handleCalendarClickOutside=function(a){var i,o;(o=(i=n.props).onClickOutside)===null||o===void 0||o.call(i,a),!n.props.inline&&!a.defaultPrevented&&n.setOpen(!1),n.props.withPortal&&a.preventDefault()},n.handleChange=function(){for(var a,i,o,l,c,d,u,h,m=[],f=0;f<arguments.length;f++)m[f]=arguments[f];var p=m[0];if(!(n.props.onChangeRaw&&(n.props.onChangeRaw.apply(n,m),!p||typeof p.isDefaultPrevented!="function"||p.isDefaultPrevented()))){n.setState({inputValue:(p==null?void 0:p.target)instanceof HTMLInputElement?p.target.value:null,lastPreSelectChange:$ne});var g=n.props,x=g.selectsRange,b=g.startDate,y=g.endDate,w=(a=n.props.dateFormat)!==null&&a!==void 0?a:e.defaultProps.dateFormat,N=(i=n.props.strictParsing)!==null&&i!==void 0?i:e.defaultProps.strictParsing,j=(p==null?void 0:p.target)instanceof HTMLInputElement?p.target.value:"";if(x){var S=n.props.rangeSeparator,k=S.trim(),C=j.split(w.includes(k)?S:k,2).map(function(O){return O.trim()}),T=C[0],A=C[1],E=fo(T??"",w,n.props.locale,N),L=E?fo(A??"",w,n.props.locale,N):null,D=((o=Ao(b))===null||o===void 0?void 0:o.getTime())!==(E==null?void 0:E.getTime()),P=((l=Ao(y))===null||l===void 0?void 0:l.getTime())!==(L==null?void 0:L.getTime());if(!D&&!P||E&&Qn(E,n.props)||L&&Qn(L,n.props))return;E&&n.setState({preSelection:E}),(d=(c=n.props).onChange)===null||d===void 0||d.call(c,[E,L],p)}else{var R=fo(j,w,n.props.locale,N,(u=n.props.selected)!==null&&u!==void 0?u:void 0);if(R||!j)n.setSelected(R,p,!0);else if(!n.props.inline){var $=qse(j,(h=n.state.preSelection)!==null&&h!==void 0?h:void 0);$&&(!n.props.minDate||!Jr($,n.props.minDate))&&(!n.props.maxDate||!Da($,n.props.maxDate))&&n.setState({preSelection:$})}}}},n.handleSelect=function(a,i,o){var l;if(!n.props.readOnly){var c=n.props,d=c.selectsRange,u=c.startDate,h=c.endDate,m=c.locale,f=c.swapRange,p=(l=n.props.dateFormat)!==null&&l!==void 0?l:e.defaultProps.dateFormat,g=!d||u&&!h&&(f||!$0(a,u));if(n.props.shouldCloseOnSelect&&!n.props.showTimeSelect&&g&&n.sendFocusBackToInput(),n.props.onChangeRaw){var x=ln(a,{dateFormat:p,locale:m});n.props.onChangeRaw(i,{date:a,formattedDate:x})}n.setSelected(a,i,!1,o),n.props.showDateSelect&&n.setState({isRenderAriaLiveMessage:!0}),!n.props.shouldCloseOnSelect||n.props.showTimeSelect?n.setPreSelection(a):g&&n.setOpen(!1)}},n.setSelected=function(a,i,o,l){var c,d,u=n.props.timeZone,h=a;if(h&&u&&(h=ba(h,u)),n.props.showYearPicker){if(h!==null&&qm(Ue(h),n.props))return}else if(n.props.showMonthYearPicker){if(h!==null&&IP(h,n.props))return}else if(h!==null&&Qn(h,n.props))return;var m=n.props,f=m.onChange,p=m.selectsRange,g=m.startDate,x=m.endDate,b=m.selectsMultiple,y=m.selectedDates,w=m.minTime,N=m.swapRange;if(!Po(n.props.selected,h)||n.props.allowSameDay||p||b)if(h!==null&&(n.props.selected&&(!o||!n.props.showTimeSelect&&!n.props.showTimeSelectOnly&&!n.props.showTimeInput)&&(h=ya(h,{hour:Es(n.props.selected),minute:Ms(n.props.selected),second:Ii(n.props.selected)})),!o&&(n.props.showTimeSelect||n.props.showTimeSelectOnly)&&w&&(h=ya(h,{hour:w.getHours(),minute:w.getMinutes(),second:w.getSeconds()})),n.props.inline||n.setState({preSelection:h}),n.props.focusSelectedMonth||n.setState({monthSelectedIn:l})),p){var j=f,S=!g&&!x,k=g&&!x,C=!g&&!!x,T=g&&x;S?j==null||j([h,null],i):k?h===null?j==null||j([null,null],i):$0(h,g)?N?j==null||j([h,g],i):j==null||j([h,null],i):j==null||j([g,h],i):C&&(h&&$0(h,x)?j==null||j([h,x],i):j==null||j([h,null],i)),T&&(j==null||j([h,null],i))}else if(b){var A=f;if(h!==null)if(!(y!=null&&y.length))A==null||A([h],i);else{var E=y.some(function(D){return Ge(D,h)});if(E){var L=y.filter(function(D){return!Ge(D,h)});A==null||A(L,i)}else A==null||A(Qr(Qr([],y,!0),[h],!1),i)}}else f==null||f(h,i);o||((d=(c=n.props).onSelect)===null||d===void 0||d.call(c,h,i),n.setState({inputValue:null}))}
885,n.setPreSelection=function(a){if(!n.props.readOnly){var i=sa(n.props.minDate),o=sa(n.props.maxDate),l=!0;if(a){var c=Rd(a);if(i&&o)l=vo(a,n.props.minDate,n.props.maxDate);else if(i){var d=Rd(n.props.minDate);l=Da(a,d)||Po(c,d)}else if(o){var u=QS(n.props.maxDate);l=Jr(a,u)||Po(c,u)}}l&&n.setState({preSelection:a})}},n.toggleCalendar=function(){n.setOpen(!n.state.open)},n.handleTimeChange=function(a,i){var o,l;if(!n.props.selectsMultiple){var c=n.props,d=c.selectsRange,u=c.startDate,h=c.endDate,m=c.onChange,f=c.timeZone;if(d){var p=m;if(i==="start"){if(u){var g=ya(u,{hour:Es(a),minute:Ms(a)});n.setState({preSelection:g}),f&&(g=ba(g,f)),p==null||p([g,h?f?ba(h,f):h:null],void 0)}}else if(i==="end"){if(h){var x=ya(h,{hour:Es(a),minute:Ms(a)});n.setState({preSelection:x}),f&&(x=ba(x,f)),p==null||p([u?f?ba(u,f):u:null,x],void 0)}}else{var b=u&&!h;if(b){var g=ya(u,{hour:Es(a),minute:Ms(a)});n.setState({preSelection:g}),f&&(g=ba(g,f)),p==null||p([g,null],void 0)}else if(u&&h){var x=ya(h,{hour:Es(a),minute:Ms(a)});n.setState({preSelection:x}),f&&(x=ba(x,f)),p==null||p([f?ba(u,f):u,x],void 0)}else{var y=ya(n.getPreSelection(),{hour:Es(a),minute:Ms(a)});n.setState({preSelection:y})}}}else{var w=n.props.selected?n.props.selected:n.getPreSelection(),y=n.props.selected?a:ya(w,{hour:Es(a),minute:Ms(a)});n.setState({preSelection:y}),y&&f&&(y=ba(y,f)),(l=(o=n.props).onChange)===null||l===void 0||l.call(o,y)}n.props.shouldCloseOnSelect&&!n.props.showTimeInput&&(n.sendFocusBackToInput(),n.setOpen(!1)),n.props.showTimeInput&&n.setOpen(!0),(n.props.showTimeSelectOnly||n.props.showTimeSelect)&&n.setState({isRenderAriaLiveMessage:!0}),n.setState({inputValue:null})}},n.onInputClick=function(){var a,i;!n.props.disabled&&!n.props.readOnly&&n.setOpen(!0),(i=(a=n.props).onInputClick)===null||i===void 0||i.call(a)},n.handleTimeOnlyArrowKey=function(a){var i,o,l,c,d=Ao(n.props.selected)||n.state.preSelection||Ke(),u=(i=n.props.timeIntervals)!==null&&i!==void 0?i:30,h=(o=n.props.dateFormat)!==null&&o!==void 0?o:e.defaultProps.dateFormat,m=Array.isArray(h)?h[0]:h,f=Rd(d),p=Es(d)*60+Ms(d),g=23*60+60-u,x;if(a===ue.ArrowUp){var b=Math.max(0,p-u);x=qu(f,b)}else{var b=Math.min(g,p+u);x=qu(f,b)}var y=ut(x,m||e.defaultProps.dateFormat,n.props.locale);if(n.setState({preSelection:x,inputValue:y}),!(n.props.selectsRange||n.props.selectsMultiple)){var w=n.props.selected?n.props.selected:n.getPreSelection(),N=n.props.selected?x:ya(w,{hour:Es(x),minute:Ms(x)});(c=(l=n.props).onChange)===null||c===void 0||c.call(l,N),(n.props.showTimeSelectOnly||n.props.showTimeSelect)&&n.setState({isRenderAriaLiveMessage:!0}),requestAnimationFrame(function(){n.scrollToTimeOption(x)})}},n.handleTimeOnlyEnterKey=function(a){var i,o,l,c,d=a.target,u=d.value,h=(i=n.props.dateFormat)!==null&&i!==void 0?i:e.defaultProps.dateFormat,m=n.props.timeFormat||"p",f=n.state.preSelection||Ao(n.props.selected)||Ke(),p=fo(u,h,n.props.locale,(o=n.props.strictParsing)!==null&&o!==void 0?o:!1,f),g=f;if(p&&cn(p))g=p;else{var x=((l=n.calendar)===null||l===void 0?void 0:l.containerRef.current)instanceof Element&&n.calendar.containerRef.current.querySelector(".react-datepicker__time-list-item[tabindex='0']");if(x instanceof HTMLElement){var b=(c=x.textContent)===null||c===void 0?void 0:c.trim();if(b){var y=fo(b,m,n.props.locale,!1,f);y&&cn(y)&&(g=y)}}}n.handleTimeChange(g),n.setOpen(!1),n.sendFocusBackToInput()},n.scrollToTimeOption=function(a){var i,o;
885if(!((i=n.calendar)===null||i===void 0)&&i.containerRef.current){for(var l=n.calendar.containerRef.current,c=Array.from(l.querySelectorAll(".react-datepicker__time-list-item")),d=null,u=1/0,h=n.props.timeFormat||"p",m=0,f=c;m<f.length;m++){var p=f[m],g=(o=p.textContent)===null||o===void 0?void 0:o.trim();if(g){var x=fo(g,h,n.props.locale,!1,a);if(x&&cn(x)){if(zP(x,a)){d=p;break}var b=Math.abs(x.getTime()-a.getTime());b<u&&(u=b,d=p)}}}d&&(c.forEach(function(y){y.setAttribute("tabindex","-1")}),d.setAttribute("tabindex","0"),d.scrollIntoView({behavior:"smooth",block:"center"}))}},n.onInputKeyDown=function(a){var i,o,l,c,d,u;(o=(i=n.props).onKeyDown)===null||o===void 0||o.call(i,a);var h=a.key;if(!n.state.open&&!n.props.inline&&!n.props.preventOpenOnFocus){(h===ue.ArrowDown||h===ue.ArrowUp||h===ue.Enter)&&((l=n.onInputClick)===null||l===void 0||l.call(n));return}if(n.state.open&&n.props.showTimeSelectOnly){if(h===ue.ArrowDown||h===ue.ArrowUp){a.preventDefault(),n.handleTimeOnlyArrowKey(h);return}if(h===ue.Enter){a.preventDefault(),n.handleTimeOnlyEnterKey(a);return}}if(n.state.open){if(h===ue.ArrowDown||h===ue.ArrowUp){a.preventDefault();var m=n.props.showTimeSelectOnly?".react-datepicker__time-list-item[tabindex='0']":n.props.showWeekPicker&&n.props.showWeekNumbers?'.react-datepicker__week-number[tabindex="0"]':n.props.showFullMonthYearPicker||n.props.showMonthYearPicker?'.react-datepicker__month-text[tabindex="0"]':'.react-datepicker__day[tabindex="0"]',f=((c=n.calendar)===null||c===void 0?void 0:c.containerRef.current)instanceof Element&&n.calendar.containerRef.current.querySelector(m);f instanceof HTMLElement&&f.focus({preventScroll:!0});return}var p=Ke(n.state.preSelection);h===ue.Enter?(a.preventDefault(),a.target.blur(),n.inputOk()&&n.state.lastPreSelectChange===U0?(n.handleSelect(p,a),!n.props.shouldCloseOnSelect&&n.setPreSelection(p)):n.setOpen(!1)):h===ue.Escape?(a.preventDefault(),a.target.blur(),n.sendFocusBackToInput(),n.setOpen(!1)):h===ue.Tab&&n.setOpen(!1),n.inputOk()||(u=(d=n.props).onInputError)===null||u===void 0||u.call(d,{code:1,msg:V0})}},n.onPortalKeyDown=function(a){var i=a.key;i===ue.Escape&&(a.preventDefault(),n.setState({preventFocus:!0},function(){n.setOpen(!1),setTimeout(function(){n.setFocus(),n.setState({preventFocus:!1})})}))},n.onDayKeyDown=function(a){var i,o,l,c,d,u,h=n.props,m=h.minDate,f=h.maxDate,p=h.disabledKeyboardNavigation,g=h.showWeekPicker,x=h.shouldCloseOnSelect,b=h.locale,y=h.calendarStartDay,w=h.adjustDateOnChange,N=h.inline;if((o=(i=n.props).onKeyDown)===null||o===void 0||o.call(i,a),!p){var j=a.key,S=a.shiftKey,k=Ke(n.state.preSelection),C=function(E,L){var D=L;switch(E){case ue.ArrowRight:D=g?_p(L,1):Tr(L,1);break;case ue.ArrowLeft:D=g?LS(L):gte(L);break;case ue.ArrowUp:D=LS(L);break;case ue.ArrowDown:D=_p(L,1);break;case ue.PageUp:D=S?Ki(L,1):Vo(L,1);break;case ue.PageDown:D=S?Er(L,1):Dr(L,1);break;case ue.Home:D=Fi(L,b,y);break;case ue.End:D=Zse(L);break}return D},T=function(E,L){for(var D=40,P=E,R=!1,$=0,O=C(E,L);!R;){if($>=D){O=L;break}m&&O<m&&(P=ue.ArrowRight,O=Qn(m,n.props)?C(P,O):m),f&&O>f&&(P=ue.ArrowLeft,O=Qn(f,n.props)?C(P,O):f),Qn(O,n.props)?((P===ue.PageUp||P===ue.Home)&&(P=ue.ArrowRight),(P===ue.PageDown||P===ue.End)&&(P=ue.ArrowLeft),O=C(P,O)):R=!0,$++}return O};if(j===ue.Enter){a.preventDefault(),n.handleSelect(k,a),!x&&n.setPreSelection(k);return}else if(j===ue.Escape){a.preventDefault(),n.setOpen(!1),n.inputOk()||(c=(l=n.props).onInputError)===null||c===void 0||c.call(l,{code:1,msg:V0});return}var A=null;switch(j){case ue.ArrowLeft:case ue.ArrowRight:case ue.ArrowUp:case ue.ArrowDown:case ue.PageUp:case ue.PageDown:case ue.Home:case ue.End:A=T(j,k);break}if(!A){(u=(d=n.props).onInputError)===null||u===void 0||u.call(d,{code:1,msg:V0});return}a.preventDefault(),n.setState({lastPreSelectChange:U0}),w&&n.setSelected(A),n.setPreSelection(A),N&&n.setState({shouldFocusDayInline:!0})}},n.onPopperKeyDown=function(a){var i=a.key;i===ue.Escape&&(a.preventDefault(),n.sendFocusBackToInput(),n.setOpen(!1))},n.onClearClick=function(a){a&&a.preventDefault&&a.preventDefault(),n.sendFocusBackToInput();var i=n.props,o=i.selectsRange,l=i.onChange;
885o?l==null||l([null,null],a):l==null||l(null,a),n.setState({inputValue:null})},n.clear=function(){n.onClearClick()},n.onScroll=function(a){typeof n.props.closeOnScroll=="boolean"&&n.props.closeOnScroll?(a.target===document||a.target===document.documentElement||a.target===document.body)&&n.setOpen(!1):typeof n.props.closeOnScroll=="function"&&n.props.closeOnScroll(a)&&n.setOpen(!1)},n.handleMonthSelectedInChange=function(a){n.setState({monthSelectedIn:a})},n.renderCalendar=function(){var a,i;return!n.props.inline&&!n.isCalendarOpen()?null:v.createElement(Ane,Be({showMonthYearDropdown:void 0,ref:function(o){n.calendar=o}},n.props,n.state,{setOpen:n.setOpen,dateFormat:(a=n.props.dateFormatCalendar)!==null&&a!==void 0?a:e.defaultProps.dateFormatCalendar,onSelect:n.handleSelect,onClickOutside:n.handleCalendarClickOutside,holidays:une(n.modifyHolidays()),outsideClickIgnoreClass:n.props.outsideClickIgnoreClass,onDropdownFocus:n.handleDropdownFocus,onTimeChange:n.handleTimeChange,className:n.props.calendarClassName,container:n.props.calendarContainer,handleOnKeyDown:n.props.onKeyDown,handleOnDayKeyDown:n.onDayKeyDown,setPreSelection:n.setPreSelection,dropdownMode:(i=n.props.dropdownMode)!==null&&i!==void 0?i:e.defaultProps.dropdownMode,onMonthSelectedInChange:n.handleMonthSelectedInChange}),n.props.children)},n.renderAriaLiveRegion=function(){var a,i=n.props.locale,o=(a=n.props.dateFormat)!==null&&a!==void 0?a:e.defaultProps.dateFormat,l=n.props.showTimeInput||n.props.showTimeSelect,c=l?"PPPPp":"PPPP",d;return n.props.selectsRange?d="Selected start date: ".concat(ln(n.props.startDate,{dateFormat:c,locale:i}),". ").concat(n.props.endDate?"End date: "+ln(n.props.endDate,{dateFormat:c,locale:i}):""):n.props.showTimeSelectOnly?d="Selected time: ".concat(ln(n.props.selected,{dateFormat:o,locale:i})):n.props.showYearPicker?d="Selected year: ".concat(ln(n.props.selected,{dateFormat:"yyyy",locale:i})):n.props.showMonthYearPicker?d="Selected month: ".concat(ln(n.props.selected,{dateFormat:"MMMM yyyy",locale:i})):n.props.showQuarterYearPicker?d="Selected quarter: ".concat(ln(n.props.selected,{dateFormat:"yyyy, QQQ",locale:i})):d="Selected date: ".concat(ln(n.props.selected,{dateFormat:c,locale:i})),v.createElement("span",{role:"alert","aria-live":"polite",className:"react-datepicker__aria-live"},d)},n.renderDateInput=function(){var a,i,o,l,c,d,u,h=Zt(n.props.className,(a={},a[n.props.outsideClickIgnoreClass||e.defaultProps.outsideClickIgnoreClass]=n.state.open,a)),m=n.props.customInput||v.createElement("input",{type:"text"}),f=n.props.customInputRef||"ref",p={},g=(o=n.props["aria-describedby"])!==null&&o!==void 0?o:n.props.ariaDescribedBy,x=(l=n.props["aria-invalid"])!==null&&l!==void 0?l:n.props.ariaInvalid,b=(c=n.props["aria-label"])!==null&&c!==void 0?c:n.props.ariaLabel,y=(d=n.props["aria-labelledby"])!==null&&d!==void 0?d:n.props.ariaLabelledBy,w=(u=n.props["aria-required"])!==null&&u!==void 0?u:n.props.ariaRequired;return g!=null&&(p["aria-describedby"]=g),x!=null&&(p["aria-invalid"]=x),b!=null&&(p["aria-label"]=b),y!=null&&(p["aria-labelledby"]=y),w!=null&&(p["aria-required"]=w),M.cloneElement(m,Be((i={},i[f]=function(N){n.input=N},i.value=n.getInputValue(),i.onBlur=n.handleBlur,i.onChange=n.handleChange,i.onClick=n.onInputClick,i.onFocus=n.handleFocus,i.onKeyDown=n.onInputKeyDown,i.id=n.props.id,i.name=n.props.name,i.form=n.props.form,i.autoFocus=n.props.autoFocus,i.placeholder=n.props.placeholderText,i.disabled=n.props.disabled,i.autoComplete=n.props.autoComplete,i.className=Zt(m.props.className,h),i.title=n.props.title,i.readOnly=n.props.readOnly,i.required=n.props.required,i.tabIndex=n.props.tabIndex,i),p))},n.renderClearButton=function(){var a=n.props,i=a.isClearable,o=a.disabled,l=a.selected,c=a.startDate,d=a.endDate,u=a.clearButtonTitle,h=a.clearButtonClassName,m=h===void 0?"":h,f=a.ariaLabelClose,p=f===void 0?"Close":f,g=a.selectedDates,x=a.readOnly;return i&&!x&&(l!=null||c!=null||d!=null||g!=null&&g.length)?v.createElement("button",{type:"button",className:Zt("react-datepicker__close-icon",m,{"react-datepicker__close-icon--disabled":o}),disabled:o,"aria-label":p,onClick:n.onClearClick,title:u,tabIndex:-1}):null},n.state=n.calcInitialState(),n.preventFocusTimeout=void 0,n}return Object.defineProperty(e,"defaultProps",{get:function(){return{allowSameDay:!1,dateFormat:"MM/dd/yyyy",dateFormatCalendar:"LLLL yyyy",disabled:!1,disabledKeyboardNavigation:!1,dropdownMode:"scroll",preventOpenOnFocus:!1,monthsShown:1,outsideClickIgnoreClass:VP,readOnly:!1,rangeSeparator:LP,withPortal:!1,selectsDisabledDaysInRange:!1,shouldCloseOnSelect:!0,showTimeSelect:!1,showTimeInput:!1,showPreviousMonths:!1,showMonthYearPicker:!1,showFullMonthYearPicker:!1,showTwoColumnMonthYearPicker:!1,showFourColumnMonthYearPicker:!1,showYearPicker:!1,showQuarterYearPicker:!1,showWeekPicker:!1,strictParsing:!1,swapRange:!1,timeIntervals:30,timeCaption:"Time",previousMonthAriaLabel:"Previous Month",previousMonthButtonLabel:"Previous Month",nextMonthAriaLabel:"Next Month",nextMonthButtonLabel:"Next Month",previousYearAriaLabel:"Previous Year",previousYearButtonLabel:"Previous Year",nextYearAriaLabel:"Next Year",nextYearButtonLabel:"Next Year",timeInputLabel:"Time",enableTabLoop:!0,yearItemNumber:xh,focusSelectedMonth:!1,showPopperArrow:!0,excludeScrollbar:!0,customTimeInput:null,calendarStartDay:void 0,toggleCalendarOnIconClick:!1,usePointerEvent:!1}}
885,enumerable:!1,configurable:!0}),e.prototype.componentDidMount=function(){window.addEventListener("scroll",this.onScroll,!0),document.addEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},e.prototype.componentDidUpdate=function(s,n){var a,i,o,l;this.props.selectsRange&&h_(s.startDate,this.props.startDate)?this.setPreSelection(this.props.startDate):h_(s.selected,this.props.selected)&&this.setPreSelection(this.props.selected),this.state.monthSelectedIn!==void 0&&s.monthsShown!==this.props.monthsShown&&this.setState({monthSelectedIn:0}),this.props.selectsRange&&n.open===!1&&this.state.open===!0&&this.state.monthSelectedIn!==0&&this.setState({monthSelectedIn:0}),s.highlightDates!==this.props.highlightDates&&this.setState({highlightDates:a_(this.props.highlightDates)}),!n.focused&&!Po(s.selected,this.props.selected)&&this.setState({inputValue:null}),n.open!==this.state.open&&(n.open===!1&&this.state.open===!0&&((i=(a=this.props).onCalendarOpen)===null||i===void 0||i.call(a)),n.open===!0&&this.state.open===!1&&((l=(o=this.props).onCalendarClose)===null||l===void 0||l.call(o)))},e.prototype.componentWillUnmount=function(){this.clearPreventFocusTimeout(),window.removeEventListener("scroll",this.onScroll,!0),document.removeEventListener("visibilitychange",this.setHiddenStateOnVisibilityHidden)},e.prototype.renderInputContainer=function(){var s=this.props,n=s.showIcon,a=s.icon,i=s.calendarIconClassname,o=s.calendarIconClassName,l=s.toggleCalendarOnIconClick,c=this.state.open;return i&&console.warn("calendarIconClassname props is deprecated. should use calendarIconClassName props."),v.createElement("div",{className:"react-datepicker__input-container".concat(n?" react-datepicker__view-calendar-icon":"")},n&&v.createElement(Pne,Be({icon:a,className:Zt(o,!o&&i,c&&"react-datepicker-ignore-onclickoutside")},l?{onClick:this.toggleCalendar}:null)),this.state.isRenderAriaLiveMessage&&this.renderAriaLiveRegion(),this.renderDateInput(),this.renderClearButton())},e.prototype.render=function(){var s=this.renderCalendar();if(this.props.inline)return s;if(this.props.withPortal){var n=this.state.open?v.createElement(HP,{enableTabLoop:this.props.enableTabLoop},v.createElement("div",{className:"react-datepicker__portal",tabIndex:-1,onKeyDown:this.onPortalKeyDown},s)):null;return this.state.open&&this.props.portalId&&(n=v.createElement(UP,Be({portalId:this.props.portalId},this.props),n)),v.createElement(v.Fragment,null,this.renderInputContainer(),n)}return v.createElement(Ine,Be({},this.props,{className:this.props.popperClassName,hidePopper:!this.isCalendarOpen(),targetComponent:this.renderInputContainer(),popperComponent:s,popperOnKeyDown:this.onPopperKeyDown,showArrow:this.props.showPopperArrow,monthHeaderPosition:this.props.monthHeaderPosition}))},e}(M.Component),$ne="input",U0="navigate";function Qu({label:t,labelClassName:e="",value:s,onChange:n,required:a,placeholder:i="Click to select date & time..."}){const o=s?new Date(s):null,l=c=>{if(!c){n({target:{value:""}});return}const d=c.getFullYear(),u=String(c.getMonth()+1).padStart(2,"0"),h=String(c.getDate()).padStart(2,"0"),m=String(c.getHours()).padStart(2,"0"),f=String(c.getMinutes()).padStart(2,"0"),p=`${d}-${u}-${h}T${m}:${f}`;n({target:{value:p}})};return r.jsxs("label",{className:"block",children:[t?r.jsxs("div",{className:`acgc-label mb-1 text-sm font-medium text-slate-700 ${e}`,children:[t,a&&r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}):null,r.jsx(Fne,{selected:o,onChange:l,showTimeSelect:!0,timeFormat:"HH:mm",timeIntervals:15,timeCaption:"Time",dateFormat:"MMMM d, yyyy h:mm aa",placeholderText:i,className:"acgc-input w-full h-11 rounded-2xl border px-4 text-slate-900 border-slate-200 focus:border-accent-600 focus:ring-2 focus:ring-accent-500/20 transition cursor-pointer",calendarClassName:"acgc-datepicker",required:a,isClearable:!0,showMonthDropdown:!0,showYearDropdown:!0,dropdownMode:"select",autoComplete:"off"})]})}function zne(){var ha;const{token:t,member:e}=Oe(),{t:s}=en(),n=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",a=v.useMemo(()=>({title:"",category_id:"",content_format:"watch",is_featured:!1,topic:"",series:"",summary:"",body:"",youtube_url:"",file_url:"",thumbnail_url:"",s
885ource_type:"acgc",partner_name:"",tags:"",year:new Date().getFullYear(),published_at:"",access_level:"members_paid"}),[]),[i,o]=v.useState(a),[l,c]=v.useState(!1),[d,u]=v.useState("create"),[h,m]=v.useState(null),[f,p]=v.useState([]),[g,x]=v.useState([]),[b,y]=v.useState(!1),[w,N]=v.useState(!1),[j,S]=v.useState({id:null,name:"",sort_order:0,is_visible:!0}),[k,C]=v.useState(!1),[T,A]=v.useState(!1),[E,L]=v.useState(!1),[D,P]=v.useState(""),[R,$]=v.useState(""),O=v.useRef(null),[_,B]=v.useState(""),[J,Q]=v.useState(""),[ce,fe]=v.useState(""),[X,pe]=v.useState(12),[be,q]=v.useState([]),[le,De]=v.useState(""),[$e,H]=v.useState(null),[he,oe]=v.useState(!1),[F,Z]=v.useState(""),[de,Ve]=v.useState(""),Pe=G=>Se=>o(Ye=>({...Ye,[G]:Se.target.value})),z=G=>{const Se=G.target.value;o(Ye=>({...Ye,source_type:Se,partner_name:Se==="partner"?Ye.partner_name:""}))},ye=v.useCallback(async G=>{const Se=new FormData;Se.append("image",G);const Ye=await U("/api/resources/admin/upload-image",{method:"POST",body:Se,token:t});if(Ye.url)return Ye.url;throw new Error("No URL returned")},[t]),ve=v.useCallback(async G=>{var Ye;const Se=(Ye=G.target.files)==null?void 0:Ye[0];if(Se){if(Se.size>1*1024*1024){P("Thumbnail too large. Maximum size is 1 MB."),O.current&&(O.current.value="");return}try{L(!0),P("");const nn=new FormData;nn.append("image",Se);const rn=await U("/api/resources/admin/upload-image",{method:"POST",body:nn,token:t});o(ma=>({...ma,thumbnail_url:rn.url?rn.url:ma.thumbnail_url}))}catch(nn){P(nn.message||"Failed to upload image")}finally{L(!1),O.current&&(O.current.value="")}}},[t]),ze=async G=>{var nn;const Se=(nn=G.target.files)==null?void 0:nn[0];if(!Se)return;const Ye=new FormData;Ye.append("file",Se);try{const rn=await U("/api/resources/admin/upload",{method:"POST",body:Ye,token:t});rn.file_url&&o(ma=>({...ma,file_url:rn.file_url}))}catch(rn){P(rn.message||"File upload failed")}},Kt=v.useMemo(()=>{const G=_.trim().toLowerCase();return(f||[]).filter(Se=>J&&Se.category!==J||ce&&(Se.content_format||"")!==ce?!1:G?`${Se.title||""} ${Se.summary||""}`.toLowerCase().includes(G):!0)},[f,_,J,ce]),zt=Kt.slice(0,X),sn=v.useCallback(async()=>{A(!0),P("");try{const G=await U("/api/resources/admin",{token:t});p(G.resources)}catch(G){P(G.message||"Failed to load resources")}finally{A(!1)}},[t]),hr=v.useCallback(async()=>{try{const G=await U("/api/resources/admin/surveys",{token:t});q(G.surveys||[])}catch{}},[t]),hs=v.useCallback(async()=>{try{const G=await U("/api/resources/admin/categories",{token:t});x(G.categories||[])}catch(G){P("Failed to load sections/categories: "+(G.message||"Unknown error"))}},[t]);v.useEffect(()=>{n&&(sn(),hr(),hs())},[n,sn,hr,hs]);const io=v.useRef(null),bh=async G=>{if(G.preventDefault(),!le.trim()||!$e){Z("Name and PDF file are required");return}oe(!0),Z(""),Ve("");try{const Se=new FormData;Se.append("file",$e);const Ye=await U("/api/resources/admin/surveys/upload",{token:t,method:"POST",body:Se});if(!Ye.url)throw new Error("Upload failed");await U("/api/resources/admin/surveys",{token:t,method:"POST",body:{name:le.trim(),url:Ye.url}}),Ve("Survey added."),De(""),H(null),io.current&&(io.current.value=""),await hr()}catch(Se){Z(Se.message||"Failed to add survey")}finally{oe(!1)}},yh=async G=>{if(window.confirm("Delete this survey document?")){oe(!0),Z(""),Ve("");try{await U(`/api/resources/admin/surveys/${G}`,{token:t,method:"DELETE"}),Ve("Survey deleted."),await hr()}catch(Se){Z(Se.message||"Failed to delete survey")}finally{oe(!1)}}},oo=()=>{E||c(!1)},vh=()=>{u("create"),m(null),o(a),pe(12),$(""),P(""),hs(),c(!0)},fl=G=>{u("edit"),m(G.id),o({title:G.title||"",category_id:G.category_id||"",content_format:G.content_format||"watch",is_featured:G.is_featured||!1,topic:G.topic||"",series:G.series||"",summary:G.summary||"",body:G.body||"",youtube_url:G.youtube_url||"",file_url:G.file_url||"",thumbnail_url:G.thumbnail_url||"",source_type:G.source_type||"acgc",partner_name:G.partner_name||"",tags:Array.isArray(G.tags)?G.tags.join(", "):"",year:G.year||new Date().getFullYear(),published_at:G.published_at?String(G.published_at).slice(0,16):"",access_level:G.access_level||"members_paid"}),$(""),P(""),c(!0)},pl=async G=>{G.preventDefault();const Se=(i.title||"").trim(),Ye=(i.youtube_url||"").trim(),nn=(i.file_url||"").trim(),rn=(i.partner_name||"").trim(),ma=(i.topic||"").trim(),Ya=(i.published_at||"").trim();if(!Se){P("Title is required.");return}if(!Ye&&!nn&&!(i.body||"").trim()){P("Add a YouTube URL, a File URL, or write some content.");return}if(i.source_type==="partner"&&!rn){P("Partner name is required for partner content.");return}if(!ma){P("Topic tag is required.");return}L(!0),P(""),$("");try{const qc=d==="edit"?`/api/resources/admin/${h}`:"/api/resources/admin";await U(qc,{token:t,method:d==="edit"?"PUT":"POST",body:{...i,category_id:i.category_id&&Number(i.category_id)>0?Number(i.category_id):null,is_featured:!!i.is_featured,type:i.content_format,topic:ma,year:i.year?Number(i.year):null,title:Se,body:i.body||"",youtube_url:Ye,file_url:nn,partner_name:rn,published_at:Ya?
885new Date(Ya).toISOString():void 0,tags:(i.tags||"").trim()}}),$(d==="edit"?"Saved successfully.":"Posted successfully."),await sn(),c(!1)}catch(qc){P(qc.message||"Failed to post")}finally{L(!1)}},Vn=async G=>{if(!(E||!window.confirm(s("portalResourcesManage.confirmDelete")))){L(!0),P(""),$("");try{await U(`/api/resources/admin/${G}`,{token:t,method:"DELETE"}),$("Deleted successfully."),await sn()}catch(Ye){P(Ye.message||"Failed to delete")}finally{L(!1)}}};return n?r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:s("portalResourcesManage.title")}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:s("portalResourcesManage.sub")})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(W,{variant:"portal",onClick:vh,disabled:E,children:s("portalResourcesManage.newCta")}),r.jsx(W,{as:K,to:"/hub/resources",variant:"portal",children:s("portalResourcesManage.backCta")})]})]}),D?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-red-200",children:D})})}):null,R?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-green-200",children:R})})}):null,r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("button",{type:"button",className:"w-full flex items-center justify-between gap-3 text-left",onClick:()=>y(G=>!G),children:[r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-semibold",children:["Manage Resource Categories",r.jsxs("span",{className:"ml-2 text-xs font-normal text-slate-400",children:["(",g.length," categories)"]})]}),r.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:'Click to expand and manage the dropdown options for "New resource"'})]}),b?r.jsx(Vi,{className:"h-4 w-4 text-slate-400 shrink-0"}):r.jsx(ht,{className:"h-4 w-4 text-slate-400 shrink-0"})]}),b&&r.jsxs("div",{className:"mt-4 space-y-3",children:[r.jsxs("div",{className:"flex gap-2 justify-end",children:[r.jsx(W,{variant:"portal",size:"sm",disabled:E,onClick:async()=>{L(!0);try{const G=new Set(g.map(Ye=>Ye.name)),Se=aM.filter(Ye=>!G.has(Ye));if(Se.length===0){alert("All default categories are already present.");return}for(let Ye=0;Ye<Se.length;Ye++)await U("/api/resources/admin/categories",{token:t,method:"POST",body:{name:Se[Ye],sort_order:(Ye+1)*10,is_visible:!0}});await hs()}catch(G){alert(G.message)}finally{L(!1)}},children:"Populate defaults"}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>{S({id:null,name:"",sort_order:0,is_visible:!0}),N(!0)},disabled:E,children:"Add Category"})]}),r.jsxs("div",{className:"grid gap-2",children:[g.map(G=>r.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/5 p-3 flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"text-white font-medium text-sm",children:G.name}),r.jsxs("div",{className:"text-xs text-slate-400",children:["Order: ",G.sort_order]}),!G.is_visible&&r.jsx(Te,{tone:"default",children:"Hidden"})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(W,{variant:"portal",size:"sm",onClick:()=>{S(G),N(!0)},disabled:E,children:"Edit"}),r.jsx(W,{variant:"portal",size:"sm",onClick:async()=>{if(window.confirm("Delete this category?")){L(!0);try{await U(`/api/resources/admin/categories/${G.id}`,{token:t,method:"DELETE"}),await hs()}catch(Se){alert(Se.message)}finally{L(!1)}}},disabled:E,children:"Delete"})]})]},G.id)),g.length===0&&r.jsxs("div",{className:"text-sm text-slate-400",children:["No categories yet. Click ",r.jsx("strong",{className:"text-slate-200",children:"Populate defaults"})," to add all standard categories at once."]})]})]})]})}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold mb-3",children:"Survey Documents"}),r.jsx("p",{className:"text-sm text-slate-300 mb-4",children:"Add survey PDFs here. They appear in the Resources dropdown for all visitors to download."}),F&&r.jsx("div",{className:"text-sm text-red-200 mb-2",children:F}),de&&r.jsx("div",{className:"text-sm text-green-200 mb-2",children:de}),r.jsx("p",{className:"text-xs text-slate-400 mb-2",children:"Name and PDF file are required"}),r.jsxs("form",{onSubmit:bh,className:"flex flex-col sm:flex-row items-end gap-2 mb-4",children:[r.jsx("div",{className:"flex-1",children:r.jsx(Y,{placeholder:"Display name (e.g. 2025 GC Survey)",value:le,onChange:G=>De(G.target.value)})}),r.jsx("div",{className:"flex-1",children:r.jsxs("label",{className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl border border-white/10 bg-white/5 hover:bg-white/10 text-sm text-slate-200 transition cursor-pointer w-full",children:[r.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"h-4 w-4 shrink-0",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),r.jsx("polyline",{points:"17 8 12 3 7 8"}),r.jsx("line",{x1:"12",y1:"3",x2:"12",y2:"15"})]}),r.jsx("span",{className:"truncate",children:$e?$e.name:"Choose PDF file"}),r.jsx("input",{ref:io,type:"file",accept:".pdf,application/pdf",onChange:G=>{var Se;return H(((Se=G.target.files)==null?void 0:Se[0])||null)},className:"hidden"})]})}),r.jsx(W,{variant:"portal",type:"submit",disabled:he,children:he?"Uploadingâ¦":"Add Survey"})]}),be.length===0?r.jsx("div",{className:"text-sm text-slate-400",children:"No survey documents yet."}):r.jsx("div",{className:"grid gap-2",children:be.map(G=>r.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/5 p-3 flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-medium",children:G.name}),r.jsx("a",{href:G.url,target:"_blank",rel:"noreferrer",className:"text-xs text-[#c08a2f] hover:underline truncate block max-w-md",children:G.url})]}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>yh(G.id),disabled:he,children:"Delete"})]},G.id))})]})}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[r.jsx("div",{className:"text-white font-semibold",children:s("portalRe
885sourcesManage.latestTitle")}),r.jsx("div",{className:"text-sm text-slate-200",children:T?s("common.loading"):s("common.itemCount",{count:Kt.length})})]}),r.jsxs("div",{className:"mt-3 grid md:grid-cols-3 gap-3",children:[r.jsx(Y,{label:s("portalResourcesManage.filters.search"),labelClassName:"text-slate-200",value:_,onChange:G=>{B(G.target.value),pe(12)},placeholder:s("portalResourcesManage.filters.searchPlaceholder")}),r.jsxs(Re,{label:s("portalResourcesManage.filters.category"),labelClassName:"text-slate-200",value:J,onChange:G=>{Q(G.target.value),pe(12)},children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:s("portalResourcesManage.filters.all")}),g.map(G=>r.jsx("option",{value:G.name,className:"bg-white text-slate-900",children:G.name},G.id))]}),r.jsxs(Re,{label:"Content format",labelClassName:"text-slate-200",value:ce,onChange:G=>{fe(G.target.value),pe(12)},children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:s("portalResourcesManage.filters.all")}),Lu.map(G=>r.jsx("option",{value:G.value,className:"bg-white text-slate-900",children:G.label},G.value))]})]}),r.jsxs("div",{className:"mt-4 grid gap-2",children:[!T&&Kt.length===0?r.jsx("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-3 text-sm text-slate-200",children:s("common.empty")}):null,zt.map(G=>r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-3 flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-medium",children:G.title}),r.jsxs("div",{className:"text-xs text-slate-200",children:[G.category," · ",G.content_format||G.type,G.series?` · ${G.series}`:"",G.topic?` · ${G.topic}`:""]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{tone:G.access_level==="public"?"accent":"brand",children:G.access_level}),r.jsx(W,{variant:"portal",size:"sm",as:"a",href:G.youtube_url||G.file_url||"#",target:"_blank",rel:"noreferrer",disabled:E||!G.youtube_url&&!G.file_url,children:s("portalResourcesManage.preview")}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>fl(G),disabled:E,children:s("common.edit")}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>Vn(G.id),disabled:E,children:s("common.delete")})]})]},G.id)),!T&&zt.length<Kt.length?r.jsx("div",{className:"pt-2",children:r.jsx(W,{variant:"portal",onClick:()=>pe(G=>G+12),disabled:E,children:s("portalResourcesManage.loadMore")})}):null]})]})}),l?r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:oo,"aria-label":"Close resource modal"}),r.jsx("div",{className:"relative max-w-3xl mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-white/10 bg-brand-900 shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-white font-semibold",children:s(d==="edit"?"portalResourcesManage.modalEditTitle":"portalResourcesManage.modalNewTitle")}),r.jsx(W,{variant:"portal",onClick:oo,disabled:E,children:s("common.close")})]}),r.jsx("div",{className:"p-4",children:r.jsxs("form",{className:"grid gap-4",onSubmit:pl,children:[r.jsx(Y,{label:s("portalRe
885sourcesManage.fields.title"),labelClassName:"text-slate-200",value:i.title,onChange:Pe("title"),required:!0}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsxs(Re,{label:s("portalResourcesManage.fields.category"),labelClassName:"text-slate-200",value:i.category_id||"",onChange:Pe("category_id"),children:[r.jsx("option",{value:"",className:"bg-white text-slate-500",children:g.length===0?"No sections yet â add one above first":"Select Section..."}),g.map(G=>r.jsx("option",{value:G.id,className:"bg-white text-slate-900",children:G.name},G.id))]}),g.length===0&&r.jsx("p",{className:"mt-1 text-xs text-amber-400",children:'No sections exist yet. Close this form and use "Add Section" in the Resource Hub Sections panel to create one first.'})]}),r.jsx(Re,{label:"Content format",labelClassName:"text-slate-200",value:i.content_format,onChange:Pe("content_format"),required:!0,children:Lu.map(G=>r.jsx("option",{value:G.value,className:"bg-white text-slate-900",children:G.label},G.value))})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"checkbox",id:"is_featured",checked:i.is_featured,onChange:G=>o(Se=>({...Se,is_featured:G.target.checked}))}),r.jsx("label",{htmlFor:"is_featured",className:"text-sm text-slate-200 cursor-pointer",children:"Mark as Featured Resource"})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx(Y,{label:"Topic Tag",labelClassName:"text-slate-200",value:i.topic,onChange:Pe("topic"),placeholder:"Select or type a topicâ¦",list:"topic-suggestions",required:!0}),r.jsx("datalist",{id:"topic-suggestions",children:oM.map(G=>r.jsx("option",{value:G},G))})]}),r.jsxs(Re,{label:"Series / Subtype",labelClassName:"text-slate-200",value:i.series,onChange:Pe("series"),children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:"None"}),(iM[(ha=g.find(G=>String(G.id)===String(i.category_id)))==null?void 0:ha.name]||[]).map(G=>r.jsx("option",{value:G,className:"bg-white text-slate-900",children:G},G))]})]}
885),r.jsx(Y,{label:s("portalResourcesManage.fields.summary"),labelClassName:"text-slate-200",value:i.summary,onChange:Pe("summary")}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-200 mb-1",children:"Content / Body"}),r.jsx($x,{value:i.body,onChange:G=>o(Se=>({...Se,body:G})),placeholder:"Write your content here⦠Add text, headings, lists, imagesâ¦",darkMode:!0,onImageUpload:ye,minHeight:"250px"})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:s("portalResourcesManage.fields.youtubeUrl"),labelClassName:"text-slate-200",value:i.youtube_url,onChange:Pe("youtube_url"),placeholder:"https://www.youtube.com/watch?v=..."}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-200 mb-1",children:s("portalResourcesManage.fields.fileUrl")}),r.jsxs("div",{className:"space-y-2",children:[r.jsx("input",{type:"file",accept:".pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx",onChange:ze,className:"w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-white text-sm file:mr-4 file:py-1 file:px-3 file:rounded file:border-0 file:text-xs file:font-medium file:bg-[#c08a2f] file:text-white hover:file:bg-[#a77324]"}),i.file_url&&r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Y,{labelClassName:"text-slate-200",value:i.file_url,onChange:Pe("file_url"),placeholder:"Or enter URL manually",className:"text-xs"}),r.jsx("button",{type:"button",onClick:()=>o(G=>({...G,file_url:""})),className:"px-2 py-1 text-xs bg-red-500/20 text-red-300 rounded hover:bg-red-500/30",children:"Clear"})]})]})]})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-200",children:["Thumbnail Image ",r.jsx("span",{className:"text-xs text-slate-400",children:"(max 1 MB)"})]}),i.thumbnail_url&&r.jsxs("div",{className:"relative w-full h-24 rounded-lg overflow-hidden border border-white/10",children:[r.jsx("img",{src:i.thumbnail_url,alt:"Thumbnail",className:"w-full h-full object-cover"}),r.jsx("button",{type:"button",onClick:()=>o(G=>({...G,thumbnail_url:""})),className:"absolute top-1 right-1 bg-black/60 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",children:"Ã"})]}),r.jsx("input",{ref:O,type:"file",accept:"image/*",className:"hidden",onChange:ve}),r.jsx(W,{variant:"portal",type:"button",onClick:()=>{var G;return(G=O.current)==null?void 0:G.click()},disabled:E,children:i.thumbnail_url?"Change image":"Upload image"})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsxs(Re,{label:s("portalRe
885sourcesManage.fields.contentOwner"),labelClassName:"text-slate-200",value:i.source_type,onChange:z,required:!0,children:[r.jsx("option",{value:"acgc",className:"bg-white text-slate-900",children:"ACGC"}),r.jsx("option",{value:"partner",className:"bg-white text-slate-900",children:"Partner/Sponsor"})]}),i.source_type==="partner"?r.jsx(Y,{label:s("portalResourcesManage.fields.partnerName"),labelClassName:"text-slate-200",value:i.partner_name,onChange:Pe("partner_name"),required:!0}):r.jsx("div",{})]}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsx(Y,{label:s("portalResourcesManage.fields.tags"),labelClassName:"text-slate-200",value:i.tags,onChange:Pe("tags")}),r.jsx(Y,{label:s("portalResourcesManage.fields.year"),labelClassName:"text-slate-200",type:"number",value:i.year,onChange:Pe("year")}),r.jsxs(Re,{label:s("portalResourcesManage.fields.access"),labelClassName:"text-slate-200",value:i.access_level,onChange:Pe("access_level"),required:!0,children:[r.jsx("option",{value:"members_paid",className:"bg-white text-slate-900",children:s("portalResourcesManage.access.paidMembers")}),r.jsx("option",{value:"public",className:"bg-white text-slate-900",children:s("portalResourcesManage.access.public")})]})]}),r.jsx("div",{className:"acgc-datepicker-dark",children:r.jsx(Qu,{label:s("portalRe
885sourcesManage.fields.publishedAt"),labelClassName:"text-slate-200",value:i.published_at,onChange:Pe("published_at"),placeholder:"Click to pick publish date & time..."})}),D?r.jsx("div",{className:"text-sm text-red-200",children:D}):null,R?r.jsx("div",{className:"text-sm text-green-200",children:R}):null,r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r.jsx(W,{variant:"portal",type:"button",onClick:oo,disabled:E,children:s("common.cancel")}),r.jsx(W,{variant:"portal",type:"submit",disabled:E,children:s(E?"common.saving":d==="edit"?"common.save":"common.post")})]})]})})]})})]}):null,w&&r.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/60",children:r.jsxs("div",{className:"bg-brand-900 border border-white/10 p-5 rounded-2xl w-full max-w-md",children:[r.jsx("h3",{className:"text-white font-semibold mb-4",children:j.id?"Edit Category":"New Category"}),r.jsxs("div",{className:"grid gap-4 mb-5",children:[r.jsx(Y,{label:"Section Name",value:j.name,onChange:G=>S(Se=>({...Se,name:G.target.value})),required:!0}),r.jsx(Y,{label:"Sort Order",type:"number",value:j.sort_order,onChange:G=>S(Se=>({...Se,sort_order:Number(G.target.value)}))}),r.jsxs("label",{className:"flex items-center gap-2 text-slate-200 text-sm cursor-pointer",children:[r.jsx("input",{type:"checkbox",checked:j.is_visible,onChange:G=>S(Se=>({...Se,is_visible:G.target.checked}))}),"Visible to members"]})]}),r.jsxs("div",{className:"flex justify-end gap-2",children:[r.jsx(W,{variant:"portal",onClick:()=>N(!1),disabled:k,children:"Cancel"}),r.jsx(W,{variant:"portal",onClick:async()=>{if(!j.name.trim())return alert("Name required");C(!0);try{j.id?await U(`/api/resources/admin/categories/${j.id}`,{token:t,method:"PUT",body:j}):await U("/api/resources/admin/categories",{token:t,method:"POST",body:j}),N(!1),await hs()}catch(G){alert(G.message)}finally{C(!1)}},disabled:k,children:"Save Section"})]})]})})]}):r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold",children:s("portalResourcesManage.notAllowedTitle")}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:s("portalResourcesManage.notAllowedSub")})]})})}function Bne(t){return t?t.startsWith("data:")||t.startsWith("http://")||t.startsWith("https://")?t:tt(t):null}function Vne(t){return t?/<(?:p|div|h[1-6]|ul|ol|li|br|blockquote|table|img)[\s>/]/i.test(t)?t:t.split(/\n\s*\n/).filter(e=>e.trim()).map(e=>`<p>${e.replace(/\n/g,"<br>")}</p>`).join(` 886`):""}const Une=["Webinar","Conference","Training","Workshop","Roundtable","Networking","Other"];function Hne(){const{token:t,member:e}=Oe(),{t:s}=en(),[n,a]=v.useState(""),[i,o]=v.useState(""),[l,c]=v.useState([]),[d,u]=v.useState(!1),[h,m]=v.useState(""),f=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",p=f||(e==null?void 0:e.payment_status)==="paid";v.useEffect(()=>{(async()=>{u(!0),m("");try{const b=await U("/api/events/members",{token:t});c(b.events||[])}catch(b){m(b.message||"Failed to load events")}finally{u(!1)}})()},[t]);const g=v.useMemo(()=>{const x=n.trim().toLowerCase();return(l||[]).filter(b=>i&&(b.type||"")!==i?!1:x?`${b.title||""} ${b.summary||""} ${b.location||""}`.toLowerCase().includes(x):!0)},[l,n,i]);return r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:s("portalEvents.title")}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:s("portalEvents.sub")})]}),f?r.jsx(W,{as:K,to:"/hub/events/manage",variant:"portal",children:s("portalEvents.manageCta")}):null]}),r.jsx(ne,{children:r.jsxs(re,{children:[p?null:r.jsx("div",{className:"mb-4 rounded-2xl border border-white/10 bg-black/20 p-4",children:r.jsxs("div",{className:"flex items-start gap-3",children:[r.jsx("div",{className:"h-10 w-10 rounded-2xl bg-red-500/10 border border-red-500/20 grid place-items-center",children:r.jsx(Ru,{className:"h-5 w-5 text-red-200"})}),r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-50 font-semibold",children:s("portalEvents.paidTitle")}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:s("portalEvents.paidSub")}),r.jsx("div",{className:"mt-3",children:r.jsx(W,{as:K,to:"/billing",variant:"primary",children:s("portalEvents.goToBilling")})})]})]})}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:s("portalEvents.searchLabel"),value:n,onChange:x=>a(x.target.value),placeholder:s("portalEvents.searchPlaceholder")}),r.jsxs(Re,{label:s("portalEvents.typeLabel"),value:i,onChange:x=>o(x.target.value),children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:s("portalEvents.all")}),Une.map(x=>r.jsx("option",{value:x,className:"bg-white text-slate-900",children:x},x))]})]}),h?r.jsx("div",{className:"mt-3 text-sm text-red-200",children:h}):null,r.jsx("div",{className:"mt-3 text-sm text-slate-300",children:d?s("common.loading"):s("common.itemCount",{count:g.length})})]})}),r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4",children:g.map((x,b)=>r.jsx(V.div,{initial:{opacity:0,y:8}
886,animate:{opacity:1,y:0},transition:{delay:b*.02},children:r.jsx(Wne,{ev:x})},x.id))})]})}function Wne({ev:t}){const{t:e}=en(),[s,n]=v.useState(!1),a=t.start_at?cr(t.start_at):null,i=a?a.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"}):"â",o=t.start_at?oa(t.start_at):"â",c=(t.end_at?cr(t.end_at):null)&&t.end_at?oa(t.end_at,{includeTimeZoneName:!1}):null,d=Bne(t.banner_url||t.header_url||t.thumbnail_url),u=t.full_description||t.short_description||t.registration_url||t.replay_url||t.materials_url;return r.jsxs(ne,{className:"h-full overflow-hidden",children:[d&&r.jsxs("div",{className:"relative h-40 bg-slate-800 overflow-hidden",children:[r.jsx("img",{src:d,alt:t.title,className:"w-full h-full object-cover opacity-90"}),r.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"}),r.jsx("div",{className:"absolute top-2.5 left-2.5 flex items-center gap-1.5",children:r.jsx(Te,{tone:t.featured?"accent":"brand",children:t.type||e("portalEvents.unknownType")})}),r.jsx("div",{className:"absolute bottom-2.5 left-2.5 text-white font-bold text-sm drop-shadow",children:i})]}),r.jsxs(re,{children:[!d&&r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx(Te,{tone:t.featured?"accent":"brand",children:t.type||e("portalEvents.unknownType")}),r.jsx(Te,{tone:t.access_level==="members_paid"?"brand":"default",children:t.access_level==="members_paid"?e("portalEvents.badges.paid"):e("portalEvents.badges.public")})]}),r.jsx("div",{className:`${d?"":"mt-3"} text-white font-bold text-lg leading-snug`,children:t.title}),t.summary?r.jsx("div",{className:"mt-2 text-sm text-slate-100",children:t.summary}):null,r.jsxs("div",{className:"mt-4 text-sm text-slate-100 space-y-1.5",children:[r.jsxs("div",{className:"flex items-center gap-1.5 font-medium",children:[r.jsx(cl,{className:"h-3.5 w-3.5 text-slate-300"}),o,c?` â ${c}`:""]}),!d&&r.jsx("div",{className:"font-medium",children:i}),t.location&&r.jsxs("div",{className:"flex items-center gap-1.5 font-medium",children:[r.jsx(kt,{className:"h-3.5 w-3.5 text-slate-300"}),t.location]}),t.is_virtual&&r.jsxs("div",{className:"flex items-center gap-1.5 font-medium",children:[r.jsx(pt,{className:"h-3.5 w-3.5 text-slate-300"}),"Virtual Event"]})]}),u&&r.jsxs("button",{onClick:()=>n(!s),className:"mt-3 inline-flex items-center gap-1 text-xs text-[#c08a2f] hover:text-[#dcb26a] font-medium transition",children:[s?"Less details":"More details",s?r.jsx(Vi,{className:"h-3 w-3"}):r.jsx(ht,{className:"h-3 w-3"})]}),s&&r.jsxs("div",{className:"mt-3 space-y-3 border-t border-white/10 pt-3",children:[(t.full_description||t.short_description)&&r.jsx("div",{className:"text-sm text-slate-200 leading-relaxed whitespace-pre-line",dangerouslySetInnerHTML:{__html:Vne(t.full_description||t.short_description)}}),t.registration_url&&r.jsxs("a",{href:t.registration_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-[#c08a2f] hover:text-[#dcb26a] font-medium",children:[r.jsx(ur,{className:"h-3 w-3"})," Registration Link"]}),t.replay_url&&r.jsxs("a",{href:t.replay_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-[#c08a2f] hover:text-[#dcb26a] font-medium",children:[r.jsx(wn,{className:"h-3 w-3"})," Watch Replay"]}),t.materials_url&&r.jsxs("a",{href:t.materials_url,target:"_blank",rel:"noreferrer",className:"inline-flex items-center gap-1.5 text-xs text-[#c08a2f] hover:text-[#dcb26a] font-medium",children:[r.jsx(es,{className:"h-3 w-3"})," Event Materials"]})]}),!s&&t.registration_url?r.jsx("div",{className:"mt-4",children:r.jsx(W,{variant:"portal",size:"sm",as:"a",href:t.registration_url,target:"_blank",rel:"noreferrer",children:e("portalEvents.registerCta")})}):null]})]})}const H0=["Webinar","Conference","Training","Workshop","Roundtable","Networking","Other"],Gne={WAT:"+01:00",EAT:"+03:00",SAST:"+02:00",CAT:"+02:00",GMT:"+00:00",UTC:"+00:00"};function m_(t,e){if(!t)return null;const s=Gne[e]||"+00:00",n=new Date(`${t}:00${s}`);return isNaN(n.getTime())?null:n.toISOString()}function f_(t,e){if(!t)return"";const n={WAT:1,EAT:3,SAST:2,CAT:2,GMT:0,UTC:0}
886[e]||0,a=new Date(t);if(isNaN(a.getTime()))return"";const i=new Date(a.getTime()+n*60*60*1e3),o=l=>String(l).padStart(2,"0");return`${i.getUTCFullYear()}-${o(i.getUTCMonth()+1)}-${o(i.getUTCDate())}T${o(i.getUTCHours())}:${o(i.getUTCMinutes())}`}function p_(t){if(t==null||t==="")return"";const e=Number(t);return Number.isNaN(e)?"":(e/100).toFixed(2)}function x_(t){if(t==null||t==="")return 0;const e=Number(t);return Number.isNaN(e)?0:Math.round(e*100)}function Yne(){const{token:t,member:e}=Oe(),{t:s}=en(),n=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",a=v.useMemo(()=>({title:"",type:H0[0],summary:"",short_description:"",full_description:"",start_at:"",end_at:"",timezone:"",location:"",is_virtual:!1,event_format:"onsite",capacity:"",event_type:"free",ticket_price_cents:"",allow_guest_tickets:!1,guest_ticket_price_cents:"",registration_url:"",access_level:"public",featured:"0",thumbnail_url:"",banner_url:"",header_url:"",registration_form:[],status:"published",member_price:"",non_member_price:"",currency:"USD",replay_url:"",materials_url:"",webinar_url:"",group_discount_enabled:!1,group_discount_min_size:"5",group_discount_percent:"10",group_discount_requires_code:!1,group_discount_code:""}),[]),[i,o]=v.useState([]),[l,c]=v.useState(!1),[d,u]=v.useState(!1),[h,m]=v.useState(""),[f,p]=v.useState(""),[g,x]=v.useState(!1),[b,y]=v.useState("create"),[w,N]=v.useState(null),[j,S]=v.useState(a),k=v.useRef(null),C=v.useRef(null),T=v.useRef(null),[A,E]=v.useState(!1),[L,D]=v.useState(null),[P,R]=v.useState([]),[$,O]=v.useState(!1),[_,B]=v.useState(!1),[J,Q]=v.useState(null),[ce,fe]=v.useState(""),X=z=>ye=>S(ve=>({...ve,[z]:ye.target.value})),pe={thumbnail_url:1*1024*1024,banner_url:5*1024*1024,header_url:5*1024*1024},be={thumbnail_url:"1 MB",banner_url:"5 MB",header_url:"5 MB"},q=v.useCallback(async(z,ye)=>{if(!ye)return;const ve=pe[z]||5*1024*1024;if(ye.size>ve)throw new Error(`File too large. Maximum size is ${be[z]||"5 MB"}.`);const ze=new FormData;ze.append("image",ye);const Kt=await U("/api/events/admin/upload",{method:"POST",body:ze,token:t});if(!Kt.image_url)throw new Error("No image URL returned");S(zt=>({...zt,[z]:Kt.image_url}))},[t]),le=v.useCallback((z,ye)=>async ve=>{var Kt;const ze=(Kt=ve.target.files)==null?void 0:Kt[0];if(ze)try{u(!0),m(""),await q(z,ze)}catch(zt){m(zt.message||"Failed to upload image")}finally{u(!1),ye.current&&(ye.current.value="")}},[q]),De=v.useCallback(async()=>{c(!0),m("");try{const z=await U("/api/events/admin",{token:t});o(z.events||[])}catch(z){m(z.message||"Failed to load events")}finally{c(!1)}},[t]);v.useEffect(()=>{n&&De()},[n,De]);const $e=()=>{d||x(!1)},H=()=>{y("create"),N(null),S(a),p(""),m(""),x(!0)},he=z=>{y("edit"),N(z.id),S({title:z.title||"",type:z.type||H0[0],summary:z.summary||"",short_description:z.short_description||"",full_description:z.full_description||"",timezone:z.timezone||"",start_at:f_(z.
886start_at,z.timezone),end_at:f_(z.end_at,z.timezone),location:z.location||"",is_virtual:z.is_virtual||!1,event_format:z.is_virtual?"online":"onsite",capacity:z.capacity||"",event_type:z.event_type||"free",ticket_price_cents:p_(z.ticket_price_cents),allow_guest_tickets:z.allow_guest_tickets||!1,guest_ticket_price_cents:p_(z.guest_ticket_price_cents),registration_url:z.registration_url||"",access_level:z.access_level||"public",featured:z.featured?"1":"0",thumbnail_url:z.thumbnail_url||"",banner_url:z.banner_url||"",header_url:z.header_url||"",registration_form:z.registration_form||[],status:z.status||"published",member_price:z.member_price!=null?String(z.member_price):"",non_member_price:z.non_member_price!=null?String(z.non_member_price):"",currency:z.currency||"USD",replay_url:z.replay_url||"",materials_url:z.materials_url||"",webinar_url:z.webinar_url||"",group_discount_enabled:!!z.group_discount_enabled,group_discount_min_size:z.group_discount_min_size!=null?String(z.group_discount_min_size):"5",group_discount_percent:z.group_discount_percent!=null?String(z.group_discount_percent):"10",group_discount_requires_code:!!z.group_discount_requires_code,group_discount_code:z.group_discount_code||""}),p(""),m(""),x(!0)},oe=async z=>{z.preventDefault();const ye=(j.title||"").trim(),ve=(j.type||"").trim(),ze=(j.start_at||"").trim();if(!ye||!ve||!ze){m(s("portalEventsManage.errors.missingRequired"));return}if((j.status||"published").trim()==="published"&&!(j.timezone||"").trim()){m(s("portalEventsManage.errors.timezoneRequiredPublished"));return}u(!0),m(""),p("");try{const zt=b==="edit"?`/api/events/admin/${w}`:"/api/events/admin";await U(zt,{token:t,method:b==="edit"?"PUT":"POST",body:{...j,title:ye,type:ve,start_at:m_(ze,j.timezone),end_at:j.end_at?m_(j.end_at,j.timezone):null,featured:j.featured==="1"?1:0,thumbnail_url:(j.thumbnail_url||"").trim()||null,banner_url:(j.banner_url||"").trim()||null,header_url:(j.header_url||"").trim()||null,is_virtual:j.event_format==="online"||j.event_format==="hybrid",capacity:j.capacity?Number(j.capacity):null,event_type:j.event_type||"free",ticket_price_cents:x_(j.ticket_price_cents),allow_guest_tickets:!!j.allow_guest_tickets,guest_ticket_price_cents:j.guest_ticket_price_cents?x_(j.guest_ticket_price_cents):null,registration_form:j.registration_form||[],status:j.status||"published",member_price:j.member_price!==""?Number(j.member_price):null,non_member_price:j.non_member_price!==""?Number(j.non_member_price):null,currency:j.currency||"USD",replay_url:(j.replay_url||"").trim()||null,materials_url:(j.materials_url||"").trim()||null,webinar_url:(j.webinar_url||"").trim()||null,group_discount_enabled:!!j.group_discount_enabled,group_discount_min_size:j.group_discount_min_size?Number(j.group_discount_min_size):5,group_discount_percent:j.group_discount_percent?Number(j.group_discount_percent):10,group_discount_requires_code:!!j.group_discount_requires_code,group_discount_code:(j.group_discount_code||"").trim()||null}}),p(s(b==="edit"?"portalEventsManage.ok.saved":"portalEventsManage.ok.posted")),await De(),x(!1)}catch(zt){const sn=zt.message||"";m(sn==="timezone_required_for_published"?s("portalEventsManage.errors.timezoneRequiredPublished"):sn||s("portalEventsManage.errors.failed"))}finally{u(!1)}},F=async z=>{if(!(d||!window.confirm(s("portalEventsManage.confirmDelete")))){u(!0),m(""),p("");try{await U(`/api/events/admin/${z}`,{token:t,method:"DELETE"}),p(s("portalEventsManage.ok.deleted")),await De()}catch(ve){m(ve.message||s("portalEventsManage.errors.failed"))}finally{u(!1)}}},Z=async z=>{D(z),E(!0),O(!0);try{const ye=await U(`/api/events/admin/${z.id}/registrations`,{token:t});R(ye.registrations||[])}catch{R([])}finally{O(!1)}},de=async z=>{if(!(_||!window.confirm(`Resend the registration / join-link email to ALL confirmed registrants for "${L==null?void 0:L.title}"? This may take a moment.`))){B(!0),fe("");try{const ve=await U(`/api/events/admin/${z}/resend-link`,{method:"POST",token:t,body:{}});fe(`Sent to ${ve.sent} of ${ve.total}${ve.failed?` â ${ve.failed} failed (see server logs)`:""}.`)}catch(ve){fe(`Failed: ${ve.message||"unknown error"}`)}finally{B(!1)}}},Ve=async(z,ye)=>{if(!J){Q(ye),fe("");try{const ve=await U(`/api/events/admin/${z}/resend-link/${ye}`,{method:"POST",token:t,body:{}});fe(`Sent to ${ve.sent_to}.`)}catch(ve){fe(`Failed: ${ve.message||"unknown error"}`)}finally{Q(null)}}},Pe=async z=>{try{const ye=await fetch(tt(`/api/events/admin/${z}/registrations/export`),{headers:{Authorization:`Bearer ${t}`}});if(!ye.ok)throw new Error("Failed to export");const ve=await ye.text(),ze=new Blob([ve],{type:"text/csv"}),Kt=URL.createObjectURL(ze),zt=document.createElement("a");zt.href=Kt,zt.download=`event-${z}-registrations.csv`,document.body.appendChild(zt),zt.click(),document.body.removeChild(zt),URL.revokeObjectURL(Kt)}catch(ye){m(ye.message||"Failed to export CSV")}};return n?r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:s("portalEventsManage.title")}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:s("portalEventsManage.sub")})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(W,{variant:"portal",onClick:H,disabled:d,children:s("portalEventsManage.newCta")}),r.jsx(W,{as:K,to:"/hub/events",variant:"portal",children:s("portalEventsManage.backCta")})]})]}),h?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-red-200",children:h})})}):null,f?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-green-200",children:f})})}):null,r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[r.jsx("div",{className:"text-white font-semibold",children:s("portalEventsManage.latestTitle")}),r.jsx("div",{className:"text-sm text-slate-200",children:l?s("common.loading"):s("common.itemCount",{count:i.length})})]}),r.jsxs("div",{className:"mt-4 grid gap-2",children:[!l&&i.length===0?r.jsx("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-3 text-sm text-slate-200",children:s("common.empty")}):null,i.map(z=>r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-3 flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-medium",children:z.title}),r.jsxs("div",{className:"text-xs text-slate-300 flex items-center gap-2 mt-0.5",children:[r.jsx("span",{children:z.type}),r.jsx("span",{children:"·"}),r.jsx("span",{children:z.start_at?new Date(z.start_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"â"}),z.registered_count>0&&r.jsxs(r.Fragment,{children:[r.jsx("span",{children:"·"}),r.jsxs("span",{children:[z.registered_count," registered"]})]})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Te,{tone:z.featured?"accent":"default",children:z.featured?s("portalEventsManage.badges.featured"):s("portalEventsManage.badges.standard")}),r.jsx(Te,{tone:z.access_level==="members_paid"?"brand":"default",children:z.access_level==="members_paid"?s("portalEventsManage.badges.paid"):s("portalEventsManage.badges.public")}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>Z(z),children:"Registrations"}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>he(z),disabled:d,children:s("common.edit")}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>
886F(z.id),disabled:d,children:s("common.delete")})]})]},z.id))]})]})}),g?r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:$e,"aria-label":"Close event modal"}),r.jsx("div",{className:"relative max-w-3xl mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-white/10 bg-brand-900 shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-white font-semibold",children:s(b==="edit"?"portalEventsManage.modalEditTitle":"portalEventsManage.modalNewTitle")}),r.jsx(W,{variant:"portal",onClick:$e,disabled:d,children:s("common.close")})]}),r.jsx("div",{className:"p-4",children:r.jsxs("form",{className:"grid gap-4",onSubmit:oe,children:[r.jsx(Y,{label:s("portalEventsManage.fields.title"),labelClassName:"text-slate-200",value:j.title,onChange:X("title"),required:!0}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Re,{label:s("portalEventsManage.fields.type"),labelClassName:"text-slate-200",value:j.type,onChange:X("type"),required:!0,children:H0.map(z=>r.jsx("option",{value:z,className:"bg-white text-slate-900",children:z},z))}),r.jsxs(Re,{label:s("portalEventsManage.fields.access"),labelClassName:"text-slate-200",value:j.access_level,onChange:X("access_level"),required:!0,children:[r.jsx("option",{value:"public",className:"bg-white text-slate-900",children:s("portalEventsManage.access.public")}),r.jsx("option",{value:"members_paid",className:"bg-white text-slate-900",children:s("portalEventsManage.access.paidMembers")})]})]}),r.jsx(Y,{label:s("portalEventsManage.fields.summary"),labelClassName:"text-slate-200",value:j.summary,onChange:X("summary")}),r.jsx(Y,{label:"Short Description",labelClassName:"text-slate-200",value:j.short_description,onChange:X("short_description"),placeholder:"Brief description for event listing"}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-200 mb-1",children:"Full Description"}),r.jsx($x,{value:j.full_description,onChange:z=>S(ye=>({...ye,full_description:z})),placeholder:"Detailed event description with rich text formatting...",className:"border-slate-600",darkMode:!0,onImageUpload:async z=>{const ye=new FormData;ye.append("image",z);const ve=await U("/api/events/admin/upload",{method:"POST",body:ye,token:t});if(!ve.image_url)throw new Error("Upload failed");return ve.image_url},onFileUpload:async z=>{const ye=new FormData;ye.append("file",z);const ve=await U("/api/events/admin/upload-doc",{method:"POST",body:ye,token:t});if(!ve.file_url)throw new Error("Upload failed");return{file_url:ve.file_url,file_name:ve.file_name}}})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4 acgc-datepicker-dark",children:[r.jsx(Qu,{label:s("portalEventsManage.fields.startAt"),labelClassName:"text-slate-200",value:j.start_at,onChange:X("start_at"),required:!0,placeholder:"Click to pick start date & time..."}),r.jsx(Qu,{label:s("portalEventsManage.fields.endAt"),labelClassName:"text-slate-200",value:j.end_at,onChange:X("end_at"),placeholder:"Click to pick end date & time..."})]}),r.jsxs(Re,{label:s("portalEventsManage.fields.timezone"),labelClassName:"text-slate-200",value:j.timezone,onChange:X("timezone"),required:j.status==="published",children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:j.status==="published"?s("portalEventsManage.timezone.placeholderPublished"):s("portalEventsManage.timezone.placeholderDraft")}),r.jsx("option",{value:"WAT",className:"bg-white text-slate-900",children:"WAT â West Africa Time (UTC+1)"}),r.jsx("option",{value:"EAT",className:"bg-white text-slate-900",children:"EAT â East Africa Time (UTC+3)"}),r.jsx("option",{value:"SAST",className:"bg-white text-slate-900",children:"SAST â South Africa Standard Time (UTC+2)"}),r.jsx("option",{value:"CAT",className:"bg-white text-slate-900",children:"CAT â Central Africa Time (UTC+2)"}),r.jsx("option",{value:"GMT",className:"bg-white text-slate-900",children:"GMT â Greenwich Mean Time (UTC+0)"}),r.jsx("option",{value:"UTC",className:"bg-white text-slate-900",children:"UTC â Coordinated Universal Time"})]}),j.status==="published"?r.jsx("p",{className:"text-xs text-slate-400 -mt-2",children:s("portalEventsManage.timezone.hintPublished")}):null,r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsxs(Re,{label:"Event Format",labelClassName:"text-slate-200",value:j.event_format,onChange:z=>S(ye=>({...ye,event_format:z.target.value,is_virtual:z.target.value==="online"||z.target.value==="hybrid"})),children:[r.jsx("option",{value:"onsite",className:"bg-white text-slate-900",children:"Onsite (In-Person)"}),r.jsx("option",{value:"online",className:"bg-white text-slate-900",children:"Online (Virtual)"}),r.jsx("option",{value:"hybrid",className:"bg-white text-slate-900",children:"Hybrid (Online + Onsite)"})]}),r.jsx(Y,{label:"Capacity",labelClassName:"text-slate-200",type:"number",value:j.capacity,onChange:X("capacity"),placeholder:"Leave empty for unlimited"}),r.jsxs(Re,{label:"Event Type",labelClassName:"text-slate-200",value:j.event_type,onCh
886ange:X("event_type"),children:[r.jsx("option",{value:"free",className:"bg-white text-slate-900",children:"Free Event"}),r.jsx("option",{value:"paid",className:"bg-white text-slate-900",children:"Paid Event"})]})]}),(j.event_format==="onsite"||j.event_format==="hybrid")&&r.jsx(Y,{label:"Venue / Physical Address",labelClassName:"text-slate-200",value:j.location,onChange:X("location"),placeholder:"e.g. Lagos Business School, Victoria Island, Lagos"}),(j.event_format==="online"||j.event_format==="hybrid")&&r.jsx(Y,{label:"Webinar / Meeting Link",labelClassName:"text-slate-200",value:j.webinar_url,onChange:X("webinar_url"),placeholder:"https://zoom.us/j/... or https://teams.microsoft.com/..."}),j.event_type==="paid"&&r.jsxs(r.Fragment,{children:[r.jsx(Y,{label:"Member Ticket Price",labelClassName:"text-slate-200",type:"number",step:"0.01",min:"0",value:j.ticket_price_cents,onChange:X("ticket_price_cents"),placeholder:"e.g. 50.00"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"checkbox",checked:j.allow_guest_tickets||!1,onChange:z=>S(ye=>({...ye,allow_guest_tickets:z.target.checked})),className:"rounded border-slate-600 bg-slate-800 text-[#c08a2f]"}),r.jsx("label",{className:"text-sm font-medium text-slate-200",children:"Allow Guest Tickets"})]}),j.allow_guest_tickets&&r.jsx(Y,{label:"Guest Ticket Price",labelClassName:"text-slate-200",type:"number",step:"0.01",min:"0",value:j.guest_ticket_price_cents||"",onChange:z=>S(ye=>({...ye,guest_ticket_price_cents:z.target.value})),placeholder:"e.g. 75.00"})]}),r.jsx("div",{className:"grid md:grid-cols-3 gap-4",children:r.jsxs(Re,{label:"Status",labelClassName:"text-slate-200",value:j.status,onChange:X("status"),children:[r.jsx("option",{value:"draft",className:"bg-white text-slate-900",children:"Draft"}),r.jsx("option",{value:"published",className:"bg-white text-slate-900",children:"Published"}),r.jsx("option",{value:"cancelled",className:"bg-white text-slate-900",children:"Cancelled"})]})}),r.jsx(Y,{label:s("portalEventsManage.fields.registrationUrl"),labelClassName:"text-slate-200",value:j.registration_url,onChange:X("registration_url"),placeholder:"https://..."}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-200",children:["Thumbnail Image ",r.jsx("span",{className:"text-xs text-slate-400",children:"(max 1 MB)"})]}),j.thumbnail_url&&r.jsxs("div",{className:"relative w-full h-24 rounded-lg overflow-hidden border border-white/10",children:[r.jsx("img",{src:j.thumbnail_url,alt:"Thumbnail",className:"w-full h-full object-cover",onError:z=>{z.currentTarget.style.display="none"}}),r.jsx("button",{type:"button",onClick:()=>S(z=>({...z,thumbnail_url:""})),className:"absolute top-1 right-1 bg-black/60 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",children:"Ã"})]}),r.jsx("input",{ref:k,type:"file",accept:"image/*",className:"hidden",onChange:le("thumbnail_url",k)}),r.jsx(W,{variant:"portal",type:"button",onClick:()=>{var z;return(z=k.current)==null?void 0:z.click()},disabled:d,children:j.thumbnail_url?"Change image":"Upload image"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-200",children:["Banner Image ",r.jsx("span",{className:"text-xs text-slate-400",children:"(max 5 MB)"})]}),j.banner_url&&r.jsxs("div",{className:"relative w-full h-24 rounded-lg overflow-hidden border border-white/10",children:[r.jsx("img",{src:j.banner_url,alt:"Banner",className:"w-full h-full object-cover",onError:z=>{z.currentTarget.style.display="none"}}),r.jsx("button",{type:"button",onClick:()=>S(z=>({...z,banner_url:""})),className:"absolute top-1 right-1 bg-black/60 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",children:"Ã"})]}),r.jsx("input",{ref:C,type:"file",accept:"image/*",className:"hidden",onChange:le("banner_url",C)}),r.jsx(W,{variant:"portal",type:"button",onClick:()=>{var z;return(z=C.current)==null?void 0:z.click()},disabled:d,children:j.banner_url?"Change image":"Upload image"})]}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-200",children:["Header Image ",r.jsx("span",{className:"text-xs text-slate-400",children:"(max 5 MB)"})]}),j.header_url&&r.jsxs("div",{className:"relative w-full h-24 rounded-lg overflow-hidden border border-white/10",children:[r.jsx("img",{src:j.header_url,alt:"Header",className:"w-full h-full object-cover",onError:z=>{z.currentTarget.style.display="none"}}),r.jsx("button",{type:"button",onClick:()=>S(z=>({...z,header_url:""})),className:"absolute top-1 right-1 bg-black/60 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",children:"Ã"})]}),r.jsx("input",{ref:T,type:"file",accept:"image/*",className:"hidden",onChange:le("header_url",T)}),r.jsx(W,{variant:"portal",type:"button",onClick:()=>{var z;return(z=T.current)==null?void 0:z.click()},disabled:d,children:j.header_url?"Change image":"Upload image"})]})]}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsx(Y,{label:"Member Price",labelClassName:"text-slate-200",type:"number",step:"0.01",min:"0",value:j.member_price,onChange:X("member_price"),placeholder:"e.g. 50.00"}),r.jsx(Y,{label:"Non-Member Price",labelClassName:"text-slate-200",type:"number",step:"0.01",min:"0",value:j.non_member_price,onChange:X("non_member_price"),placeholder:"e.g. 100.00"}),r.jsxs(Re,{label:"Currency",labelClassName:"text-slate-200",value:j.currency,onChange:X("currency"),children:[r.jsx("option",{value:"USD",className:"bg-white text-slate-900",children:"USD"}),r.jsx("option",{value:"GBP",className:"bg-white text-slate-900",children:"GBP"}),r.jsx("option",{value:"EUR",className:"bg-white text-slate-900",children:"EUR"}),r.jsx("option",{value:"ZAR",className:"bg-white text-slate-900",children:"ZAR"}),r.jsx("option",{value:"KES",className:"bg-white text-slate-900",children:"KES"}),r.jsx("option",{value:"NGN",className:"bg-white text-slate-900",children:"NGN"})]})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:"Replay URL (post-event)",labelClassName:"text-slate-200",value:j.replay_url,onChange:X("replay_url"),placeholder:"https://youtube.com/..."}),r.jsx(Y,{label:"Materials URL (post-event)",labelClassName:"text-slate-200",value:j.materials_url,onChange:X("materials_url"),placeholder:"https://drive.google.com/..."})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-200 mb-2",children:"Registration Form Fields"}),r.jsxs("div",{className:"space-y-2",children:[j.registration_form.map((z,ye)=>r.jsxs("div",{className:"border border-slate-700 rounded-lg p-4 space-y-3",children:[r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[r.jsx(Y,{placeholder:"Field label",value:z.label||"",onChange:ve=>{const ze={...j};ze.registration_form[ye]={...z,label:ve.target.value},S(ze)}}
886),r.jsxs(Re,{value:z.type||"text",onChange:ve=>{const ze={...j};ze.registration_form[ye]={...z,type:ve.target.value},S(ze)},children:[r.jsx("option",{value:"text",children:"Text"}),r.jsx("option",{value:"email",children:"Email"}),r.jsx("option",{value:"phone",children:"Phone"}),r.jsx("option",{value:"select",children:"Dropdown"}),r.jsx("option",{value:"checkbox",children:"Checkbox"}),r.jsx("option",{value:"textarea",children:"Textarea"}),r.jsx("option",{value:"number",children:"Number"})]})]}),r.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-3",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"checkbox",checked:z.required||!1,onChange:ve=>{const ze={...j};ze.registration_form[ye]={...z,required:ve.target.checked},S(ze)},className:"rounded border-slate-600 bg-slate-800 text-[#c08a2f]"}),r.jsx("label",{className:"text-sm text-slate-200",children:"Required"})]}),r.jsx(Y,{type:"number",placeholder:"Max characters",value:z.max_length||"",onChange:ve=>{const ze={...j};ze.registration_form[ye]={...z,max_length:ve.target.value?Number(ve.target.value):null},S(ze)},min:"1",max:"1000"}),r.jsx(Y,{placeholder:"Placeholder text",value:z.placeholder||"",onChange:ve=>{const ze={...j};ze.registration_form[ye]={...z,placeholder:ve.target.value},S(ze)}})]}),(z.type==="select"||z.type==="checkbox")&&r.jsx(Y,{placeholder:"Options (comma-separated)",value:z.options||"",onChange:ve=>{const ze={...j};ze.registration_form[ye]={...z,options:ve.target.value},S(ze)},helper:"For dropdowns and checkboxes"}),r.jsx("div",{className:"flex justify-end",children:r.jsx("button",{type:"button",onClick:()=>{const ve={...j};ve.registration_form=ve.registration_form.filter((ze,Kt)=>Kt!==ye),S(ve)},className:"px-3 py-1 text-sm bg-red-600 text-white rounded hover:bg-red-700 transition",children:"Remove Field"})})]},ye)),r.jsx("button",{type:"button",onClick:()=>{const z={...j};z.registration_form=[...z.registration_form,{label:"",type:"text"}],S(z)},className:"px-3 py-1 text-sm bg-[#c08a2f] text-white rounded",children:"Add Field"})]})]}),r.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/5 p-4 space-y-3",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("label",{className:"text-sm font-semibold text-slate-200",children:"Group / Organisation Discount"}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"checkbox",checked:j.group_discount_enabled||!1,onChange:z=>S(ye=>({...ye,group_discount_enabled:z.target.checked})),className:"rounded border-slate-600 bg-slate-800 text-[#c08a2f]",i
886d:"group_discount_enabled"}),r.jsx("label",{htmlFor:"group_discount_enabled",className:"text-sm text-slate-200",children:"Enable group discount"})]})]}),j.group_discount_enabled&&r.jsxs("div",{className:"space-y-3 pt-2 border-t border-white/10",children:[r.jsxs("div",{className:"grid md:grid-cols-2 gap-3",children:[r.jsx(Y,{label:"Minimum group size",labelClassName:"text-slate-300",type:"number",min:"2",max:"500",value:j.group_discount_min_size,onChange:X("group_discount_min_size"),placeholder:"e.g. 5",helper:"Minimum tickets to qualify"}),r.jsxs(Re,{label:"Discount percentage",labelClassName:"text-slate-300",value:j.group_discount_percent,onChange:X("group_discount_percent"),children:[r.jsx("option",{value:"10",className:"bg-white text-slate-900",children:"10%"}),r.jsx("option",{value:"15",className:"bg-white text-slate-900",children:"15%"}),r.jsx("option",{value:"20",className:"bg-white text-slate-900",children:"20%"}),r.jsx("option",{value:"25",className:"bg-white text-slate-900",children:"25%"}),r.jsx("option",{value:"30",className:"bg-white text-slate-900",children:"30%"}),r.jsx("option",{value:"50",className:"bg-white text-slate-900",children:"50%"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{type:"checkbox",checked:j.group_discount_requires_code||!1,onChange:z=>S(ye=>({...ye,group_discount_requires_code:z.target.checked})),className:"rounded border-slate-600 bg-slate-800 text-[#c08a2f]",i
886d:"group_discount_requires_code"}),r.jsx("label",{htmlFor:"group_discount_requires_code",className:"text-sm text-slate-300",children:"Require a group/promo code to unlock discount"})]}),j.group_discount_requires_code&&r.jsx(Y,{label:"Group / Promo Code",labelClassName:"text-slate-300",value:j.group_discount_code,onChange:X("group_discount_code"),placeholder:"e.g. CORP2025",helper:"Buyers must enter this code to get the discount"}),r.jsxs("div",{className:"text-xs text-[#c08a2f] bg-[#c08a2f]/10 rounded-lg px-3 py-2",children:["Preview: Buy ",j.group_discount_min_size||5,"+ tickets â Save ",j.group_discount_percent||10,"%"]})]})]}),r.jsxs(Re,{label:s("portalEventsManage.fields.featured"),labelClassName:"text-slate-200",value:j.featured,onChange:X("featured"),children:[r.jsx("option",{value:"0",className:"bg-white text-slate-900",children:s("portalEventsManage.featured.no")}),r.jsx("option",{value:"1",className:"bg-white text-slate-900",children:s("portalEventsManage.featured.yes")})]}),h?r.jsx("div",{className:"text-sm text-red-200",children:h}):null,f?r.jsx("div",{className:"text-sm text-green-200",children:f}):null,r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r.jsx(W,{variant:"portal",type:"button",onClick:$e,disabled:d,children:s("common.cancel")}),r.jsx(W,{variant:"portal",type:"submit",disabled:d,children:s(d?"common.saving":b==="edit"?"common.save":"common.post")})]})]})})]})})]}):null,A&&L?r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:()=>E(!1),"aria-label":"Close registrations modal"}),r.jsx("div",{className:"relative max-w-4xl mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-white/10 bg-brand-900 shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-semibold",children:["Registrations â ",L.title]}),r.jsx("div",{className:"text-xs text-slate-300 mt-0.5",children:$?"Loading...":`${P.length} registration${P.length!==1?"s":""}`})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[P.length>0&&r.jsxs(r.Fragment,{children:[r.jsx(W,{variant:"portal",size:"sm",onClick:()=>de(L.id),disabled:_,title:"Re-send the registration confirmation (with join link) to every confirmed registrant",children:_?"Resendingâ¦":"Resend Link to All"}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>Pe(L.id),children:"Export CSV"})]}),r.jsx(W,{variant:"portal",onClick:()=>E(!1),children:"Close"})]})]}),r.jsx("div",{className:"p-4",children:$?r.jsx("div",{className:"text-sm text-slate-300 text-center py-8",children:"Loading registrations..."}):P.length===0?r.jsx("div",{className:"text-sm text-slate-300 text-center py-8",children:"No registrations yet for this event."}):r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"flex gap-4 mb-4 text-sm",children:[r.jsxs("span",{className:"text-slate-300",children:["Total: ",r.jsx("span",{className:"text-white font-semibold",children:P.length})]}),r.jsxs("span",{className:"text-slate-300",children:["Members: ",r.jsx("span",{className:"text-green-400 font-semibold",children:P.filter(z=>z.attendee_type==="member").length})]}),r.jsxs("span",{className:"text-slate-300",children:["Non-Members: ",r.jsx("span",{className:"text-[#e6c784] font-semibold",children:P.filter(z=>z.attendee_type==="guest").length})]})]}),ce&&r.jsx("div",{className:"mb-4 px-3 py-2 rounded-md bg-white/5 border border-white/10 text-xs text-slate-200",children:ce}),r.jsx("div",{className:"overflow-x-auto",children:r.jsxs("table",{className:"w-full text-sm text-left",children:[r.jsx("thead",{children:r.jsxs("tr",{className:"border-b border-white/10 text-slate-300",children:[r.jsx("th",{className:"py-2 px-3 font-medium",children:"#"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Type"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Name"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Email"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Phone"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Job Title"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Organisation"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Sector"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Industry"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Country"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Package"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Status"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Registered"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Attended"}),r.jsx("th",{className:"py-2 px-3 font-medium",children:"Email"})]})}),r.jsx("tbody",{children:P.map((z,ye)=>{const ve=(()=>
886{try{return typeof z.registration_data=="string"?JSON.parse(z.registration_data):z.registration_data||{}}catch{return{}}})(),ze=z.attendee_type==="guest";return r.jsxs("tr",{className:`border-b border-white/5 hover:bg-white/5 transition ${ze?"bg-[#c08a2f]/[0.03]":""}`,children:[r.jsx("td",{className:"py-2 px-3 text-slate-400",children:ye+1}),r.jsx("td",{className:"py-2 px-3 whitespace-nowrap",children:r.jsx(Te,{tone:ze?"accent":"brand",className:"text-[10px]",children:ze?"Non-Member":"Member"})}),r.jsxs("td",{className:"py-2 px-3 text-white font-medium whitespace-nowrap",children:[z.member_name||z.guest_name||"â",z.member_linkedin&&r.jsx("a",{href:z.member_linkedin,target:"_blank",rel:"noreferrer",className:"ml-1.5 text-[#c08a2f] hover:text-[#dcb26a] text-xs",children:"LinkedIn"})]}),r.jsx("td",{className:"py-2 px-3 text-slate-300 whitespace-nowrap",children:z.member_email||z.guest_email||"â"}),r.jsx("td",{className:"py-2 px-3 text-slate-300 whitespace-nowrap",children:z.member_phone||z.guest_phone||"â"}),r.jsx("td",{className:"py-2 px-3 text-slate-300 whitespace-nowrap",children:z.member_job_title||ve.job_title||"â"}),r.jsx("td",{className:"py-2 px-3 text-slate-300 whitespace-nowrap",children:z.member_organisation||ve.organisation||"â"}),r.jsx("td",{className:"py-2 px-3 text-slate-300 whitespace-nowrap capitalize",children:z.member_sector_type||ve.sector||"â"}),r.jsx("td",{className:"py-2 px-3 text-slate-300 whitespace-nowrap",children:z.member_industry||"â"}),r.jsx("td",{className:"py-2 px-3 text-slate-300 whitespace-nowrap",children:z.member_country||"â"}),r.jsx("td",{className:"py-2 px-3 whitespace-nowrap",children:ze?r.jsx("span",{className:"text-slate-500 text-xs",children:"N/A"}):r.jsx(Te,{tone:"default",className:"text-[10px]",children:(z.member_package||"â").replace(/_/g," ")})}),r.jsx("td",{className:"py-2 px-3",children:r.jsx(Te,{tone:z.payment_status==="paid"?"accent":z.payment_status==="waitlist"?"default":"brand",children:z.payment_status==="paid"?z.ticket_price_cents>0?"Paid":"Confirmed":z.payment_status==="waitlist"?"Waitlist":"Pending"})}),r.jsx("td",{className:"py-2 px-3 text-slate-300 whitespace-nowrap",children:z.registered_at?new Date(z.registered_at).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric",hour:"2-digit",minute:"2-digit"}):"â"}),r.jsx("td",{className:"py-2 px-3",children:z.attended?r.jsx("span",{className:"text-green-400 font-medium",children:"Yes"}):r.jsx("span",{className:"text-slate-500",children:"No"})}),r.jsx("td",{className:"py-2 px-3 whitespace-nowrap",children:r.jsx("button",{type:"button",onClick:()=>Ve(L.id,z.id),disabled:J===z.id||_,className:"text-xs px-2 py-1 rounded-md bg-[#c08a2f] hover:bg-[#a77324] text-white font-semibold transition disabled:opacity-50",title:"Re-send registration confirmation (with join link) to this attendee",children:J===z.id?"Sendingâ¦":"Resend"})})]},z.id)})})]})})]})})]})})]}):null]}):r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold",children:s("portalEventsManage.notAllowedTitle")}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:s("portalEventsManage.notAllowedSub")})]})})}const bm=[{value:"in_house_insights",label:"In-House Insights"},{value:"newsletter",label:"Newsletter"},{value:"in_house_life",label:"My In-House Life"}];function qne(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",n=v.useMemo(()=>({title:"",category:bm[0].value,summary:"",body:"",thumbnail_url:"",video_url:"",external_url:"",author_name:"",author_title:"",author_company:"",published_at:""}),[]),[a,i]=v.useState([]),[o,l]=v.useState(!1),[c,d]=v.useState(!1),[u,h]=v.useState(""),[m,f]=v.useState(""),[p,g]=v.useState(!1),[x,b]=v.useState("create"),[y,w]=v.useState(null),[N,j]=v.useState(n),S=v.useRef(null),k=v.useRef(null),C=_=>B=>j(J=>({...J,[_]:B.target.value})),T=v.useCallback(async _=>{const B=new FormData;B.append("image",_);const J=await U("/api/insights/admin/upload-image",{method:"POST",body:B,token:t});if(J.url)return J.url;throw new Error("No image URL returned")},[t]),A=v.useCallback(async _=>{var J;const B=(J=_.target.files)==null?void 0:J[0];
886if(B){if(B.size>1*1024*1024){h("Thumbnail too large. Maximum size is 1 MB."),S.current&&(S.current.value="");return}try{d(!0),h("");const Q=new FormData;Q.append("image",B);const ce=await U("/api/insights/admin/upload-image",{method:"POST",body:Q,token:t});j(fe=>({...fe,thumbnail_url:ce.url?ce.url:fe.thumbnail_url}))}catch(Q){h(Q.message||"Failed to upload image")}finally{d(!1),S.current&&(S.current.value="")}}},[t]),E=v.useCallback(async _=>{var J;const B=(J=_.target.files)==null?void 0:J[0];if(B)try{d(!0),h("");const Q=new FormData;Q.append("video",B);const ce=await U("/api/insights/admin/upload-video",{method:"POST",body:Q,token:t});j(fe=>({...fe,video_url:ce.url?ce.url:fe.video_url}))}catch(Q){h(Q.message||"Failed to upload video")}finally{d(!1),k.current&&(k.current.value="")}},[t]),L=v.useCallback(async()=>{l(!0),h("");try{const _=await U("/api/insights/admin",{token:t});i(_.insights||[])}catch(_){h(_.message||"Failed to load insights")}finally{l(!1)}},[t]);v.useEffect(()=>{s&&L()},[s,L]);const D=()=>{c||g(!1)},P=()=>{b("create"),w(null),j(n),f(""),h(""),g(!0)},R=_=>{b("edit"),w(_.id),j({title:_.title||"",category:_.category||bm[0].value,summary:_.summary||"",body:_.body||"",thumbnail_url:_.thumbnail_url||"",video_url:_.video_url||"",external_url:_.external_url||"",author_name:_.author_name||"",author_title:_.author_title||"",author_company:_.author_company||"",published_at:_.published_at?String(_.published_at).slice(0,16):""}),f(""),h(""),g(!0)},$=async _=>{_.preventDefault();const B=(N.title||"").trim(),J=(N.category||"").trim();if(!B||!J){h("Title and category are required");return}d(!0),h(""),f("");try{const Q=x==="edit"?`/api/insights/admin/${y}`:"/api/insights/admin";await U(Q,{token:t,method:x==="edit"?"PUT":"POST",body:{...N,title:B,category:J,published_at:N.published_at?new Date(N.published_at).toISOString():void 0}}),f(x==="edit"?"Insight saved.":"Insight published."),await L(),g(!1)}catch(Q){h(Q.message||"Failed to save")}finally{d(!1)}},O=async _=>{if(!(c||!window.confirm("Delete this insight article? This cannot be undone."))){d(!0),h(""),f("");try{await U(`/api/insights/admin/${_}`,{token:t,method:"DELETE"}),f("Insight deleted."),await L()}catch(J){h(J.message||"Failed to delete")}finally{d(!1)}}};return s?r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:"Manage Insights"}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:"Create, edit, and delete insight articles, newsletters, and profiles."})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(W,{variant:"portal",onClick:P,disabled:c,children:"New Insight"}),r.jsx(W,{as:K,to:"/hub",variant:"portal",children:"Back to Hub"})]})]}),u?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-red-200",children:u})})}):null,m?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-green-200",children:m})})}):null,r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[r.jsx("div",{className:"text-white font-semibold",children:"All Insights"}),r.jsx("div",{className:"text-sm text-slate-200",children:o?"Loadingâ¦":`${a.length} article${a.length!==1?"s":""}`})]}),r.jsxs("div",{className:"mt-4 grid gap-2",children:[!o&&a.length===0?r.jsx("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-3 text-sm text-slate-200",children:'No insights yet. Click "New Insight" to create one.'}):null,a.map(_=>{var B;return r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-3 flex items-center justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-white font-medium truncate",children:_.title}),r.jsx("div",{className:"text-xs text-slate-200",children:((B=bm.find(J=>J.value===_.category))==null?void 0:B.label)||_.category})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx(Te,{tone:"brand",children:_.category==="newsletter"?"Newsletter":_.category==="in_house_life"?"Profile":"Article"}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>
886R(_),disabled:c,children:"Edit"}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>O(_.id),disabled:c,children:"Delete"})]})]},_.id)})]})]})}),p?r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:D,"aria-label":"Close insight modal"}),r.jsx("div",{className:"relative max-w-3xl mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-white/10 bg-brand-900 shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-white font-semibold",children:x==="edit"?"Edit Insight":"New Insight"}),r.jsx(W,{variant:"portal",onClick:D,disabled:c,children:"Close"})]}),r.jsx("div",{className:"p-4",children:r.jsxs("form",{className:"grid gap-4",onSubmit:$,children:[r.jsx(Y,{label:"Title",labelClassName:"text-slate-200",value:N.title,onChange:C("title"),required:!0}),r.jsx(Re,{label:"Category",labelClassName:"text-slate-200",value:N.category,onChange:C("category"),required:!0,children:bm.map(_=>r.jsx("option",{value:_.value,className:"bg-white text-slate-900",children:_.label},_.value))}),r.jsx(Y,{label:"Summary",labelClassName:"text-slate-200",value:N.summary,onChange:C("summary")}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-sm font-medium text-slate-200 mb-1",children:"Body / Content"}),r.jsx($x,{value:N.body,onChange:_=>j(B=>({...B,body:_})),placeholder:"Write your insight here⦠Add text, headings, lists, and inline images.",darkMode:!0,onImageUpload:T,minHeight:"250px"})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-200",children:["Thumbnail Image ",r.jsx("span",{className:"text-xs text-slate-400",children:"(max 1 MB)"})]}),N.thumbnail_url&&r.jsxs("div",{className:"relative w-full h-24 rounded-lg overflow-hidden border border-white/10",children:[r.jsx("img",{src:N.thumbnail_url,alt:"Thumbnail",className:"w-full h-full object-cover"}),r.jsx("button",{type:"button",onClick:()=>j(_=>({..._,thumbnail_url:""})),className:"absolute top-1 right-1 bg-black/60 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",children:"Ã"})]}),r.jsx("input",{ref:S,type:"file",accept:"image/*",className:"hidden",onChange:A}),r.jsx(W,{variant:"portal",type:"button",onClick:()=>{var _;return(_=S.current)==null?void 0:_.click()},disabled:c,children:N.thumbnail_url?"Change image":"Upload image"})]}),r.jsxs("div",{className:"space-y-3",children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-200",children:["Video ",r.jsx("span",{className:"text-xs text-slate-400",children:"(upload file or paste YouTube / embed URL)"})]}),N.video_url&&r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"rounded-lg overflow-hidden border border-white/10 bg-black",children:/youtube\.com|youtu\.be|vimeo\.com/.test(N.video_url)?r.jsx("iframe",{src:N.video_url.replace(/watch\?v=/,"embed/").replace(/youtu\.be\//,"youtube.com/embed/"),className:"w-full aspect-video",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,title:"Video preview"}):r.jsx("video",{src:N.video_url,controls:!0,className:"w-full aspect-video",preload:"metadata"})}),r.jsx("button",{type:"button",onClick:()=>j(_=>({..._,video_url:""})),className:"px-2 py-1 text-xs bg-red-500/20 text-red-300 rounded hover:bg-red-500/30",children:"Remove video"})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("input",{ref:k,type:"file",accept:"video/mp4,video/webm,video/ogg,video/quicktime",className:"hidden",onChange:E}),r.jsx(W,{variant:"portal",type:"button",onClick:()=>{var _;return(_=k.current)==null?void 0:_.click()},disabled:c,children:N.video_url?"Upload new file":"Upload video file"}),r.jsx("span",{className:"text-xs text-slate-400",children:"or"})]}),r.jsx("input",{type:"text",value:/^(https?:\/\/)/.test(N.video_url)&&!/^\/uploads\//.test(N.video_url)&&!/localhost|127\.0\.0\.1/.test(N.video_url)?N.video_url:(N.video_url&&!N.video_url.
886startsWith("http"),""),onChange:_=>j(B=>({...B,video_url:_.target.value})),placeholder:"https://www.youtube.com/watch?v=... or https://vimeo.com/...",className:"w-full px-3 py-2 bg-white/5 border border-white/10 rounded-lg text-white text-sm placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500/50"})]})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:"External URL",labelClassName:"text-slate-200",value:N.external_url,onChange:C("external_url"),placeholder:"https://..."}),r.jsx("div",{className:"text-xs text-slate-300 self-end pb-2",children:"Use the editor for blog-style content, upload a picture for the cover, and optionally upload a video for the detail page."})]}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsx(Y,{label:"Author Name",labelClassName:"text-slate-200",value:N.author_name,onChange:C("author_name")}),r.jsx(Y,{label:"Author Title",labelClassName:"text-slate-200",value:N.author_title,onChange:C("author_title")}),r.jsx(Y,{label:"Author Company",labelClassName:"text-slate-200",value:N.author_company,onChange:C("author_company")})]}),r.jsx("div",{className:"acgc-datepicker-dark",children:r.jsx(Qu,{label:"Published At",labelClassName:"text-slate-200",value:N.published_at,onChange:C("published_at"),placeholder:"Click to pick publish date & time..."})}),u?r.jsx("div",{className:"text-sm text-red-200",children:u}):null,m?r.jsx("div",{className:"text-sm text-green-200",children:m}):null,r.jsxs("div",{className:"flex items-center justify-end gap-2",children:[r.jsx(W,{variant:"portal",type:"button",onClick:D,disabled:c,children:"Cancel"}),r.jsx(W,{variant:"portal",type:"submit",disabled:c,children:c?"Savingâ¦":x==="edit"?"Save":"Publish"})]})]})})]})})]}):null]}):r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold",children:"Not authorised"}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:"Only admins and editors can manage insights."})]})})}const Kne=["full-time","part-time","contract","internship"],Jne=["on-site","remote","hybrid"],Qne=["Entry","Mid","Senior","Lead","Executive","C-Suite"],Xne=["active","closed","draft"],Zne=["USD","GBP","EUR","ZAR","KES","NGN"],g_={title:"",company:"",location:"",location_type:"on-site",type:"full-time",sector:"",industry:"",seniority:"",salary_min:"",salary_max:"",currency:"USD",description:"",requirements:"",apply_url:"",company_logo_url:"",featured:!1,status:"active",expires_at:""};function ere(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",[n,a]=v.useState([]),[i,o]=v.useState(!1),[l,c]=v.useState(""),[d,u]=v.useState(null),[h,m]=v.useState({...g_}),[f,p]=v.useState(!1),g=v.useRef(null),x=v.useCallback(async C=>{var A;const T=(A=C.target.files)==null?void 0:A[0];if(T){if(T.size>1*1024*1024){c("Logo too large. Maximum size is 1 MB."),g.current&&(g.current.value="");return}try{p(!0),c("");const E=new FormData;E.append("image",T);const L=await U("/api/jobs/admin/upload-logo",{method:"POST",body:E,token:t});L.image_url&&k("company_logo_url",L.image_url)}catch(E){c(E.message||"Failed to upload logo")}finally{p(!1),g.current&&(g.current.value="")}}},[t]),b=async()=>{o(!0),c("");try{const C=await U("/api/jobs/admin",{token:t});a(C.jobs||[])}catch(C){c(C.message||"Failed to load jobs")}finally{o(!1)}};v.useEffect(()=>{b()},[t]);const y=()=>{m({...g_}),u("new")},w=C=>{m({title:C.title||"",company:C.company||"",location:C.location||"",location_type:C.location_type||"on-site",type:C.type||"full-time",sector:C.sector||"",industry:C.industry||"",seniority:C.seniority||"",salary_min:C.salary_min??"",salary_max:C.salary_max??"",currency:C.currency||"USD",description:C.description||"",requirements:C.requirements||"",apply_url:C.apply_url||"",company_logo_url:C.company_logo_url||"",featured:!!C.featured,status:C.status||"active",expires_at:C.expires_at?C.expires_at.slice(0,10):""}),u(C)},N=()=>u(null),j=async()=>{p(!0),c("");try{const C={...h,salary_min:h.salary_min?Number(h.salary_min):null,salary_max:h.salary_max?Number(h.salary_max):null,expires_at:h.expires_at||null};
886d==="new"?await U("/api/jobs/admin",{token:t,method:"POST",body:C}):await U(`/api/jobs/admin/${d.id}`,{token:t,method:"PUT",body:C}),N(),b()}catch(C){c(C.message||"Failed to save")}finally{p(!1)}},S=async C=>{if(window.confirm("Delete this job listing?"))try{await U(`/api/jobs/admin/${C}`,{token:t,method:"DELETE"}),b()}catch(T){c(T.message||"Failed to delete")}},k=(C,T)=>m(A=>({...A,[C]:T}));return s?r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:"Manage Jobs"}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Post and manage career opportunities for members."})]}),r.jsxs(W,{variant:"portal",onClick:y,children:[r.jsx(qs,{className:"h-4 w-4"})," Post Job"]})]}),l&&r.jsx("div",{className:"text-sm text-red-300",children:l}),d!==null&&r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:N,"aria-label":"Close"}),r.jsx("div",{className:"relative max-w-3xl mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-white/10 bg-brand-900 shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-white font-semibold",children:d==="new"?"Post New Job":"Edit Job"}),r.jsx(W,{variant:"portal",onClick:N,children:"Close"})]}),r.jsx("div",{className:"p-4",children:r.jsxs("div",{className:"grid gap-4",children:[r.jsx(Y,{label:"Job Title *",labelClassName:"text-slate-200",value:h.title,onChange:C=>k("title",C.target.value)}),r.jsx(Y,{label:"Company *",labelClassName:"text-slate-200",value:h.company,onChange:C=>k("company",C.target.value)}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:"Location *",labelClassName:"text-slate-200",value:h.location,onChange:C=>k("location",C.target.value),placeholder:"e.g. Lagos, Nigeria"}),r.jsx(Re,{label:"Location Type",labelClassName:"text-slate-200",value:h.location_type,onCh
886ange:C=>k("location_type",C.target.value),children:Jne.map(C=>r.jsx("option",{value:C,className:"bg-white text-slate-900",children:C},C))})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Re,{label:"Job Type",labelClassName:"text-slate-200",value:h.type,onChange:C=>k("type",C.target.value),children:Kne.map(C=>r.jsx("option",{value:C,className:"bg-white text-slate-900",children:C.replace("-"," ")},C))}),r.jsxs(Re,{label:"Seniority",labelClassName:"text-slate-200",value:h.seniority,onChange:C=>k("seniority",C.target.value),children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:"â None â"}),Qne.map(C=>r.jsx("option",{value:C,className:"bg-white text-slate-900",children:C},C))]})]}),r.jsxs(Re,{label:"Industry",labelClassName:"text-slate-200",value:h.industry,onChange:C=>k("industry",C.target.value),children:[r.jsx("option",{value:"",className:"bg-white text-slate-900",children:"â None â"}),Gi.map(C=>r.jsx("option",{value:C,className:"bg-white text-slate-900",children:C},C))]}),r.jsxs("div",{className:"grid md:grid-cols-3 gap-4",children:[r.jsx(Y,{label:"Min Salary",labelClassName:"text-slate-200",type:"number",value:h.salary_min,onChange:C=>k("salary_min",C.target.value),placeholder:"e.g. 50000"}),r.jsx(Y,{label:"Max Salary",labelClassName:"text-slate-200",type:"number",value:h.salary_max,onChange:C=>k("salary_max",C.target.value),placeholder:"e.g. 80000"}),r.jsx(Re,{label:"Currency",labelClassName:"text-slate-200",value:h.currency,onChange:C=>k("currency",C.target.value),children:Zne.map(C=>r.jsx("option",{value:C,className:"bg-white text-slate-900",children:C},C))})]}),r.jsxs("div",{children:[r.jsx("label",{className:"acgc-label text-sm text-slate-200 mb-1 block",children:"Description"}),r.jsx("textarea",{value:h.description,onChange:C=>k("description",C.target.value),rows:5,className:"w-full rounded-2xl bg-white/10 border border-white/15 px-4 py-3 text-sm text-white placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500/50",placeholder:"Job description, responsibilities..."})]}),r.jsxs("div",{children:[r.jsx("label",{className:"acgc-label text-sm text-slate-200 mb-1 block",children:"Requirements"}),r.jsx("textarea",{value:h.requirements,onChange:C=>k("requirements",C.target.value),rows:4,className:"w-full rounded-2xl bg-white/10 border border-white/15 px-4 py-3 text-sm text-white placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500/50",placeholder:"Qualifications, experience, skills..."})]}),r.jsx(Y,{label:"Apply URL",labelClassName:"text-slate-200",value:h.apply_url,onChange:C=>k("apply_url",C.target.value),placeholder:"https://..."}),r.jsxs("div",{className:"space-y-2",children:[r.jsxs("label",{className:"block text-sm font-medium text-slate-200",children:["Company Logo ",r.jsx("span",{className:"text-xs text-slate-400",children:"(max 1 MB)"})]}),h.company_logo_url&&r.jsxs("div",{className:"relative w-24 h-24 rounded-lg overflow-hidden border border-white/10",children:[r.jsx("img",{src:h.company_logo_url.startsWith("data:")||h.company_logo_url.startsWith("http")?h.company_logo_url:tt(h.company_logo_url),alt:"Logo",className:"w-full h-full object-contain bg-white/5"}),r.jsx("button",{type:"button",onClick:()=>k("company_logo_url",""),className:"absolute top-1 right-1 bg-black/60 text-white rounded-full w-5 h-5 flex items-center justify-center text-xs hover:bg-red-600",children:"Ã"})]}),r.jsx("input",{ref:g,type:"file",accept:"image/*",className:"hidden",onChange:x}),r.jsx(W,{variant:"portal",type:"button",onClick:()=>{var C;return(C=g.current)==null?void 0:C.click()},disabled:f,children:h.company_logo_url?"Change logo":"Upload logo"})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Re,{label:"Status",labelClassName:"text-slate-200",value:h.status,onChange:C=>k("status",C.target.value),children:Xne.map(C=>r.jsx("option",{value:C,className:"bg-white text-slate-900",children:C},C))}),r.jsx("div",{className:"acgc-datepicker-dark",children:r.jsx(Qu,{label:"Expires At",labelClassName:"text-slate-200",value:h.expires_at,onChange:C=>k("expires_at",C.target.value),placeholder:"Click to pick expiry date..."})})]}),r.jsxs(Re,{label:"Featured",labelClassName:"text-slate-200",value:h.featured?"1":"0",onChange:C=>k("featured",C.target.value==="1"),children:[r.jsx("option",{value:"0",className:"bg-white text-slate-900",children:"No"}),r.jsx("option",{value:"1",className:"bg-white text-slate-900",children:"Yes â shown on homepage & top of listings"})]}),r.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[r.jsx(W,{variant:"portal",onClick:N,children:"Cancel"}
886),r.jsx(W,{variant:"primary",onClick:j,disabled:f,children:f?"Saving...":d==="new"?"Post Job":"Save Changes"})]})]})})]})})]}),i?r.jsx("div",{className:"text-slate-400 text-center py-8",children:"Loading..."}):n.length===0?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-slate-400 text-center py-8",children:'No jobs posted yet. Click "Post Job" to create one.'})})}):r.jsx("div",{className:"space-y-3",children:n.map(C=>{var T;return r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("div",{className:"text-white font-semibold",children:C.title}),C.featured&&r.jsxs(Te,{className:"bg-[#c08a2f]/10 text-[#c08a2f] border-[#c08a2f]/20",children:[r.jsx(An,{className:"h-3 w-3 mr-1"}),"Featured"]}),r.jsx(Te,{tone:C.status==="active"?"accent":(C.status==="draft","default"),children:C.status})]}),r.jsxs("div",{className:"text-sm text-slate-300 mt-1",children:[C.company," · ",C.location," · ",(T=C.type)==null?void 0:T.replace("-"," ")," · ",C.location_type]}),C.industry&&r.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[C.industry,C.seniority?` · ${C.seniority}`:""]})]}),r.jsxs("div",{className:"flex gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>w(C),className:"p-2 rounded-lg hover:bg-white/10 text-slate-300 hover:text-white transition",children:r.jsx(Ui,{className:"h-4 w-4"})}),r.jsx("button",{onClick:()=>S(C.id),className:"p-2 rounded-lg hover:bg-red-500/10 text-slate-300 hover:text-red-300 transition",children:r.jsx(Lt,{className:"h-4 w-4"})})]})]})})},C.id)})})]}):r.jsx("div",{className:"text-slate-400 p-8 text-center",children:"Access denied"})}function b_(t){return t==null?"â":`$${(t/100).toLocaleString(void 0,{minimumFractionDigits:0})}`}function tre(t){return t?new Date(t).toLocaleString(void 0,{dateStyle:"medium",timeStyle:"short"}):"â"}function sre(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",[n,a]=v.useState("registrations"),[i,o]=v.useState([]),[l,c]=v.useState([]),[d,u]=v.useState(!0),[h,m]=v.useState(""),[f,p]=v.useState(""),[g,x]=v.useState("all"),b=v.useCallback(async()=>{u(!0),m("");try{const[k,C]=await Promise.all([U("/api/conference/admin/registrations",{token:t}),U("/api/conference/admin/excursions",{token:t})]);o(k.registrations||[]),c(C.excursions||[])}catch(k){m(k.message||"Failed to load conference registrations")}finally{u(!1)}},[t]);v.useEffect(()=>{b()},[b]);const y=async k=>{try{const C=await fetch(tt(`/api/conference/admin/${k}/export`),{headers:{Authorization:`Bearer ${t}`}});if(!C.ok)throw new Error("Failed to export");const T=await C.text(),A=new Blob([T],{type:"text/csv"}),E=URL.createObjectURL(A),L=document.createElement("a");L.href=E,L.download=`acgc-conference-${k}.csv`,document.body.appendChild(L),L.click(),document.body.removeChild(L),URL.revokeObjectURL(E)}catch(C){m(C.message||"Failed to export CSV")}};if(!s)return r.jsx("div",{className:"text-slate-400 p-8 text-center",children:"Access denied"});const w=n==="registrations"?i:l,N=w.filter(k=>{if(g!=="all"&&k.payment_status!==g)return!1;if(!f.trim())return!0;const C=f.toLowerCase();return[k.full_name,k.email,k.organisation_name,k.ticket_name,k.option_name].filter(Boolean).some(T=>T.toLowerCase().includes(C))}),j=w.filter(k=>k.payment_status==="paid"),S=j.reduce((k,C)=>k+(C.ticket_price_cents??C.price_cents??0),0);return r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between gap-4 flex-wrap",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:"Conference Registrations"}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Everyone who has registered for the conference or booked the Abidjan excursion, and what they paid."})]}),r.jsxs(W,{variant:"portal",onClick:()=>y(n),children:[r.jsx(Ys,{className:"h-4 w-4"})," Export CSV"]})]}),r.jsxs("div",{className:"flex gap-2",children:[r.jsxs("button",{type:"button",onClick:()=>a("registrations"),className:`px-4 py-2 rounded-full text-sm font-semibold transition ${n==="registrations"?"bg-white/15 text-white":"text-slate-400 hover:text-white"}`,children:["Conference Registrations (",i.length,")"]}),r.jsxs("button",{type:"button",onClick:()=>a("excursions"),className:`px-4 py-2 rounded-full text-sm font-semibold transition ${n==="excursions"?"bg-white/15 text-white":"text-slate-400 hover:text-white"}`,children:["Abidjan Excursion (",l.length,")"]})]}),r.jsxs("div",{className:"grid sm:grid-cols-3 gap-4",children:[r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"text-xs text-slate-400 uppercase tracking-wider",children:["Total ",n==="registrations"?"Registrations":"Bookings"]}),r.jsx("div",{className:"text-2xl font-bold text-white mt-1",children:w.length})]})}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-xs text-slate-400 uppercase tracking-wider",children:"Paid"}),r.jsx("div",{className:"text-2xl font-bold text-white mt-1",children:j.length})]})}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-xs text-slate-400 uppercase tracking-wider",children:"Revenue Collected"}),r.jsx("div",{className:"text-2xl font-bold text-white mt-1",children:b_(S)})]})})]}),r.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[r.jsxs("div",{className:"flex-1 relative",children:[r.jsx(Ua,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),r.jsx("input",{value:f,onChange:k=>p(k.target.value),placeholder:"Search by name, email, organisation...",className:"w-full h-11 rounded-2xl bg-white/10 border border-white/15 pl-10 pr-4 text-sm text-white placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500/50"})]}),r.jsxs("select",{value:g,onChange:k=>x(k.target.value),className:"h-11 rounded-2xl bg-white/10 border border-white/15 px-4 text-sm text-white focus:outline-none focus:ring-2 focus:ring-accent-500/50",children:[r.jsx("option",{value:"all",className:"bg-white text-slate-900",children:"All statuses"}),r.jsx("option",{value:"paid",className:"bg-white text-slate-900",children:"Paid"}),r.jsx("option",{value:"pending",className:"bg-white text-slate-900",children:"Pending"})]})]}),h&&r.jsx("div",{className:"text-sm text-red-300",children:h}),d?r.jsx("div",{className:"text-slate-400 text-center py-8",children:"Loading..."}):N.length===0?r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"text-slate-400 text-center py-8",children:["No ",n==="registrations"?"registrations":"bookings"," found."]})})}):r.jsx("div",{className:"space-y-3",children:N.map(k=>r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("div",{className:"text-white font-semibold",children:k.full_name}),r.jsx(Te,{tone:k.payment_status==="paid"?"accent":"default",children:k.payment_status||"pending"}),k.is_current_member&&r.jsx(Te,{tone:"brand",children:"Member"})]}),r.jsxs("div",{className:"text-sm text-slate-300 mt-1",children:[k.email,k.organisation_name?` · ${k.organisation_name}`:"",k.job_title?` · ${k.job_title}`:""]}),r.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[n==="registrations"?k.ticket_name:k.option_name,k.country_of_residence?` · ${k.country_of_residence}
886`:""," · ",tre(k.created_at)]})]}),r.jsx("div",{className:"text-lg font-bold text-white shrink-0",children:b_(k.ticket_price_cents??k.price_cents)})]})})},k.id))})]})}function nre(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",[n,a]=v.useState("inbox"),[i,o]=v.useState([]),[l,c]=v.useState(!1),[d,u]=v.useState(""),[h,m]=v.useState(null),[f,p]=v.useState(0),[g,x]=v.useState([]),[b,y]=v.useState(null),[w,N]=v.useState(""),[j,S]=v.useState(""),[k,C]=v.useState(""),[T,A]=v.useState(!1),[E,L]=v.useState(null),[D,P]=v.useState(null),R=async()=>{c(!0),u("");try{const pe=await U(n==="inbox"?"/api/messages/inbox":"/api/messages/sent",{token:t});if(o(pe.messages||[]),n==="inbox"){const be=await U("/api/messages/unread-count",{token:t});p(be.count||0)}}catch(X){u(X.message||"Failed to load messages")}finally{c(!1)}},$=async()=>{try{const X=await U("/api/messages/recipients",{token:t});x(X.members||[])}catch{}};v.useEffect(()=>{(n==="inbox"||n==="sent")&&R(),n==="compose"&&$()},[t,n]);const O=async X=>{try{await U(`/api/messages/${X}/read`,{token:t,method:"PUT"}),o(pe=>pe.map(be=>be.id===X?{...be,read:!0}:be)),p(pe=>Math.max(0,pe-1))}catch{}},_=async X=>{if(window.confirm("Delete this message?"))try{await U(`/api/messages/${X}`,{token:t,method:"DELETE"}),o(pe=>pe.filter(be=>be.id!==X))}catch(pe){u(pe.message||"Delete failed")}},B=X=>{if(h===X){m(null);return}m(X);const pe=i.find(be=>be.id===X);n==="inbox"&&pe&&!pe.read&&O(X)},J=async X=>{if(X.preventDefault(),!!k.trim()){A(!0),L(null),u("");try{const pe=await U("/api/messages/bulk",{token:t,method:"POST",body:{subject:j.trim()||null,body:k.trim()}});L({ok:!0,sent:pe.sent}),S(""),C("")}catch(pe){u(pe.message||"Bulk send failed")}finally{A(!1)}}},Q=X=>{P({id:X.from_id,first_name:X.from_first_name,last_name:X.from_last_name,job_title:X.from_job_title,avatar_url:X.from_avatar_url,organisation:X.from_organisation,country:X.from_country})},ce=w.trim()?g.filter(X=>{const pe=w.toLowerCase();return`${X.first_name} ${X.last_name}`.toLowerCase().includes(pe)||(X.organisation||"").toLowerCase().includes(pe)}):g,fe=X=>`px-4 py-2 rounded-2xl text-sm font-medium transition border ${n===X?"bg-white/10 text-white border-white/15":"text-slate-400 border-transparent hover:bg-white/5"}`;return r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-slate-50 font-semibold text-xl",children:"Messages"}),r.jsx("div",{className:"mt-1 text-sm text-slate-400",children:"Private messages between ACGC members."})]}),r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx("button",{onClick:()=>a("inbox"),className:fe("inbox"),children:r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(H3,{className:"h-4 w-4"}),"Inbox",f>0&&r.jsx(Te,{tone:"accent",className:"text-xs ml-1",children:f})]})}),r.jsx("button",{onClick:()=>a("sent"),className:fe("sent"),children:r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(ia,{className:"h-4 w-4"}),"Sent"]})}),r.jsx("button",{onClick:()=>a("compose"),className:fe("compose"),children:r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(q7,{className:"h-4 w-4"}),"Compose"]})}),s&&r.jsx("button",{onClick:()=>a("bulk"),className:fe("bulk"),children:r.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[r.jsx(fk,{className:"h-4 w-4"}),"Bulk Message"]})})]}),d&&r.jsx("div",{className:"text-sm text-red-300",children:d}),n==="compose"&&r.jsxs("div",{children:[r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-slate-100 font-medium mb-3",children:"Select a member to message"}),r.jsx(Y,{placeholder:"Search members by name or organisationâ¦",value:w,onChange:X=>N(X.target.value),className:"!bg-white/5 !border-white/10 !text-white placeholder:!text-slate-500"}),r.jsx("div",{className:"mt-3 max-h-72 overflow-auto space-y-1",children:ce.length===0?r.jsx("div",{className:"text-sm text-slate-500 py-3 text-center",children:"No members found"}):ce.map(X=>r.jsxs("button",{onClick:()=>y(X),className:"w-full text-left flex items-center gap-3 p-2.5 rounded-xl hover:bg-white/5 transition",children:[r.jsx("div",{className:"h-9 w-9 rounded-full bg-white/10 grid place-items-center shrink-0 overflow-hidden",children:X.avatar_url?r.jsx("img",{src:X.avatar_url.startsWith("data:")||X.avatar_url.startsWith("http")?X.avatar_url:tt(X.avatar_url),alt:"",className:"h-full w-full object-cover"}):r.jsx(Ls,{className:"h-4 w-4 text-slate-500"})}),r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"text-sm text-slate-100 font-medium truncate",children:[X.first_name," ",X.last_name]}),r.jsx("div",{className:"text-xs text-slate-500 truncate",children:[X.job_title,X.organisation].filter(
886Boolean).join(" · ")})]})]},X.id))})]})}),b&&r.jsx(yy,{recipient:b,onClose:()=>y(null),onSent:()=>{y(null),a("sent"),R()}})]}),n==="bulk"&&s&&r.jsx(ne,{children:r.jsx(re,{children:E?r.jsxs("div",{className:"text-center py-4",children:[r.jsx("div",{className:"text-green-400 font-semibold text-lg",children:"Bulk message sent!"}),r.jsxs("p",{className:"mt-1 text-sm text-slate-400",children:["Delivered to ",E.sent," member",E.sent!==1?"s":"","."]}),r.jsx(W,{variant:"portal",size:"sm",className:"mt-4",onClick:()=>L(null),children:"Send another"})]}):r.jsxs("form",{onSubmit:J,className:"grid gap-4",children:[r.jsxs("div",{className:"flex items-center gap-2 p-3 rounded-xl bg-white/5 border border-white/10",children:[r.jsx(at,{className:"h-5 w-5 text-slate-400 shrink-0"}),r.jsxs("p",{className:"text-sm text-slate-300",children:["This message will be sent to ",r.jsx("strong",{className:"text-white",children:"all members"}),"."]})]}),r.jsx(Y,{label:"Subject",placeholder:"Optional subject line",value:j,onChange:X=>S(X.target.value),maxLength:200,className:"!bg-white/5 !border-white/10 !text-white placeholder:!text-slate-500",labelClassName:"!text-slate-300"}),r.jsxs("div",{children:[r.jsxs("div",{className:"acgc-label mb-1 text-sm text-slate-300",children:["Message",r.jsx("span",{className:"text-red-500 ml-0.5",children:"*"})]}),r.jsx("textarea",{value:k,onChange:X=>C(X.target.value),placeholder:"Write your message to all membersâ¦",rows:6,maxLength:5e3,required:!0,className:"acgc-input w-full rounded-2xl border px-4 py-3 text-white bg-white/5 border-white/10 focus:border-accent-600 focus:ring-2 focus:ring-accent-500/20 transition resize-none placeholder:text-slate-500"}),r.jsxs("div",{className:"mt-1 text-xs text-slate-500 text-right",children:[k.length,"/5,000"]})]}),r.jsx("div",{className:"flex justify-end gap-2",children:r.jsxs(W,{type:"submit",variant:"portal",size:"sm",disabled:T||!k.trim(),children:[r.jsx(fk,{className:"h-3.5 w-3.5"}),T?"Sendingâ¦":"Send to all members"]})})]})})}),(n==="inbox"||n==="sent")&&r.jsx(r.Fragment,{children:l?r.jsx("div",{className:"text-slate-400 text-center py-8",children:"Loadingâ¦"}):i.length===0?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-slate-400 text-center py-6",children:n==="inbox"?"Your inbox is empty.":"No sent messages yet."})})}):r.jsx("div",{className:"space-y-2",children:i.map(X=>{const pe=h===X.id,be=n==="inbox",q=be?`${X.from_first_name} ${X.from_last_name}`:`${X.to_first_name} ${X.to_last_name}`,le=be?X.from_job_title:X.to_job_title,De=be?X.from_organisation:X.to_organisation,$e=be?X.from_country:X.to_country,H=be?X.from_avatar_url:X.to_avatar_url,he=H?H.startsWith("data:")||H.startsWith("http")?H:tt(H):null;return r.jsx(V.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},children:r.jsx(ne,{children:r.jsxs(re,{className:"!p-0",children:[r.jsxs("button",{onClick:()=>B(X.id),className:"w-full text-left p-4 flex items-start gap-3 hover:bg-white/5 transition rounded-2xl",children:[r.jsx("div",{className:"h-10 w-10 rounded-xl border border-white/15 overflow-hidden bg-white/5 grid place-items-center shrink-0",children:he?r.jsx("img",{src:he,alt:"",className:"h-full w-full object-cover"}):r.jsx(Ls,{className:"h-5 w-5 text-slate-500"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:`text-sm font-medium ${be&&!X.read?"text-white":"text-slate-200"}`,children:q}),be&&!X.read&&r.jsx("span",{className:"h-2 w-2 rounded-full bg-accent-500 shrink-0"})]}),le&&r.jsxs("div",{className:"text-xs text-slate-500 flex items-center gap-1",children:[r.jsx(Wt,{className:"h-3 w-3"}),le]}),De&&r.jsxs("div",{className:"text-xs text-slate-400 flex items-center gap-1",children:[r.jsx(Gt,{className:"h-3 w-3"}),De,$e&&r.jsxs("span",{className:"ml-1.5 flex items-center gap-0.5",children:[r.jsx(kt,{className:"h-3 w-3"}),$e]})]}),X.subject&&r.jsx("div",{className:"text-sm text-slate-300 mt-0.5 truncate",children:X.subject}),r.jsx("div",{className:"text-xs text-slate-500 mt-1",children:new Date(X.created_at).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit"})})]}),r.jsx("div",{className:"shrink-0 text-slate-500",children:pe?r.jsx(Vi,{className:"h-4 w-4"}):r.jsx(ht,{className:"h-4 w-4"})})]}),pe&&r.jsxs("div",{className:"px-4 pb-4 border-t border-white/10 pt-3",children:[r.jsx("div",{className:"text-sm text-slate-200 whitespace-pre-wrap",children:X.body}),r.jsxs("div",{className:"mt-3 flex justify-between",children:[be&&r.jsxs(W,{variant:"ghost",size:"sm",onClick:()=>Q(X),className:"text-xs text-slate-300 hover:text-white",children:[r.jsx(W7,{className:"h-3.5 w-3.5"})," Reply"]}),r.jsxs(W,{variant:"ghost",size:"sm",onClick:()=>_(X.id),className:"text-xs text-red-300 hover:text-red-200 ml-auto",children:[r.jsx(Lt,{className:"h-3.5 w-3.5"})," Delete"]})]})]})]})})},X.id)})})}),D&&r.jsx(yy,{recipient:D,onClose:()=>P(null),onSent:()=>{P(null),R()}})]})}function ym(t){if(!t)return null;const e=t.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([^&?\s]+)/);return e?e[1]:null}function rre(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin",n=(e==null?void 0:e.role)==="editor",a=s||n,[i,o]=v.useState(null),[l,c]=v.useState([]),[d,u]=v.useState([]),[h,m]=v.useState([]),[f,p]=v.useState(null),[g,x]=v.useState(null),[b,y]=v.useState(null),[w,N]=v.useState(null),[j,S]=v.useState(!0),[k,C]=v.useState(""),[T,A]=v.useState([]),[E,L]=v.useState(!0),[D,P]=v.useState(""),[R,$]=v.useState(""),[O,_]=v.useState(!1),[B,J]=v.useState(!1),[Q,ce]=v.useState(null),fe=async()=>{try{const H=await U("/api/partner-videos/admin",{token:t});A(H.videos||[])}catch{}finally{L(!1)}};v.useEffect(()=>{a&&fe()},[a]),v.useEffect(()=>{if(Q){const H=setTimeout(()=>ce(null),3e3);return()=>clearTimeout(H)}},[Q]);const X=async H=>{if(H.preventDefault(),!!R.trim()){if(!ym(R.trim())){ce({type:"error",msg:"Invalid YouTube URL"});return}_(!0);try{await U("/api/partner-videos/admin",{token:t,method:"POST",body:{title:D.trim(),youtube_url:R.trim()}}),P(""),$(""),J(!1),ce({type:"success",msg:"Video added"}),await fe()}catch(he){ce({type:"error",msg:he.message||"Failed to add"})}finally{_(!1)}}}
886,pe=async H=>{if(window.confirm("Remove this video?"))try{await U(`/api/partner-videos/admin/${H}`,{token:t,method:"DELETE"}),ce({type:"success",msg:"Video removed"}),await fe()}catch(he){ce({type:"error",msg:he.message||"Failed to delete"})}},be=v.useRef(null),q=v.useRef(null),le=H=>{be.current=H},De=H=>{q.current=H},$e=async()=>{if(be.current===null||q.current===null||be.current===q.current){be.current=null,q.current=null;return}const H=[...T],[he]=H.splice(be.current,1);H.splice(q.current,0,he),A(H),be.current=null,q.current=null;try{const oe=H.map((F,Z)=>({id:F.id,sort_order:Z+1}));await U("/api/partner-videos/admin/reorder/batch",{token:t,method:"PUT",body:{order:oe}}),ce({type:"success",msg:"Order saved"})}catch{ce({type:"error",msg:"Failed to save order"}),await fe()}};return v.useEffect(()=>{if(!a)return;(async()=>{S(!0),C("");try{const[he,oe,F,Z,de,Ve,Pe,z]=await Promise.all([U("/api/stats/overview",{token:t}),U("/api/stats/membership-growth",{token:t}),U("/api/stats/members-by-country",{token:t}),U("/api/stats/members-by-package",{token:t}),U("/api/stats/event-performance",{token:t}),U("/api/stats/content-stats",{token:t}),U("/api/stats/revenue",{token:t}),U("/api/stats/recent-activity",{token:t})]);o(he),c(oe.growth||[]),u(F.countries||[]),m(Z.packages||[]),p(de),x(Ve),y(Pe),N(z)}catch(he){C(he.message||"Failed to load dashboard data")}finally{S(!1)}})()},[a,t]),a?r.jsxs("div",{className:"grid gap-6",children:[r.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:"Admin Dashboard"}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Centralised overview of members, events, content, and payments."})]}),r.jsx("div",{className:"flex items-center gap-2",children:r.jsx(Te,{tone:s?"accent":"brand",children:s?"Admin":"Editor"})})]}),k&&r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-red-200",children:k})})}),j&&r.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:Array.from({length:8}).map((H,he)=>r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-5 animate-pulse",children:[r.jsx("div",{className:"h-3 w-16 bg-white/10 rounded"}),r.jsx("div",{className:"mt-3 h-7 w-20 bg-white/10 rounded"})]},he))}),!j&&i&&r.jsxs(r.Fragment,{children:[r.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-4",children:[r.jsx(Za,{icon:at,label:"Total Members",value:i.members.total,sub:`${i.members.paid} paid · ${i.members.free} free`,color:"text-blue-400"}),r.jsx(Za,{icon:Gt,label:"Organisations",value:i.organisations,color:"text-emerald-400"}),r.jsx(Za,{icon:Ds,label:"Events",value:i.events.total,sub:`${i.events.upcoming} upcoming`,color:"text-purple-400"}),r.jsx(Za,{icon:Du,label:"Resources",value:i.resources,color:"text-amber-400"}),r.jsx(Za,{icon:es,label:"Insights",value:i.insights,color:"text-cyan-400"}),r.jsx(Za,{icon:gi,label:"Total Revenue",value:ore(i.revenue.total),sub:`${i.revenue.payments} payments`,color:"text-green-400"}),r.jsx(Za,{icon:fy,label:"Conversion Rate",value:i.members.total>0?`${Math.round(i.members.paid/i.members.total*100)}%`:"0%",sub:"Paid / Total",color:"text-rose-400"}),r.jsx(Za,{icon:pt,label:"Countries",value:d.length,sub:d.slice(0,3).map(H=>H.country).join(", "),color:"text-indigo-400"})]}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold mb-3",children:"Quick Actions"}),r.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-4 gap-3",children:[r.jsx(ei,{to:"/hub/members/manage",icon:at,label:"Manage Members"}),r.jsx(ei,{to:"/hub/events/manage",icon:Ds,label:"Manage Events"}),r.jsx(ei,{to:"/hub/resources/manage",icon:Du,label:"Manage Resources"}),r.jsx(ei,{to:"/hub/insights/manage",icon:es,label:"Manage Insights"}),r.jsx(ei,{to:"/hub/partner-videos",icon:uk,label:"Partner Videos"}),r.jsx(ei,{to:"/hub/advisory-board",icon:at,label:"Advisory Board"}),r.jsx(ei,{to:"/hub/resource-hub",icon:On,label:"Manage Resource Hub"}),r.jsx(ei,{href:"/api/admin/members/export",icon:Ys,label:"Export Members CSV",isDownload:!0,token:t})]})]})}),r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Wi,{className:"h-4 w-4 text-purple-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Partner Page Videos"})]}),r.jsxs("button",{onClick:()=>J(!B),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-white/10 hover:bg-white/15 text-sm text-slate-200 transition",children:[B?r.jsx(He,{className:"h-3.5 w-3.5"}):r.jsx(qs,{className:"h-3.5 w-3.5"}),B?"Cancel":"Add Video"]})]})}),r.jsxs(re,{children:[r.jsx("div",{className:"text-xs text-slate-400 mb-4",children:"Conference highlight videos displayed on the Partnering With Us page."}),B&&r.jsxs("form",{onSubmit:X,className:"mb-4 p-4 rounded-xl bg-white/5 border border-white/10 space-y-3",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1",children:"Title (optional)"}),r.jsx("input",{type:"text",placeholder:"e.g. ACGC 2025 Conference Highlights",value:D,onChange:H=>P(H.target.value),className:"w-full h-9 rounded-lg border border-white/10 bg-white/5 px-3 text-sm text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1",children:"YouTube URL *"}),r.jsx("input",{type:"text",required:!0,placeholder:"https://www.youtube.com/watch?v=...",value:R,onChange:H=>$(H.target.value),className:"w-full h-9 rounded-lg border border-white/10 bg-white/5 px-3 text-sm text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),R&&ym(R)&&r.jsx("div",{className:"rounded-lg overflow-hidden border border-white/10",children:r.jsx("img",{src:`https://img.youtube.com/vi/${ym(R)}/hqdefault.jpg`,alt:"Preview",className:"w-full h-32 object-cover"})}),r.jsxs("button",{type:"submit",disabled:O,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg bg-[#c08a2f] hover:bg-[#a
88677324] text-white text-sm font-medium transition disabled:opacity-60",children:[r.jsx(qs,{className:"h-3.5 w-3.5"})," ",O?"Adding...":"Add Video"]})]}),E?r.jsx("div",{className:"text-sm text-slate-400",children:"Loading videos..."}):T.length===0?r.jsx("div",{className:"text-sm text-slate-400",children:'No videos yet. Click "Add Video" above.'}):r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Drag to reorder"}),T.map((H,he)=>{const oe=ym(H.youtube_url);return r.jsxs("div",{draggable:!0,onDragStart:()=>le(he),onDragEnter:()=>De(he),onDragEnd:$e,onDragOver:F=>F.preventDefault(),className:"flex items-center gap-3 rounded-xl bg-white/5 border border-white/10 p-3 cursor-grab active:cursor-grabbing hover:bg-white/[0.08] transition",children:[r.jsx("div",{className:"text-slate-500 hover:text-slate-300 shrink-0",children:r.jsx(ui,{className:"h-4 w-4"})}),oe&&r.jsxs("div",{className:"w-20 h-12 rounded-lg overflow-hidden bg-black shrink-0 relative",children:[r.jsx("img",{src:`https://img.youtube.com/vi/${oe}/hqdefault.jpg`,alt:"",className:"w-full h-full object-cover"}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("div",{className:"h-6 w-6 rounded-full bg-white/80 flex items-center justify-center",children:r.jsx(wn,{className:"h-3 w-3 text-[#1f0f3f] ml-0.5",fill:"#1f0f3f"})})})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm text-white truncate",children:H.title||"Untitled"}),r.jsx("div",{className:"text-xs text-slate-400 truncate",children:H.youtube_url})]}),r.jsx("button",{onClick:()=>pe(H.id),className:"h-8 w-8 rounded-lg flex items-center justify-center text-slate-400 hover:text-red-400 hover:bg-red-500/10 transition shrink-0",children:r.jsx(Lt,{className:"h-4 w-4"})})]},H.id)})]})]})]}),Q&&r.jsx("div",{className:`fixed bottom-6 right-6 z-50 px-4 py-3 rounded-xl shadow-lg text-sm font-medium ${Q.type==="error"?"bg-red-600 text-white":"bg-emerald-600 text-white"}`,children:Q.msg}),l.length>0&&r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(fy,{className:"h-4 w-4 text-blue-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Membership Growth"})]})}),r.jsx(re,{children:r.jsx(ire,{data:l.map(H=>({label:H.month,value:H.signups,paid:H.paid}))})})]}),r.jsxs("div",{className:"grid lg:grid-cols-2 gap-4",children:[d.length>0&&r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(pt,{className:"h-4 w-4 text-indigo-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Members by Country"})]})}),r.jsx(re,{children:r.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto",children:d.map(H=>{var oe;const he=((oe=d[0])==null?void 0:oe.count)||1;return r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("div",{className:"w-24 text-xs text-slate-300 truncate shrink-0",children:H.country||"Unknown"}),r.jsx("div",{className:"flex-1 h-5 bg-white/5 rounded-full overflow-hidden",children:r.jsx("div",{className:"h-full bg-indigo-500/60 rounded-full transition-all duration-500",style:{width:`${H.count/he*100}%`}})}),r.jsx("div",{className:"text-xs text-slate-400 w-8 text-right",children:H.count})]},H.country)})})})]}),h.length>0&&r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(gi,{className:"h-4 w-4 text-green-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Membership Breakdown"})]})}),r.jsx(re,{children:r.jsx("div",{className:"space-y-3",children:h.map(H=>r.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-white/5 border border-white/10 px-4 py-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-white font-medium capitalize",children:H.membership_package}),r.jsx("div",{className:"text-xs text-slate-400 capitalize",children:H.payment_status})]}),r.jsx("div",{className:"text-lg font-bold text-white",children:H.count})]},`${H.membership_package}-${H.payment_status}`))})})]})]}),r.jsxs("div",{className:"grid lg:grid-cols-2 gap-4",children:[f&&r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ds,{className:"h-4 w-4 text-purple-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Event Performance"})]})}),r.jsxs(re,{children:[r.jsx("div",{className:"flex items-center gap-3 mb-4",children:r.jsxs(Te,{tone:"accent",children:[f.featured," Featured"]})}),r.jsx("div",{className:"space-y-2",children:(f.byType||[]).map(H=>r.jsxs("div",{className:"flex items-center justify-between rounded-xl bg-white/5 border border-white/10 px-4 py-2.5",children:[r.jsx("div",{className:"text-sm text-slate-200",children:H.type}),r.jsx("div",{className:"text-sm font-semibold text-white",children:H.count})]},H.type))})]})]}),g&&r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Vw,{className:"h-4 w-4 text-amber-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Content Breakdown"})]})}),r.jsxs(re,{children:[r.jsx("div",{className:"grid grid-cols-2 gap-2",children:(g.byType||[]).map(H=>r.jsxs("div",{className:"rounded-xl bg-white/5 border border-white/10 px-3 py-2.5 text-center",children:[r.jsx("div",{className:"text-lg font-bold text-white",children:H.count}),r.jsx("div",{className:"text-[11px] text-slate-400 capitalize",children:H.type})]},H.type))}),r.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:(g.bySource||[]).map(H=>r.jsxs(Te,{tone:H.source_type==="acgc"?"brand":"default",children:[H.source_type,": ",H.count]},H.source_type))})]})]})]}),b&&(b.byCurrency||[]).length>0&&r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(gi,{className:"h-4 w-4 text-green-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Revenue"})]})}),r.jsx(re,{children:r.jsx("div",{className:"grid sm:grid-cols-3 gap-3",children:b.byCurrency.map(H=>r.jsxs("div",{className:"rounded-xl bg-white/5 border border-white/10 px-4 py-3 text-center",children:[r.jsx("div",{className:"text-xs text-slate-400 uppercase",children:H.currency}),r.jsx("div",{className:"mt-1 text-lg font-bold text-white",children:y_(H.total,H.currency)}),r.jsxs("div",{className:"text-xs text-slate-500",children:[H.payments," payment",H.payments!==1?"s":""]})]},H.currency))})})]}),w&&r.jsxs("div",{className:"grid lg:grid-cols-2 gap-4",children:[r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(uk,{className:"h-4 w-4 text-blue-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Recent Signups"})]})}),r.jsx(re,{children:r.jsxs("div",{className:"space-y-2",children:[(w.recentMembers||[]).length===0&&r.jsx("div",{className:"text-sm text-slate-400",children:"No recent signups."}),(w.recentMembers||[]).map(H=>r.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl bg-white/5 border border-white/10 px-3 py-2.5",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"text-sm text-white font-medium truncate",children:[H.first_name," ",H.last_name]}),r.jsx("div",{className:"text-xs text-slate-400 truncate",children:H.organisation_name})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx(Te,{tone:H.payment_status==="paid"?"accent":"default",children:H.payment_status}),r.jsx("div",{className:"text-[10px] text-slate-500",children:v_(H.created_at)})]})]},H.id))]})})]}),r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(gi,{className:"h-4 w-4 text-green-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Recent Payments"})]})}),r.jsx(re,{children:r.jsxs("div",{className:"space-y-2",children:[(w.recentPayments||[]).length===0&&r.jsx("div",{className:"text-sm text-slate-400",children:"No recent payments."}),(w.recentPayments||[]).map(H=>r.jsxs("div",{className:"flex items-center justify-between gap-3 rounded-xl bg-white/5 border border-white/10 px-3 py-2.5",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"text-sm text-white font-medium truncate",children:[H.first_name," ",H.last_name]}),r.jsx("div",{className:"text-xs text-slate-400",children:H.email})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx("div",{className:"text-sm font-semibold text-green-400",children:y_(H.amount,H.currency)}),r.jsx("div",{className:"text-[10px] text-slate-500",children:v_(H.created_at)})]})]},H.id))]})})]})]}),s&&r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Hi,{className:"h-4 w-4 text-rose-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Compliance & Security"})]})}),r.jsxs(re,{children:[r.jsxs("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-3",children:[r.jsx(_l,{icon:ls,label:"SSL Encryption",status:"Active",ok:!0}
886),r.jsx(_l,{icon:ls,label:"Role-Based Access",status:"Admin / Editor / Member",ok:!0}),r.jsx(_l,{icon:ls,label:"Stripe Integration",status:"Connected",ok:!0}),r.jsx(_l,{icon:ls,label:"JWT Authentication",status:"Active (7-day expiry)",ok:!0}),r.jsx(_l,{icon:oc,label:"GDPR Data Export",status:"Available via API",ok:!0}),r.jsx(_l,{icon:oc,label:"NDPR Compliance",status:"Data deletion available",ok:!0})]}),r.jsx("div",{className:"mt-4 text-xs text-slate-500",children:"Data hosting region and automated backups should be configured at the infrastructure level. Contact your hosting provider to ensure EU or Africa-based server compliance."})]})]}),s&&r.jsx(are,{token:t})]})]}):r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold",children:"Access Denied"}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:"Only administrators and editors can access this dashboard."})]})})}function Za({icon:t,label:e,value:s,sub:n,color:a="text-white"}){return r.jsxs(V.div,{initial:{opacity:0,y:8},animate:{opacity:1,y:0},className:"rounded-2xl border border-white/10 bg-white/5 p-5",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"text-xs text-slate-400 uppercase tracking-wider",children:e}),r.jsx(t,{className:`h-4 w-4 ${a}`})]}),r.jsx("div",{className:"mt-2 text-2xl font-bold text-white",children:s}),n&&r.jsx("div",{className:"mt-1 text-xs text-slate-500",children:n})]})}function ei({to:t,href:e,icon:s,label:n,isDownload:a,token:i}){const o="flex items-center gap-3 rounded-xl bg-white/5 border border-white/10 px-4 py-3 text-sm text-slate-200 hover:bg-white/10 hover:border-white/20 transition group";if(a&&e){const l=async c=>{c.preventDefault();try{const d=await fetch(e.startsWith("http")?e:tt(e),{headers:{Authorization:`Bearer ${i}`}});if(!d.ok)throw new Error("Download failed");const u=await d.blob(),h=URL.createObjectURL(u),m=document.createElement("a");m.href=h,m.download="acgc-members.csv",m.click(),URL.revokeObjectURL(h)}catch(d){alert("Failed to download: "+d.message)}};return r.jsxs("button",{onClick:l,className:o,children:[r.jsx(s,{className:"h-4 w-4 text-slate-400 group-hover:text-white transition"}),n]})}return r.jsxs(K,{to:t,className:o,children:[r.jsx(s,{className:"h-4 w-4 text-slate-400 group-hover:text-white transition"}),n,r.jsx(ll,{className:"h-3.5 w-3.5 text-slate-400 ml-auto group-hover:text-slate-300 transition"})]})}function _l({icon:t,label:e,status:s,ok:n}){return r.jsxs("div",{className:"flex items-start gap-3 rounded-xl bg-white/5 border border-white/10 px-4 py-3",children:[r.jsx(t,{className:`h-4 w-4 mt-0.5 shrink-0 ${n?"text-green-400":"text-amber-400"}`}),r.jsxs("div",{children:[r.jsx("div",{className:"text-sm text-white font-medium",children:e}),r.jsx("div",{className:"text-xs text-slate-400",children:s})]})]})}function are({token:t}){const[e,s]=v.useState(""),[n,a]=v.useState(!1),[i,o]=v.useState(null),l=async()=>{if(e.trim()){a(!0),o(null);try{const c=await U("/api/admin/test-email",{method:"POST",body:{to:e.trim()},token:t});o({ok:!0,message:`Sent successfully (ID: ${c.messageId||"n/a"})`})}catch(c){o({ok:!1,message:c.message||"Failed to send"})}finally{a(!1)}}};return r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(Ft,{className:"h-4 w-4 text-blue-400"}),r.jsx("div",{className:"text-white font-semibold",children:"Send Test Email"})]})}),r.jsxs(re,{children:[r.jsx("div",{className:"text-sm text-slate-300 mb-4",children:"Verify that email delivery (Resend / SMTP) is working by sending a test message."}),r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsx("input",{type:"email",placeholder:"[email protected]",value:e,onChange:c=>s(c.target.value),onKeyDown:c=>c.key==="Enter"&&l(),className:"flex-1 rounded-xl bg-white/5 border border-white/10 px-4 py-2.5 text-sm text-white placeholder-slate-500 focus:outline-none focus:border-white/30 transition"}),r.jsxs(W,{onClick:l,disabled:n||!e.trim(),className:"bg-blue-600 hover:bg-blue-500 text-white border border-blue-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[r.jsx(ia,{className:"h-3.5 w-3.5"}),n?"Sendingâ¦":"Send"]})]}),i&&r.jsxs("div",{className:`mt-3 rounded-xl px-4 py-2.5 text-sm ${i.ok?"bg-green-500/10 border border-green-500/20 text-green-300":"bg-red-500/10 border border-red-500/20 text-red-300"}`,children:[i.ok?r.jsx(ls,{className:"h-3.5 w-3.5 inline mr-1.5"}):r.jsx(oc,{className:"h-3.5 w-3.5 inline mr-1.5"}),i.message]})]})]})}function ire({data:t}){const e=Math.max(...t.map(n=>n.value),1),s=112;return r.jsx("div",{className:"flex items-end gap-1.5 h-40",children:t.map((n,a)=>{var l;const i=Math.max(n.value/e*s,4),o=n.value>0&&n.paid>0?Math.max(n.paid/n.value*i,2):0;return r.jsxs("div",{className:"flex-1 flex flex-col items-center gap-1 min-w-0",children:[r.jsx("div",{className:"text-[10px] text-slate-500 font-medium",children:n.value}),r.jsxs("div",{className:"w-full flex flex-col gap-0.5",style:{height:`${i}px`},children:[o>0&&r.jsx("div",{className:"w-full bg-green-500/60 rounded-t",style:{height:`${o}px`}}),r.jsx("div",{className:"w-full bg-blue-500/60 rounded-t flex-1",style:{minHeight:2}})]}),r.jsx("div",{className:"text-[9px] text-slate-400 truncate w-full text-center",children:((l=n.label)==null?void 0:l.slice(5))||n.label})]},a)})})}
886function ore(t){return t?`$${(t/100).toLocaleString("en-US",{minimumFractionDigits:0})}`:"$0"}function y_(t,e){if(!t)return"â";try{return new Intl.NumberFormat("en-US",{style:"currency",currency:e||"USD",minimumFractionDigits:0}).format(t/100)}catch{return`${e||""} ${(t/100).toFixed(0)}`}}function v_(t){if(!t)return"";const e=Date.now()-new Date(t).getTime(),s=Math.floor(e/6e4);if(s<1)return"just now";if(s<60)return`${s}m ago`;const n=Math.floor(s/60);if(n<24)return`${n}h ago`;const a=Math.floor(n/24);return a<30?`${a}d ago`:`${Math.floor(a/30)}mo ago`}function lre(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin",[n,a]=v.useState([]),[i,o]=v.useState(!0),[l,c]=v.useState(""),[d,u]=v.useState(""),[h,m]=v.useState(null),[f,p]=v.useState(!1),[g,x]=v.useState(null),b=v.useCallback(async()=>{try{c("");const j=await U("/api/admin/members",{token:t});a(j.members||[])}catch(j){c(j.message||"Failed to load members")}finally{o(!1)}},[t]);v.useEffect(()=>{s&&b()},[s,b]);const y=(j,S=!0)=>{x({msg:j,ok:S}),setTimeout(()=>x(null),4e3)},w=async()=>{if(h){p(!0);try{const{type:j,member:S}=h;j==="ban"?(await U(`/api/admin/members/${S.id}/ban`,{method:"POST",token:t}),y(`${S.first_name} ${S.last_name} has been banned`)):j==="unban"?(await U(`/api/admin/members/${S.id}/unban`,{method:"POST",token:t}),y(`${S.first_name} ${S.last_name} has been unbanned`)):j==="delete"?(await U(`/api/admin/members/${S.id}`,{method:"DELETE",token:t}),y(`${S.first_name} ${S.last_name} has been permanently deleted`)):j==="approval-email"&&(await U(`/api/admin/members/${S.id}/send-approval-email`,{method:"POST",token:t}),y(`Approval email sent to ${S.first_name} ${S.last_name}`)),m(null),await b()}catch(j){y(j.message||"Action failed",!1)}finally{p(!1)}}};if(!s)return r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold",children:"Access Denied"}),r.jsx("div",{className:"mt-1 text-sm text-slate-200",children:"Only administrators can manage members."})]})});const N=n.filter(j=>{var k,C,T,A;if(!d.trim())return!0;const S=d.toLowerCase();return((k=j.first_name)==null?void 0:k.toLowerCase().includes(S))||((C=j.last_name)==null?void 0:C.toLowerCase().includes(S))||((T=j.email)==null?void 0:T.toLowerCase().includes(S))||((A=j.organisation_name)==null?void 0:A.toLowerCase().includes(S))});return r.jsxs("div",{className:"grid gap-6",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:"Member Management"}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"View, ban, unban, and delete members. Admins cannot be banned or deleted."})]}),g&&r.jsxs("div",{className:`rounded-xl px-4 py-3 text-sm flex items-center gap-2 ${g.ok?"bg-green-500/10 border border-green-500/20 text-green-300":"bg-red-500/10 border border-red-500/20 text-red-300"}`,children:[g.ok?r.jsx(ls,{className:"h-4 w-4 shrink-0"}):r.jsx(oc,{className:"h-4 w-4 shrink-0"}),g.msg]}),l&&r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-red-200",children:l})})}),r.jsxs("div",{className:"relative",children:[r.jsx(Ua,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-500"}),r.jsx("input",{type:"text",placeholder:"Search by name, email, or organisation...",value:d,onChange:j=>u(j.target.value),className:"w-full rounded-xl bg-white/5 border border-white/10 pl-10 pr-4 py-2.5 text-sm text-white placeholder-slate-500 focus:outline-none focus:border-white/30 transition"})]}),i?r.jsx("div",{className:"space-y-3",children:Array.from({length:6}).map((j,S)=>r.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/5 p-4 animate-pulse",children:[r.jsx("div",{className:"h-4 w-48 bg-white/10 rounded"}),r.jsx("div",{className:"mt-2 h-3 w-32 bg-white/10 rounded"})]},S))}):r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx(at,{className:"h-4 w-4 text-blue-400"}),r.jsxs("div",{className:"text-white font-semibold",children:["All Members (",N.length,")"]})]})}),r.jsx(re,{children:r.jsxs("div",{className:"space-y-2 max-h-[600px] overflow-y-auto",children:[N.length===0&&r.jsx("div",{className:"text-sm text-slate-400 py-4 text-center",children:"No members found."}),N.map(j=>r.jsxs("div",{className:`flex items-center justify-between gap-3 rounded-xl border px-4 py-3 transition ${j.banned?"bg-red-500/5 border-red-500/20":"bg-white/5 border-white/10"}`,children:[r.jsxs("div",{className:"min-w-0 flex-1",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsxs("span",{className:"text-sm text-white font-medium",children:[j.first_name," ",j.last_name]}),j.role==="admin"&&r.jsx(Te,{tone:"accent",children:"Admin"}),j.role==="editor"&&r.jsx(Te,{tone:"brand",children:"Editor"}),j.banned&&r.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-semibold uppercase tracking-wider text-red-400 bg-red-500/10 px-2 py-0.5 rounded-full",children:[r.jsx(u7,{className:"h-3 w-3"})," Banned"]})]}),r.jsx("div",{className:"text-xs text-slate-400 truncate mt-0.5",children:j.email}),r.jsxs("div",{className:"text-xs text-slate-500 mt-0.5",children:[j.organisation_name," · ",j.job_title," · ",j.country]}),r.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[r.jsx(Te,{tone:j.payment_status==="paid"?"accent":"default",children:j.payment_status}),r.jsx("span",{className:"text-[10px] text-slate-500",children:j.membership_package})]})]}),j.role!=="admin"&&r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx("button",{onClick:()=>m({type:"approval-email",member:j}),title:"Send Approval Email",className:"p-2 rounded-lg bg-blue-500/10 border border-blue-500/20 text-blue-400 hover:bg-blue-500/20 transition",children:r.jsx(Ft,{className:"h-4 w-4"})}),j.banned?r.jsx("button",{onClick:()=>m({type:"unban",member:j}),title:"Unban",className:"p-2 rounded-lg bg-green-500/10 border border-green-500/20 text-green-400 hover:bg-green-500/20 transition",children:r.jsx(pk,{className:"h-4 w-4"})}):r.jsx("button",{onClick:()=>m({type:"ban",member:j}),title:"Ban",className:"p-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-400 hover:bg-amber-500/20 transition",children:r.jsx(Ru,{className:"h-4 w-4"})}),r.jsx("button",{onClick:()=>m({type:"delete",member:j}),title:"Delete",className:"p-2 rounded-lg bg-red-500/10 border border-red-500/20 text-red-400 hover:bg-red-500/20 transition",children:r.jsx(Lt,{className:"h-4 w-4"})})]})]},j.id))]})})]}),h&&r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",children:r.jsxs("div",{className:"relative w-full max-w-md mx-4 rounded-2xl border border-white/10 bg-[#0f0824] p-6 shadow-xl",children:[r.jsx("button",{onClick:()=>m(null),className:"absolute top-3 right-3 p-1 rounded-lg text-slate-400 hover:text-white hover:bg-white/10 transition",children:r.jsx(He,{className:"h-4 w-4"})}),r.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[h.type==="delete"?r.jsx("div",{className:"p-2 rounded-full bg-red-500/20",children:r.jsx(Lt,{className:"h-5 w-5 text-red-400"})}):h.type==="ban"?r.jsx("div",{className:"p-2 rounded-full bg-amber-500/20",children:r.jsx(Ru,{className:"h-5 w-5 text-amber-400"})}):h.type==="approval-email"?r.jsx("div",{className:"p-2 rounded-full bg-blue-500/20",children:r.jsx(Ft,{className:"h-5 w-5 text-blue-400"})}):r.jsx("div",{className:"p-2 rounded-full bg-green-500/20",children:r.jsx(pk,{className:"h-5 w-5 text-green-400"})}),r.jsx("div",{className:"text-white font-semibold text-lg",children:h.type==="delete"?"Delete Member":h.type==="ban"?"Ban Member":h.type==="approval-email"?"Send Approval Email"
886:"Unban Member"})]}),r.jsx("div",{className:"text-sm text-slate-300 mb-2",children:h.type==="approval-email"?"Send the membership approval email to this member? This includes login link, LinkedIn group, and WhatsApp group links.":r.jsxs(r.Fragment,{children:["Are you sure you want to ",r.jsx("strong",{className:"text-white",children:h.type})," this member?"]})}),r.jsxs("div",{className:"rounded-xl bg-white/5 border border-white/10 p-3 mb-4",children:[r.jsxs("div",{className:"text-sm text-white font-medium",children:[h.member.first_name," ",h.member.last_name]}),r.jsx("div",{className:"text-xs text-slate-400",children:h.member.email}),r.jsx("div",{className:"text-xs text-slate-500",children:h.member.organisation_name})]}),h.type==="delete"&&r.jsxs("div",{className:"flex items-start gap-2 rounded-xl bg-red-500/10 border border-red-500/20 p-3 mb-4",children:[r.jsx(oc,{className:"h-4 w-4 text-red-400 shrink-0 mt-0.5"}),r.jsxs("div",{className:"text-xs text-red-300",children:["This action is ",r.jsx("strong",{children:"permanent"})," and cannot be undone. All data associated with this member (payments, messages, event registrations) will be deleted."]})]}),h.type==="ban"&&r.jsxs("div",{className:"flex items-start gap-2 rounded-xl bg-amber-500/10 border border-amber-500/20 p-3 mb-4",children:[r.jsx(oc,{className:"h-4 w-4 text-amber-400 shrink-0 mt-0.5"}),r.jsx("div",{className:"text-xs text-amber-300",children:"The member will be unable to log in. You can unban them later."})]}),r.jsxs("div",{className:"flex items-center gap-3 justify-end",children:[r.jsx("button",{onClick:()=>m(null),disabled:f,className:"rounded-xl px-4 py-2 text-sm text-slate-300 bg-white/5 border border-white/10 hover:bg-white/10 transition",children:"Cancel"}),r.jsx("button",{onClick:w,disabled:f,className:`rounded-xl px-4 py-2 text-sm font-medium transition disabled:opacity-50 ${h.type==="delete"?"bg-red-600 hover:bg-red-500 text-white border border-red-500":h.type==="ban"?"bg-amber-600 hover:bg-amber-500 text-white border border-amber-500":h.type==="approval-email"?"bg-blue-600 hover:bg-blue-500 text-white border border-blue-500":"bg-green-600 hover:bg-green-500 text-white border border-green-500"}`,children:f?"Processing...":h.type==="delete"?"Yes, Delete Permanently":h.type==="ban"?"Yes, Ban Member":h.type==="approval-email"?"Send Email":"Yes, Unban Member"})]})]})})]})}function vm(t){if(!t)return null;const e=t.match(/(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))([^&?\s]+)/);return e?e[1]:null}function cre(){const{member:t,token:e}=Oe(),s=(t==null?void 0:t.role)==="admin",n=(t==null?void 0:t.role)==="editor",a=s||n,[i,o]=v.useState([]),[l,c]=v.useState(!0),[d,u]=v.useState(""),[h,m]=v.useState(null),[f,p]=v.useState(""),[g,x]=v.useState(""),[b,y]=v.useState(!1),[w,N]=v.useState(!1),j=async()=>{try{const D=await U("/api/partner-videos/admin",{token:e});o(D.videos||[])}catch(D){u(D.message||"Failed to load videos")}finally{c(!1)}};v.useEffect(()=>{a&&j()},[a]),v.useEffect(()=>{if(h){const D=setTimeout(()=>m(null),3e3);return()=>clearTimeout(D)}},[h]);const S=async D=>{if(D.preventDefault(),!g.trim())return;if(!vm(g.trim())){m({type:"error",message:"Invalid YouTube URL. Please paste a valid YouTube link."});return}y(!0);try{await U("/api/partner-videos/admin",{token:e,method:"POST",body:{title:f.trim(),youtube_url:g.trim()}}),p(""),x(""),N(!1),m({type:"success",message:"Video added successfully"}),await j()}catch(R){m({type:"error",message:R.message||"Failed to add video"})}finally{y(!1)}},k=async D=>{if(window.confirm("Remove this video from the partnering page?"))try{await U(`/api/partner-videos/admin/${D}`,{token:e,method:"DELETE"}),m({type:"success",message:"Video removed"}),await j()}catch(P){m({type:"error",message:P.message||"Failed to delete"})}},C=v.useRef(null),T=v.useRef(null),A=D=>{C.current=D},E=D=>{T.current=D},L=async()=>{if(C.current===null||T.current===null||C.current===T.current){C.current=null,T.current=null;return}const D=[...i],[P]=D.splice(C.current,1);D.splice(T.current,0,P),o(D),C.current=null,T.current=null;try{const R=D.map(($,O)=>({id:$.id,sort_order:O+1}));await U("/api/partner-videos/admin/reorder/batch",{token:e,method:"PUT",body:{order:R}}),m({type:"success",message:"Order saved"})}catch{m({type:"error",message:"Failed to save order"}),await j()}};return a?r.jsxs("div",{className:"max-w-4xl mx-auto",children:[r.jsxs("div",{className:"flex items-center justify-between mb-6",children:[r.jsxs("div",{children:[r.jsxs("h1",{className:"text-2xl font-bold text-white flex items-center gap-2",children:[r.jsx(Wi,{className:"h-6 w-6 text-[#c08a2f]"}),"Partner Page Videos"]}),r.jsx("p",{className:"mt-1 text-sm text-slate-400",children:"Manage conference highlight videos displayed on the Partnering With Us page."})]}),r.jsxs("button",{onClick:()=>N(!w),className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg bg-[#c08a2f] hover:bg-[#a
88677324] text-white text-sm font-medium transition",children:[w?r.jsx(He,{className:"h-4 w-4"}):r.jsx(qs,{className:"h-4 w-4"}),w?"Cancel":"Add Video"]})]}),w&&r.jsxs(V.div,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},className:"rounded-2xl border border-white/10 bg-white/5 p-6 mb-6",children:[r.jsx("h3",{className:"text-sm font-semibold text-white mb-4",children:"Add New Video"}),r.jsxs("form",{onSubmit:S,className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"Title (optional)"}),r.jsx("input",{type:"text",placeholder:"e.g. ACGC 2025 Conference Highlights",value:f,onChange:D=>p(D.target.value),className:"w-full h-10 rounded-lg border border-white/10 bg-white/5 px-3 text-sm text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1.5",children:"YouTube URL *"}),r.jsx("input",{type:"text",required:!0,placeholder:"https://www.youtube.com/watch?v=...",value:g,onChange:D=>x(D.target.value),className:"w-full h-10 rounded-lg border border-white/10 bg-white/5 px-3 text-sm text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),g&&vm(g)&&r.jsx("div",{className:"rounded-xl overflow-hidden border border-white/10",children:r.jsx("img",{src:`https://img.youtube.com/vi/${vm(g)}/hqdefault.jpg`,alt:"Preview",className:"w-full h-40 object-cover"})}),r.jsx("div",{className:"flex justify-end",children:r.jsxs("button",{type:"submit",disabled:b,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white text-sm font-medium transition disabled:opacity-60",children:[r.jsx(qs,{className:"h-3.5 w-3.5"})," ",b?"Adding...":"Add Video"]})})]})]}),l?r.jsx("div",{className:"text-center py-12 text-slate-400",children:"Loading..."}):d?r.jsx("div",{className:"text-center py-12 text-red-400",children:d}):i.length===0?r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-12 text-center",children:[r.jsx(Wi,{className:"h-10 w-10 text-slate-500 mx-auto mb-3"}),r.jsx("p",{className:"text-slate-400",children:'No videos added yet. Click "Add Video" to get started.'})]}):r.jsx("div",{className:"space-y-3",children:i.map((D,P)=>{const R=vm(D.youtube_url);return r.jsxs(V.div,{draggable:!0,onDragStart:()=>A(P),onDragEnter:()=>E(P),onDragEnd:L,onDragOver:$=>$.preventDefault(),initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:P*.03},className:"rounded-xl border border-white/10 bg-white/5 p-4 flex items-center gap-4 cursor-grab active:cursor-grabbing hover:bg-white/[0.08] transition",children:[r.jsx("div",{className:"text-slate-500 hover:text-slate-300 shrink-0",children:r.jsx(ui,{className:"h-5 w-5"})}),R&&r.jsxs("div",{className:"w-28 h-16 rounded-lg overflow-hidden bg-black shrink-0 relative",children:[r.jsx("img",{src:`https://img.youtube.com/vi/${R}/hqdefault.jpg`,alt:D.title,className:"w-full h-full object-cover"}),r.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:r.jsx("div",{className:"h-7 w-7 rounded-full bg-white/80 flex items-center justify-center",children:r.jsx(wn,{className:"h-3 w-3 text-[#1f0f3f] ml-0.5",fill:"#1f0f3f"})})})]}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm font-medium text-white truncate",children:D.title||"Untitled Video"}),r.jsx("div",{className:"text-xs text-slate-400 truncate mt-0.5",children:D.youtube_url})]}),r.jsx("button",{onClick:()=>k(D.id),className:"h-8 w-8 rounded-lg flex items-center justify-center text-slate-400 hover:text-red-400 hover:bg-red-500/10 transition shrink-0",title:"Remove video",children:r.jsx(Lt,{className:"h-4 w-4"})})]},D.id)})}),h&&r.jsx("div",{className:`fixed bottom-6 right-6 z-50 px-4 py-3 rounded-xl shadow-lg text-sm font-medium ${h.type==="error"?"bg-red-600 text-white":"bg-emerald-600 text-white"}`,children:h.message})]}):r.jsx("div",{className:"p-8 text-center text-slate-500",children:"Access denied"})}function dre(t){return t.split(" ").map(e=>e[0]).join("").toUpperCase().slice(0,2)}function ure(){const{token:t}=Oe(),[e,s]=v.useState([]),[n,a]=v.useState(!0),[i,o]=v.useState(null),[l,c]=v.useState(!1),[d,u]=v.useState(null),h=async()=>{try{const x=await U("/api/advisory-board/admin",{token:t});s(x.members||[])}catch{}finally{a(!1)}};v.useEffect(()=>{h()},[]),v.useEffect(()=>{if(d){const x=setTimeout(()=>u(null),3e3);return()=>clearTimeout(x)}},[d]);const m=async x=>{if(window.confirm("Remove this board member?"))try{await U(`/api/advisory-board/admin/${x}`,{token:t,method:"DELETE"}),u({type:"success",msg:"Removed"}),await h()}catch(b){u({type:"error",msg:b.message})}},f=v.useRef(null),p=v.useRef(null),g=async()=>
886{if(f.current===null||p.current===null||f.current===p.current){f.current=null,p.current=null;return}const x=[...e],[b]=x.splice(f.current,1);x.splice(p.current,0,b),s(x),f.current=null,p.current=null;try{await U("/api/advisory-board/admin/reorder/batch",{token:t,method:"PUT",body:{order:x.map((y,w)=>({id:y.id,sort_order:w+1}))}}),u({type:"success",msg:"Order saved"})}catch{await h()}};return r.jsxs("div",{className:"grid gap-6",children:[r.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:"Advisory Board"}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Manage advisory board members displayed on the public page."})]}),r.jsxs("button",{onClick:()=>{c(!l),o(null)},className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white text-sm font-medium transition",children:[l?r.jsx(He,{className:"h-4 w-4"}):r.jsx(qs,{className:"h-4 w-4"})," ",l?"Cancel":"Add Member"]})]}),l&&r.jsx(w_,{token:t,onDone:()=>{c(!1),h()},onToast:u}),i&&r.jsx(w_,{token:t,member:i,onDone:()=>{o(null),h()},onToast:u,onCancel:()=>o(null)}),r.jsxs(ne,{children:[r.jsx($s,{children:r.jsx("div",{className:"text-white font-semibold",children:"Board Members"})}),r.jsx(re,{children:n?r.jsx("div",{className:"text-sm text-slate-400",children:"Loading..."}):e.length===0?r.jsx("div",{className:"text-sm text-slate-400",children:"No members yet."}):r.jsxs("div",{className:"space-y-2",children:[r.jsx("div",{className:"text-xs text-slate-500 mb-1",children:"Drag to reorder"}),e.map((x,b)=>r.jsxs("div",{draggable:!0,onDragStart:()=>{f.current=b},onDragEnter:()=>{p.current=b},onDragEnd:g,onDragOver:y=>y.preventDefault(),className:"flex items-center gap-3 rounded-xl bg-white/5 border border-white/10 p-3 cursor-grab active:cursor-grabbing hover:bg-white/[0.08] transition",children:[r.jsx(ui,{className:"h-4 w-4 text-slate-500 shrink-0"}),r.jsx("div",{className:"w-10 h-10 rounded-full overflow-hidden bg-white/10 shrink-0",children:x.photo_url?r.jsx("img",{src:x.photo_url,alt:"",className:"w-full h-full object-cover"}):r.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-[#1f0f3f] to-[#3a1f6f]",children:r.jsx("span",{className:"text-xs font-bold text-white/80",children:dre(x.name)})})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-sm text-white font-medium truncate",children:x.name}),r.jsx("div",{className:"text-xs text-slate-400 truncate",children:[x.role_title,x.company].filter(Boolean).join(", ")}),x.chair_title&&r.jsx("div",{className:"text-xs text-[#c08a2f]",children:x.chair_title})]}),r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[x.linkedin_url&&r.jsx(bn,{className:"h-3.5 w-3.5 text-[#0077b5]"}),x.video_url&&r.jsx(Wi,{className:"h-3.5 w-3.5 text-purple-400"})]}),r.jsx("button",{onClick:()=>{o(x),c(!1)},className:"h-8 w-8 rounded-lg flex items-center justify-center text-slate-400 hover:text-blue-400 hover:bg-blue-500/10 transition shrink-0",children:r.jsx(V7,{className:"h-4 w-4"})}),r.jsx("button",{onClick:()=>m(x.id),className:"h-8 w-8 rounded-lg flex items-center justify-center text-slate-400 hover:text-red-400 hover:bg-red-500/10 transition shrink-0",children:r.jsx(Lt,{className:"h-4 w-4"})})]},x.id))]})})]}),d&&r.jsx("div",{className:`fixed bottom-6 right-6 z-50 px-4 py-3 rounded-xl shadow-lg text-sm font-medium ${d.type==="error"?"bg-red-600 text-white":"bg-emerald-600 text-white"}`,children:d.msg})]})}function w_({token:t,member:e,onDone:s,onToast:n,onCancel:a}){const i=!!e,[o,l]=v.useState((e==null?void 0:e.name)||""),[c,d]=v.useState((e==null?void 0:e.role_title)||""),[u,h]=v.useState((e==null?void 0:e.company)||""),[m,f]=v.useState((e==null?void 0:e.chair_title)||""),[p,g]=v.useState((e==null?void 0:e.linkedin_url)||""),[x,b]=v.useState((e==null?void 0:e.bio_html)||""),[y,w]=v.useState((e==null?void 0:e.video_url)||""),[N,j]=v.useState(!1),[S,k]=v.useState(!1),C=async E=>{if(E.preventDefault(),!!o.trim()){j(!0);try{const L={name:o.trim(),role_title:c.trim(),company:u.trim(),chair_title:m.trim(),linkedin_url:p.trim(),video_url:y.trim(),bio_html:x};i?await U(`/api/advisory-board/admin/${e.id}`,{token:t,method:"PUT",body:L}):await U("/api/advisory-board/admin",{token:t,method:"POST",body:L}),n({type:"success",msg:i?"Updated":"Added"}),s()}catch(L){n({type:"error",msg:L.message})}finally{j(!1)}}},T=async E=>{var D;const L=(D=E.target.files)==null?void 0:D[0];if(!(!L||!i)){k(!0);try{const P=new FormData;P.append("photo",L),await U(`/api/advisory-board/admin/${e.id}/photo`,{token:t,method:"POST",body:P}),n({type:"success",msg:"Photo uploaded"}),s()}catch(P){n({type:"error",msg:P.message})}finally{k(!1)}}},A="w-full h-9 rounded-lg border border-white/10 bg-white/5 px-3 text-sm text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40";return r.jsxs(ne,{children:[r.jsx($s,{children:r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"text-white font-semibold",children:i?`Edit: ${e.name}`:"Add New Member"}),a&&r.jsx("button",{onClick:a,className:"text-slate-400 hover:text-white",children:r.jsx(He,{className:"h-4 w-4"})})]})}),r.jsx(re,{children:r.jsxs("form",{onSubmit:C,className:"space-y-4",children:[r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1",children:"Name *"}),r.jsx("input",{required:!0,value:o,onChange:E=>l(E.target.value),placeholder:"Full name",className:A})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1",children:"Chair Title"}),r.jsx("input",{value:m,onChange:E=>f(E.target.value),placeholder:"e.g. Chair, ACGC Advisory Board",className:A})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1",children:"Role / Title"}),r.jsx("input",{value:c,onChange:E=>d(E.target.value),placeholder:"e.g. General Counsel",className:A})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1",children:"Company"}),r.jsx("input",{value:u,onChange:E=>h(E.target.value),placeholder:"e.g. Company Ltd (Country)",className:A})]}),r.jsxs("div",{className:"sm:col-span-2",children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1",children:"LinkedIn URL"}),r.jsx("input",{value:p,onChange:E=>g(E.target.value),placeholder:"https://linkedin.com/in/...",className:A})]}),r.jsxs("div",{className:"sm:col-span-2",children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1",children:"YouTube Video Bio URL"}),r.jsx("input",{value:y,onChange:E=>w(E.target.value),placeholder:"https://www.youtube.com/watch?v=...",className:A})]})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-1",children:"Bio (HTML)"}),r.jsx("textarea",{value:x,onChange:E=>b(E.target.value),rows:5,placeholder:"<p>Full biography text...</p>",className:"w-full rounded-lg border border-white/10 bg-white/5 px-3 py-2 text-sm text-white placeholder-slate-500 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),i&&r.jsxs("div",{className:"pt-2 border-t border-white/10",children:[r.jsx("label",{className:"block text-xs font-medium text-slate-300 mb-2",children:"Photo"}),e.photo_url&&r.jsx("img",{src:e.photo_url,alt:"",className:"w-16 h-16 rounded-full object-cover mb-2"}),r.jsxs("label",{className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-white/10 hover:bg-white/15 text-sm text-slate-200 transition cursor-pointer",children:[r.jsx(Q7,{className:"h-3.5 w-3.5"}
886)," ",S?"Uploading...":"Upload Photo",r.jsx("input",{type:"file",accept:"image/*",onChange:T,className:"hidden",disabled:S})]})]}),r.jsxs("div",{className:"flex items-center gap-3 pt-2",children:[r.jsxs("button",{type:"submit",disabled:N,className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg bg-[#c08a2f] hover:bg-[#a77324] text-white text-sm font-medium transition disabled:opacity-60",children:[r.jsx(Gw,{className:"h-3.5 w-3.5"})," ",N?"Saving...":i?"Update Member":"Add Member"]}),!i&&r.jsx("p",{className:"text-xs text-slate-500",children:"Save first, then edit to upload photo."})]})]})})]})}function W0(t,e){return`${(t||"")[0]||""}${(e||"")[0]||""}`.toUpperCase()}const j_=["bg-[#1f0f3f]","bg-[#2a1654]","bg-[#c08a2f]","bg-[#2d6a4f]","bg-[#7c3aed]","bg-[#0369a1]"];function G0(t){let e=0;for(let s=0;s<t.length;s++)e=t.charCodeAt(s)+((e<<5)-e);return j_[Math.abs(e)%j_.length]}function hre(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",[n,a]=v.useState([]),[i,o]=v.useState(""),[l,c]=v.useState(!1),[d,u]=v.useState([]),[h,m]=v.useState(!1),[f,p]=v.useState(null),[g,x]=v.useState(""),[b,y]=v.useState(!1),[w,N]=v.useState(""),[j,S]=v.useState(""),[k,C]=v.useState(!1),T=v.useCallback(async($="")=>{c(!0);try{const O=$?`?q=${encodeURIComponent($)}`:"",_=await U(`/api/leaderboard/admin/members${O}`,{token:t});a(_.members||[])}catch(O){S(O.message||"Failed to load members")}finally{c(!1)}},[t]),A=v.useCallback(async()=>{m(!0);try{const $=await U("/api/leaderboard/admin",{token:t});u($.leaderboard||[])}catch($){S($.message||"Failed to load leaderboard")}finally{m(!1)}},[t]);v.useEffect(()=>{s&&(T(),A())},[s,T,A]),v.useEffect(()=>{const $=setTimeout(()=>T(i),300);return()=>clearTimeout($)},[i,T]);const E=$=>{p($),x($.current_rank?String($.current_rank):""),N("")},L=async()=>{const $=Number(g);if(!$||$<1){N("Enter a valid rank (⥠1)");return}y(!0),N("");try{const O=await U("/api/leaderboard/admin",{token:t,method:"POST",body:{member_id:f.id,rank:$}});u(O.leaderboard||[]),await T(i),p(null)}catch(O){N(O.message||"Failed to assign rank")}finally{y(!1)}},D=async($,O)=>{const _=$.rank+O;if(!(_<1)){C(!0);try{const B=await U(`/api/leaderboard/admin/${$.id}`,{token:t,method:"PUT",body:{rank:_}});u(B.leaderboard||[]),await T(i)}catch(B){S(B.message||"Failed to update rank")}finally{C(!1)}}},P=async $=>{if(window.confirm(`Remove ${$.first_name} ${$.last_name} from the leaderboard?`)){C(!0);try{const O=await U(`/api/leaderboard/admin/${$.id}`,{token:t,method:"DELETE"});u(O.leaderboard||[]),await T(i)}catch(O){S(O.message||"Failed to remove entry")}finally{C(!1)}}};if(!s)return r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold",children:"Access Denied"}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Admin or Editor role required."})]})});const R=new Set(d.map($=>$.member_id));return r.jsxs("div",{className:"grid gap-5",children:[r.jsx("div",{className:"flex items-start justify-between flex-wrap gap-3",children:r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-semibold text-xl flex items-center gap-2",children:[r.jsx(Yw,{className:"h-5 w-5 text-[#c08a2f]"}),"Leaderboard Manager"]}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Search any registered ACGC member and assign them a rank. Rank 1 appears at the top of the podium."})]})}),j&&r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"text-sm text-red-300 flex items-center justify-between",children:[j,r.jsx("button",{onClick:()=>S(""),className:"text-slate-400 hover:text-white",children:r.jsx(He,{className:"h-4 w-4"})})]})})}),r.jsxs("div",{className:"grid lg:grid-cols-2 gap-5",children:[r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold mb-3",children:"All Registered Members"}),r.jsxs("div",{className:"relative mb-3",children:[r.jsx(Ua,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-slate-400"}),r.jsx("input",{type:"text",value:i,onChange:$=>o($.target.value),placeholder:"Search by name, title or organisationâ¦",className:"w-full h-10 pl-9 pr-3 rounded-xl border border-white/10 bg-white/5 text-white text-sm placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/40"})]}),r.jsxs("div",{className:"grid gap-2 max-h-[560px] overflow-y-auto pr-1",children:[l&&r.jsx("div",{className:"text-sm text-slate-400 py-4 text-center",children:"Loadingâ¦"}),!l&&n.length===0&&r.jsx("div",{className:"text-sm text-slate-400 py-4 text-center",children:"No members found."}),n.map($=>{const O=`${$.first_name} ${$.last_name}`,_=R.has($.id);return r.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-white/10 bg-white/5 p-3",children:[r.jsx("div",{className:`h-9 w-9 shrink-0 rounded-full ${G0(O)} flex items-center justify-center text-xs font-bold text-white`,children:$.avatar_url?r.jsx("img",{src:$.avatar_url,alt:O,className:"h-full w-full rounded-full object-cover"}):W0($.first_name,$.last_name)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-white text-sm font-medium truncate",children:O}),r.jsxs("div",{className:"text-xs text-slate-400 truncate",children:[$.job_title," · ",$.organisation]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[_&&r.jsxs(Te,{tone:"accent",children:["#",$.current_rank]}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>
886E($),disabled:k,children:_?"Update Rank":"Assign Rank"})]})]},$.id)})]})]})}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"text-white font-semibold mb-3",children:["Current Leaderboard",r.jsxs("span",{className:"ml-2 text-xs font-normal text-slate-400",children:["(",d.length," ranked)"]})]}),h&&r.jsx("div",{className:"text-sm text-slate-400 py-4 text-center",children:"Loadingâ¦"}),!h&&d.length===0&&r.jsx("div",{className:"text-sm text-slate-400 py-4 text-center",children:"No one ranked yet. Use the left panel to assign ranks to members."}),r.jsx("div",{className:"grid gap-2 max-h-[560px] overflow-y-auto pr-1",children:d.map(($,O)=>{const _=`${$.first_name} ${$.last_name}`,B=$.rank<=3,J=$.rank===1?"ð¥":$.rank===2?"ð¥":$.rank===3?"ð¥":null;return r.jsxs("div",{className:`flex items-center gap-3 rounded-xl border p-3 ${B?"border-[#c08a2f]/40 bg-[#c08a2f]/10":"border-white/10 bg-white/5"}`,children:[r.jsx("div",{className:"w-8 text-center shrink-0",children:J?r.jsx("span",{className:"text-xl",children:J}):r.jsxs("span",{className:"text-sm font-bold text-slate-400",children:["#",$.rank]})}),r.jsx("div",{className:`h-9 w-9 shrink-0 rounded-full ${G0(_)} flex items-center justify-center text-xs font-bold text-white`,children:$.avatar_url?r.jsx("img",{src:$.avatar_url,alt:_,className:"h-full w-full rounded-full object-cover"}):W0($.first_name,$.last_name)}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"text-white text-sm font-medium truncate",children:_}),r.jsxs("div",{className:"text-xs text-slate-400 truncate",children:[$.job_title," · ",$.organisation]})]}),r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>D($,-1),disabled:k||O===0,className:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-white/10 disabled:opacity-30 transition",title:"Move up",children:r.jsx(px,{className:"h-3.5 w-3.5"})}),r.jsx("button",{onClick:()=>D($,1),disabled:k||O===d.length-1,className:"p-1.5 rounded-lg text-slate-400 hover:text-white hover:bg-white/10 disabled:opacity-30 transition",title:"Move down",children:r.jsx(fx,{className:"h-3.5 w-3.5"})}),r.jsx("button",{onClick:()=>E({...$,id:$.member_id,current_rank:$.rank}),disabled:k,className:"p-1.5 rounded-lg text-slate-400 hover:text-[#c08a2f] hover:bg-white/10 disabled:opacity-30 transition text-xs font-medium",title:"Edit rank",children:"Edit"}),r.jsx("button",{onClick:()=>P($),disabled:k,className:"p-1.5 rounded-lg text-slate-400 hover:text-red-400 hover:bg-red-400/10 disabled:opacity-30 transition",title:"Remove from leaderboard",children:r.jsx(He,{className:"h-3.5 w-3.5"})})]})]},$.id)})})]})})]}),f&&r.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:r.jsxs("div",{className:"bg-[#161b22] border border-white/10 rounded-2xl p-6 w-full max-w-sm shadow-2xl",children:[r.jsxs("div",{className:"flex items-center justify-between mb-4",children:[r.jsx("div",{className:"text-white font-semibold",children:f.current_rank?"Update Rank":"Assign Rank"}),r.jsx("button",{onClick:()=>p(null),className:"text-slate-400 hover:text-white",children:r.jsx(He,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"flex items-center gap-3 mb-5 p-3 rounded-xl bg-white/5 border border-white/10",children:[r.jsx("div",{className:`h-10 w-10 shrink-0 rounded-full ${G0(`${f.first_name} ${f.last_name}`)} flex items-center justify-center text-sm font-bold text-white`,children:W0(f.first_name,f.last_name)}),r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-medium",children:[f.first_name," ",f.last_name]}),r.jsxs("div",{className:"text-xs text-slate-400",children:[f.job_title," · ",f.organisation]})]})]}),r.jsxs("div",{className:"mb-1",children:[r.jsx(Y,{label:"Rank number",labelClassName:"text-slate-200",type:"number",min:"1",value:g,onChange:$=>x($.target.value),placeholder:"e.g. 1",autoFocus:!0}),r.jsx("p",{className:"mt-1 text-xs text-slate-400",children:"Rank 1 = top of podium. If another member holds this rank, they will be removed from that position."})]}),w&&r.jsx("div",{className:"mt-2 text-sm text-red-400",children:w}),r.jsxs("div",{className:"mt-4 flex gap-2 justify-end",children:[r.jsx(W,{variant:"portal",onClick:()=>p(null),disabled:b,children:"Cancel"}),r.jsx(W,{variant:"portal",onClick:L,disabled:b,children:b?"Savingâ¦":"Confirm Rank"})]})]})})]})}function mre(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",[n,a]=v.useState([]),[i,o]=v.useState(!1),[l,c]=v.useState(!1),[d,u]=v.useState("create"),[h,m]=v.useState(null),[f,p]=v.useState(!1),[g,x]=v.useState(""),[b,y]=v.useState(""),w={title:"",slug:"",year:new Date().getFullYear(),quarter:"Q1",description:"",sessions:[],slides:[],supporting_documents:[],faculty:[],group_submissions:[],whatsapp_url:"",is_active:!1},[N,j]=v.useState(w),S=v.useCallback(async()=>
886{if(t){o(!0);try{const O=await U("/api/resource-hub/admin/programs",{token:t});a(O.programs||[])}catch(O){console.error(O)}finally{o(!1)}}},[t]);v.useEffect(()=>{s&&S()},[s,S]);const k=()=>{u("create"),m(null),j({...w}),x(""),y(""),c(!0)},C=O=>{u("edit"),m(O.id),j({title:O.title||"",slug:O.slug||"",year:O.year||new Date().getFullYear(),quarter:O.quarter||"",description:O.description||"",sessions:O.sessions||[],slides:O.slides||[],supporting_documents:O.supporting_documents||[],faculty:O.faculty||[],group_submissions:O.group_submissions||[],whatsapp_url:O.whatsapp_url||"",is_active:!!O.is_active}),x(""),y(""),c(!0)},T=()=>{f||c(!1)},A=async(O,_)=>{var J;const B=(J=O.target.files)==null?void 0:J[0];if(B){if(B.size>50*1024*1024){alert("File too large. Max 50 MB.");return}try{p(!0);const Q=new FormData;Q.append("file",B);const ce=await U("/api/resource-hub/admin/upload",{method:"POST",body:Q,token:t});ce.url&&_(ce.url)}catch(Q){alert(Q.message||"File upload failed")}finally{p(!1),O.target.value=""}}},E=async O=>{if(O.preventDefault(),!N.title.trim()){x("Title is required");return}p(!0),x(""),y("");try{const _=d==="edit"?`/api/resource-hub/admin/programs/${h}`:"/api/resource-hub/admin/programs";await U(_,{token:t,method:d==="edit"?"PUT":"POST",body:{...N,year:N.year?Number(N.year):null}}),y(d==="edit"?"Program updated.":"Program created."),await S(),c(!1)}catch(_){x(_.message||"Failed to save")}finally{p(!1)}},L=async O=>{if(!f&&window.confirm("Delete this Resource Hub Program completely? This action cannot be undone.")){p(!0),x("");try{await U(`/api/resource-hub/admin/programs/${O}`,{token:t,method:"DELETE"}),await S()}catch(_){x(_.message||"Failed to delete")}finally{p(!1)}}},D=(O,_)=>{j(B=>({...B,[O]:[...B[O],_]}))},P=(O,_,B,J)=>{j(Q=>{const ce=[...Q[O]];return ce[_]={...ce[_],[B]:J},{...Q,[O]:ce}})},R=(O,_)=>{j(B=>{const J=[...B[O]];return J.splice(_,1),{...B,[O]:J}})},$=(O,_,B)=>{_+B<0||_+B>=N[O].length||j(J=>{const Q=[...J[O]],ce=Q[_];return Q[_]=Q[_+B],Q[_+B]=ce,{...J,[O]:Q}})};return s?r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:"Resource Hub Programs"}),r.jsxs("div",{className:"mt-1 text-sm text-slate-300",children:["Create and manage standalone dedicated resource hubs (e.g., ACEP 2025 Hub). These do NOT appear in the general resources directory.",r.jsx("button",{onClick:async()=>{if(window.confirm("This will download ACEP assets from the legacy library, upload them to Cloudinary, and replace the acep-2025 programme. Requires CLOUDINARY_* env. YouTube videos are embedded on this site. Proceed?"))try{await U("/api/resource-hub/admin/seed-acep-2025",{method:"POST",token:t}),alert("Successfully seeded ACEP 2025 content!"),window.location.reload()}catch(O){alert("Error seeding data: "+O.message)}},className:"mt-2 px-3 py-1.5 bg-[#c08a2f] text-white text-xs font-semibold rounded hover:bg-[#a77324] transition-colors",children:"Auto-Migrate ACEP 2025 (legacy â Cloudinary)"})]})]}),r.jsx(W,{variant:"portal",onClick:k,disabled:f,children:"+ New Program Hub"})]}),g&&r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-red-300",children:g})})}),b&&r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-green-300",children:b})})}),r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold mb-4",children:"Existing Hubs"}),r.jsxs("div",{className:"grid gap-2",children:[i?r.jsx("div",{className:"text-slate-400",children:"Loading..."}):null,!i&&n.length===0&&r.jsx("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-3 text-sm text-slate-300",children:"No programs found."}),n.map(O=>r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-4 flex items-center justify-between gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-medium text-lg",children:O.title}),r.jsxs("div",{className:"text-xs text-slate-400 mt-1",children:["Slug: /",O.slug,"-hub · ",O.year," ",O.quarter," · ",O.sessions.length," sessions, ",O.slides.length," slides, ",O.faculty.length," faculty"]})]}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[r.jsx(Te,{tone:O.is_active?"accent":"neutral",children:O.is_active?"Active":"Draft"}),r.jsx(W,{variant:"portal",size:"sm",as:"a",href:`/${O.slug}-hub`,target:"_blank",children:"View"}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>C(O),disabled:f,children:"Edit"}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>L(O.id),disabled:f,children:"Delete"})]})]},O.id))]})]})}),l&&r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:T,"aria-label":"Close"}),r.jsx("div",{className:"relative max-w-4xl mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-white/10 bg-[#161b22] shadow-2xl overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between sticky top-0 bg-[#161b22] z-10",children:[r.jsx("div",{className:"text-white font-semibold text-lg",children:d==="edit"?"Edit Resource Hub":"New Resource Hub"}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(W,{variant:"portal",onClick:T,disabled:f,children:"Cancel"}
886),r.jsx(W,{variant:"portal",onClick:E,disabled:f,children:f?"Saving...":"Save Hub"})]})]}),r.jsx("div",{className:"p-6",children:r.jsxs("form",{className:"grid gap-6",onSubmit:E,children:[g&&r.jsx("div",{className:"p-3 bg-red-900/50 text-red-200 rounded-xl",children:g}),r.jsxs("div",{className:"space-y-4 bg-white/5 p-5 rounded-2xl border border-white/10",children:[r.jsx("h3",{className:"text-white font-medium text-lg",children:"Basic Details"}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsx(Y,{label:"Program Title",labelClassName:"text-slate-200",value:N.title,onChange:O=>j(_=>({..._,title:O.target.value})),required:!0,placeholder:"e.g. ACEP 2026"}),r.jsx(Y,{label:"URL Slug (auto-generated if empty)",labelClassName:"text-slate-200",value:N.slug,onChange:O=>j(_=>({..._,slug:O.target.value})),placeholder:"e.g. acep-2026"}),r.jsx(Y,{label:"Year",type:"number",labelClassName:"text-slate-200",value:N.year,onChange:O=>j(_=>({..._,year:O.target.value}))}),r.jsx(Y,{label:"Quarter",labelClassName:"text-slate-200",value:N.quarter,onChange:O=>j(_=>({..._,quarter:O.target.value})),placeholder:"e.g. Q1"})]}),r.jsx("label",{className:"block text-sm font-medium text-slate-200",children:"Description"}),r.jsx("textarea",{className:"w-full px-3 py-2 bg-[#0d1117] border border-white/10 rounded-xl text-white focus:outline-none focus:ring-2 focus:ring-[#c08a2f]",rows:3,value:N.description,onChange:O=>j(_=>({..._,description:O.target.value}))}),r.jsx(Y,{label:"WhatsApp Group URL (optional)",labelClassName:"text-slate-200",value:N.whatsapp_url,onChange:O=>j(_=>({..._,whatsapp_url:O.target.value})),placeholder:"https://chat.whatsapp.com/..."}),r.jsxs("label",{className:"flex items-center gap-2 text-white",children:[r.jsx("input",{type:"checkbox",checked:N.is_active,onChange:O=>j(_=>({..._,is_active:O.target.checked})),className:"w-4 h-4 rounded text-[#c08a2f]"}),"Publish Program (Make Active)"]})]}),r.jsxs("div",{className:"space-y-4 bg-white/5 p-5 rounded-2xl border border-white/10",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsx("h3",{className:"text-white font-medium text-lg",children:"Sessions / Video Recordings"}),r.jsx(W,{variant:"portal",size:"sm",type:"button",onClick:()=>D("sessions",{title:"",url:"",thumbnail:""}),children:"+ Add Session"})]}),N.sessions.map((O,_)=>r.jsxs("div",{className:"flex gap-3 bg-[#0d1117] p-3 rounded-xl border border-white/5",children:[r.jsxs("div",{className:"flex flex-col gap-1 justify-center",children:[r.jsx("button",{type:"button",onClick:()=>$("sessions",_,-1),className:"text-slate-500 hover:text-white",children:r.jsx(ui,{className:"h-4 w-4"})}),r.jsx("button",{type:"button",onClick:()=>$("sessions",_,1),className:"text-slate-500 hover:text-white",children:r.jsx(ui,{className:"h-4 w-4"})})]}),r.jsxs("div",{className:"flex-1 grid md:grid-cols-3 gap-3",children:[r.jsx(Y,{placeholder:"Session Title",value:O.title,onChange:B=>P("sessions",_,"title",B.target.value)}),r.jsx(Y,{placeholder:"Video URL (YouTube/Vimeo)",value:O.url,onChange:B=>P("sessions",_,"url",B.target.value)}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Y,{placeholder:"Thumbnail URL",value:O.thumbnail,onChange:B=>P("sessions",_,"thumbnail",B.target.value),className:"flex-1"}),r.jsxs("label",{className:"cursor-pointer bg-white/10 hover:bg-white/20 text-white text-xs px-2 py-2 rounded flex items-center justify-center shrink-0",children:["Upload",r.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:B=>A(B,J=>P("sessions",_,"thumbnail",J))})]})]})]}),r.jsx("button",{type:"button",onClick:()=>R("sessions",_),className:"text-red-400 hover:text-red-300 shrink-0",children:r.jsx(Lt,{className:"h-5 w-5 mt-2"})})]},_))]}),r.jsxs("div",{className:"space-y-4 bg-white/5 p-5 rounded-2xl border border-white/10",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsx("h3",{className:"text-white font-medium text-lg",children:"Slides & Materials"}),r.jsx(W,{variant:"portal",size:"sm",type:"button",onClick:()=>D("slides",{title:"",url:"",session:""}),children:"+ Add Slide"})]}),N.slides.map((O,_)=>r.jsxs("div",{className:"flex gap-3 bg-[#0d1117] p-3 rounded-xl border border-white/5",children:[r.jsx("div",{className:"flex flex-col gap-1 justify-center",children:r.jsx("button",{type:"button",onClick:()=>$("slides",_,-1),className:"text-slate-500 hover:text-white",children:r.jsx(ui,{className:"h-4 w-4"})})}),r.jsxs("div",{className:"flex-1 grid md:grid-cols-3 gap-3",children:[r.jsx(Y,{placeholder:"Slide Title",value:O.t
886itle,onChange:B=>P("slides",_,"title",B.target.value)}),r.jsx(Y,{placeholder:"Session (e.g. 'Session 1')",value:O.session,onChange:B=>P("slides",_,"session",B.target.value)}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Y,{placeholder:"PDF URL",value:O.url,onChange:B=>P("slides",_,"url",B.target.value),className:"flex-1"}),r.jsxs("label",{className:"cursor-pointer bg-white/10 hover:bg-white/20 text-white text-xs px-2 py-2 rounded flex items-center justify-center shrink-0",children:["Upload",r.jsx("input",{type:"file",className:"hidden",accept:".pdf,.doc,.docx,.ppt,.pptx",onChange:B=>A(B,J=>P("slides",_,"url",J))})]})]})]}),r.jsx("button",{type:"button",onClick:()=>R("slides",_),className:"text-red-400 hover:text-red-300 shrink-0",children:r.jsx(Lt,{className:"h-5 w-5 mt-2"})})]},_))]}),r.jsxs("div",{className:"space-y-4 bg-white/5 p-5 rounded-2xl border border-white/10",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsx("h3",{className:"text-white font-medium text-lg",children:"Supporting Documents"}),r.jsx(W,{variant:"portal",size:"sm",type:"button",onClick:()=>D("supporting_documents",{title:"",url:""}),children:"+ Add Document"})]}),N.supporting_documents.map((O,_)=>r.jsxs("div",{className:"flex gap-3 bg-[#0d1117] p-3 rounded-xl border border-white/5",children:[r.jsx("div",{className:"flex flex-col gap-1 justify-center",children:r.jsx("button",{type:"button",onClick:()=>$("supporting_documents",_,-1),className:"text-slate-500 hover:text-white",children:r.jsx(ui,{className:"h-4 w-4"})})}),r.jsxs("div",{className:"flex-1 grid md:grid-cols-2 gap-3",children:[r.jsx(Y,{placeholder:"Document Title",value:O.title,onChange:B=>P("supporting_documents",_,"title",B.target.value)}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Y,{placeholder:"File URL",value:O.url,onChange:B=>P("supporting_documents",_,"url",B.target.value),className:"flex-1"}),r.jsxs("label",{className:"cursor-pointer bg-white/10 hover:bg-white/20 text-white text-xs px-2 py-2 rounded flex items-center justify-center shrink-0",children:["Upload",r.jsx("input",{type:"file",className:"hidden",accept:".pdf,.doc,.docx,.ppt,.pptx,.xls,.xlsx",onChange:B=>A(B,J=>P("supporting_documents",_,"url",J))})]})]})]}),r.jsx("button",{type:"button",onClick:()=>R("supporting_documents",_),className:"text-red-400 hover:text-red-300 shrink-0",children:r.jsx(Lt,{className:"h-5 w-5 mt-2"})})]},_))]}),r.jsxs("div",{className:"space-y-4 bg-white/5 p-5 rounded-2xl border border-white/10",children:[r.jsxs("div",{className:"flex justify-between items-center",children:[r.jsx("h3",{className:"text-white font-medium text-lg",children:"Faculty"}),r.jsx(W,{variant:"portal",size:"sm",type:"button",onClick:()=>D("faculty",{name:"",title:"",photo:"",bio:""}),children:"+ Add Faculty"})]}),N.faculty.map((O,_)=>r.jsxs("div",{className:"flex gap-3 bg-[#0d1117] p-4 rounded-xl border border-white/5",children:[r.jsx("div",{className:"flex flex-col gap-1",children:r.jsx("button",{type:"button",onClick:()=>$("faculty",_,-1),className:"text-slate-500 hover:text-white",children:r.jsx(ui,{className:"h-4 w-4"})})}),r.jsxs("div",{className:"flex-1 grid gap-3",children:[r.jsxs("div",{className:"grid md:grid-cols-3 gap-3",children:[r.jsx(Y,{placeholder:"Name",value:O.name,onChange:B=>P("faculty",_,"name",B.target.value)}),r.jsx(Y,{placeholder:"Title / Credentials",value:O.title,onChange:B=>P("faculty",_,"title",B.target.value)}),r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Y,{placeholder:"Photo URL",value:O.photo,onChange:B=>P("faculty",_,"photo",B.target.value),className:"flex-1"}),r.jsxs("label",{className:"cursor-pointer bg-white/10 hover:bg-white/20 text-white text-xs px-2 py-2 rounded flex items-center justify-center shrink-0",children:["Upload",r.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:B=>A(B,J=>P("faculty",_,"photo",J))})]})]})]}),r.jsx(Y,{placeholder:"Short Bio (Optional)",value:O.bio,onChange:B=>P("faculty",_,"bio",B.target.value)})]}),r.jsx("button",{type:"button",onClick:()=>R("faculty",_),className:"text-red-400 hover:text-red-300 shrink-0",children:r.jsx(Lt,{className:"h-5 w-5 mt-2"})})]},_))]}),r.jsxs("div",{className:"sticky bottom-0 bg-[#161b22] pt-4 pb-2 border-t border-white/10 flex justify-end gap-3",children:[r.jsx(W,{variant:"portal",type:"button",onClick:T,disabled:f,children:"Cancel"}),r.jsx(W,{variant:"portal",type:"submit",disabled:f,children:f?"
886Saving...":"Save Hub Program"})]})]})})]})})]})]}):r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"text-white font-semibold",children:"Access Denied"}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Admin or Editor role required."})]})})}const fre=["Programmes","Contributions","Support Requests","Bank Details"],N_={name:"",category:"other",description:"",cost_note:"",application_url:"",flyer_url:"",is_active:!0,sort_order:0};function pre(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",[n,a]=v.useState("Programmes");return s?r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:"ACGC LIFT Initiative"}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Manage LIFT programmes and view contributions & support requests."})]}),r.jsx("div",{className:"flex gap-2 border-b border-white/10",children:fre.map(i=>r.jsx("button",{onClick:()=>a(i),className:`px-4 py-2 text-sm font-medium border-b-2 transition ${n===i?"border-[#c08a2f] text-white":"border-transparent text-slate-400 hover:text-slate-200"}`,children:i},i))}),n==="Programmes"&&r.jsx(gre,{token:t}),n==="Contributions"&&r.jsx(bre,{token:t}),n==="Support Requests"&&r.jsx(yre,{token:t}),n==="Bank Details"&&r.jsx(xre,{token:t})]}):r.jsx("div",{className:"text-slate-400 p-8 text-center",children:"Access denied"})}function xre({token:t}){const[e,s]=v.useState(""),[n,a]=v.useState(!0),[i,o]=v.useState(!1),[l,c]=v.useState(""),[d,u]=v.useState(!1),h=async()=>{a(!0),c("");try{const f=await U("/api/lift/admin/bank-details",{token:t});s(f.bank_details||"")}catch(f){c(f.message||"Failed to load bank details")}finally{a(!1)}};v.useEffect(()=>{h()},[t]);const m=async()=>{o(!0),c(""),u(!1);try{await U("/api/lift/admin/bank-details",{token:t,method:"PUT",body:{bank_details:e}}),u(!0),setTimeout(()=>u(!1),2500)}catch(f){c(f.message||"Failed to save")}finally{o(!1)}};return r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-center gap-2 text-white font-semibold mb-1",children:[r.jsx(Hw,{className:"h-4 w-4 text-[#c08a2f]"})," Bank Transfer Instructions"]}),r.jsx("p",{className:"text-sm text-slate-400 mb-4",children:'Shown to contributors on the public LIFT page when they choose "Bank transfer" instead of paying by card. Include account name, bank, account/IBAN number, SWIFT/BIC, and any per-currency details.'}),n?r.jsx("div",{className:"text-slate-400 text-center py-8",children:"Loading..."}):r.jsxs("div",{className:"grid gap-3",children:[r.jsx("textarea",{value:e,onChange:f=>s(f.target.value),rows:10,className:"w-full rounded-2xl bg-white/10 border border-white/15 px-4 py-3 text-sm text-white placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500/50 font-mono",placeholder:`e.g. 887Account name: ACGC 888Bank: ... 889Account number / IBAN: ... 890SWIFT/BIC: ... 891USD account: ... 892GBP account: ...`}),l&&r.jsx("div",{className:"text-sm text-red-300",children:l}),r.jsxs("div",{className:"flex items-center justify-end gap-3",children:[d&&r.jsxs("span",{className:"text-sm text-emerald-300 flex items-center gap-1",children:[r.jsx(ls,{className:"h-4 w-4"})," Saved"]}),r.jsx(W,{variant:"primary",onClick:m,disabled:i,children:i?"Saving...":"Save"})]})]})]})})}function gre({token:t}){const[e,s]=v.useState([]),[n,a]=v.useState(!1),[i,o]=v.useState(""),[l,c]=v.useState(null),[d,u]=v.useState({...N_}),[h,m]=v.useState(!1),[f,p]=v.useState(!1),g=v.useRef(null),x=async()=>{a(!0),o("");try{const C=await U("/api/lift/admin/programmes",{token:t});s(C.programmes||[])}catch(C){o(C.message||"Failed to load programmes")}finally{a(!1)}};v.useEffect(()=>{x()},[t]);const b=(C,T)=>u(A=>({...A,[C]:T})),y=()=>{u({...N_,sort_order:e.length}),c("new")},w=C=>{u({name:C.name,category:C.category,description:C.description||"",cost_note:C.cost_note||"",application_url:C.application_url||"",flyer_url:C.flyer_url||"",is_active:C.is_active,sort_order:C.sort_order}),c(C)},N=()=>c(null),j=async()=>{m(!0),o("");try{l==="new"?await U("/api/lift/admin/programmes",{token:t,method:"POST",body:d}):await U(`/api/lift/admin/programmes/${l.id}`,{token:t,method:"PUT",body:d}),N(),x()}catch(C){o(C.message||"Failed to save")}finally{m(!1)}},S=async C=>{var A;const T=(A=C.target.files)==null?void 0:A[0];if(T){p(!0),o("");try{const E=new FormData;E.append("file",T);const L=await U("/api/lift/admin/upload",{method:"POST",body:E,token:t});b("flyer_url",L.file_url)}catch(E){o(E.message||"Failed to upload flyer")}finally{p(!1),g.current&&(g.current.value="")}}},k=async C=>
892{if(window.confirm("Delete this programme?"))try{await U(`/api/lift/admin/programmes/${C}`,{token:t,method:"DELETE"}),x()}catch(T){o(T.message||"Failed to delete")}};return r.jsxs("div",{className:"grid gap-4",children:[r.jsx("div",{className:"flex justify-end",children:r.jsxs(W,{variant:"portal",onClick:y,children:[r.jsx(qs,{className:"h-4 w-4"})," Add Programme"]})}),i&&r.jsx("div",{className:"text-sm text-red-300",children:i}),l!==null&&r.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[r.jsx("button",{type:"button",className:"fixed inset-0 bg-black/50",onClick:N,"aria-label":"Close"}),r.jsx("div",{className:"relative max-w-2xl mx-auto my-8 px-4 pb-8",children:r.jsxs("div",{className:"rounded-3xl border border-white/10 bg-brand-900 shadow-soft overflow-hidden",children:[r.jsxs("div",{className:"p-4 border-b border-white/10 flex items-center justify-between gap-3",children:[r.jsx("div",{className:"text-white font-semibold",children:l==="new"?"Add LIFT Programme":"Edit Programme"}),r.jsx(W,{variant:"portal",onClick:N,children:"Close"})]}),r.jsx("div",{className:"p-4",children:r.jsxs("div",{className:"grid gap-4",children:[r.jsx(Y,{label:"Programme name *",labelClassName:"text-slate-200",value:d.name,onChange:C=>b("name",C.target.value),placeholder:"e.g. Harambee Fellowship"}),r.jsxs(Re,{label:"Category",labelClassName:"text-slate-200",value:d.category,onChange:C=>b("category",C.target.value),children:[r.jsx("option",{value:"online_course",className:"bg-white text-slate-900",children:"Online course"}),r.jsx("option",{value:"in_person_event",className:"bg-white text-slate-900",children:"In-person event"}),r.jsx("option",{value:"fellowship",className:"bg-white text-slate-900",children:"Fellowship"}),r.jsx("option",{value:"other",className:"bg-white text-slate-900",children:"Other"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"acgc-label text-sm text-slate-200 mb-1 block",children:"Description"}),r.jsx("textarea",{value:d.description,onChange:C=>b("description",C.target.value),rows:3,className:"w-full rounded-2xl bg-white/10 border border-white/15 px-4 py-3 text-sm text-white placeholder:text-slate-400 focus:outline-none focus:ring-2 focus:ring-accent-500/50"})]}),r.jsx(Y,{label:"Cost note",labelClassName:"text-slate-200",value:d.cost_note,onChange:C=>b("cost_note",C.target.value),placeholder:"e.g. $100â$300 USD"}),r.jsx(Y,{label:"Application URL",labelClassName:"text-slate-200",value:d.application_url,onChange:C=>b("application_url",C.target.value),placeholder:"Google form / external link"}),r.jsxs("div",{children:[r.jsx("label",{className:"acgc-label text-sm text-slate-200 mb-1 block",children:"Flyer"}),r.jsxs("div",{className:"flex items-center gap-3",children:[d.flyer_url&&(/\.pdf$/i.test(d.flyer_url)?r.jsx("a",{href:d.flyer_url,target:"_blank",rel:"noreferrer",className:"text-xs text-[#c08a2f] underline",children:"View uploaded PDF"}):r.jsx("img",{src:d.flyer_url,alt:"flyer",className:"h-16 w-16 object-cover rounded-lg border border-white/15"})),r.jsx("input",{ref:g,type:"file",accept:"image/*,application/pdf",onChange:S,className:"text-xs text-slate-300"}),f&&r.jsx("span",{className:"text-xs text-slate-400",children:"Uploadingâ¦"})]})]}),r.jsxs("div",{className:"grid md:grid-cols-2 gap-4",children:[r.jsxs(Re,{label:"Active",labelClassName:"text-slate-200",value:d.is_active?"1":"0",onChange:C=>b("is_active",C.target.value==="1"),children:[r.jsx("option",{value:"1",className:"bg-white text-slate-900",children:"Yes â shown on LIFT page"}),r.jsx("option",{value:"0",className:"bg-white text-slate-900",children:"No â hidden"})]}),r.jsx(Y,{label:"Sort order",labelClassName:"text-slate-200",type:"number",value:d.sort_order,onChange:C=>b("sort_order",Number(C.target.value))})]}),r.jsxs("div",{className:"flex justify-end gap-2 pt-2",children:[r.jsx(W,{variant:"portal",onClick:N,children:"Cancel"}),r.jsx(W,{variant:"primary",onClick:j,disabled:h,children:h?"Saving...":"Save"})]})]})})]})})]}),n?r.jsx("div",{className:"text-slate-400 text-center py-8",children:"Loading..."}):e.length===0?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-slate-400 text-center py-8",children:'No programmes yet. Click "Add Programme" to create one.'})})}):r.jsx("div",{className:"space-y-3",children:e.map(C=>r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"flex items-start justify-between gap-3",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("div",{className:"text-white font-semibold",children:C.name}),r.jsx(Te,{tone:C.is_active?"accent":"default",children:C.is_active?"Active":"Hidden"})]}),r.jsxs("div",{className:"text-sm text-slate-300 mt-1",children:[C.category.replace("_"," "),C.cost_note?` · ${C.cost_note}`:""]})]}),r.jsxs("div",{className:"flex gap-1 shrink-0",children:[r.jsx("button",{onClick:()=>w(C),className:"p-2 rounded-lg hover:bg-white/10 text-slate-300 hover:text-white transition",children:r.jsx(Ui,{className:"h-4 w-4"})}),r.jsx("button",{onClick:()=>k(C.id),className:"p-2 rounded-lg hover:bg-red-500/10 text-slate-300 hover:text-red-300 transition",children:r.jsx(Lt,{className:"h-4 w-4"})})]})]})})},C.id))})]})}function bre({token:t}){const[e,s]=v.useState([]),[n,a]=v.useState(!1),[i,o]=v.useState(""),[l,c]=v.useState(""),d=async()=>{a(!0),o("");try{const f=l?`?status=${l}`:"",p=await U(`/api/lift/admin/contributions${f}`,{token:t});s(p.contributions||[])}catch(f){o(f.message||"Failed to load contributions")}finally{a(!1)}};v.useEffect(()=>{d()},[t,l]);const u=async(f,p)=>{try{await U(`/api/lift/admin/contributions/${f}`,{token:t,method:"PUT",body:{status:p}}),d()}catch(g){o(g.message||"Failed to update status")}},h=async f=>{if(window.confirm("Confirm the bank transfer has been received and mark this contribution as paid?"))try{await U(`/api/lift/admin/contributions/${f}`,{token:t,method:"PUT",body:{payment_status:"paid",status:"confirmed"}}),d()}catch(p){o(p.message||"Failed to update payment status")}},m=async()=>{const p=await(await fetch(tt("/api/lift/admin/contributions/export"),{headers:{Authorization:`Bearer ${t}`}})).blob(),g=URL.createObjectURL(p),x=document.createElement("a");x.href=g,x.download="lift_contributions.csv",x.click(),URL.revokeObjectURL(g)};return r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[r.jsxs(Re,{value:l,onCh
892ange:f=>c(f.target.value),labelClassName:"text-slate-200",className:"max-w-[220px]",children:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"new",children:"New"}),r.jsx("option",{value:"contacted",children:"Contacted"}),r.jsx("option",{value:"confirmed",children:"Confirmed"}),r.jsx("option",{value:"completed",children:"Completed"})]}),r.jsxs(W,{variant:"portal",onClick:m,children:[r.jsx(Ys,{className:"h-4 w-4"})," Export CSV"]})]}),i&&r.jsx("div",{className:"text-sm text-red-300",children:i}),n?r.jsx("div",{className:"text-slate-400 text-center py-8",children:"Loading..."}):e.length===0?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-slate-400 text-center py-8",children:"No contributions yet."})})}):r.jsx("div",{className:"space-y-3",children:e.map(f=>r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[r.jsx("div",{className:"text-white font-semibold",children:f.contributor_name}),r.jsx(Te,{children:f.support_type.replace("_"," ")}),f.payment_method==="bank_transfer"&&r.jsxs("span",{className:"text-[11px] font-semibold px-2 py-0.5 rounded-full bg-white/10 text-slate-300 flex items-center gap-1",children:[r.jsx(Hw,{className:"h-3 w-3"})," Bank transfer"]}),r.jsx("span",{className:`text-[11px] font-semibold px-2 py-0.5 rounded-full ${f.payment_status==="paid"?"bg-emerald-500/15 text-emerald-300":f.payment_status==="pending"?"bg-amber-500/15 text-amber-300":f.payment_status==="failed"?"bg-red-500/15 text-red-300":"bg-white/10 text-slate-300"}`,children:f.payment_status==="paid"?"Paid":f.payment_status==="pending"?"Payment pending":f.payment_status==="failed"?"Payment failed":"Unpaid"})]}),r.jsxs("div",{className:"text-sm text-slate-300 mt-1",children:[f.contributor_email,f.contributor_organisation?` · ${f.contributor_organisation}`:""]}),f.nominee_name&&r.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:["Nominee: ",f.nominee_name,f.nominee_email?` (${f.nominee_email})`:""]}),r.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[f.programme_name||f.programme_other||"General LIFT support"," · ",f.coverage_type,f.amount?` · ${f.currency} ${f.amount}`:""," · Ref: ",f.reference_code]})]}),r.jsxs("div",{className:"flex flex-col items-end gap-2",children:[f.payment_method==="bank_transfer"&&f.payment_status!=="paid"&&r.jsxs(W,{variant:"portal",onClick:()=>h(f.id),className:"whitespace-nowrap",children:[r.jsx(ls,{className:"h-4 w-4"})," Mark Paid"]}),r.jsxs(Re,{value:f.status,onChange:p=>u(f.id,p.target.value),className:"max-w-[160px]",children:[r.jsx("option",{value:"new",children:"New"}),r.jsx("option",{value:"contacted",children:"Contacted"}),r.jsx("option",{value:"confirmed",children:"Confirmed"}),r.jsx("option",{value:"completed",children:"Completed"})]})]})]})})},f.id))})]})}function yre({token:t}){const[e,s]=v.useState([]),[n,a]=v.useState(!1),[i,o]=v.useState(""),[l,c]=v.useState(""),d=async()=>{a(!0),o("");try{const m=l?`?status=${l}`:"",f=await U(`/api/lift/admin/support-requests${m}`,{token:t});s(f.support_requests||[])}catch(m){o(m.message||"Failed to load support requests")}finally{a(!1)}};v.useEffect(()=>{d()},[t,l]);const u=async(m,f)=>{try{await U(`/api/lift/admin/support-requests/${m}`,{token:t,method:"PUT",body:{status:f}}),d()}catch(p){o(p.message||"Failed to update status")}},h=async()=>{const f=await(await fetch(tt("/api/lift/admin/support-requests/export"),{headers:{Authorization:`Bearer ${t}`}})).blob(),p=URL.createObjectURL(f),g=document.createElement("a");g.href=p,g.download="lift_support_requests.csv",g.click(),URL.revokeObjectURL(p)};return r.jsxs("div",{className:"grid gap-4",children:[r.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[r.jsxs(Re,{value:l,onChange:m=>c(m.target.value),className:"max-w-[220px]",children:[r.jsx("option",{value:"",children:"All statuses"}),r.jsx("option",{value:"new",children:"New"}),r.jsx("option",{value:"under_review",children:"Under review"}),r.jsx("option",{value:"approved",children:"Approved"}),r.jsx("option",{value:"declined",children:"Declined"})]}),r.jsxs(W,{variant:"portal",onClick:h,children:[r.jsx(Ys,{className:"h-4 w-4"})," Export CSV"]})]}),i&&r.jsx("div",{className:"text-sm text-red-300",children:i}),n?r.jsx("div",{className:"text-slate-400 text-center py-8",children:"Loading..."}):e.length===0?r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-slate-400 text-center py-8",children:"No support requests yet."})})}):r.jsx("div",{className:"space-y-3",children:e.map(m=>r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"flex items-start justify-between gap-3 flex-wrap",children:[r.jsxs("div",{className:"min-w-0",children:[r.jsx("div",{className:"text-white font-semibold",children:m.full_name}),r.jsxs("div",{className:"text-sm text-slate-300 mt-1",children:[m.email,m.country?` · ${m.country}`:""]}),m.organisation&&r.jsxs("div",{className:"text-xs text-slate-400 mt-0.5",children:[m.organisation,m.role_title?` â ${m.role_title}`:""]}),r.jsx("div",{className:"text-xs text-slate-400 mt-0.5",children:m.programme_name||m.programme_interest||"Not sure yet"})]}),r.jsxs(Re,{value:m.status,onChange:f=>u(m.id,f.target.value),className:"max-w-[160px]",children:[r.jsx("option",{value:"new",children:"New"}),r.jsx("option",{value:"under_review",children:"Under review"}),r.jsx("option",{value:"approved",children:"Approved"}),r.jsx("option",{value:"declined",children:"Declined"})]})]})})},m.id))})]})}const k_=[{key:"about",label:"About the Conference"},{key:"cancellation_policy",label:"Cancellation / Refund / Transfer Policy"},{key:"visa_info",label:"Visa Facilitation"},{key:"accommodation_intro",label:"Accommodation Intro"},{key:"excursion_intro",label:"Excursion Intro"}
892,{key:"loyalty_intro",label:"Loyalty Passport Intro"},{key:"awards_intro",label:"Community Awards Intro"}],vre=["Details","Tickets","Join + Attend Tiers","Sponsors","Hotels","Excursion Options","FAQs","Content Blocks","Programme","Passport Tiers"],wre=[{value:"break",label:"Break / Logistics"},{value:"plenary",label:"Plenary / Keynote"},{value:"session",label:"Session / Workshop"}];function wm(t){if(!t)return"";const e=new Date(t);return Number.isNaN(e.getTime())?"":e.toISOString().slice(0,16)}function Fp(t){return t==null||t===""?"":(Number(t)/100).toString()}function av(t){if(t==null||t==="")return null;const e=Number(t);return Number.isNaN(e)?null:Math.round(e*100)}function jre(){const{token:t,member:e}=Oe(),s=(e==null?void 0:e.role)==="admin"||(e==null?void 0:e.role)==="editor",[n,a]=v.useState([]),[i,o]=v.useState(!0),[l,c]=v.useState(""),[d,u]=v.useState(null),h=v.useCallback(async()=>{o(!0),c("");try{const x=await U("/api/conferences/admin",{token:t});a(x.conferences||[])}catch(x){c(x.message||"Failed to load conferences")}finally{o(!1)}},[t]);if(v.useEffect(()=>{h()},[h]),!s)return r.jsx("div",{className:"text-slate-400 p-8 text-center",children:"Access denied"});if(d)return r.jsx(Nre,{conferenceId:d,token:t,onBack:()=>{u(null),h()}});const m=async()=>{const x=new Date().getFullYear()+1;try{const b=await U("/api/conferences/admin",{token:t,method:"POST",body:{title:`ACGC Conference ${x}`,year:x,start_date:new Date(`${x}-09-30`).toISOString(),status:"draft"}});u(b.conference.id)}catch(b){c(b.message||"Failed to create conference")}},f=async x=>{try{const b=await U(`/api/conferences/admin/${x}/duplicate`,{token:t,method:"POST",body:{}});await h(),u(b.conference.id)}catch(b){c(b.message||"Failed to duplicate conference")}},p=async x=>{if(window.confirm("Delete this conference and all its tickets, programme, sponsors, and content? This cannot be undone."))try{await U(`/api/conferences/admin/${x}`,{token:t,method:"DELETE"}),await h()}catch(b){c(b.message||"Failed to delete conference")}},g=async(x,b)=>{const y=b==="published"?"draft":"published";try{await U(`/api/conferences/admin/${x}`,{token:t,method:"PUT",body:{status:y}}),await h()}catch(w){c(w.message||"Failed to update status")}};return r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-start justify-between flex-wrap gap-3",children:[r.jsxs("div",{children:[r.jsx("div",{className:"text-white font-semibold text-xl",children:"Conferences"}),r.jsx("div",{className:"mt-1 text-sm text-slate-300",children:"Create and edit conference editions â details, tickets, programme, sponsors, and page content."})]}),r.jsxs(W,{variant:"portal",onClick:m,children:[r.jsx(qs,{className:"h-4 w-4 mr-1"})," New Conference"]})]}),l&&r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-red-300",children:l})})}),r.jsx(ne,{children:r.jsx(re,{children:r.jsxs("div",{className:"grid gap-2",children:[i&&r.jsx("div",{className:"text-slate-400 text-center py-8",children:"Loading..."}),!i&&n.length===0&&r.jsx("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-3 text-sm text-slate-200",children:"No conferences yet."}),n.map(x=>r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-3 flex items-center justify-between gap-3 flex-wrap",children:[r.jsxs("div",{children:[r.jsxs("div",{className:"text-white font-medium",children:[x.title," ",x.edition_label?`â ${x.edition_label}`:""]}),r.jsxs("div",{className:"text-xs text-slate-300 flex items-center gap-2 mt-0.5",children:[r.jsxs("span",{children:["/",x.slug]}),r.jsx("span",{children:"·"}),r.jsx("span",{children:x.start_date?new Date(x.start_date).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"}):"â"})]})]}),r.jsxs("div",{className:"flex items-center gap-2",children:[x.is_current&&r.jsx(Te,{tone:"accent",children:"Current"}),r.jsx(Te,{tone:x.status==="published"?"brand":"default",children:x.status==="published"?"Published":"Draft"}),x.status==="published"?r.jsxs(W,{variant:"portal",size:"sm",onClick:()=>g(x.id,x.status),title:"Unpublish â hides this conference from the public site",children:[r.jsx(gx,{className:"h-3.5 w-3.5 mr-1"})," Unpublish"]}):r.jsxs(W,{variant:"primary",size:"sm",onClick:()=>g(x.id,x.status),title:"Publish â makes this conference visible on the public site",children:[r.jsx(pt,{className:"h-3.5 w-3.5 mr-1"})," Publish"]}),r.jsxs(W,{variant:"portal",size:"sm",onClick:()=>u(x.id),children:[r.jsx(Ui,{className:"h-3.5 w-3.5 mr-1"})," Edit"]}),r.jsxs(W,{variant:"portal",size:"sm",onClick:()=>f(x.id),children:[r.jsx(U3,{className:"h-3.5 w-3.5 mr-1"})," Duplicate"]}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>p(x.id),children:r.jsx(Lt,{className:"h-3.5 w-3.5"})})]})]},x.id))]})})})]})}function Nre({conferenceId:t,token:e,onBack:s}){var m;const[n,a]=v.useState("Details"),[i,o]=v.useState(null),[l,c]=v.useState(!0),[d,u]=v.useState(""),h=v.useCallback(async()=>{c(!0),u("");try{const f=await U(`/api/conferences/admin/${t}`,{token:e});o(f)}catch(f){u(f.message||"Failed to load conference")}finally{c(!1)}},[t,e]);return v.useEffect(()=>{h()}
892,[h]),r.jsxs("div",{className:"grid gap-5",children:[r.jsxs("div",{className:"flex items-center gap-3",children:[r.jsxs(W,{variant:"portal",size:"sm",onClick:s,children:[r.jsx(vn,{className:"h-4 w-4 mr-1"})," Back"]}),r.jsx("div",{className:"text-white font-semibold text-lg",children:((m=i==null?void 0:i.conference)==null?void 0:m.title)||"Conference"})]}),d&&r.jsx(ne,{children:r.jsx(re,{children:r.jsx("div",{className:"text-sm text-red-300",children:d})})}),r.jsx("div",{className:"flex gap-2 border-b border-white/10 overflow-x-auto",children:vre.map(f=>r.jsx("button",{onClick:()=>a(f),className:`px-4 py-2 text-sm font-medium border-b-2 whitespace-nowrap transition ${n===f?"border-[#c08a2f] text-white":"border-transparent text-slate-400 hover:text-slate-200"}`,children:f},f))}),i?r.jsxs(r.Fragment,{children:[n==="Details"&&r.jsx(kre,{token:e,conferenceId:t,conference:i.conference,onSaved:h}),n==="Tickets"&&r.jsx(Tl,{token:e,conferenceId:t,resource:"tickets",itemLabel:"ticket",items:i.tickets,onChange:h,fields:[{key:"ticket_key",label:"Ticket Key",type:"text",placeholder:"e.g. member_early_bird"},{key:"name",label:"Name",type:"text"},{key:"category",label:"Category",type:"select",options:["member","non_member","single"]},{key:"price_cents",label:"Price (USD)",type:"dollars",placeholder:"e.g. 295.00"},{key:"sort_order",label:"Sort Order",type:"number"},{key:"is_active",label:"Active",type:"boolean"}]}),n==="Join + Attend Tiers"&&r.jsx(Tl,{token:e,conferenceId:t,resource:"join-attend-tiers",itemLabel:"tier",items:i.join_attend_tiers,onChange:h,fields:[{key:"tier_key",label:"Tier Key",type:"text",placeholder:"e.g. join_attend_ind_africa"},{key:"name",label:"Name",type:"text"},{key:"membership_fee_cents",label:"Membership Fee (USD)",type:"dollars",placeholder:"e.g. 120.00"},{key:"sort_order",label:"Sort Order",type:"number"},{key:"is_active",label:"Active",type:"boolean"}]}),n==="Sponsors"&&r.jsx(Tl,{token:e,conferenceId:t,resource:"sponsors",itemLabel:"sponsor",items:i.sponsors,onChange:h,fields:[{key:"tier",label:"Tier",type:"text",placeholder:"e.g. Ubuntu"},{key:"tier_label",label:"Tier Label",type:"text",placeholder:"e.g. Institutional Partner"},{key:"sub",label:"Tier Sub-label",type:"text"},{key:"accent",label:"Accent",type:"text",placeholder:"e.g. gold"},{key:"name",label:"Sponsor Name",type:"text"},{key:"sub_name",label:"Sponsor Sub-name",type:"text"},{key:"logo_url",label:"Sponsor Logo",type:"image"},{key:"sort_order",label:"Sort Order",type:"number"}]}),n==="Hotels"&&r.jsx(Tl,{token:e,conferenceId:t,resource:"hotels",itemLabel:"hotel",items:i.hotels,onChange:h,fields:[{key:"name",label:"Name",type:"text"},{key:"area",label:"Area",type:"text"},{key:"distance",label:"Distance",type:"text"},{key:"rating",label:"Rating",type:"number"},{key:"price_range",label:"Price Range",type:"text"},{key:"phone",label:"Phone",type:"text"},{key:"email",label:"Email",type:"text"},{key:"website",label:"Website",type:"text"},{key:"map_url",label:"Map URL",type:"text"},{key:"is_bnb",label:"B&B / Serviced Apt",type:"boolean"},{key:"sort_order",label:"Sort Order",type:"number"}]}),n==="Excursion Options"&&r.jsx(Tl,{token:e,conferenceId:t,resource:"excursion-options",itemLabel:"option",items:i.excursion_options,onChange:h,fields:[{key:"option_key",label:"Option Key",type:"text",placeholder:"e.g. tour_only"},{key:"name",label:"Name",type:"text"},{key:"price_cents",label:"Price (USD)",type:"dollars",placeholder:"e.g. 95.00"},{key:"description",label:"Description",type:"textarea"},{key:"sort_order",label:"Sort Order",type:"number"},{key:"is_active",label:"Active",type:"boolean"}]}),n==="FAQs"&&r.jsx(Tl,{token:e,conferenceId:t,resource:"faqs",itemLabel:"FAQ",items:i.faqs,onChange:h,fields:[{key:"question",label:"Question",type:"text"},{key:"answer",label:"Answer",type:"textarea"},{key:"sort_order",label:"Sort Order",type:"number"}]}),n==="Content Blocks"&&r.jsx(Cre,{token:e,conferenceId:t,blocks:i.content_blocks,onSaved:h}),n==="Programme"&&r.jsx(Mre,{token:e,conferenceId:t,conference:i.conference,onSaved:h}),n==="Passport Tiers"&&r.jsx(Sre,{token:e,conferenceId:t,conference:i.conference,onSaved:h})]}):l?r.jsx("div",{className:"text-slate-400 text-center py-8",children:"Loading..."}):null]})}function kre({token:t,conferenceId:e,conference:s,onSaved:n}){const[a,i]=v.useState({title:s.title||"",slug:s.slug||"",edition_label:s.edition_label||"",tagline:s.tagline||"",year:s.year||"",start_date:wm(s.start_date),end_date:wm(s.end_date),timezone:s.timezone||"",city:s.city||"",country:s.country||"",venue_name:s.venue_name||"",venue_address:s.venue_address||"",banner_url:s.banner_url||"",thumbnail_url:s.thumbnail_url||"",status:s.status||"draft",is_current:!!s.is_current,registration_open:s.registration_open!==!1,early_bird_deadline:wm(s.early_bird_deadline),countdown_target:wm(s.countdown_target),join_attend_rate_early:Fp(s.join_attend_rate_early_cents),join_attend_rate_standard:Fp(s.join_attend_rate_standard_cents)}),[o,l]=v.useState(!1),[c,d]=v.useState(!1),[u,h]=v.useState(""),[m,f]=v.useState(!1),p=v.useRef(null),g=y=>w=>{const N=w.target.type==="checkbox"?w.target.checked:w.target.value;i(j=>({...j,[y]:N}))},x=async y=>{var N;const w=(N=y.target.files)==null?void 0:N[0];if(w){d(!0),h("");try{const j=new FormData;j.append("image",w);const S=await U("/api/conferences/admin/upload",{method:"POST",body:j,token:t});i(k=>({...k,banner_url:S.image_url}))}catch(j){h(j.message||"Failed to upload banner")}finally{d(!1),p.current&&(p.current.value="")}}},b=async y=>{const w=y??a.status;l(!0),h(""),f(!1);try{await U(`/api/conferences/admin/${e}`,{token:t,method:"PUT",body:{...a,status:w,year:a.year?Number(a.year):void 0,start_date:a.start_date?new Date(a.start_date).toISOString():void 0,end_date:a.end_date?new Date(a.end_date).toISOString():null,early_bird_deadline:a.early_bird_deadline?new Date(a.early_bird_deadline).toISOString():null,countdown_target:a.countdown_target?new Date(a.countdown_target).toISOString():null,join_attend_rate_early:void 0,join_attend_rate_standard:void 0,join_attend_rate_early_cents:av(a.join_attend_rate_early),join_attend_rate_standard_cents:av(a.join_attend_rate_standard)}}),y&&i(N=>({...N,status:y})),f(!0),n==null||n(),setTimeout(()=>f(!1),2500)}catch(N){h(N.message||"Failed to save")}finally{l(!1)}};return r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[r.jsx(Vt,{label:"Title",children:r.jsx(Y,{value:a.title,onChange:g("title")})}),r.jsx(Vt,{label:"Slug (URL)",children:r.jsx(Y,{value:a.slug,onChange:g("slug"),placeholder:"e.g. 2026"})}),r.jsx(Vt,{label:"Edition Label",children:r.jsx(Y,{value:a.edition_label,onChange:g("edition_label"),placeholder:"e.g. 8th Annual"})}),r.jsx(Vt,{label:"Year",children:r.jsx(Y,{type:"number",value:a.year,onChange:g("year")})}),r.jsx(Vt,{label:"Tagline",full:!0,children:r.jsx(Y,{value:a.tagline,onChange:g("tagline")})}),r.jsx(Vt,{label:"Start Date",children:r.jsx(Y,{type:"datetime-local",value:a.start_date,onChange:g("start_date")})}),r.jsx(Vt,{label:"End Date",children:r.jsx(Y,{type:"datetime-local",value:a.end_date,onChange:g("end_date")})}),r.jsx(Vt,{label:"Timezone",children:r.jsx(Y,{value:a.timezone,onChange:g("timezone"),placeholder:"e.g. Africa/Abidjan"})}),r.jsx(Vt,{label:"City",children:r.jsx(Y,{value:a.city,onChange:g("city")})}),r.jsx(Vt,{label:"Country",children:r.jsx(Y,{value:a.country,onChange:g("country")})}),r.jsx(Vt,{label:"Venue Name",children:r.jsx(Y,{value:a.venue_name,onChange:g("venue_name")}
892)}),r.jsx(Vt,{label:"Venue Address",full:!0,children:r.jsx(Y,{value:a.venue_address,onChange:g("venue_address")})}),r.jsx(Vt,{label:"Status",children:r.jsxs(Re,{value:a.status,onChange:g("status"),children:[r.jsx("option",{value:"draft",children:"Draft"}),r.jsx("option",{value:"published",children:"Published"})]})}),r.jsx(Vt,{label:"Registration Open",children:r.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-200 mt-2",children:[r.jsx("input",{type:"checkbox",checked:a.registration_open,onChange:g("registration_open")})," Open for registration"]})}),r.jsx(Vt,{label:"Current Conference",children:r.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-200 mt-2",children:[r.jsx("input",{type:"checkbox",checked:a.is_current,onChange:g("is_current")})," This is the current/featured conference"]})}),r.jsx(Vt,{label:"Early Bird Deadline",children:r.jsx(Y,{type:"datetime-local",value:a.early_bird_deadline,onChange:g("early_bird_deadline")})}),r.jsx(Vt,{label:"Countdown Target",children:r.jsx(Y,{type:"datetime-local",value:a.countdown_target,onChange:g("countdown_target")})}),r.jsx(Vt,{label:"Join+Attend Rate â Early Bird (USD)",children:r.jsx(Y,{type:"number",step:"0.01",min:"0",placeholder:"e.g. 220.00",value:a.join_attend_rate_early,onChange:g("join_attend_rate_early")})}),r.jsx(Vt,{label:"Join+Attend Rate â Standard (USD)",children:r.jsx(Y,{type:"number",step:"0.01",min:"0",placeholder:"e.g. 275.00",value:a.join_attend_rate_standard,onChange:g("join_attend_rate_standard")})}),r.jsx(Vt,{label:"Banner Image",full:!0,children:r.jsxs("div",{className:"flex items-center gap-3",children:[a.banner_url&&r.jsx("img",{src:a.banner_url,alt:"banner",className:"h-16 w-28 object-cover rounded-lg border border-white/10"}),r.jsx("input",{ref:p,type:"file",accept:"image/*",onChange:x,className:"text-xs text-slate-300"}),c&&r.jsx("span",{className:"text-xs text-slate-400",children:"Uploadingâ¦"})]})})]}),u&&r.jsx("div",{className:"text-sm text-red-300 mt-4",children:u}),r.jsxs("div",{className:"flex items-center justify-end gap-3 mt-5",children:[m&&r.jsxs("span",{className:"text-sm text-emerald-300 flex items-center gap-1",children:[r.jsx(ls,{className:"h-4 w-4"})," Saved"]}),r.jsx(W,{variant:"portal",onClick:()=>b(),disabled:o,children:o?"Saving...":"Save Details"}),a.status==="published"?r.jsxs(W,{variant:"dark",onClick:()=>b("draft"),disabled:o,title:"Unpublish â hides this conference from the public site",children:[r.jsx(gx,{className:"h-4 w-4 mr-1"})," ",o?"Saving...":"Unpublish"]}):r.jsxs(W,{variant:"primary",onClick:()=>b("published"),disabled:o,title:"Publish â makes this conference visible on the public site",children:[r.jsx(pt,{className:"h-4 w-4 mr-1"})," ",o?"Publishing...":"Publish"]})]})]})})}function Vt({label:t,children:e,full:s}){return r.jsxs("div",{className:s?"sm:col-span-2":"",children:[r.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:t}),e]})}function Tl({token:t,conferenceId:e,resource:s,itemLabel:n,items:a,fields:i,onChange:o}){const l=v.useMemo(()=>{const P={};for(const R of i)P[R.key]=R.type==="boolean"?!0:R.type==="number"||R.type==="dollars"?0:"";return P},[i]),[c,d]=v.useState(null),[u,h]=v.useState(l),[m,f]=v.useState(!1),[p,g]=v.useState(!1),[x,b]=v.useState(null),[y,w]=v.useState(""),N=P=>R=>{const $=R.target.type==="checkbox"?R.target.checked:R.target.value;h(O=>({...O,[P]:$}))},j=async(P,R)=>{if(R){b(P),w("");try{const $=new FormData;$.append("image",R);const O=await U("/api/conferences/admin/upload",{method:"POST",body:$,token:t});h(_=>({..._,[P]:O.image_url}))}catch($){w($.message||"Failed to upload image")}finally{b(null)}}},S=()=>{h(l),f(!0),d(null)},k=P=>{const R={...P};for(const $ of i)$.type==="dollars"&&(R[$.key]=Fp(P[$.key]));h(R),d(P.id),f(!1)},C=()=>{f(!1),d(null)},T=async()=>{g(!0),w("");try{const P={...u};for(const R of i)R.type==="dollars"&&(P[R.key]=av(u[R.key])??0);c?await U(`/api/conferences/admin/${e}/${s}/${c}`,{token:t,method:"PUT",body:P}):await U(`/api/conferences/admin/${e}/${s}`,{token:t,method:"POST",body:P}),C(),o==null||o()}catch(P){w(P.message||"Failed to save")}finally{g(!1)}},A=async P=>{if(window.confirm(`Delete this ${n}?`))try{await U(`/api/conferences/admin/${e}/${s}/${P}`,{token:t,method:"DELETE"}),o==null||o()}catch(R){w(R.message||"Failed to delete")}},E=i.some(P=>P.key==="is_active"),L=async P=>{try{await U(`/api/conferences/admin/${e}/${s}/${P.id}`,{token:t,method:"PUT",body:{is_active:!P.is_active}}),o==null||o()}catch(R){w(R.message||"Failed to update status")}},D=m||c!=null;return r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-center justify-between mb-3",children:[r.jsx("div",{className:"text-white font-semibold capitalize",children:s.replace(/-/g," ")}),!D&&r.jsxs(W,{variant:"portal",size:"sm",onClick:S,children:[r.jsx(qs,{className:"h-3.5 w-3.5 mr-1"})," Add ",n]})]}),y&&r.jsx("div",{className:"text-sm text-red-300 mb-3",children:y}),D&&r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 p-4 mb-4 grid sm:grid-cols-2 gap-3",children:[i.map(P=>r.jsxs("div",{className:P.type==="textarea"?"sm:col-span-2":"",children:[r.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:P.label}),P.type==="textarea"?r.jsx("textarea",{value:u[P.key]??"",onChange:N(P.key),rows:3,className:"w-full rounded-xl bg-white/10 border border-white/15 px-3 py-2 text-sm text-white"}):P.type==="boolean"?r.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-200 mt-2",children:[r.jsx("input",{type:"checkbox",checked:!!u[P.key],onChange:N(P.key)})," Yes"]}):P.type==="select"?r.jsx(Re,{value:u[P.key]??"",onChange:N(P.key),children:P.options.map(R=>r.jsx("option",{value:R,children:R},R))}):P.type==="dollars"?r.jsxs("div",{className:"flex items-center gap-2",children:[r.jsx("span",{className:"text-sm text-slate-400",children:"$"}),r.jsx(Y,{type:"number",step:"0.01",min:"0",value:u[P.key]??"",onChange:N(P.key),placeholder:P.placeholder||"0.00"})]}):P.type==="image"?r.jsxs("div",{className:"flex items-center gap-3",children:[u[P.key]&&r.jsx("img",{src:u[P.key],alt:"",className:"h-12 w-12 object-contain rounded-lg border border-white/10 bg-white/5"}),r.jsx("input",{type:"file",accept:"image/*",onChange:R=>{var $;return j(P.key,($=R.target.files)==null?void 0:$[0])},className:"text-xs text-slate-300"}),x===P.key&&r.jsx("span",{className:"text-xs text-slate-400",children:"Uploadingâ¦"})]}):r.jsx(Y,{type:P.type==="number"?"number":"text",value:u[P.key]??"",onChange:N(P.key),placeholder:P.placeholder})]},P.key)),r.jsxs("div",{className:"sm:col-span-2 flex items-center justify-end gap-3 mt-1",children:[r.jsx(W,{variant:"portal",size:"sm",onClick:C,children:"Cancel"}),r.jsx(W,{variant:"primary",size:"sm",onClick:T,disabled:p,children:p?"Saving...":"Save"})]})]}),r.jsxs("div",{className:"grid gap-2",children:[(!a||a.length===0)&&r.jsxs("div",{className:"text-sm text-slate-400",children:["No ",s.replace(/-/g," ")," yet."]}),(a||[]).map(P=>r.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/5 p-3 flex items-center justify-between gap-3 min-w-0",children:[r.jsx("div",{className:"text-sm text-slate-100 truncate min-w-0 flex-1",children:i.slice(0,3).map(R=>R.type==="dollars"?P[R.key]!=null?`$${Fp(P[R.key])}`:null:P[R.key]).filter(R=>R!=null&&R!=="").join(" â ")}),r.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[E&&(P.is_active?r.jsxs(W,{variant:"dark",size:"sm",onClick:()=>L(P),title:"Disable â stop offering this and hide it from the public page",children:[r.jsx(gx,{className:"h-3.5 w-3.5 mr-1"})," Disable"]}):r.jsxs(W,{variant:"primary",size:"sm",onClick:()=>L(P),title:"Enable â offer this again on the public page",children:[r.jsx(pt,{className:"h-3.5 w-3.5 mr-1"})," Enable"]})),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>k(P),children:r.jsx(Ui,{className:"h-3.5 w-3.5"})}),r.jsx(W,{variant:"portal",size:"sm",onClick:()=>A(P.id),children:r.jsx(Lt,{className:"h-3.5 w-3.5"})})]})]},P.id))]})]})})}function Cre({token:t,conferenceId:e,blocks:s,onSaved:n}){const[a,i]=v.useState(k_[0].key),[o,l]=v.useState((s==null?void 0:s[a])||""),[c,d]=v.useState(!1),[u,h]=v.useState(!1),[m,f]=v.useState("");v.useEffect(()=>{l((s==null?void 0:s[a])||"")},[a,s]);const p=async()=>{d(!0),f(""),h(!1);try{await U(`/api/conferences/admin/${e}/content-blocks/${a}`,{token:t,method:"PUT",body:{html_content:o}}),h(!0),n==null||n(),setTimeout(()=>h(!1),2500)}catch(g){f(g.message||"Failed to save")}finally{d(!1)}};return r.jsx(ne,{children:r.jsxs(re,{children:[r.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:k_.map(g=>r.jsx("button",{onClick:()=>i(g.key),className:`px-3 py-1.5 rounded-full text-xs font-medium transition ${a===g.key?"bg-[#c08a2f] text-white":"bg-white/10 text-slate-300 hover:bg-white/15"}`,children:g.label},g.key))}),r.jsx($x,{value:o,onChange:l,darkMode:!0,minHeight:"240px"}),m&&r.jsx("div",{className:"text-sm text-red-300 mt-3",children:m}),r.jsxs("div",{className:"flex items-center justify-end gap-3 mt-4",children:[u&&r.jsxs("span",{className:"text-sm text-emerald-300 flex items-center gap-1",children:[r.jsx(ls,{className:"h-4 w-4"})," Saved"]}
892),r.jsx(W,{variant:"primary",onClick:p,disabled:c,children:c?"Saving...":"Save Block"})]})]})})}function Sre({token:t,conferenceId:e,conference:s,onSaved:n}){const[a,i]=v.useState(()=>s.passport_tiers_json||[]),[o,l]=v.useState(!1),[c,d]=v.useState(!1),[u,h]=v.useState(""),m=(b,y,w)=>i(N=>{const j=[...N];return j[b]={...j[b],[y]:w},j}),f=b=>i(y=>y.filter((w,N)=>N!==b)),p=()=>i(b=>[...b,{stamp:b.length+1,label:"",perk:""}]),g=(b,y)=>{i(w=>{const N=b+y;if(N<0||N>=w.length)return w;const j=[...w];return[j[b],j[N]]=[j[N],j[b]],j})},x=async()=>{l(!0),h(""),d(!1);try{await U(`/api/conferences/admin/${e}`,{token:t,method:"PUT",body:{passport_tiers_json:a}}),d(!0),n==null||n(),setTimeout(()=>d(!1),2500)}catch(b){h(b.message||"Failed to save")}finally{l(!1)}};return r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsx("div",{className:"text-white font-semibold",children:"Loyalty Passport Tiers"}),r.jsxs(W,{variant:"portal",size:"sm",type:"button",onClick:p,children:[r.jsx(qs,{className:"h-3.5 w-3.5 mr-1"})," Add tier"]})]}),r.jsx("p",{className:"text-sm text-slate-400 mb-4",children:"Each stamp a returning delegate earns unlocks the next tier and its perk. Add, remove, or reorder tiers freely â nothing here is fixed to a specific number of tiers."}),a.length===0&&r.jsx("div",{className:"rounded-xl border border-white/10 bg-white/5 p-4 text-sm text-slate-400 mb-4",children:'No tiers yet â click "Add tier" to start.'}),r.jsx("div",{className:"space-y-2",children:a.map((b,y)=>r.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/5 p-3 flex items-start gap-3",children:[r.jsxs("div",{className:"grid sm:grid-cols-[90px_1fr_2fr] gap-3 flex-1",children:[r.jsx(Y,{label:"Stamp #",labelClassName:"text-slate-300",type:"number",value:b.stamp??"",onChange:w=>m(y,"stamp",Number(w.target.value))}),r.jsx(Y,{label:"Tier label",labelClassName:"text-slate-300",value:b.label||"",onChange:w=>m(y,"label",w.target.value),placeholder:"e.g. Advocate"}),r.jsx(Y,{label:"Perk",labelClassName:"text-slate-300",value:b.perk||"",onChange:w=>m(y,"perk",w.target.value),placeholder:"e.g. Priority registration access"})]}),r.jsxs("div",{className:"flex items-center gap-1 shrink-0 mt-6",children:[r.jsx("button",{type:"button",disabled:y===0,onClick:()=>g(y,-1),className:"text-slate-400 hover:text-white disabled:opacity-30 p-1.5",title:"Move up",children:r.jsx(px,{className:"h-4 w-4"})}),r.jsx("button",{type:"button",disabled:y===a.length-1,onClick:()=>g(y,1),className:"text-slate-400 hover:text-white disabled:opacity-30 p-1.5",title:"Move down",children:r.jsx(fx,{className:"h-4 w-4"})}),r.jsx("button",{type:"button",onClick:()=>f(y),className:"text-red-400 hover:text-red-300 p-1.5",title:"Remove tier",children:r.jsx(Lt,{className:"h-4 w-4"})})]})]},y))}),u&&r.jsx("div",{className:"text-sm text-red-300 mt-4",children:u}),r.jsxs("div",{className:"flex items-center justify-end gap-3 mt-5",children:[c&&r.jsxs("span",{className:"text-sm text-emerald-300 flex items-center gap-1",children:[r.jsx(ls,{className:"h-4 w-4"})," Saved"]}),r.jsx(W,{variant:"primary",onClick:x,disabled:o,children:o?"Saving...":"Save Passport Tiers"})]})]})})}function WP({items:t,onChange:e,placeholder:s}){const n=t||[],a=(l,c)=>{const d=[...n];d[l]=c,e(d)},i=l=>e(n.filter((c,d)=>d!==l)),o=()=>e([...n,""]);return r.jsxs("div",{className:"space-y-1.5",children:[n.map((l,c)=>r.jsxs("div",{className:"flex gap-2",children:[r.jsx(Y,{value:l,onChange:d=>a(c,d.target.value),placeholder:s,className:"flex-1"}),r.jsx("button",{type:"button",onClick:()=>i(c),className:"text-red-400 hover:text-red-300 shrink-0 px-1",title:"Remove",children:r.jsx(Lt,{className:"h-4 w-4"})})]},c)),r.jsxs("button",{type:"button",onClick:o,className:"text-xs text-[#c08a2f] hover:text-[#a77324] font-semibold inline-flex items-center gap-1",children:[r.jsx(qs,{className:"h-3 w-3"})," Add speaker"]})]})}function _re({item:t,onChange:e,onRemove:s}){return r.jsxs("div",{className:"rounded-lg border border-white/10 bg-black/20 p-3 space-y-2",children:[r.jsxs("div",{className:"flex items-center justify-between",children:[r.jsx("div",{className:"text-xs font-semibold text-slate-400 uppercase tracking-wide",children:"Breakout item"}),r.jsx("button",{type:"button",onClick:s,className:"text-red-400 hover:text-red-300",title:"Remove breakout item",children:r.jsx(Lt,{className:"h-3.5 w-3.5"})})]}),r.jsx(Y,{value:t.title||"",onChange:n=>e({...t,title:n.target.value}),placeholder:"Title"}),r.jsx("textarea",{value:t.body||"",onChange:n=>e({...t,body:n.target.value}),placeholder:"Body / description (optional)",rows:2,className:"w-full rounded-lg bg-white/10 border border-white/15 px-3 py-2 text-sm text-white placeholder:text-slate-500 focus:outline-none focus:ring-2 focus:ring-accent-500/50"}),r.jsxs("div",{children:[r.jsx("div",{className:"text-xs text-slate-400 mb-1",children:"Speakers"}),r.jsx(WP,{items:t.speakers,onChange:n=>e({...t,speakers:n}),placeholder:"e.g. Jane Doe, General Counsel, Acme Corp"})]})]})}function Tre({session:t,onChange:e,onRemove:s,onMoveUp:n,onMoveDown:a,canMoveUp:i,canMoveDown:o}){const[l,c]=v.useState(!1),d=(p,g)=>e({...t,[p]:g}),u=t.descItems||[],h=()=>d("descItems",[...u,{title:"",body:"",speakers:[]}]),m=(p,g)=>{const x=[...u];x[p]=g,d("descItems",x)},f=p=>d("descItems",u.filter((g,x)=>x!==p));return r.jsxs("div",{className:"rounded-xl border border-white/10 bg-white/5",children:[r.jsxs("div",{className:"flex items-center gap-2 p-3",children:[r.jsx("button",{type:"button",onClick:()=>c(!l),className:"text-slate-400 hover:text-white shrink-0",children:l?r.jsx(ht,{className:"h-4 w-4"}):r.jsx(ll,{className:"h-4 w-4"})}),r.jsxs("button",{type:"button",onClick:()=>c(!l),className:"flex-1 min-w-0 text-left",children:[r.jsx("div",{className:"text-sm text-white font-medium truncate",children:t.title||"Untitled session"}),r.jsxs("div",{className:"text-xs text-slate-400 truncate",children:[t.time||"No time set",t.type?` · ${t.type}`:""]})]}),r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{type:"button",disabled:!i,onClick:n,className:"text-slate-400 hover:text-white disabled:opacity-30 p-1",title:"Move up",children:r.jsx(px,{className:"h-3.5 w-3.5"})}),r.jsx("button",{type:"button",disabled:!o,onClick:a,className:"text-slate-400 hover:text-white disabled:opacity-30 p-1",title:"Move down",children:r.jsx(fx,{className:"h-3.5 w-3.5"})}),r.jsx("button",{type:"button",onClick:s,className:"text-red-400 hover:text-red-300 p-1",title:"Remove session",children:r.jsx(Lt,{className:"h-3.5 w-3.5"})})]})]}),l&&r.jsxs("div",{className:"border-t border-white/10 p-3 space-y-3",children:[r.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[r.jsx(Y,{label:"Time",labelClassName:"text-slate-300",value:t.time||"",onChange:p=>d("time",p.target.value),placeholder:"e.g. 9:00am â 9:15am"}),r.jsx(Re,{label:"Type",labelClassName:"text-slate-300",value:t.type||"session",onChange:p=>d("type",p.target.value),children:wre.map(p=>r.jsx("option",{value:p.value,className:"bg-white text-slate-900",children:p.label},p.value))})]}),r.jsx(Y,{label:"Title",labelClassName:"text-slate-300",value:t.title||"",onChange:p=>d("title",p.target.value)}),r.jsx(Y,{label:"Title in French (optional)",labelClassName:"text-slate-300",value:t.titleFr||"",onChange:p=>d("titleFr",p.target.value)}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Description"}),r.jsx("textarea",{value:t.desc||"",onChange:p=>d("desc",p.target.value),rows:3,className:"w-full rounded-xl bg-white/10 border border-white/15 px-3 py-2 text-sm text-white placeholder:text-slate-500 focus:outline-none focus:ring-2 focus:ring-accent-500/50"})]}),r.jsxs("div",{children:[r.jsx("label",{className:"block text-xs font-semibold text-slate-300 mb-1",children:"Speakers"}),r.jsx(WP,{items:t.speaker,onChange:p=>d("speaker",p),placeholder:"e.g. Jane Doe, General Counsel, Acme Corp"})]}),r.jsx(Y,{label:"Sponsor (optional)",labelClassName:"text-slate-300",value:t.sponsor||"",onChange:p=>d("sponsor",p.target.value)}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[r.jsx("label",{className:"block text-xs font-semibold text-slate-300",children:"Breakout items (optional â for parallel roundtables etc.)"}),r.jsxs("button",{type:"button",onClick:h,className:"text-xs text-[#c08a2f] hover:text-[#a77324] font-semibold inline-flex items-center gap-1",children:[r.jsx(qs,{className:"h-3 w-3"})," Add breakout item"]})]}),r.jsx("div",{className:"space-y-2",children:u.map((p,g)=>r.jsx(_re,{item:p,onChange:x=>m(g,x),onRemove:()=>f(g)},g))})]})]})]})}function Ere({day:t,onChange:e,onRemove:s,onMoveUp:n,onMoveDown:a,canMoveUp:i,canMoveDown:o}){const[l,c]=v.useState(!1),d=(g,x)=>e({...t,[g]:x}),u=t.sessions||[],h=()=>d("sessions",[...u,{time:"",title:"",type:"session",desc:""}]),m=(g,x)=>{const b=[...u];b[g]=x,d("sessions",b)},f=g=>d("sessions",u.filter((x,b)=>b!==g)),p=(g,x)=>{const b=g+x;if(b<0||b>=u.length)return;const y=[...u];[y[g],y[b]]=[y[b],y[g]],d("sessions",y)};return r.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/5 overflow-hidden",children:[r.jsxs("div",{className:"flex items-center gap-3 p-4",children:[r.jsx("button",{type:"button",onClick:()=>c(!l),className:"text-slate-400 hover:text-white shrink-0",children:l?r.jsx(ht,{className:"h-5 w-5"}):r.jsx(ll,{className:"h-5 w-5"})}),r.jsxs("button",{type:"button",onClick:()=>c(!l),className:"flex-1 min-w-0 text-left",children:[r.jsx("div",{className:"text-white font-semibold truncate",children:t.title||"Untitled day"}),r.jsxs("div",{className:"text-xs text-slate-400 truncate",children:[t.dayLabel||"â"," · ",t.date||"No date set"," · ",u.length," session",u.length===1?"":"s",t.comingSoon?" · Coming soon":""]})]}),r.jsxs("div",{className:"flex items-center gap-1 shrink-0",children:[r.jsx("button",{type:"button",disabled:!i,onClick:n,className:"text-slate-400 hover:text-white disabled:opacity-30 p-1.5",title:"Move up",children:r.jsx(px,{className:"h-4 w-4"})}),r.jsx("button",{type:"button",disabled:!o,onClick:a,className:"text-slate-400 hover:text-white disabled:opacity-30 p-1.5",title:"Move down",children:r.jsx(fx,{className:"h-4 w-4"})}),r.jsx("button",{type:"button",onClick:s,className:"text-red-400 hover:text-red-300 p-1.5",title:"Remove day",children:r.jsx(Lt,{className:"h-4 w-4"})})]})]}),l&&r.jsxs("div",{className:"border-t border-white/10 p-4 space-y-4",children:[r.jsxs("div",{className:"grid sm:grid-cols-2 gap-3",children:[r.jsx(Y,{label:"Badge (short label)",labelClassName:"text-slate-300",value:t.badge||"",onChange:g=>d("badge",g.target.value),placeholder:"e.g. 1 Oct"}),r.jsx(Y,{label:"Day label",labelClassName:"text-slate-300",value:t.dayLabel||"",onChange:g=>d("dayLabel",g.target.value),placeholder:"e.g. Day 1"}),r.jsx(Y,{label:"Date",labelClassName:"text-slate-300",value:t.date||"",onChange:g=>d("date",g.target.value),placeholder:"e.g. 1 October 2026"}),r.jsx("div",{className:"flex items-end pb-2.5",children:r.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-200",children:[r.jsx("input",{type:"checkbox",checked:!!t.comingSoon,onChange:g=>d("comingSoon",g.target.checked)}
892),'Mark as "Coming soon" (hides the full schedule for this day)']})})]}),r.jsx(Y,{label:"Day title",labelClassName:"text-slate-300",value:t.title||"",onChange:g=>d("title",g.target.value),placeholder:"e.g. Signals, Sovereignty & Strategic Direction"}),r.jsxs("div",{children:[r.jsxs("div",{className:"flex items-center justify-between mb-2",children:[r.jsx("div",{className:"text-sm font-semibold text-white",children:"Sessions"}),r.jsxs(W,{variant:"portal",size:"sm",type:"button",onClick:h,children:[r.jsx(qs,{className:"h-3.5 w-3.5 mr-1"})," Add session"]})]}),u.length===0&&r.jsx("div",{className:"text-sm text-slate-400",children:"No sessions yet."}),r.jsx("div",{className:"space-y-2",children:u.map((g,x)=>r.jsx(Tre,{session:g,onChange:b=>m(x,b),onRemove:()=>f(x),onMoveUp:()=>p(x,-1),onMoveDown:()=>p(x,1),canMoveUp:x>0,canMoveDown:x<u.length-1},x))})]})]})]})}function Mre({token:t,conferenceId:e,conference:s,onSaved:n}){const[a,i]=v.useState(()=>s.programme_json||[]),[o,l]=v.useState(!1),[c,d]=v.useState(!1),[u,h]=v.useState(""),m=()=>{i(b=>[...b,{id:`day-${Date.now()}`,badge:"",dayLabel:"",date:"",title:"",comingSoon:!1,sessions:[]}])},f=(b,y)=>i(w=>{const N=[...w];return N[b]=y,N}),p=b=>{window.confirm("Remove this day and all of its sessions?")&&i(y=>y.filter((w,N)=>N!==b))},g=(b,y)=>{i(w=>{const N=b+y;if(N<0||N>=w.length)return w;const j=[...w];return[j[b],j[N]]=[j[N],j[b]],j})},x=async()=>{l(!0),h(""),d(!1);try{await U(`/api/conferences/admin/${e}`,{token:t,method:"PUT",body:{programme_json:a}}),d(!0),n==null||n(),setTimeout(()=>d(!1),2500)}catch(b){h(b.message||"Failed to save")}finally{l(!1)}};return r.jsx(ne,{children:r.jsxs(re,{children:[r.jsxs("div",{className:"flex items-center justify-between mb-1",children:[r.jsx("div",{className:"text-white font-semibold",children:"Programme"}),r.jsxs(W,{variant:"portal",size:"sm",type:"button",onClick:m,children:[r.jsx(qs,{className:"h-3.5 w-3.5 mr-1"})," Add day"]})]}),r.jsx("p",{className:"text-sm text-slate-400 mb-4",children:"Days and their sessions appear on the public conference page in the order shown here. Add as many days or sessions as this edition needs â nothing here is fixed to a specific year or day count."}),a.length===0&&r.jsx("div",{className:"rounded-xl border border-white/10 bg-white/5 p-4 text-sm text-slate-400 mb-4",children:'No days yet â click "Add day" to start building the programme.'}),r.jsx("div",{className:"space-y-3",children:a.map((b,y)=>r.jsx(Ere,{day:b,onChange:w=>f(y,w),onRemove:()=>p(y),onMoveUp:()=>g(y,-1),onMoveDown:()=>g(y,1),canMoveUp:y>0,canMoveDown:y<a.length-1},b.id||y))}),u&&r.jsx("div",{className:"text-sm text-red-300 mt-4",children:u}),r.jsxs("div",{className:"flex items-center justify-end gap-3 mt-5",children:[c&&r.jsxs("span",{className:"text-sm text-emerald-300 flex items-center gap-1",children:[r.jsx(ls,{className:"h-4 w-4"})," Saved"]}),r.jsx(W,{variant:"primary",onClick:x,disabled:o,children:o?"Saving...":"Save Programme"})]})]})})}function Are({children:t}){const{token:e,member:s,loading:n}=Oe(),a=jn();return n?r.jsx("div",{"data-surface":"portal",className:"min-h-screen grid place-items-center",children:r.jsx("div",{className:"text-slate-200",children:"Loadingâ¦"})}):e?s&&s.role!=="admin"&&s.role!=="editor"?r.jsx(Mn,{to:"/",replace:!0}):t:r.jsx(Mn,{to:"/login",state:{from:a.pathname},replace:!0})}function Pre(){return r.jsx(Mn,{to:"/hub/acep-2025",replace:!0})}function Dre(){return r.jsx(Mn,{to:"/hub/acep-2025",replace:!0})}const Rre="C0mmun1ty",C_="resource-hub-access";function S_({children:t}){const[e,s]=v.useState(()=>{try{return sessionStorage.getItem(C_)==="granted"}catch{return!1}}),[n,a]=v.useState(""),[i,o]=v.useState(""),l=c=>{if(c.preventDefault(),n===Rre){try{sessionStorage.setItem(C_,"granted")}catch{}s(!0),o("")}else o("Incorrect access code. Please try again.")};return e?t:r.jsx("div",{className:"min-h-[80vh] bg-gradient-to-b from-slate-50 to-white flex items-center justify-center px-4 py-16",children:r.jsxs("div",{className:"w-full max-w-md rounded-2xl border border-slate-200 bg-white shadow-xl p-8 md:p-10",children:[r.jsxs("div",{className:"flex flex-col items-center text-center mb-6",children:[r.jsx("div",{className:"h-14 w-14 roun
892ded-full bg-[#1f0f3f]/10 grid place-items-center mb-4",children:r.jsx(or,{className:"h-6 w-6 text-[#1f0f3f]"})}),r.jsx("h1",{className:"text-2xl font-bold text-[#1f0f3f]",children:"Resource Hub Access"}),r.jsx("p",{className:"mt-2 text-sm text-slate-600",children:"This area is protected. Please enter the access code to continue."})]}),r.jsxs("form",{onSubmit:l,className:"space-y-4",children:[r.jsxs("div",{children:[r.jsx("label",{htmlFor:"access-code",className:"block text-sm font-medium text-slate-700 mb-1.5",children:"Access code"}),r.jsx("input",{id:"access-code",type:"password",autoFocus:!0,value:n,onChange:c=>{a(c.target.value),i&&o("")},placeholder:"Enter access code",className:"w-full h-11 rounded-xl border border-slate-200 bg-white px-4 text-sm text-slate-900 focus:outline-none focus:ring-2 focus:ring-[#c08a2f]/30 focus:border-[#c08a2f] transition"})]}),i&&r.jsx("div",{className:"text-sm text-red-600 bg-red-50 border border-red-200 rounded-xl px-4 py-2",children:i}),r.jsxs("button",{type:"submit",className:"w-full inline-flex items-center justify-center gap-2 h-11 px-6 rounded-xl bg-[#c08a2f] hover:bg-[#a77324] text-white text-sm font-semibold transition shadow-sm",children:["Unlock Resource Hub ",r.jsx(nt,{className:"h-4 w-4"})]})]}),r.jsxs("p",{className:"mt-6 text-xs text-slate-500 text-center",children:["Don't have the code?"," ",r.jsx(K,{to:"/joining-options",className:"text-[#c08a2f] font-semibold hover:underline",children:"Learn about membership"})]})]})})}function Lre(){const t=jn();return v.useEffect(()=>{localStorage.getItem("acgc_cookie_consent")},[]),v.useEffect(()=>{},[t]),null}function Ore(){const[t,e]=v.useState(!1);v.useEffect(()=>{if(!localStorage.getItem("acgc_cookie_consent")){const i=setTimeout(()=>e(!0),1500);return()=>clearTimeout(i)}},[]);const s=()=>{localStorage.setItem("acgc_cookie_consent","accepted"),e(!1),window.location.reload()},n=()=>{localStorage.setItem("acgc_cookie_consent","declined"),e(!1)};return r.jsx(ir,{children:t&&r.jsx(V.div,{initial:{y:100,opacity:0},animate:{y:0,opacity:1},exit:{y:100,opacity:0},transition:{type:"spring",damping:25,stiffness:300},className:"fixed bottom-0 inset-x-0 z-[100] p-4 md:p-6",children:r.jsx("div",{className:"max-w-3xl mx-auto rounded-2xl bg-white border border-slate-200 shadow-[0_-4px_40px_-8px_rgba(0,0,0,0.15)] p-5 md:p-6",children:r.jsxs("div",{className:"flex items-start gap-4",children:[r.jsx("div",{className:"shrink-0 h-10 w-10 rounded-xl bg-[#1f0f3f] grid place-items-center",children:r.jsx(g7,{className:"h-5 w-5 text-white"})}),r.jsxs("div",{className:"flex-1 min-w-0",children:[r.jsx("div",{className:"font-semibold text-slate-900 text-sm",children:"We value your privacy"}),r.jsx("p",{className:"mt-1 text-xs text-slate-500 leading-relaxed",children:'We use cookies and similar technologies to improve your experience, analyse site traffic, and personalise content. By clicking "Accept", you consent to the use of cookies in accordance with our privacy policy. This site complies with GDPR and NDPR data protection regulations. You can change your preferences at any time.'}),r.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-2",children:[r.jsx("button",{onClick:s,className:"inline-flex items-center px-4 py-2 rounded-lg bg-[#1f0f3f] text-white text-xs font-medium hover:bg-[#2a1654] transition",children:"Accept All"}),r.jsx("button",{onClick:n,className:"inline-flex items-center px-4 py-2 rounded-lg bg-slate-100 text-slate-700 text-xs font-medium hover:bg-slate-200 transition",children:"Decline Non-Essential"})]})]}),r.jsx("button",{onClick:n,className:"shrink-0 h-7 w-7 rounded-lg bg-slate-100 grid place-items-center text-slate-400 hover:text-slate-600 hover:bg-slate-200 transition","aria-label":"Close",children:r.jsx(He,{className:"h-3.5 w-3.5"})})]})})})})}function Ire(){const{pathname:t}=jn();return M.useEffect(()=>{window.scrollTo(0,0)},[t]),null}function Fre(){return r.jsxs(n8,{children:[r.jsx(Ire,{}),r.jsx(Lre,{}),r.jsx(Ore,{}),r.jsxs(fO,{children:[r.jsxs(je,{element:r.jsx(dV,{}),children:[r.jsx(je,{path:"/",element:r.jsx(fV,{})}),r.jsx(je,{path:"/about",element:r.jsx(wV,{})}),r.jsx(je,{path:"/about/advisory-board",element:r.jsx(NV,{})}),r.jsx(je,{path:"/about/advisory-board/:id",element:r.jsx(KV,{})}),r.jsx(je,{path:"/team",element:r.jsx(QV,{})}),r.jsx(je,{path:"/joining-options",element:r.jsx(eU,{})}),r.jsx(je,{path:"/lift-initiative",element:r.jsx(aU,{})}),r.jsx(je,{path:"/events",element:r.jsx(cU,{})}),r.jsx(je,{path:"/events/:slug",element:r.jsx(yU,{})}),r.jsx(je,{path:"/my-events",element:r.jsx(vU,{})}),r.jsx(je,{path:"/resources",element:r.jsx(CU,{})}),r.jsx(je,{path:"/resources/:id",element:r.jsx(MU,{})}),r.jsx(je,{path:"/insights",element:r.jsx(PU,{})}),r.jsx(je,{path:"/insights/:id",element:r.jsx(VU,{})}),r.jsx(je,{path:"/directory",element:r.jsx(HU,{})}),r.jsx(je,{path:"/members/leaderboard",element:r.jsx(QU,{})}),r.jsx(je,{path:"/conference",element:r.jsx(EH,{})}),r.jsx(je,{path:"/conference/:slug",element:r.jsx(kH,{})}),r.jsx(je,{path:"/conference-2026",element:r.jsx(Mn,{to:"/conference/2026",replace:!0})}),r.jsx(je,{path:"/conference-registration-success",element:r.jsx(PH,{})}),r.jsx(je,{path:"/careers",element:r.jsx(IH,{})}),r.jsx(je,{path:"/partners-and-sponsors",element:r.jsx(VH,{})}),r.jsx(je,{path:"/partnering-with-us",element:r.jsx(HH,{})}),r.jsx(je,{path:"/resource-hub",element:r.jsx(S_,{children:r.jsx(l9,{})})}),r.jsx(je,{path:"/programmes",element:r.jsx(Mn,{to:"/resource-hub",replace:!0})}),r.jsx(je,{path:"/compliance-essentials-library",element:r.jsx(Pre,{})}),r.jsx(je,{path:"/compliance-essentials-library/program/:programId",element:r.jsx(Dre,{})}),r.jsx(je,{path:"/hub/:slug",element:r.jsx(S_,{children:r.jsx(r9,{})})}),r.jsx(je,{path:"/profile",element:r.jsx(c9,{})}),r.jsx(je,{path:"/billing",element:r.jsx(p9,{})}),r.jsx(je,{path:"/messages",element:r.jsx(g9,{})}),r.jsx(je,{path:"/login",element:r.jsx(b9,{})}),r.jsx(je,{path:"/join",element:r.jsx(j9,{})}),r.jsx(je,{path:"/forgot-password",element:r.jsx(_9,{})}),r.jsx(je,{path:"/reset-password",element:r.jsx(T9,{})}),r.jsx(je,{path:"/registration-success",element:r.jsx(E9,{})})]}),r.jsxs(je,{path:"/hub",element:r.jsx(Are,{children:r.jsx(hV,{})}),children:[r.jsx(je,{index:!0,element:r.jsx(A9,{})}),r.jsx(je,{path:"directory",element:r.jsx(D9,{})}),r.jsx(je,{path:"directory/:id",element:r.jsx(L9,{})}),r.jsx(je,{path:"events",element:r.jsx(Hne,{})}),r.jsx(je,{path:"events/manage",element:r.jsx(Yne,{})}),r.jsx(je,{path:"resources",element:r.jsx(I9,{})}),r.jsx(je,{path:"resources/manage",element:r.jsx(zne,{})}),r.jsx(je,{path:"insights/manage",element:r.jsx(qne,{})}),r.jsx(je,{path:"jobs/manage",element:r.jsx(ere,{})}),r.jsx(je,{path:"conference/manage",element:r.jsx(sre,{})}),r.jsx(je,{path:"conferences/manage",element:r.jsx(jre,{})}),r.jsx(je,{path:"messages",element:r.jsx(nre,{})}),r.jsx(je,{path:"admin",element:r.jsx(rre,{})}),r.jsx(je,{path:"members/manage",element:r.jsx(lre,{})}),r.jsx(je,{path:"partner-videos",element:r.jsx(cre,{})}),r.jsx(je,{path:"advisory-board",element:r.jsx(ure,{})}),r.jsx(je,{path:"leaderboard/manage",element:r.jsx(hre,{})}),r.jsx(je,{path:"resource-hub",element:r.jsx(mre,{})}),r.jsx(je,{path:"lift/manage",element:r.jsx(pre,{})}),r.jsx(je,{path:"profile",element:r.jsx(O9,{})})]}),r.jsx(je,{path:"*",element:r.jsx(Mn,{to:"/",replace:!0})})]})]})}Y0.createRoot(document.getElementById("root")).render(r.jsx(v.StrictMode,{children:r.jsx(NO,{children:r.jsx(Fre,{})})}));
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.